you can now delete characters in the timerentry description with the mute-key
[enigma2.git] / lib / python / Screens / TimerEntry.py
index e649666f5acf083bccde6f23f8e89c38460caafd..fff51db5188d63ad12fb95b62d5ac5c5e2002879 100644 (file)
@@ -19,13 +19,14 @@ class TimerEntry(Screen):
 
                self.createConfig()
 
-               self["actions"] = NumberActionMap(["SetupActions"],
+               self["actions"] = NumberActionMap(["SetupActions", "TextEntryActions"],
                {
                        "ok": self.keySelect,
                        "save": self.keyGo,
                        "cancel": self.keyCancel,
                        "left": self.keyLeft,
                        "right": self.keyRight,
+                       "delete": self.keyDelete,
                        "1": self.keyNumberGlobal,
                        "2": self.keyNumberGlobal,
                        "3": self.keyNumberGlobal,
@@ -95,7 +96,12 @@ class TimerEntry(Screen):
 
 
                        # 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)
@@ -164,9 +170,15 @@ class TimerEntry(Screen):
                        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 keyDelete(self):
+               self["config"].handleKey(config.key["delete"])
+                       
        def keyRightCallback(self, configPath):
                currentConfigPath = self["config"].getCurrent()[1].parent.getConfigPath()
                # check if we are still on the same config entry
@@ -174,8 +186,11 @@ class TimerEntry(Screen):
                        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"):