From dfbd5853de864053e8ac10d1269e8137f3cb5a34 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Wed, 1 Mar 2006 02:37:17 +0000 Subject: [PATCH] display clock png in single epg list for fitting timers (we have a problem with the event id matching for manual timers) --- RecordTimer.py | 4 ++-- data/epgclock-fs8.png | 0 lib/python/Components/EpgList.py | 14 ++++++++++---- lib/python/Screens/EpgSelection.py | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 data/epgclock-fs8.png diff --git a/RecordTimer.py b/RecordTimer.py index 4c3304c7..9f78ff24 100644 --- a/RecordTimer.py +++ b/RecordTimer.py @@ -328,8 +328,8 @@ class RecordTimer(timer.Timer): def isInTimer(self, eventid, begin, duration, service): time_match = 0 - for x in self.timer: - if x.service_ref == service: + for x in self.timer_list: + if str(x.service_ref) == str(service): if x.eit is not None and x.repeated == 0: if x.eit == eventid: return duration diff --git a/data/epgclock-fs8.png b/data/epgclock-fs8.png new file mode 100644 index 00000000..e69de29b diff --git a/lib/python/Components/EpgList.py b/lib/python/Components/EpgList.py index 542f5d9a..7e5dca10 100644 --- a/lib/python/Components/EpgList.py +++ b/lib/python/Components/EpgList.py @@ -5,6 +5,7 @@ from enigma import * from re import * from time import localtime, time from ServiceReference import ServiceReference +from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE EPG_TYPE_SINGLE = 0 EPG_TYPE_MULTI = 1 @@ -42,7 +43,8 @@ class Rect: return self.__width class EPGList(HTMLComponent, GUIComponent): - def __init__(self, type=EPG_TYPE_SINGLE, selChangedCB=None): + def __init__(self, type=EPG_TYPE_SINGLE, selChangedCB=None, timer = None): + self.timer = timer self.onSelChanged = [ ] if selChangedCB is not None: self.onSelChanged.append(selChangedCB) @@ -135,13 +137,17 @@ class EPGList(HTMLComponent, GUIComponent): w = width/10*5; self.descr_rect = Rect(xpos, 0, width, height) - def buildSingleEntry(self, eventId, beginTime, duration, EventName): + def buildSingleEntry(self, eventId, beginTime, duration, EventName, rec=False): r1=self.datetime_rect r2=self.descr_rect res = [ eventId ] t = localtime(beginTime) res.append((eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_LEFT, "%02d.%02d, %02d:%02d"%(t[2],t[1],t[3],t[4]))) - res.append((eListboxPythonMultiContent.TYPE_TEXT, r2.left(), r2.top(), r2.width(), r2.height(), 0, RT_HALIGN_LEFT, EventName)) + if rec: + res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, r2.left(), r2.top(), 21, 21, loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, 'epgclock-fs8.png')))) + res.append((eListboxPythonMultiContent.TYPE_TEXT, r2.left() + 25, r2.top(), r2.width(), r2.height(), 0, RT_HALIGN_LEFT, EventName)) + else: + res.append((eListboxPythonMultiContent.TYPE_TEXT, r2.left(), r2.top(), r2.width(), r2.height(), 0, RT_HALIGN_LEFT, EventName)) return res def buildMultiEntry(self, changecount, service, eventId, begTime, duration, EventName, nowTime, service_name): @@ -232,7 +238,7 @@ class EPGList(HTMLComponent, GUIComponent): tmp = self.queryEPG(test) self.list = [ ] for x in tmp: - self.list.append(self.buildSingleEntry(x[0], x[1], x[2], x[3])) + self.list.append(self.buildSingleEntry(x[0], x[1], x[2], x[3], (self.timer.isInTimer(eventid=x[0], begin=x[1], duration=x[2], service=service) > 0))) # self.list.append(self.buildSingleEntry(refstr, x[0], x[1], x[2], x[3])) self.l.setList(self.list) print time() - t diff --git a/lib/python/Screens/EpgSelection.py b/lib/python/Screens/EpgSelection.py index 378e0d89..bf841fa4 100644 --- a/lib/python/Screens/EpgSelection.py +++ b/lib/python/Screens/EpgSelection.py @@ -46,7 +46,7 @@ class EPGSelection(Screen): self.zapFunc = zapFunc self["key_green"] = Button(_("Add timer")) - self["list"] = EPGList(self.type, self.onSelectionChanged) + self["list"] = EPGList(type = self.type, selChangedCB = self.onSelectionChanged, timer = self.session.nav.RecordTimer) class ChannelActionMap(ActionMap): def action(self, contexts, action): -- 2.30.2