set parent
[enigma2.git] / lib / python / Screens / MinuteInput.py
1 from Screen import Screen
2 from Components.ActionMap import NumberActionMap
3 from Components.Input import Input
4
5 class MinuteInput(Screen):
6                 def __init__(self, session, basemins = 5):
7                         Screen.__init__(self, session)
8                                                 
9                         self["minutes"] = Input(str(basemins), type=Input.NUMBER)
10                         
11                         self["actions"] = NumberActionMap([ "InputActions" , "MinuteInputActions" ],
12                         {
13                                 "1": self.keyNumberGlobal,
14                                 "2": self.keyNumberGlobal,
15                                 "3": self.keyNumberGlobal,
16                                 "4": self.keyNumberGlobal,
17                                 "5": self.keyNumberGlobal,
18                                 "6": self.keyNumberGlobal,
19                                 "7": self.keyNumberGlobal,
20                                 "8": self.keyNumberGlobal,
21                                 "9": self.keyNumberGlobal,
22                                 "0": self.keyNumberGlobal,
23                                 "left": self.left,
24                                 "right": self.right,
25                                 "up": self.up,
26                                 "down": self.down,
27                                 "ok": self.ok,
28                                 "cancel": self.cancel
29                         })
30                         
31                 def keyNumberGlobal(self, number):
32                         self["minutes"].number(number)
33                         pass
34                         
35                 def left(self):
36                         self["minutes"].left()
37                         
38                 def right(self):
39                         self["minutes"].right()
40                         
41                 def up(self):
42                         self["minutes"].up()
43                 
44                 def down(self):
45                         self["minutes"].down()
46                                 
47                 def ok(self):
48                         self.close(int(self["minutes"].getText()))
49                         
50                 def cancel(self):
51                         self.close(0)