X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/7bc4a59528ab13f3062dc1520e76f9ecedd87400..71f4df6d025fa09d937dd5e259992cf04b4a04f8:/lib/python/Screens/TimerEdit.py diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py index 41b6a12e..173b1ba2 100644 --- a/lib/python/Screens/TimerEdit.py +++ b/lib/python/Screens/TimerEdit.py @@ -4,6 +4,7 @@ from Components.ActionMap import ActionMap from Components.TimeInput import TimeInput from Components.Label import Label from Components.Button import Button +from Components.TextInput import TextInput class TimerEdit(Screen): def __init__(self, session, entry): @@ -15,6 +16,13 @@ class TimerEdit(Screen): "cancel": self.close }) + self["shortcuts"] = ActionMap(["ShortcutActions"], + { + "red": self.beginFocus, + "yellow": self.endFocus, + "green": self.descFocus + }) + self.entry = entry # begin, end, description, service self["begin"] = TimeInput() @@ -23,10 +31,20 @@ class TimerEdit(Screen): self["lbegin"] = Label("Begin") self["lend"] = Label("End") - self["description"] = Label("bla") -# TextInput() + self["description"] = TextInput() self["apply"] = Button("Apply") self["service"] = Button() + + self["description"].setText(entry.description); + + def beginFocus(self): + self.setFocus(self["begin"]) + + def endFocus(self): + self.setFocus(self["end"]) + + def descFocus(self): + self.setFocus(self["description"]) def apply(self): print "applied!" @@ -46,9 +64,9 @@ class TimerEditList(Screen): self["actions"] = ActionMap(["OkCancelActions"], { - "ok": self.openEdit, +# "ok": self.openEdit, "cancel": self.close }) def openEdit(self): - self.session.open(TimerEdit, self["timerlist"].getCurrent()) + self.session.open(TimerEdit, self["timerlist"].getCurrent()[0])