X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/0afd2995239e9c831b4e73ba27ec97302337db01..d94506110fbfebcd3f49546c2403b5448589362a:/lib/python/Screens/MinuteInput.py diff --git a/lib/python/Screens/MinuteInput.py b/lib/python/Screens/MinuteInput.py index 68909b61..f01fbbec 100644 --- a/lib/python/Screens/MinuteInput.py +++ b/lib/python/Screens/MinuteInput.py @@ -1,19 +1,14 @@ from Screen import Screen from Components.ActionMap import NumberActionMap -from Components.Label import Label -from Components.Button import Button -from Components.Pixmap import Pixmap -from Components.MenuList import MenuList -from enigma import eSize, ePoint +from Components.Input import Input class MinuteInput(Screen): def __init__(self, session, basemins = 5): Screen.__init__(self, session) - self["minutes"] = Label() - self.updateValue(basemins) + self["minutes"] = Input(str(basemins), type=Input.NUMBER) - self["actions"] = NumberActionMap([ "NumberZapActions", "MinuteInputActions" ], + self["actions"] = NumberActionMap([ "InputActions" , "MinuteInputActions", "TextEntryActions", "KeyboardInputActions" ], { "1": self.keyNumberGlobal, "2": self.keyNumberGlobal, @@ -25,29 +20,48 @@ class MinuteInput(Screen): "8": self.keyNumberGlobal, "9": self.keyNumberGlobal, "0": self.keyNumberGlobal, + "left": self.left, + "right": self.right, + "home": self.home, + "end": self.end, + "deleteForward": self.deleteForward, + "deleteBackward": self.deleteBackward, "up": self.up, "down": self.down, "ok": self.ok, "cancel": self.cancel }) - def updateValue(self, minutes): - self.minutes = minutes - self["minutes"].setText(str(self.minutes) + _(" mins")) - def keyNumberGlobal(self, number): - #self.updateValue(self.minutes * 10 + number) + self["minutes"].number(number) pass + def left(self): + self["minutes"].left() + + def right(self): + self["minutes"].right() + + def home(self): + self["minutes"].home() + + def end(self): + self["minutes"].end() + + def deleteForward(self): + self["minutes"].delete() + + def deleteBackward(self): + self["minutes"].deleteBackward() + def up(self): - self.updateValue(self.minutes + 1) + self["minutes"].up() def down(self): - if self.minutes > 0: - self.updateValue(self.minutes - 1) + self["minutes"].down() def ok(self): - self.close(self.minutes) + self.close(int(self["minutes"].getText())) def cancel(self): self.close(0) \ No newline at end of file