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 from Components.TextInput import TextInput
9 class TimerEdit(Screen):
10 def __init__(self, session, entry):
11 Screen.__init__(self, session)
13 self["actions"] = ActionMap(["OkCancelActions"],
19 self["shortcuts"] = ActionMap(["ShortcutActions"],
21 "red": self.beginFocus,
22 "yellow": self.endFocus,
23 "green": self.descFocus
27 # begin, end, description, service
28 self["begin"] = TimeInput()
29 self["end"] = TimeInput()
31 self["lbegin"] = Label("Begin")
32 self["lend"] = Label("End")
34 self["description"] = TextInput()
35 self["apply"] = Button("Apply")
36 self["service"] = Button()
38 self["description"].setText(entry.description);
41 self.setFocus(self["begin"])
44 self.setFocus(self["end"])
47 self.setFocus(self["description"])
52 class TimerEditList(Screen):
53 def __init__(self, session):
54 Screen.__init__(self, session)
57 for timer in session.nav.RecordTimer.timer_list:
58 list.append(TimerEntry(timer, 0))
60 for timer in session.nav.RecordTimer.processed_timers:
61 list.append(TimerEntry(timer, 1))
63 self["timerlist"] = TimerList(list)
65 self["actions"] = ActionMap(["OkCancelActions"],
72 self.session.open(TimerEdit, self["timerlist"].getCurrent()[0])