reenable editing of network settings by adding an action for every number
[enigma2.git] / lib / python / Components / config.py
index 482482ce15d53f0ec12590fd8f44c4523e80060c..4cdd359a5205f65f11ec4abb7baec429a4f9e2d9 100644 (file)
@@ -37,7 +37,9 @@ class configFile:
                        
                fileHandle = open("config", "w")
                
-               for x in self.configElements:
+               keys = self.configElements.keys()
+               keys.sort()
+               for x in keys:
                        wstr = x + "=" + self.configElements[x]
                        
                        if wstr[len(wstr) - 1] != '\n':
@@ -316,14 +318,13 @@ class configElement:
                #is this right? activate settings after load/cancel and use default     
                self.change()
 
-       def __init__(self, configPath, control, defaultValue, vals, shouldSave = True):
+       def __init__(self, configPath, control, defaultValue, vals):
                self.configPath = configPath
                self.defaultValue = defaultValue
                self.controlType = control
                self.vals = vals
                self.notifierList = [ ]
                self.enabled = True
-               self.shouldSave = shouldSave
                self.loadData()         
        def addNotifier(self, notifier):
                self.notifierList.append(notifier);
@@ -334,9 +335,15 @@ class configElement:
        def reload(self):
                self.loadData()
        def save(self):
-               if (self.shouldSave == True):
-                       configfile.setKey(self.configPath, self.datatoFile(self.controlType,self.value))
+               configfile.setKey(self.configPath, self.datatoFile(self.controlType,self.value))
 
+class configElement_nonSave(configElement):
+       def __init__(self, configPath, control, defaultValue, vals):
+               configElement.__init__(self, configPath, control, defaultValue, vals)
+
+       def save(self):
+               pass
+               
 def getConfigListEntry(description, element):
        b = element
        item = b.controlType(b)