X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/7b9d3432c8b671621bba5803a0e44cb295f7f6f8..d4db62a3c940f3d9dabc97a55dd028b7f869047f:/lib/python/Components/config.py?ds=sidebyside diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 75dee0ce..c433f01b 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -1,4 +1,5 @@ from time import * +from Tools.NumericalTextInput import * class configFile: def __init__(self): @@ -76,7 +77,7 @@ class configSelection: self.checkValues() - self.parent.change() + self.parent.change() def __call__(self, selected): #needed by configlist self.checkValues() @@ -275,6 +276,7 @@ class configText: self.parent = parent self.markedPos = 0 self.mode = self.parent.vals[0] + self.textInput = NumericalTextInput(self.nextEntry) def checkValues(self): if (self.markedPos < 0): @@ -287,23 +289,30 @@ class configText: def save(self): self.parent.save() + + def nextEntry(self): + print self.parent + self.parent.vals[1](self.parent.getConfigPath()) def handleKey(self, key): #this will no change anything on the value itself #so we can handle it here in gui element if key == config.key["prevElement"]: + self.textInput.nextKey() self.markedPos -= 1 + if key == config.key["nextElement"]: + self.textInput.nextKey() self.markedPos += 1 if (self.mode == self.extendableSize): if (self.markedPos >= len(self.parent.value)): self.parent.value = self.parent.value.ljust(len(self.parent.value) + 1) - + if key >= config.key["0"] and key <= config.key["9"]: number = 9 - config.key["9"] + key - self.parent.value = self.parent.value[0:self.markedPos] + str(number) + self.parent.value[self.markedPos + 1:] + self.parent.value = self.parent.value[0:self.markedPos] + str(self.textInput.getKey(number)) + self.parent.value[self.markedPos + 1:] self.checkValues() @@ -384,7 +393,7 @@ class configElement: tcnt = cnt cnt += 1 if tcnt != -1: - return tcnt + return tcnt return 0 #prevent bigger then array def datafromFile(self, control, data): @@ -460,6 +469,10 @@ class configElement: self.notifierList = [ ] self.enabled = True self.loadData() + + def getConfigPath(self): + return self.configPath + def addNotifier(self, notifier): self.notifierList.append(notifier); notifier(self);