add onShown eventlist for executing stuff after the screen is drawn
[enigma2.git] / lib / python / Screens / ChannelSelection.py
index 37f594dc1f958f7b8f9392b8df353fc10f14bf0a..d3921306b6ac547922aa66564de4a15288311604 100644 (file)
@@ -158,7 +158,7 @@ class ChannelSelection(Screen):
 
                self["actions"] = ChannelActionMap(["ChannelSelectActions", "OkCancelActions", "ContextMenuActions"],
                        {
 
                self["actions"] = ChannelActionMap(["ChannelSelectActions", "OkCancelActions", "ContextMenuActions"],
                        {
-                               "cancel": self.close,
+                               "cancel": self.doClose,
                                "ok": self.channelSelected,
                                "mark": self.doMark,
                                "contextMenu": self.doContext,
                                "ok": self.channelSelected,
                                "mark": self.doMark,
                                "contextMenu": self.doContext,
@@ -374,11 +374,19 @@ class ChannelSelection(Screen):
                        refstr = ""
                config.tv.lastservice.value = refstr
                config.tv.lastservice.save()
                        refstr = ""
                config.tv.lastservice.value = refstr
                config.tv.lastservice.save()
+               
+       def doClose(self):
+               self.close()
 
 class SimpleChannelSelection(ChannelSelection):
        def __init__(self, session, title):
                ChannelSelection.__init__(self, session)
                self.title = title
 
 class SimpleChannelSelection(ChannelSelection):
        def __init__(self, session, title):
                ChannelSelection.__init__(self, session)
                self.title = title
+               self.onShown.append(self.onExecCallback)
+
+       def onExecCallback(self):
+               print "onExecCallback"
+               self.session.currentDialog.instance.setTitle(self.title)
                
        def channelSelected(self): # just return selected service
                ref = self.servicelist.getCurrent()
                
        def channelSelected(self): # just return selected service
                ref = self.servicelist.getCurrent()
@@ -386,4 +394,7 @@ class SimpleChannelSelection(ChannelSelection):
                
        def doContext(self): # don't show context menu
                pass
                
        def doContext(self): # don't show context menu
                pass
+       
+       def doClose(self):
+               self.close(None)
                
\ No newline at end of file
                
\ No newline at end of file