small fixes for PIG
[enigma2.git] / lib / python / Components / GUISkin.py
index 0fb94214ff4c7529cea3c53f5e6104bd2d3aa912..9f65025deef3f1c236df5a0268a39337afb1b52f 100644 (file)
@@ -1,6 +1,7 @@
 from GUIComponent import GUIComponent
 from skin import applyAllAttributes
 from Tools.CList import CList
+from Sources.Source import Source
 
 class GUISkin:
        __module__ = __name__
@@ -10,10 +11,18 @@ class GUISkin:
                self.summaries = CList()
 
        def createGUIScreen(self, parent, desktop):
-               for val in self.values() + self.renderer:
+               for val in self.renderer:
                        if isinstance(val, GUIComponent):
                                val.GUIcreate(parent)
-                               val.applySkin(desktop)
+                               if not val.applySkin(desktop):
+                                       print "warning, skin is missing renderer", val, "in", self
+
+               for key in self:
+                       val = self[key]
+                       if isinstance(val, GUIComponent):
+                               val.GUIcreate(parent)
+                               if not val.applySkin(desktop):
+                                       print "warning, skin is missing element", key, "in", self
 
                for w in self.additionalWidgets:
                        w.instance = w.widget(parent)
@@ -27,9 +36,15 @@ class GUISkin:
                                f()
 
        def deleteGUIScreen(self):
+               seenFakeSource = False
                for (name, val) in self.items():
+                       if name == "fake" and isinstance(val, Source):
+                               seenFakeSource = True
                        if isinstance(val, GUIComponent):
                                val.GUIdelete()
+               if seenFakeSource:
+                       print "DEL FAKE SOURCE"
+                       del self["fake"]
 
        def close(self):
                self.deleteGUIScreen()