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