X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/d3df119df8520deac7a05ce9e7be2e4a68a2127c..df21108d272341745a001f781a3b8bd628f4ace6:/lib/python/Components/config.py diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 82a5d6d8..f0652143 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -526,13 +526,14 @@ class configElement: #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.saveDefaults = saveDefaults self.loadData() def getConfigPath(self): @@ -547,7 +548,8 @@ class configElement: def reload(self): self.loadData() def save(self): - configfile.setKey(self.configPath, self.datatoFile(self.controlType,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): def __init__(self, configPath, control, defaultValue, vals):