- if not self.isRecording:
- newEntry = RecordTimerEntry(self.currentService, *parseEvent(self.event))
- self.session.openWithCallback(self.timerEditFinished, TimerEntry, newEntry)
-
- def timerEditFinished(self, answer):
- if (answer[0]):
- self.session.nav.RecordTimer.record(answer[1])
+ if self.isRecording:
+ return
+ event = self.event
+ serviceref = self.currentService
+ if event is None:
+ return
+ eventid = event.getEventId()
+ refstr = serviceref.ref.toString()
+ for timer in self.session.nav.RecordTimer.timer_list:
+ if timer.eit == eventid and timer.service_ref.ref.toString() == refstr:
+ cb_func = lambda ret : not ret or self.removeTimer(timer)
+ self.session.openWithCallback(cb_func, MessageBox, _("Do you really want to delete %s?") % event.getEventName())
+ break
+ else:
+ newEntry = RecordTimerEntry(self.currentService, checkOldTimers = True, dirname = preferredTimerPath(), *parseEvent(self.event))
+ self.session.openWithCallback(self.finishedAdd, TimerEntry, newEntry)
+
+ def finishedAdd(self, answer):
+ print "finished add"
+ if answer[0]:
+ entry = answer[1]
+ simulTimerList = self.session.nav.RecordTimer.record(entry)
+ if simulTimerList is not None:
+ for x in simulTimerList:
+ if x.setAutoincreaseEnd(entry):
+ self.session.nav.RecordTimer.timeChanged(x)
+ simulTimerList = self.session.nav.RecordTimer.record(entry)
+ if simulTimerList is not None:
+ self.session.openWithCallback(self.finishSanityCorrection, TimerSanityConflict, simulTimerList)
+ self["key_green"].setText(_("Remove timer"))
+ self.key_green_choice = self.REMOVE_TIMER