fix for stupid servicename *duck* - defer zap to lastservice
authorRonny Strutz <ronny.strutz@multimedia-labs.de>
Tue, 15 Nov 2005 15:33:47 +0000 (15:33 +0000)
committerRonny Strutz <ronny.strutz@multimedia-labs.de>
Tue, 15 Nov 2005 15:33:47 +0000 (15:33 +0000)
lib/python/Screens/ChannelSelection.py

index 9435aff..d83d3d7 100644 (file)
@@ -3,7 +3,7 @@ from Components.Button import Button
 from Components.ServiceList import ServiceList
 from Components.ActionMap import ActionMap
 from EpgSelection import EPGSelection
-from enigma import eServiceReference, eEPGCache, eEPGCachePtr, eServiceCenter, eServiceCenterPtr, iMutableServiceListPtr
+from enigma import eServiceReference, eEPGCache, eEPGCachePtr, eServiceCenter, eServiceCenterPtr, iMutableServiceListPtr, eTimer
 from Components.config import config, configElement, ConfigSubsection, configText
 
 from Screens.FixedMenu import FixedMenu
@@ -60,6 +60,13 @@ class ChannelContextMenu(FixedMenu):
                self.close()
  
 class ChannelSelection(Screen):
+       def lastService(self):
+               self.lastServiceTimer.stop()
+               #zap to last running tv service
+               config.tv = ConfigSubsection();
+               config.tv.lastservice = configElement("config.tv.lastservice", configText, "", 0);
+               self.session.nav.playService(eServiceReference(config.tv.lastservice.value))
+       
        def __init__(self, session):
                Screen.__init__(self, session)
                
@@ -80,13 +87,9 @@ class ChannelSelection(Screen):
                
                #self["okbutton"] = Button("ok", [self.channelSelected])
 
-               config.tv = ConfigSubsection();
-               config.tv.lastservice = configElement("config.tv.lastservice", configText, "", 0);
-               
-               print "lastservice:"  + config.tv.lastservice.value
-               ref = eServiceReference(config.tv.lastservice.value)
-               print ref
-               self.session.nav.playService(ref)
+               self.lastServiceTimer = eTimer()
+               self.lastServiceTimer.timeout.get().append(self.lastService)
+               self.lastServiceTimer.start(100)
 
                class ChannelActionMap(ActionMap):
                        def action(self, contexts, action):