store config in /etc/enigma2 and create the path if needed
[enigma2.git] / lib / python / Components / config.py
index 7137845f7feb9cab8f38c793c3550de8af59d8ef..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