you can now delete characters in the timerentry description with the mute-key
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 28 Nov 2005 03:16:57 +0000 (03:16 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 28 Nov 2005 03:16:57 +0000 (03:16 +0000)
data/keymap.xml
lib/python/Components/config.py
lib/python/Screens/TimerEntry.py

index f95a129..5a7c669 100644 (file)
                <key id="KEY_0" mapto="0" flags="m" />
        </map>
        
+       <map context="TextEntryActions">
+               <key id="KEY_MUTE" mapto="delete" flags="mr" />
+       </map>  
 
        <map context="InfobarPVRActions">
                <key id="KEY_YELLOW" mapto="pauseService" flags="m" />
index 0245a4f..7137845 100644 (file)
@@ -293,6 +293,8 @@ class configText:
        def handleKey(self, key):
                #this will no change anything on the value itself
                #so we can handle it here in gui element
+               if key == config.key["delete"]:
+                       self.parent.value = self.parent.value[0:self.markedPos] + self.parent.value[self.markedPos + 1:]
                if key == config.key["prevElement"]:
                        self.textInput.nextKey()
                        self.markedPos -= 1
@@ -329,6 +331,7 @@ class Config:
                self.key = { "choseElement": 0,
                                         "prevElement": 1,
                                         "nextElement": 2,
+                                        "delete": 3,
                                         "0": 10,
                                         "1": 11,
                                         "2": 12,
index b73b7c0..fff51db 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,
@@ -175,6 +176,9 @@ class TimerEntry(Screen):
                        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