X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e573cf16494de5150298e52250c0474a94ca7fb1..44c32e4101acdeb6df3833f35e9c0719e993a2a5:/lib/python/Screens/EventView.py diff --git a/lib/python/Screens/EventView.py b/lib/python/Screens/EventView.py index 8a684ead..5d50d9bc 100644 --- a/lib/python/Screens/EventView.py +++ b/lib/python/Screens/EventView.py @@ -1,20 +1,22 @@ from Screen import Screen +from Screens.TimerEdit import TimerSanityConflict from Components.ActionMap import ActionMap from Components.Button import Button from Components.Label import Label from Components.ScrollLabel import ScrollLabel -from enigma import eServiceEventPtr, eEPGCache, eTimer -from ServiceReference import ServiceReference +from Components.TimerList import TimerList +from enigma import eEPGCache, eTimer, eServiceReference from RecordTimer import RecordTimerEntry, parseEvent from TimerEntry import TimerEntry -from time import localtime, asctime +from time import localtime +from Components.config import config class EventViewBase: def __init__(self, Event, Ref, callback=None, similarEPGCB=None): self.similarEPGCB = similarEPGCB self.cbFunc = callback self.currentService=Ref - self.isRecording = len(Ref.ref.getPath()) + self.isRecording = (not Ref.ref.flags & eServiceReference.isGroup) and len(Ref.ref.getPath()) self.event = Event self["epg_description"] = ScrollLabel() self["datetime"] = Label() @@ -23,7 +25,7 @@ class EventViewBase: self["key_red"] = Button("") if similarEPGCB is not None: self.SimilarBroadcastTimer = eTimer() - self.SimilarBroadcastTimer.timeout.get().append(self.getSimilarEvents) + self.SimilarBroadcastTimer.callback.append(self.getSimilarEvents) else: self.SimilarBroadcastTimer = None if self.isRecording: @@ -60,13 +62,25 @@ class EventViewBase: def timerAdd(self): if not self.isRecording: newEntry = RecordTimerEntry(self.currentService, checkOldTimers = True, *parseEvent(self.event)) - self.session.openWithCallback(self.timerEditFinished, TimerEntry, newEntry) - - def timerEditFinished(self, answer): - if (answer[0]): - self.session.nav.RecordTimer.record(answer[1]) + 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: + if (len(simulTimerList) == 2) and (simulTimerList[1].dontSave) and (simulTimerList[1].autoincrease): + simulTimerList[1].end = entry.begin - 30 + self.session.nav.RecordTimer.timeChanged(simulTimerList[1]) + self.session.nav.RecordTimer.record(entry) + else: + self.session.openWithCallback(self.finishSanityCorrection, TimerSanityConflict, simulTimerList) else: - print "Timeredit aborted" + print "Timeredit aborted" + + def finishSanityCorrection(self, answer): + self.finishedAdd(answer) def setService(self, service): self.currentService=service