X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/4d1d7ab4619beef6a1b5ef5990fb5942da9358d8..bd9b9d79572ecb649b26f86dd6bb07d5e6f20766:/lib/python/Components/config.py diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 482482ce..5a92f076 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -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': @@ -116,8 +118,7 @@ class configSequence: self.markedPos = 0 def checkValues(self): - maxPos = len(self.parent.value) * self.parent.vals[1] - print maxPos + maxPos = len(self.parent.value) * len(self.parent.vals[1]) + len(self.parent.value) if self.markedPos >= maxPos: self.markedPos = maxPos - 1 @@ -316,14 +317,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 +334,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)