X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/9b6b96172d1d20d9daf3c11bc5f0222f487d53d7..b8783e5b26a7dd0601bece623c4cbfe19f57977b:/lib/python/Components/config.py diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 635eb748..c17e5aa1 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -38,6 +38,18 @@ class configFile: else: self.configElements[key] = value + def getResolvedKey(self, key): + str = self.configElements[key] + if len(str): + pos = str.find('*') + if pos != -1: + str = str[pos+1:] + pos = str.find('*') + if pos != -1: + return str[:pos] + return str + return None + def save(self): if self.changed == 0: #no changes, so no write to disk needed return @@ -92,10 +104,17 @@ class configSelection: def __call__(self, selected): #needed by configlist self.checkValues() - 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]) + + returnValue = _(self.parent.vals[self.parent.value]) + if not isinstance(returnValue, str): + returnValue = returnValue[1] + + # FIXME: it's not really nice to translate this here. + # however, configSelections are persistent. + + # WORKAROUND: don't translate "" + if returnValue: + returnValue = _(returnValue) return ("text", returnValue) @@ -169,6 +188,8 @@ class configSequenceArg: if (type == "IP"): return (("."), [(0,255),(0,255),(0,255),(0,255)], "") # configsequencearg.get ("MAC") + if (type == "POSITION"): + return ((","), [(0,args[0]),(0,args[1]),(0,args[2]),(0,args[3])], "") if (type == "MAC"): return ((":"), [(1,255),(1,255),(1,255),(1,255),(1,255),(1,255)], "") # configsequencearg.get ("CLOCK") @@ -595,7 +616,7 @@ def getConfigListEntry(description, element): item = b.controlType(b) return ((description, item)) -def configElementBoolean(name, default, texts=(_("Enable"), _("Disable"))): +def configElementBoolean(name, default, texts=(_("Disable"), _("Enable"))): return configElement(name, configSelection, default, texts) config.misc = ConfigSubsection()