From d7d95c7b2435ab1819bc23eff5ff53aaac2b9ff1 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Tue, 8 Nov 2005 23:12:55 +0000 Subject: [PATCH] use the new TimerEntry-screen to edit a timerentry --- lib/python/Components/TimerList.py | 2 +- lib/python/Screens/TimerEdit.py | 10 ++++++---- lib/python/Screens/TimerEntry.py | 22 +++++++++++++--------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/lib/python/Components/TimerList.py b/lib/python/Components/TimerList.py index 793bed4c..dbc0cfc7 100644 --- a/lib/python/Components/TimerList.py +++ b/lib/python/Components/TimerList.py @@ -22,7 +22,7 @@ RT_WRAP = 32 # | | # | | # -def TimerEntry(timer, processed): +def TimerEntryComponent(timer, processed): res = [ timer ] diff --git a/lib/python/Screens/TimerEdit.py b/lib/python/Screens/TimerEdit.py index f8c9f207..1bc734a6 100644 --- a/lib/python/Screens/TimerEdit.py +++ b/lib/python/Screens/TimerEdit.py @@ -1,10 +1,11 @@ from Screen import Screen -from Components.TimerList import TimerList, TimerEntry +from Components.TimerList import TimerList, TimerEntryComponent 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 +from TimerEntry import TimerEntry class TimerEdit(Screen): def __init__(self, session, entry): @@ -55,10 +56,10 @@ class TimerEditList(Screen): list = [ ] for timer in session.nav.RecordTimer.timer_list: - list.append(TimerEntry(timer, 0)) + list.append(TimerEntryComponent(timer, 0)) for timer in session.nav.RecordTimer.processed_timers: - list.append(TimerEntry(timer, 1)) + list.append(TimerEntryComponent(timer, 1)) self["timerlist"] = TimerList(list) @@ -69,4 +70,5 @@ class TimerEditList(Screen): }) def openEdit(self): - self.session.open(TimerEdit, self["timerlist"].getCurrent()[0]) + self.session.open(TimerEntry, self["timerlist"].getCurrent()[0]) + #self.session.open(TimerEdit, self["timerlist"].getCurrent()[0]) diff --git a/lib/python/Screens/TimerEntry.py b/lib/python/Screens/TimerEntry.py index 91e96732..5893749b 100644 --- a/lib/python/Screens/TimerEntry.py +++ b/lib/python/Screens/TimerEntry.py @@ -7,10 +7,10 @@ from Components.Label import Label from time import * class TimerEntry(Screen): - def __init__(self, session): + def __init__(self, session, timer): Screen.__init__(self, session) - self.createConfig() + self.createConfig(timer) self["actions"] = NumberActionMap(["SetupActions"], { @@ -36,19 +36,23 @@ class TimerEntry(Screen): self["introduction"] = Label("Press OK to start the scan") - def createConfig(self): + def createConfig(self, timer): config.timerentry = ConfigSubsection() - config.timerentry.date = configElement_nonSave("config.timerentry.date", configDateTime, time(), ("%d.%B %Y", 86400)) - config.timerentry.time = configElement_nonSave("config.timerentry.time", configDateTime, time(), ("%H:%M", 60)) - config.timerentry.weekday = configElement_nonSave("config.timerentry.weekday", configDateTime, time(), ("%A", 86400)) + config.timerentry.startdate = configElement_nonSave("config.timerentry.startdate", configDateTime, timer.begin, ("%d.%B %Y", 86400)) + config.timerentry.starttime = configElement_nonSave("config.timerentry.starttime", configDateTime, timer.begin, ("%H:%M", 60)) + config.timerentry.enddate = configElement_nonSave("config.timerentry.enddate", configDateTime, timer.end, ("%d.%B %Y", 86400)) + config.timerentry.endtime = configElement_nonSave("config.timerentry.endtime", configDateTime, timer.end, ("%H:%M", 60)) + #config.timerentry.weekday = configElement_nonSave("config.timerentry.weekday", configDateTime, time(), ("%A", 86400)) def createSetup(self): self.list = [] - self.list.append(getConfigListEntry("Date", config.timerentry.date)) - self.list.append(getConfigListEntry("Time", config.timerentry.time)) - self.list.append(getConfigListEntry("Weekday", config.timerentry.weekday)) + self.list.append(getConfigListEntry("StartDate", config.timerentry.startdate)) + self.list.append(getConfigListEntry("StartTime", config.timerentry.starttime)) + self.list.append(getConfigListEntry("EndDate", config.timerentry.enddate)) + self.list.append(getConfigListEntry("EndTime", config.timerentry.endtime)) +# self.list.append(getConfigListEntry("Weekday", config.timerentry.weekday)) self["config"].list = self.list self["config"].l.setList(self.list) -- 2.30.2