moving the list generation to a seperate method
[enigma2.git] / lib / python / Components / config.py
index 0245a4f4ead961275fe71dc518d53fa74dec1b5b..4d5af5ccd9b2ba725f2d2a35cf589b26895b63d1 100644 (file)
@@ -1,12 +1,13 @@
 from time import *
 from Tools.NumericalTextInput import *
+from Tools.Directories import *
 
 class configFile:
        def __init__(self):
                self.changed = 0
                self.configElements = { }
                try:
-                       self.file = open("config")
+                       self.file = open(resolveFilename(SCOPE_CONFIG, "config"))
                except IOError:
                        print "cannot open config file"
                        return 
@@ -38,7 +39,7 @@ class configFile:
                if self.changed == 0:           #no changes, so no write to disk needed
                        return
                        
-               fileHandle = open("config", "w")
+               fileHandle = open(resolveFilename(SCOPE_CONFIG, "config"), "w")
                
                keys = self.configElements.keys()
                keys.sort()
@@ -260,8 +261,11 @@ class configSequence:
                        num += 1
                        # only mark cursor when we are selected
                        # (this code is heavily ink optimized!)
-               return ("mtext"[1-selected:], value, [mPos])
-
+               if (self.parent.enabled == True):
+                       return ("mtext"[1-selected:], value, [mPos])
+               else:
+                       return ("text", value)
+               
 class configText:
        # used as first parameter
        # is the text of a fixed size or is the user able to extend the length of the text
@@ -293,6 +297,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 +335,7 @@ class Config:
                self.key = { "choseElement": 0,
                                         "prevElement": 1,
                                         "nextElement": 2,
+                                        "delete": 3,
                                         "0": 10,
                                         "1": 11,
                                         "2": 12,