+ if t.disabled:
+ t.enable()
+ self.session.nav.RecordTimer.timeChanged(t)
+
+ else:
+ if t.isRunning() and t.repeated:
+ list = []
+ list.append((_("Stop current event but not coming events"), "stoponlycurrent"))
+ list.append((_("Stop current event and disable coming events"), "stopall"))
+ list.append((_("Don't stop current event but disable coming events"), "stoponlycoming"))
+ self.session.openWithCallback(boundFunction(self.runningEventCallback, t), ChoiceBox, title=_("Repeating event currently recording... What do you want to do?"), list = list)
+ else:
+ t.disable()
+ self.session.nav.RecordTimer.timeChanged(t)
+ self.updateState()
+ self.refill()
+
+ def runningEventCallback(self, t, result):
+ if result is not None:
+ if result[1] == "stoponlycurrent" or result[1] == "stopall":
+ t.enable()
+ t.processRepeated(findRunningEvent = False)
+ self.session.nav.RecordTimer.doActivate(t)
+ if result[1] == "stoponlycoming" or result[1] == "stopall":
+ t.disable()
+ self.session.nav.RecordTimer.timeChanged(t)
+
+ self.updateState()
+ self.refill()
+
+ def updateState(self):
+ if len(self.list) > 0:
+ if self["timerlist"].getCurrent()[0].disabled:
+ self["key_yellow"].setText(_("Enable"))
+ else:
+ self["key_yellow"].setText(_("Disable"))
+ self["key_yellow"].instance.invalidate()
+
+ def fillTimerList(self):
+ del self.list[:]
+
+ for timer in self.session.nav.RecordTimer.timer_list:
+ self.list.append(TimerEntryComponent(timer, processed=False))
+
+ for timer in self.session.nav.RecordTimer.processed_timers:
+ self.list.append(TimerEntryComponent(timer, processed=True))
+ self.list.sort(cmp = lambda x, y: x[0].begin < y[0].begin)
+
+ def showLog(self):
+ cur=self["timerlist"].getCurrent()
+ if cur:
+ self.session.openWithCallback(self.finishedEdit, TimerLog, cur[0])
+
+ def openEdit(self):
+ cur=self["timerlist"].getCurrent()
+ if cur:
+ self.session.openWithCallback(self.finishedEdit, TimerEntry, cur[0])
+
+ def cleanupQuestion(self):
+ self.session.openWithCallback(self.cleanupTimer, MessageBox, _("Really delete done timers?"))