fix channelselection in timeredit dialog
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 11 Oct 2006 13:24:51 +0000 (13:24 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 11 Oct 2006 13:24:51 +0000 (13:24 +0000)
lib/python/Components/config.py
lib/python/Screens/TimerEntry.py

index b16b93e..e9c8b1c 100644 (file)
@@ -165,6 +165,13 @@ class ConfigSelection(ConfigElement):
        def getValue(self):
                return self._value
 
+       def setCurrentText(self, text):
+               i = self.choices.index(self.value)
+               del self.description[self.choices[i]]
+               self.choices[i] = text
+               self.description[text] = text
+               self._value = text
+
        value = property(getValue, setValue)
        
        def getIndex(self):
index 2bf5bd1..5be0f82 100644 (file)
@@ -214,7 +214,7 @@ class TimerEntry(Screen, ConfigListScreen):
        def finishedChannelSelection(self, *args):
                if len(args):
                        self.timer.service_ref = ServiceReference(args[0])
-                       self.timerentry_service.vals = (str(self.timer.service_ref.getServiceName()),)
+                       self.timerentry_service.setCurrentText(self.timer.service_ref.getServiceName())
                        self["config"].invalidate(self.channelEntry)
 
        def getTimestamp(self, date, mytime):