hold red or blue key in movie player to seek x minutes forward or backward
[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 enigma import eSize, ePoint
8
9 class MinuteInput(Screen):
10                 def __init__(self, session, basemins = 5):
11                         Screen.__init__(self, session)
12                                                 
13                         self["minutes"] = Label()
14                         self.updateValue(basemins)
15                         
16                         self["actions"] = NumberActionMap([ "NumberZapActions", "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                                 "up": self.up,
29                                 "down": self.down,
30                                 "ok": self.ok,
31                                 "cancel": self.cancel
32                         })
33                         
34                 def updateValue(self, minutes):
35                         self.minutes = minutes
36                         self["minutes"].setText(str(self.minutes) + _(" mins"))
37                         
38                 def keyNumberGlobal(self, number):
39                         #self.updateValue(self.minutes * 10 + number)
40                         pass
41                         
42                 def up(self):
43                         self.updateValue(self.minutes + 1)
44                 
45                 def down(self):
46                         if self.minutes > 0:
47                                 self.updateValue(self.minutes - 1)
48                                 
49                 def ok(self):
50                         self.close(self.minutes)
51                         
52                 def cancel(self):
53                         self.close(0)