refs bug #429
[enigma2.git] / lib / python / Components / Renderer / Picon.py
index 27741d6..5ae43ed 100644 (file)
@@ -3,13 +3,12 @@
 ##
 from Renderer import Renderer
 from enigma import ePixmap
-from Components.config import config
-from Tools.Directories import 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/',
+       searchPaths = ('/usr/share/enigma2/%s/',
                                '/media/cf/%s/',
-                               '/media/usb/%s/']
+                               '/media/usb/%s/')
 
        def __init__(self):
                Renderer.__init__(self)
@@ -17,7 +16,7 @@ class Picon(Renderer):
                self.nameCache = { }
                self.pngname = ""
 
-       def applySkin(self, desktop):
+       def applySkin(self, desktop, parent):
                attribs = [ ]
                for (attrib, value) in self.skinAttributes:
                        if attrib == "path":
@@ -25,7 +24,7 @@ class Picon(Renderer):
                        else:
                                attribs.append((attrib,value))
                self.skinAttributes = attribs
-               return Renderer.applySkin(self, desktop)
+               return Renderer.applySkin(self, desktop, parent)
 
        GUI_WIDGET = ePixmap
 
@@ -48,13 +47,10 @@ class Picon(Renderer):
                                if pngname == "": # no default yet in cache..
                                        pngname = self.findPicon("picon_default")
                                        if pngname == "":
-                                               pos = config.skin.primary_skin.value.rfind('/')
-                                               if pos != -1:
-                                                       str = config.skin.primary_skin.value[:pos+1]
-                                                       str += 'picon_default.png'
-                                                       if fileExists(str):
-                                                               pngname = str
-                                               if pngname == "": # Fallback to enigma2 logo
+                                               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: