From 10a5ad85625aa211236b39448037884f811eeec9 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Fri, 20 May 2005 19:36:15 +0000 Subject: [PATCH] - follow changes regarding timers - allow description to be edited (won't be saved yet) --- lib/python/Components/TimerList.py | 2 +- lib/python/Screens/TimerEdit.py | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/python/Components/TimerList.py b/lib/python/Components/TimerList.py index da005b0..9ef7cc4 100644 --- a/lib/python/Components/TimerList.py +++ b/lib/python/Components/TimerList.py @@ -23,7 +23,7 @@ RT_WRAP = 32 # | | # def TimerEntry(timer, processed): - res = [ ] + res = [ timer ] res.append((0, 0, 400, 30, 0, RT_HALIGN_LEFT, timer.service_ref.getServiceName())) res.append((0, 30, 200, 20, 1, RT_HALIGN_LEFT, "%s, %s" % FuzzyTime(timer.begin))) diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py index 2fe389e..f8c9f20 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): @@ -18,7 +19,8 @@ class TimerEdit(Screen): self["shortcuts"] = ActionMap(["ShortcutActions"], { "red": self.beginFocus, - "yellow": self.endFocus + "yellow": self.endFocus, + "green": self.descFocus }) self.entry = entry @@ -29,10 +31,11 @@ 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"]) @@ -40,6 +43,9 @@ class TimerEdit(Screen): def endFocus(self): self.setFocus(self["end"]) + def descFocus(self): + self.setFocus(self["description"]) + def apply(self): print "applied!" @@ -63,4 +69,4 @@ class TimerEditList(Screen): }) def openEdit(self): - self.session.open(TimerEdit, self["timerlist"].getCurrent()) + self.session.open(TimerEdit, self["timerlist"].getCurrent()[0]) -- 2.7.4