git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix build with old api
[enigma2.git]
/
screens.py
diff --git
a/screens.py
b/screens.py
index dd13c5502413f4204b1ad243a9554090538569c8..77d064f586b48292d76bb71275c5f77bdfef63c5 100644
(file)
--- a/
screens.py
+++ b/
screens.py
@@
-15,17
+15,22
@@
class Screen(dict, HTMLSkin, GUISkin):
GUISkin.__init__(self)
def execBegin(self):
GUISkin.__init__(self)
def execBegin(self):
+# assert self.session == None, "a screen can only exec one per time"
+# self.session = session
for (name, val) in self.items():
val.execBegin()
def execEnd(self):
for (name, val) in self.items():
val.execEnd()
for (name, val) in self.items():
val.execBegin()
def execEnd(self):
for (name, val) in self.items():
val.execEnd()
+# assert self.session != None, "execEnd on non-execing screen!"
+# self.session = None
# never call this directly - it will be called from the session!
def doClose(self):
GUISkin.close(self)
# never call this directly - it will be called from the session!
def doClose(self):
GUISkin.close(self)
+ del self.session
for (name, val) in self.items():
print "%s -> %d" % (name, sys.getrefcount(val))
del self[name]
for (name, val) in self.items():
print "%s -> %d" % (name, sys.getrefcount(val))
del self[name]
@@
-58,9
+63,10
@@
class mainMenu(Screen):
Screen.__init__(self, session)
b = Button("ok")
Screen.__init__(self, session)
b = Button("ok")
- self["actions"] = ActionMap(
"MainMenuActions"
,
+ self["actions"] = ActionMap(
["OkCancelActions"]
,
{
{
- "selected": self.okbuttonClick
+ "ok": self.okbuttonClick,
+ "cancel": self.close
})
b.onClick = [ self.okbuttonClick ]
})
b.onClick = [ self.okbuttonClick ]
@@
-77,37
+83,38
@@
class mainMenu(Screen):
("wie spaet ists?!", self.goClock)
])
("wie spaet ists?!", self.goClock)
])
-#class mainMenu(Screen):
-# def __init__(self):
-# GUISkin.__init__(self)
-#
-# self["title"] = Header("this is the\nMAIN MENU !!!");
-# self["okbutton"] = Button("ok")
-# self["okbutton"].onClick = [ self.close ]
-
class channelSelection(Screen):
def __init__(self, session):
Screen.__init__(self, session)
self["list"] = ServiceList()
class channelSelection(Screen):
def __init__(self, session):
Screen.__init__(self, session)
self["list"] = ServiceList()
- self["list"].setRoot(eServiceReference("
1:0:1:0:0:0:0:0:0:0:PREMIERE
"))
+ self["list"].setRoot(eServiceReference("
""1:0:1:0:0:0:0:0:0:0:(provider=="ARD") && (type == 1)""
"))
self["okbutton"] = Button("ok", [self.channelSelected])
class ChannelActionMap(ActionMap):
self["okbutton"] = Button("ok", [self.channelSelected])
class ChannelActionMap(ActionMap):
- def action(self, context, action):
+ def action(self, context
s
, action):
if action[:7] == "bouquet":
print "setting root to " + action[8:]
self.csel["list"].setRoot(eServiceReference("1:0:1:0:0:0:0:0:0:0:" + action[8:]))
else:
if action[:7] == "bouquet":
print "setting root to " + action[8:]
self.csel["list"].setRoot(eServiceReference("1:0:1:0:0:0:0:0:0:0:" + action[8:]))
else:
- ActionMap.action(self, context, action)
+ ActionMap.action(self, context
s
, action)
- self["actions"] = ChannelActionMap(
"ChannelSelectActions"
,
+ self["actions"] = ChannelActionMap(
["ChannelSelectActions", "OkCancelActions"]
,
{
{
- "selectChannel": self.channelSelected,
+ "cancel": self.close,
+ "ok": self.channelSelected,
+ "mark": self.doMark
})
self["actions"].csel = self
})
self["actions"].csel = self
+ def doMark(self):
+ ref = self["list"].getCurrent()
+ if self["list"].isMarked(ref):
+ self["list"].removeMarked(ref)
+ else:
+ self["list"].addMarked(ref)
+
def channelSelected(self):
self.session.nav.playService(self["list"].getCurrent())
self.close()
def channelSelected(self):
self.session.nav.playService(self["list"].getCurrent())
self.close()
@@
-117,7
+124,7
@@
class infoBar(Screen):
def __init__(self, session):
Screen.__init__(self, session)
def __init__(self, session):
Screen.__init__(self, session)
- self["actions"] = ActionMap(
"InfobarActions"
,
+ self["actions"] = ActionMap(
[ "InfobarActions" ]
,
{
"switchChannel": self.switchChannel,
"mainMenu": self.mainMenu
{
"switchChannel": self.switchChannel,
"mainMenu": self.mainMenu