add additional argument to the configElement constructor to make configElements,...
[enigma2.git] / lib / python / Components / config.py
index 5d098a37f3d331b3245d0b7f020936e4481e05f0..482482ce15d53f0ec12590fd8f44c4523e80060c 100644 (file)
@@ -316,13 +316,14 @@ class configElement:
                #is this right? activate settings after load/cancel and use default     
                self.change()
 
                #is this right? activate settings after load/cancel and use default     
                self.change()
 
-       def __init__(self, configPath, control, defaultValue, vals):
+       def __init__(self, configPath, control, defaultValue, vals, shouldSave = True):
                self.configPath = configPath
                self.defaultValue = defaultValue
                self.controlType = control
                self.vals = vals
                self.notifierList = [ ]
                self.enabled = True
                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);
                self.loadData()         
        def addNotifier(self, notifier):
                self.notifierList.append(notifier);
@@ -333,7 +334,8 @@ class configElement:
        def reload(self):
                self.loadData()
        def save(self):
        def reload(self):
                self.loadData()
        def save(self):
-               configfile.setKey(self.configPath, self.datatoFile(self.controlType,self.value))
+               if (self.shouldSave == True):
+                       configfile.setKey(self.configPath, self.datatoFile(self.controlType,self.value))
 
 def getConfigListEntry(description, element):
        b = element
 
 def getConfigListEntry(description, element):
        b = element