Screen.__init__(self, session)
list = [ ]
- for timer in session.nav.RecordTimer.timer_list:
- list.append(TimerEntryComponent(timer, 0))
-
- for timer in session.nav.RecordTimer.processed_timers:
- list.append(TimerEntryComponent(timer, 1))
-
+ self.list = list
+ self.fillTimerList()
+
self["timerlist"] = TimerList(list)
self["key_red"] = Button("Delete")
"green": self.addCurrentTimer
})
+ def fillTimerList(self):
+ del self.list[:]
+
+ for timer in self.session.nav.RecordTimer.timer_list:
+ self.list.append(TimerEntryComponent(timer, 0))
+
+ for timer in self.session.nav.RecordTimer.processed_timers:
+ self.list.append(TimerEntryComponent(timer, 1))
+
def openEdit(self):
self.session.openWithCallback(self.finishedEdit, TimerEntry, self["timerlist"].getCurrent()[0])
#self.session.open(TimerEdit, self["timerlist"].getCurrent()[0])
def removeTimer(self):
# FIXME doesn't work...
self.session.nav.RecordTimer.removeEntry(self["timerlist"].getCurrent()[0])
+ self.fillTimerList()
+ self["timerlist"].invalidate()
def addCurrentTimer(self):
begin = time()
# FIXME only works if already playing a service
serviceref = ServiceReference(self.session.nav.getCurrentlyPlayingServiceReference())
- self.addTimer(begin, end, serviceref, epg, description)
+ self.addTimer(RecordTimerEntry(begin, end, serviceref, epg, description))
- def addTimer(self, begin, end, serviceref, epg, description):
- newEntry = RecordTimerEntry(begin, end, serviceref, epg, description)
- self.session.openWithCallback(self.finishedAdd, TimerEntry, newEntry)
+ def addTimer(self, timer):
+ self.session.openWithCallback(self.finishedAdd, TimerEntry, timer)
def finishedEdit(self, answer):
if (answer[0]):
print "Edited timer"
+ self.fillTimerList()
else:
print "Timeredit aborted"
-
+
def finishedAdd(self, answer):
if (answer[0]):
self.session.nav.RecordTimer.record(answer[1])
+ self.fillTimerList()
else:
- print "Timeredit aborted"
\ No newline at end of file
+ print "Timeredit aborted"