diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-12-30 07:22:59 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-12-30 07:22:59 +0000 |
| commit | c06f79c0451ca844f89809058a2767a1a319b137 (patch) | |
| tree | 1322a73a1b1412cec49bc86ccc20b3c6dbaa695a /lib/python/Components/config.py | |
| parent | 21ad640445f0812c5fa954015a3389e4824dc5e1 (diff) | |
| download | enigma2-c06f79c0451ca844f89809058a2767a1a319b137.tar.gz enigma2-c06f79c0451ca844f89809058a2767a1a319b137.zip | |
configSelection is now saved to config file in a human readable style
Diffstat (limited to 'lib/python/Components/config.py')
| -rw-r--r-- | lib/python/Components/config.py | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 3bbdde10..2b51d169 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -78,8 +78,16 @@ class configSelection: def __call__(self, selected): #needed by configlist self.checkValues() - return ("text", _(self.parent.vals[self.parent.value])) + if isinstance(self.parent.vals[self.parent.value], str): + returnValue = _(self.parent.vals[self.parent.value]) + else: + returnValue = _(self.parent.vals[self.parent.value][1]) + + print self.parent.vals[self.parent.value] + + return ("text", returnValue) + class configDateTime: def __init__(self, parent): self.parent = parent @@ -417,7 +425,17 @@ class configElement: if control == ConfigSlider: return int(data) elif control == configSelection: - return int(data) + try: + return int(data) + except: + for x in data.split(":"): + if x[0] == "*": + count = 0 + for y in self.vals: + if y[0] == x[1:-1]: + return count + count += 1 + return self.defaultValue elif control == configDateTime: return int(data) elif control == configText: @@ -437,6 +455,18 @@ class configElement: if control == ConfigSlider: return str(data) elif control == configSelection: + if isinstance(self.vals[data], str): + return str(data) + else: + confList = [] + count = 0 + for x in self.vals: + if count == data: + confList.append("*" + str(x[0] + "*")) + else: + confList.append(x[0]) + count += 1 + return ":".join(confList) return str(data) elif control == configDateTime: return str(data) |
