refs bug #429
[enigma2.git] / lib / python / Components / EpgList.py
old mode 100644 (file)
new mode 100755 (executable)
index 3b07412..41cd1b2
@@ -8,7 +8,7 @@ from Tools.LoadPixmap import LoadPixmap
 
 from time import localtime, time
 from ServiceReference import ServiceReference
-from Tools.Directories import resolveFilename, SCOPE_SKIN_IMAGE
+from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN
 
 EPG_TYPE_SINGLE = 0
 EPG_TYPE_MULTI = 1
@@ -53,11 +53,11 @@ class EPGList(HTMLComponent, GUIComponent):
                        assert(type == EPG_TYPE_SIMILAR)
                        self.l.setBuildFunc(self.buildSimilarEntry)
                self.epgcache = eEPGCache.getInstance()
-               self.clock_pixmap = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, 'skin_default/icons/epgclock.png'))
-               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'))
+               self.clock_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock.png'))
+               self.clock_add_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_add.png'))
+               self.clock_pre_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_pre.png'))
+               self.clock_post_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_post.png'))
+               self.clock_prepost_pixmap = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, 'skin_default/icons/epgclock_prepost.png'))
 
        def getEventFromId(self, service, eventid):
                event = None
@@ -212,7 +212,7 @@ class EPGList(HTMLComponent, GUIComponent):
                        res.append((eListboxPythonMultiContent.TYPE_TEXT, r3.left(), r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT, service_name))
                return res
 
-       def buildMultiEntry(self, changecount, service, eventId, begTime, duration, EventName, nowTime, service_name):
+       def buildMultiEntry(self, changecount, service, eventId, beginTime, duration, EventName, nowTime, service_name):
                (clock_pic, rec) = self.getPixmapForEntry(service, eventId, beginTime, duration)
                r1=self.service_rect
                r2=self.progress_rect
@@ -226,10 +226,10 @@ class EPGList(HTMLComponent, GUIComponent):
                        ))
                else:
                        res.append((eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_LEFT, service_name))
-               if begTime is not None:
-                       if nowTime < begTime:
-                               begin = localtime(begTime)
-                               end = localtime(begTime+duration)
+               if beginTime is not None:
+                       if nowTime < beginTime:
+                               begin = localtime(beginTime)
+                               end = localtime(beginTime+duration)
 #                              print "begin", begin
 #                              print "end", end
                                res.extend((
@@ -237,7 +237,7 @@ class EPGList(HTMLComponent, GUIComponent):
                                        (eListboxPythonMultiContent.TYPE_TEXT, r3.left(), r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT, EventName)
                                ))
                        else:
-                               percent = (nowTime - begTime) * 100 / duration
+                               percent = (nowTime - beginTime) * 100 / duration
                                res.extend((
                                        (eListboxPythonMultiContent.TYPE_PROGRESS, r2.left(), r2.top(), r2.width(), r2.height(), percent),
                                        (eListboxPythonMultiContent.TYPE_TEXT, r3.left(), r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT, EventName)