fix ChannelSelectionBase to work with SimpleChannelSelection
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sun, 27 Nov 2005 23:04:51 +0000 (23:04 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Sun, 27 Nov 2005 23:04:51 +0000 (23:04 +0000)
channelselection is now opened when pressing left/right in the TimerEntry

lib/python/Screens/ChannelSelection.py
lib/python/Screens/TimerEntry.py

index 8951770a511e26b427871a56c18e8547a82e13da..0534a78d79e2ed0ed4a14abc1b09191df0ef3b8c 100644 (file)
@@ -223,6 +223,8 @@ class ChannelSelectionBase(Screen):
                self.servicelist = self["list"]
 
                #self["okbutton"] = Button("ok", [self.channelSelected])
                self.servicelist = self["list"]
 
                #self["okbutton"] = Button("ok", [self.channelSelected])
+               
+               self.lastService = None
 
                self.lastServiceTimer = eTimer()
                self.lastServiceTimer.timeout.get().append(self.lastService)
 
                self.lastServiceTimer = eTimer()
                self.lastServiceTimer.timeout.get().append(self.lastService)
index e649666f5acf083bccde6f23f8e89c38460caafd..b73b7c0dfcad9c2af9005a1a6a7f31f3c1dc2910 100644 (file)
@@ -95,7 +95,12 @@ class TimerEntry(Screen):
 
 
                        # FIXME some service-chooser needed here
 
 
                        # FIXME some service-chooser needed here
-                       config.timerentry.service = configElement_nonSave("config.timerentry.service", configSelection, 0, ((str(self.timer.service_ref.getServiceName())),))
+                       servicename = "N/A"
+                       try: # no current service available?
+                               servicename = str(self.timer.service_ref.getServiceName())
+                       except:
+                               pass
+                       config.timerentry.service = configElement_nonSave("config.timerentry.service", configSelection, 0, ((servicename),))
                        
                        config.timerentry.startdate.addNotifier(self.checkDate)
                        config.timerentry.enddate.addNotifier(self.checkDate)
                        
                        config.timerentry.startdate.addNotifier(self.checkDate)
                        config.timerentry.enddate.addNotifier(self.checkDate)
@@ -164,8 +169,11 @@ class TimerEntry(Screen):
                        self.createSetup()
 
        def keyLeft(self):
                        self.createSetup()
 
        def keyLeft(self):
-               self["config"].handleKey(config.key["prevElement"])
-               self.newConfig()
+               if self["config"].getCurrent()[0] == _("Channel"):
+                       self.keySelect()
+               else:
+                       self["config"].handleKey(config.key["prevElement"])
+                       self.newConfig()
 
        def keyRightCallback(self, configPath):
                currentConfigPath = self["config"].getCurrent()[1].parent.getConfigPath()
 
        def keyRightCallback(self, configPath):
                currentConfigPath = self["config"].getCurrent()[1].parent.getConfigPath()
@@ -174,8 +182,11 @@ class TimerEntry(Screen):
                        self.keyRight()
 
        def keyRight(self):
                        self.keyRight()
 
        def keyRight(self):
-               self["config"].handleKey(config.key["nextElement"])
-               self.newConfig()
+               if self["config"].getCurrent()[0] == _("Channel"):
+                       self.keySelect()
+               else:
+                       self["config"].handleKey(config.key["nextElement"])
+                       self.newConfig()
                
        def keySelect(self):
                if self["config"].getCurrent()[0] == _("Channel"):
                
        def keySelect(self):
                if self["config"].getCurrent()[0] == _("Channel"):