make tmbinc happy
[enigma2.git] / lib / python / Components / config.py
index 51e753caf4261e9ac0d166a59309e08dc4727028..f0652143666cf25471473720f43c29139ab85e89 100644 (file)
@@ -526,13 +526,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, saveDefaults = 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.saveDefaults = saveDefaults
                self.loadData()         
                
        def getConfigPath(self):
                self.loadData()         
                
        def getConfigPath(self):
@@ -547,7 +548,7 @@ class configElement:
        def reload(self):
                self.loadData()
        def save(self):
        def reload(self):
                self.loadData()
        def save(self):
-               if self.defaultValue != self.value:
+               if self.defaultValue != self.value or self.saveDefaults == True:
                        configfile.setKey(self.configPath, self.datatoFile(self.controlType,self.value))
 
 class configElement_nonSave(configElement):
                        configfile.setKey(self.configPath, self.datatoFile(self.controlType,self.value))
 
 class configElement_nonSave(configElement):