diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2007-09-26 20:31:17 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2007-09-26 20:31:17 +0000 |
| commit | bd2e4390946cda853f8d295b76d491d2d60bbe4a (patch) | |
| tree | 7a040a11be142dd3b0fd58596555457fc5a7a342 /lib/python/Components | |
| parent | 00594a7659e4ea14214058c7f3c536704b7ef915 (diff) | |
| download | enigma2-bd2e4390946cda853f8d295b76d491d2d60bbe4a.tar.gz enigma2-bd2e4390946cda853f8d295b76d491d2d60bbe4a.zip | |
fix caching, allow path= to override last path component (for LCD picons or differently shaped icons)
Diffstat (limited to 'lib/python/Components')
| -rw-r--r-- | lib/python/Components/Renderer/Picon.py | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/python/Components/Renderer/Picon.py b/lib/python/Components/Renderer/Picon.py index a96bf69f..6d97341d 100644 --- a/lib/python/Components/Renderer/Picon.py +++ b/lib/python/Components/Renderer/Picon.py @@ -6,18 +6,31 @@ from enigma import ePixmap from Tools.Directories import pathExists, fileExists, SCOPE_SKIN_IMAGE, resolveFilename class Picon(Renderer): - pngname = "" - nameCache = { } - searchPaths = ['/usr/share/enigma2/picon/', - '/media/cf/picon/', - '/media/usb/picon/'] + searchPaths = ['/usr/share/enigma2/%s/', + '/media/cf/%s/', + '/media/usb/%s/'] def __init__(self): Renderer.__init__(self) + self.path = "picon" + self.nameCache = { } + self.pngname = "" + + def applySkin(self, desktop): + print "-> Picon, applySkin:", self.skinAttributes + attribs = [ ] + for (attrib, value) in self.skinAttributes: + if attrib == "path": + self.path = value + else: + attribs.append((attrib,value)) + self.skinAttributes = attribs + return Renderer.applySkin(self, desktop) GUI_WIDGET = ePixmap def changed(self, what): + print "PICON: path=%s" % self.path if self.instance: pngname = "" if what[0] != self.CHANGED_CLEAR: @@ -44,7 +57,7 @@ class Picon(Renderer): def findPicon(self, serviceName): for path in self.searchPaths: - pngname = path + serviceName + ".png" + pngname = (path % self.path) + serviceName + ".png" if fileExists(pngname): return pngname return "" |
