1 from Screen import Screen
2 from Components.TimerList import TimerList, TimerEntryComponent
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
8 from TimerEntry import TimerEntry
10 class TimerEdit(Screen):
11 def __init__(self, session, entry):
12 Screen.__init__(self, session)
14 self["actions"] = ActionMap(["OkCancelActions"],
20 self["shortcuts"] = ActionMap(["ShortcutActions"],
22 "red": self.beginFocus,
23 "yellow": self.endFocus,
24 "green": self.descFocus
28 # begin, end, description, service
29 self["begin"] = TimeInput()
30 self["end"] = TimeInput()
32 self["lbegin"] = Label("Begin")
33 self["lend"] = Label("End")
35 self["description"] = TextInput()
36 self["apply"] = Button("Apply")
37 self["service"] = Button()
39 self["description"].setText(entry.description);
42 self.setFocus(self["begin"])
45 self.setFocus(self["end"])
48 self.setFocus(self["description"])
53 class TimerEditList(Screen):
54 def __init__(self, session):
55 Screen.__init__(self, session)
58 for timer in session.nav.RecordTimer.timer_list:
59 list.append(TimerEntryComponent(timer, 0))
61 for timer in session.nav.RecordTimer.processed_timers:
62 list.append(TimerEntryComponent(timer, 1))
64 self["timerlist"] = TimerList(list)
66 self["key_red"] = Button("Delete")
67 self["key_green"] = Button("Add")
68 self["key_yellow"] = Button("")
69 self["key_blue"] = Button("")
71 self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions"],
75 "red": self.removeTimer,
76 "green": self.addTimer
80 self.session.open(TimerEntry, self["timerlist"].getCurrent()[0])
81 #self.session.open(TimerEdit, self["timerlist"].getCurrent()[0])
83 def removeTimer(self):