ignore applySkin when skinAttributes is None
[enigma2.git] / lib / python / Plugins / Extensions / GraphMultiEPG / GraphMultiEpg.py
index e1481276c6bcc73679a11cbb261e424c29d6630e..9040539a61749953b4869d6940bf250010ddcce2 100644 (file)
@@ -1,4 +1,4 @@
-from skin import queryColor
+from skin import parseColor
 from Components.config import config, ConfigClock, ConfigInteger
 from Components.Pixmap import Pixmap
 from Components.Button import Button
@@ -7,7 +7,7 @@ from Components.HTMLComponent import HTMLComponent
 from Components.GUIComponent import GUIComponent
 from Components.EpgList import Rect
 from Components.Sources.Event import Event
-from Components.Sources.Clock import Clock
+from Components.Sources.Source import ObsoleteSource
 from Screens.Screen import Screen
 from Screens.EventView import EventViewSimple
 from Screens.TimeDateInput import TimeDateInput
@@ -43,24 +43,27 @@ class EPGList(HTMLComponent, GUIComponent):
                self.list = None
                self.event_rect = None
 
-               #query skin colors
-               col = queryColor("GraphEpg.Foreground")
-               self.foreColor = col and col.argb()
-
-               col = queryColor("GraphEpg.Border")
-               self.borderColor = col and col.argb()
-
-               col = queryColor("GraphEpg.Background")
-               if col is None:
-                       self.backColor = 0x586d88
-               else:
-                       self.backColor = col.argb()
-
-               col = queryColor("GraphEpg.BackgroundSelected")
-               if col is None:
-                       self.backColorSelected = 0x808080
-               else:
-                       self.backColorSelected = col.argb()
+               self.foreColor = None
+               self.borderColor = None
+               self.backColor = 0x586d88
+               self.backColorSelected = 0x808080
+
+       def applySkin(self, desktop):
+               if self.skinAttributes is not None:
+                       attribs = [ ]
+                       for (attrib, value) in self.skinAttributes:
+                               if attrib == "EntryForegroundColor":
+                                       self.foreColor = parseColor(value).argb()
+                               elif attrib == "EntryBorderColor":
+                                       self.borderColor = parseColor(value).argb()
+                               elif attrib == "EntryBackgroundColor":
+                                       self.backColor = parseColor(value).argb()
+                               elif attrib == "EntryBackgroundColorSelected":
+                                       self.backColorSelected = parseColor(value).argb()
+                               else:
+                                       attribs.append((attrib,value))
+                       self.skinAttributes = attribs
+               return GUIComponent.applySkin(self, desktop)
 
        def isSelectable(self, service, sname, event_list):
                return (event_list and len(event_list) and True) or False
@@ -159,7 +162,7 @@ class EPGList(HTMLComponent, GUIComponent):
                xpos += w;
                w = width/10*8;
                self.event_rect = Rect(xpos, 0, w, height)
-               self.l.setSelectionClip(eRect(xpos, 0, w, height), False)
+               self.l.setSelectionClip(eRect(0,0,0,0), False)
 
        def calcEntryPosAndWidthHelper(self, stime, duration, start, end, width):
                xpos = (stime - start) * width / (end - start)
@@ -325,7 +328,7 @@ class GraphMultiEPG(Screen):
                self["key_green"] = Button(_("Add timer"))
                self["timeline_text"] = TimelineText()
                self["Event"] = Event()
-               self["Clock"] = Clock()
+               self["Clock"] = ObsoleteSource(new_source = "global.CurrentTime", removal_date = "2008-01")
                self.time_lines = [ ]
                for x in (0,1,2,3,4,5):
                        pm = Pixmap()