you can now delete characters in the timerentry description with the mute-key
[enigma2.git] / lib / python / Components / config.py
index 2056192fe05aa2a3b8e67a92a13e57850b83bf57..7137845f7feb9cab8f38c793c3550de8af59d8ef 100644 (file)
@@ -55,10 +55,9 @@ class configSelection:
                
        def checkValues(self):
                if self.parent.value < 0:
-                       self.parent.value = 0   
-
-               if(self.parent.value >= (len(self.parent.vals) - 1)):
-                       self.parent.value = len(self.parent.vals) - 1
+                       self.parent.value = len(self.parent.vals) - 1   
+               elif(self.parent.value > (len(self.parent.vals) - 1)):
+                       self.parent.value = 0
 
        def cancel(self):
                self.parent.reload()
@@ -78,7 +77,7 @@ class configSelection:
 
        def __call__(self, selected):                   #needed by configlist
                self.checkValues()
-               return ("text", self.parent.vals[self.parent.value])
+               return ("text", _(self.parent.vals[self.parent.value]))
 
 class configDateTime:
        def __init__(self, parent):
@@ -294,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
@@ -330,6 +331,7 @@ class Config:
                self.key = { "choseElement": 0,
                                         "prevElement": 1,
                                         "nextElement": 2,
+                                        "delete": 3,
                                         "0": 10,
                                         "1": 11,
                                         "2": 12,