From: ghost Date: Sat, 3 Jan 2009 09:36:40 +0000 (+0100) Subject: small timer fixes by adenin X-Git-Tag: 2.6.0~516 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/85209b4213f85d7b5f9f46ee5cfc1c6115c51828 small timer fixes by adenin --- diff --git a/lib/python/Components/EpgList.py b/lib/python/Components/EpgList.py index 01157842..30f566fd 100644 --- a/lib/python/Components/EpgList.py +++ b/lib/python/Components/EpgList.py @@ -55,6 +55,7 @@ class EPGList(HTMLComponent, GUIComponent): self.clock_add_pixmap = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, 'skin_default/icons/epgclock_add.png')) self.clock_pre_pixmap = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, 'skin_default/icons/epgclock_pre.png')) self.clock_post_pixmap = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, 'skin_default/icons/epgclock_post.png')) + self.clock_prepost_pixmap = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, 'skin_default/icons/epgclock_prepost.png')) def getEventFromId(self, service, eventid): event = None @@ -63,7 +64,7 @@ class EPGList(HTMLComponent, GUIComponent): return event def getCurrentChangeCount(self): - if self.type == EPG_TYPE_MULTI: + if self.type == EPG_TYPE_MULTI and self.l.getCurrentSelection() is not None: return self.l.getCurrentSelection()[0] return 0 @@ -95,11 +96,12 @@ class EPGList(HTMLComponent, GUIComponent): def selectionChanged(self): for x in self.onSelChanged: if x is not None: - try: - x() - except: # FIXME!!! - print "FIXME in EPGList.selectionChanged" - pass + x() +# try: +# x() +# except: # FIXME!!! +# print "FIXME in EPGList.selectionChanged" +# pass GUI_WIDGET = eListbox @@ -139,18 +141,28 @@ class EPGList(HTMLComponent, GUIComponent): self.service_rect = Rect(width/20*7, 0, width/20*13, height) def getClockPixmap(self, refstr, beginTime, duration, eventId): + pre_clock = 1 + post_clock = 2 + clock_type = 0 endTime = beginTime + duration for x in self.timer.timer_list: if x.service_ref.ref.toString() == refstr: - beg = x.begin - end = x.end if x.eit == eventId: return self.clock_pixmap - elif beginTime > beg and beginTime < end and endTime > end: - return self.clock_post_pixmap + beg = x.begin + end = x.end + if beginTime > beg and beginTime < end and endTime > end: + clock_type |= pre_clock elif beginTime < beg and endTime > beg and endTime < end: - return self.clock_pre_pixmap - return self.clock_add_pixmap + clock_type |= post_clock + if clock_type == 0: + return self.clock_add_pixmap + elif clock_type == pre_clock: + return self.clock_pre_pixmap + elif clock_type == post_clock: + return self.clock_post_pixmap + else: + return self.clock_prepost_pixmap def buildSingleEntry(self, service, eventId, beginTime, duration, EventName): rec=beginTime and (self.timer.isInTimer(eventId, beginTime, duration, service)) diff --git a/lib/python/Plugins/Extensions/GraphMultiEPG/GraphMultiEpg.py b/lib/python/Plugins/Extensions/GraphMultiEPG/GraphMultiEpg.py index 441cb5d8..afae6b3a 100644 --- a/lib/python/Plugins/Extensions/GraphMultiEPG/GraphMultiEpg.py +++ b/lib/python/Plugins/Extensions/GraphMultiEPG/GraphMultiEpg.py @@ -155,11 +155,12 @@ class EPGList(HTMLComponent, GUIComponent): def selectionChanged(self): for x in self.onSelChanged: if x is not None: - try: - x() - except: # FIXME!!! - print "FIXME in EPGList.selectionChanged" - pass + x() +# try: +# x() +# except: # FIXME!!! +# print "FIXME in EPGList.selectionChanged" +# pass GUI_WIDGET = eListbox @@ -291,13 +292,13 @@ class EPGList(HTMLComponent, GUIComponent): self.time_base = int(stime) test = [ (service.ref.toString(), 0, self.time_base, self.time_epoch) for service in services ] test.insert(0, 'XRnITBD') - print "BEFORE:" - for x in test: - print x +# print "BEFORE:" +# for x in test: +# print x epg_data = self.queryEPG(test) - print "EPG:" - for x in epg_data: - print x +# print "EPG:" +# for x in epg_data: +# print x self.list = [ ] tmp_list = None service = "" @@ -535,7 +536,7 @@ class GraphMultiEPG(Screen): else: self.session.openWithCallback(self.finishSanityCorrection, TimerSanityConflict, simulTimerList) else: - print "Timeredit aborted" + print "Timeredit aborted" def finishSanityCorrection(self, answer): self.finishedAdd(answer) diff --git a/lib/python/Screens/EpgSelection.py b/lib/python/Screens/EpgSelection.py index b40f445f..f6793269 100644 --- a/lib/python/Screens/EpgSelection.py +++ b/lib/python/Screens/EpgSelection.py @@ -285,7 +285,7 @@ class EPGSelection(Screen): else: self.applyButtonState(1) days = [ _("Mon"), _("Tue"), _("Wed"), _("Thu"), _("Fri"), _("Sat"), _("Sun") ] - datastr = "" + datestr = "" event = cur[0] if event is not None: now = time() @@ -306,14 +306,14 @@ class EPGSelection(Screen): serviceref = cur[1] eventid = event.getEventId() refstr = serviceref.ref.toString() - + isRecordEvent = False for timer in self.session.nav.RecordTimer.timer_list: - if self.key_green_choice != self.REMOVE_TIMER: - if timer.eit == eventid and timer.service_ref.ref.toString() == refstr: - self["key_green"].setText(_("Remove timer")) - self.key_green_choice = self.REMOVE_TIMER - break - else: - if self.key_green_choice != self.ADD_TIMER: - self["key_green"].setText(_("Add timer")) - self.key_green_choice = self.ADD_TIMER + if timer.eit == eventid and timer.service_ref.ref.toString() == refstr: + isRecordEvent = True + break + if isRecordEvent and self.key_green_choice != self.REMOVE_TIMER: + self["key_green"].setText(_("Remove timer")) + self.key_green_choice = self.REMOVE_TIMER + elif not isRecordEvent and self.key_green_choice != self.ADD_TIMER: + self["key_green"].setText(_("Add timer")) + self.key_green_choice = self.ADD_TIMER