experimental dm8000 recording fix, doesn't belong here
[enigma2.git] / lib / python / Components / Renderer / Picon.py
index 6d97341d08f02f981540fe889a21a4897e848003..de19c9aaf3cc555b1fff8f9555abf94f29447a6c 100644 (file)
@@ -3,7 +3,7 @@
 ##
 from Renderer import Renderer
 from enigma import ePixmap
 ##
 from Renderer import Renderer
 from enigma import ePixmap
-from Tools.Directories import pathExists, fileExists, SCOPE_SKIN_IMAGE, resolveFilename
+from Tools.Directories import fileExists, SCOPE_SKIN_IMAGE, SCOPE_CURRENT_SKIN, resolveFilename
 
 class Picon(Renderer):
        searchPaths = ['/usr/share/enigma2/%s/',
 
 class Picon(Renderer):
        searchPaths = ['/usr/share/enigma2/%s/',
@@ -16,8 +16,7 @@ class Picon(Renderer):
                self.nameCache = { }
                self.pngname = ""
 
                self.nameCache = { }
                self.pngname = ""
 
-       def applySkin(self, desktop):
-               print "-> Picon, applySkin:", self.skinAttributes
+       def applySkin(self, desktop, parent):
                attribs = [ ]
                for (attrib, value) in self.skinAttributes:
                        if attrib == "path":
                attribs = [ ]
                for (attrib, value) in self.skinAttributes:
                        if attrib == "path":
@@ -25,12 +24,11 @@ class Picon(Renderer):
                        else:
                                attribs.append((attrib,value))
                self.skinAttributes = attribs
                        else:
                                attribs.append((attrib,value))
                self.skinAttributes = attribs
-               return Renderer.applySkin(self, desktop)
+               return Renderer.applySkin(self, desktop, parent)
 
        GUI_WIDGET = ePixmap
 
        def changed(self, what):
 
        GUI_WIDGET = ePixmap
 
        def changed(self, what):
-               print "PICON: path=%s" % self.path
                if self.instance:
                        pngname = ""
                        if what[0] != self.CHANGED_CLEAR:
                if self.instance:
                        pngname = ""
                        if what[0] != self.CHANGED_CLEAR:
@@ -48,8 +46,12 @@ class Picon(Renderer):
                                pngname = self.nameCache.get("default", "")
                                if pngname == "": # no default yet in cache..
                                        pngname = self.findPicon("picon_default")
                                pngname = self.nameCache.get("default", "")
                                if pngname == "": # no default yet in cache..
                                        pngname = self.findPicon("picon_default")
-                                       if pngname == "": # Fallback to enigma2 logo
-                                               pngname = resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/enigma2.png")
+                                       if pngname == "":
+                                               tmp = resolveFilename(SCOPE_CURRENT_SKIN, "picon_default.png")
+                                               if fileExists(tmp):
+                                                       pngname = tmp
+                                               else:
+                                                       pngname = resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/picon_default.png")
                                        self.nameCache["default"] = pngname
                        if self.pngname != pngname:
                                self.instance.setPixmapFromFile(pngname)
                                        self.nameCache["default"] = pngname
                        if self.pngname != pngname:
                                self.instance.setPixmapFromFile(pngname)