- work on timers
[enigma2.git] / lib / python / Screens / TimerEdit.py
1 from Screen import Screen
2 from Components.TimerList import TimerList, TimerEntry
3 from Components.ActionMap import ActionMap
4 from Components.TimeInput import TimeInput
5 from Components.Label import Label
6 from Components.Button import Button
7
8 class TimerEdit(Screen):
9         def __init__(self, session, entry):
10                 Screen.__init__(self, session)
11
12                 self["actions"] = ActionMap(["OkCancelActions"], 
13                         {
14                                 "ok": self.apply,
15                                 "cancel": self.close
16                         })
17                 
18                 self.entry = entry
19                 # begin, end, description, service
20                 self["begin"] = TimeInput()
21                 self["end"] = TimeInput()
22                 
23                 self["lbegin"] = Label("Begin")
24                 self["lend"] = Label("End")
25                 
26                 self["description"] = Label("bla")
27 # TextInput()
28                 self["apply"] = Button("Apply")
29                 self["service"] = Button()
30         
31         def apply(self):
32                 print "applied!"
33         
34 class TimerEditList(Screen):
35         def __init__(self, session):
36                 Screen.__init__(self, session)
37                 
38                 list = [ ]
39                 for timer in session.nav.RecordTimer.timer_list:
40                         list.append(TimerEntry(timer, 0))
41                 
42                 for timer in session.nav.RecordTimer.processed_timers:
43                         list.append(TimerEntry(timer, 1))
44                 
45                 self["timerlist"] = TimerList(list)
46
47                 self["actions"] = ActionMap(["OkCancelActions"], 
48                         {
49                                 "ok": self.openEdit,
50                                 "cancel": self.close
51                         })
52
53         def openEdit(self):
54                 self.session.open(TimerEdit, self["timerlist"].getCurrent())