git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update sv, hy, lt, pl, fr language
[enigma2.git]
/
lib
/
python
/
Screens
/
InputBox.py
diff --git
a/lib/python/Screens/InputBox.py
b/lib/python/Screens/InputBox.py
index 6cdb42ee8da47f47e5fba6eaec372a94a8dd1ac0..43b8a8b8cc3d7d5bfe28d49952f7d213ea84a6e4 100644
(file)
--- a/
lib/python/Screens/InputBox.py
+++ b/
lib/python/Screens/InputBox.py
@@
-22,16
+22,12
@@
class InputBox(Screen):
"back": self.cancel,
"left": self.keyLeft,
"right": self.keyRight,
"back": self.cancel,
"left": self.keyLeft,
"right": self.keyRight,
- "delete": self.keyDelete,
- "moveLeft": self.keyLeft,
- "moveRight": self.keyRight,
- "moveHome": self.keyHome,
- "moveEnd": self.keyEnd,
+ "home": self.keyHome,
+ "end": self.keyEnd,
"deleteForward": self.keyDelete,
"deleteBackward": self.keyBackspace,
"tab": self.keyTab,
"toggleOverwrite": self.keyInsert,
"deleteForward": self.keyDelete,
"deleteBackward": self.keyBackspace,
"tab": self.keyTab,
"toggleOverwrite": self.keyInsert,
- "accept": self.go,
"1": self.keyNumberGlobal,
"2": self.keyNumberGlobal,
"3": self.keyNumberGlobal,
"1": self.keyNumberGlobal,
"2": self.keyNumberGlobal,
"3": self.keyNumberGlobal,
@@
-43,8
+39,9
@@
class InputBox(Screen):
"9": self.keyNumberGlobal,
"0": self.keyNumberGlobal
}, -1)
"9": self.keyNumberGlobal,
"0": self.keyNumberGlobal
}, -1)
- rcinput = eRCInput.getInstance()
- rcinput.setKeyboardMode(rcinput.kmAscii)
+ if self["input"].type == Input.TEXT:
+ rcinput = eRCInput.getInstance()
+ rcinput.setKeyboardMode(rcinput.kmAscii)
def gotAsciiCode(self):
self["input"].handleAscii(getPrevAsciiCode())
def gotAsciiCode(self):
self["input"].handleAscii(getPrevAsciiCode())
@@
-88,7
+85,7
@@
class InputBox(Screen):
class PinInput(InputBox):
def __init__(self, session, service = "", triesEntry = None, pinList = [], *args, **kwargs):
class PinInput(InputBox):
def __init__(self, session, service = "", triesEntry = None, pinList = [], *args, **kwargs):
- InputBox.__init__(self, session = session, text="
9876
", maxSize=True, type=Input.PIN, *args, **kwargs)
+ InputBox.__init__(self, session = session, text="
", maxSize=True, type=Input.PIN, *args, **kwargs)
self.waitTime = 15
self.waitTime = 15
@@
-102,13
+99,20
@@
class PinInput(InputBox):
remaining = (self.triesEntry.time.value + (self.waitTime * 60)) - time()
remainingMinutes = int(remaining / 60)
remainingSeconds = int(remaining % 60)
remaining = (self.triesEntry.time.value + (self.waitTime * 60)) - time()
remainingMinutes = int(remaining / 60)
remainingSeconds = int(remaining % 60)
- self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.closePinCancel, MessageBox, _("You have to wait
for") + " " + str(remainingMinutes) + " " + _("minutes and") + " " + str(remainingSeconds) + " " + _("seconds."
), MessageBox.TYPE_ERROR))
+ self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.closePinCancel, MessageBox, _("You have to wait
%s!") % (str(remainingMinutes) + " " + _("minutes") + ", " + str(remainingSeconds) + " " + _("seconds")
), MessageBox.TYPE_ERROR))
else:
self.setTries(3)
self["tries"] = Label("")
self.onShown.append(self.showTries)
else:
self.setTries(3)
self["tries"] = Label("")
self.onShown.append(self.showTries)
+ def gotAsciiCode(self):
+ if self["input"].currPos == len(self["input"]) - 1:
+ InputBox.gotAsciiCode(self)
+ self.go()
+ else:
+ InputBox.gotAsciiCode(self)
+
def keyNumberGlobal(self, number):
if self["input"].currPos == len(self["input"]) - 1:
InputBox.keyNumberGlobal(self, number)
def keyNumberGlobal(self, number):
if self["input"].currPos == len(self["input"]) - 1:
InputBox.keyNumberGlobal(self, number)
@@
-117,7
+121,7
@@
class PinInput(InputBox):
InputBox.keyNumberGlobal(self, number)
def checkPin(self, pin):
InputBox.keyNumberGlobal(self, number)
def checkPin(self, pin):
- if pin is not None and int(pin) in self.pinList:
+ if pin is not None and
pin.find(" ") == -1 and
int(pin) in self.pinList:
return True
return False
return True
return False
@@
-136,18
+140,22
@@
class PinInput(InputBox):
pass
def closePinWrong(self, *args):
pass
def closePinWrong(self, *args):
+ rcinput = eRCInput.getInstance()
+ rcinput.setKeyboardMode(rcinput.kmNone)
print "args:", args
self.close(False)
def closePinCorrect(self, *args):
print "args:", args
self.close(False)
def closePinCorrect(self, *args):
+ rcinput = eRCInput.getInstance()
+ rcinput.setKeyboardMode(rcinput.kmNone)
self.close(True)
def closePinCancel(self, *args):
self.close(True)
def closePinCancel(self, *args):
+ rcinput = eRCInput.getInstance()
+ rcinput.setKeyboardMode(rcinput.kmNone)
self.close(None)
def cancel(self):
self.close(None)
def cancel(self):
- rcinput = eRCInput.getInstance()
- rcinput.setKeyboardMode(rcinput.kmNone)
self.closePinCancel()
def getTries(self):
self.closePinCancel()
def getTries(self):