use servicereferences instead of servicename as picon filenames
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 17 Sep 2007 18:50:39 +0000 (18:50 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 17 Sep 2007 18:50:39 +0000 (18:50 +0000)
data/skin.xml
lib/python/Components/Renderer/Picon.py

index df8e3270df73858117e3a5c9a04acf84dc0eca54..3e98dc54954d42441507ec210620777c7bd8fa3e 100644 (file)
                </widget>       
                <!-- Channellogo (Picon) -->
                <widget source="CurrentService" render="Picon" position="47,2" zPosition="2" size="74,57" >
                </widget>       
                <!-- Channellogo (Picon) -->
                <widget source="CurrentService" render="Picon" position="47,2" zPosition="2" size="74,57" >
-                       <convert type="ServiceName">Name</convert>
+                       <convert type="ServiceName">Reference</convert>
                </widget>
                <!-- Service name -->
                <widget source="CurrentService" render="Label" position="130,30" size="360,27" font="Regular;21" valign="center" halign="right" noWrap="1" backgroundColor="#263c59" shadowColor="#1d354c" shadowOffset="-1,-1" transparent="1" >
                </widget>
                <!-- Service name -->
                <widget source="CurrentService" render="Label" position="130,30" size="360,27" font="Regular;21" valign="center" halign="right" noWrap="1" backgroundColor="#263c59" shadowColor="#1d354c" shadowOffset="-1,-1" transparent="1" >
index 32c777f555256a1371766b25ad02642548e06f2b..060337af158e3ce64cc9c4b576037fc6447d69ce 100644 (file)
@@ -23,12 +23,14 @@ class Picon(Renderer):
                        pngname = ""
                        if what[0] != self.CHANGED_CLEAR:
                                sname = self.source.text
                        pngname = ""
                        if what[0] != self.CHANGED_CLEAR:
                                sname = self.source.text
+                               # strip all after last :
+                               pos = sname.rfind(':')
+                               if pos != -1:
+                                       sname = sname[:pos].rstrip(':')
                                pngname = self.nameCache.get(sname, "")
                                if pngname == "":
                                        pngname = self.findPicon(self.source.text)
                                pngname = self.nameCache.get(sname, "")
                                if pngname == "":
                                        pngname = self.findPicon(self.source.text)
-                                       if pngname == "":
-                                               self.nameCache[sname] = pngname
-                                       else:
+                                       if pngname != "":
                                                self.nameCache[sname] = pngname
                        if pngname == "": # no picon for service found
                                pngname = self.nameCache.get("default", "")
                                                self.nameCache[sname] = pngname
                        if pngname == "": # no picon for service found
                                pngname = self.nameCache.get("default", "")
@@ -44,18 +46,7 @@ class Picon(Renderer):
 
        def findPicon(self, serviceName):
                for path in self.searchPaths:
 
        def findPicon(self, serviceName):
                for path in self.searchPaths:
-                       if pathExists(path):
-                               png = self.findFile(path, serviceName)
-                               if png != "":
-                                       return png
+                       pngname = path + serviceName + ".png"
+                       if fileExists(pngname):
+                               return pngname
                return ""
                return ""
-
-       def findFile(self, path, serviceName):
-               pngname = path + serviceName + ".png"
-               if fileExists(pngname):
-                       return pngname
-               else:
-                       for i in range(len(serviceName), 1, -1):
-                               if fileExists(path + serviceName[0:i] + ".png"):
-                                       return path + serviceName[0:i] + ".png"
-                       return ""