From: Fraxinas Date: Mon, 8 Dec 2008 12:43:31 +0000 (+0100) Subject: add search parameter for NumericalTextInput which supplies a mapping with only lowerc... X-Git-Tag: 2.6.0~550 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/22e4755ccb4820da1a50c7301951978dc45eaab3 add search parameter for NumericalTextInput which supplies a mapping with only lowercase and standard ascii characters plus number plus SQL wildcards --- diff --git a/lib/python/Tools/NumericalTextInput.py b/lib/python/Tools/NumericalTextInput.py index 5954c9c3..be4cf01f 100644 --- a/lib/python/Tools/NumericalTextInput.py +++ b/lib/python/Tools/NumericalTextInput.py @@ -3,12 +3,33 @@ from enigma import eTimer from Components.Language import language class NumericalTextInput: - def __init__(self, nextFunc=None, handleTimeout = True): + def __init__(self, nextFunc=None, handleTimeout = True, search = False): self.mapping = [] self.lang = language.getLanguage() self.useableChars=None self.nextFunction=nextFunc - + + if handleTimeout: + self.timer = eTimer() + self.timer.callback.append(self.timeout) + else: + self.timer = None + self.lastKey = -1 + self.pos = -1 + + if search: + self.mapping.append (u"%_0") # 0 + self.mapping.append (u" 1") # 1 + self.mapping.append (u"abc2") # 2 + self.mapping.append (u"def3") # 3 + self.mapping.append (u"ghi4") # 4 + self.mapping.append (u"jkl5") # 5 + self.mapping.append (u"mno6") # 6 + self.mapping.append (u"pqrs7") # 7 + self.mapping.append (u"tuv8") # 8 + self.mapping.append (u"wxyz9") # 9 + return + if self.lang == 'de_DE': self.mapping.append (u".,?'+\"0-()@/:_$!") # 0 self.mapping.append (u" 1") # 1 @@ -54,14 +75,6 @@ class NumericalTextInput: self.mapping.append (u"tuv8TUV") # 8 self.mapping.append (u"wxyz9WXYZ") # 9 - if handleTimeout: - self.timer = eTimer() - self.timer.callback.append(self.timeout) - else: - self.timer = None - self.lastKey = -1 - self.pos = -1 - def setUseableChars(self, useable): self.useableChars = useable