add cleanup call, implement DiskspacePrecondition, add WorkspaceExistsPrecondition
[enigma2.git] / lib / python / Components / ServiceList.py
index 46c024dd8017fa3e15ff42c3300bdfbb6a36236f..059b890611ef03aa9f59474c8a9371dc3048fb8a 100644 (file)
@@ -2,7 +2,8 @@ from HTMLComponent import HTMLComponent
 from GUIComponent import GUIComponent
 from skin import parseColor
 
-from enigma import loadPNG, eListboxServiceContent, eListbox, eServiceCenter, eServiceReference, gFont, eRect
+from enigma import eListboxServiceContent, eListbox, eServiceCenter, eServiceReference, gFont, eRect
+from Tools.LoadPixmap import LoadPixmap
 
 from string import upper
 
@@ -16,27 +17,27 @@ class ServiceList(HTMLComponent, GUIComponent):
                GUIComponent.__init__(self)
                self.l = eListboxServiceContent()
 
-               pic = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "folder.png"))
+               pic = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/folder.png"))
                if pic:
                        self.l.setPixmap(self.l.picFolder, pic)
 
-               pic = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "marker-fs8.png"))
+               pic = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/icons/marker.png"))
                if pic:
                        self.l.setPixmap(self.l.picMarker, pic)
 
-               pic = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_dvb_s-fs8.png"))
+               pic = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "ico_dvb_s-fs8.png"))
                if pic:
                        self.l.setPixmap(self.l.picDVB_S, pic)
 
-               pic = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_dvb_c-fs8.png"))
+               pic = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "ico_dvb_c-fs8.png"))
                if pic:
                        self.l.setPixmap(self.l.picDVB_C, pic)
 
-               pic = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_dvb_t-fs8.png"))
+               pic = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "ico_dvb_t-fs8.png"))
                if pic:
                        self.l.setPixmap(self.l.picDVB_T, pic)
 
-               pic = loadPNG(resolveFilename(SCOPE_SKIN_IMAGE, "ico_service_group-fs8.png"))
+               pic = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "ico_service_group-fs8.png"))
                if pic:
                        self.l.setPixmap(self.l.picServiceGroup, pic)
 
@@ -44,7 +45,7 @@ class ServiceList(HTMLComponent, GUIComponent):
                self.mode = self.MODE_NORMAL
                self.onSelectionChanged = [ ]
 
-       def applySkin(self, desktop):
+       def applySkin(self, desktop, parent):
                attribs = [ ]
                if self.skinAttributes is not None:
                        attribs = [ ]
@@ -62,7 +63,7 @@ class ServiceList(HTMLComponent, GUIComponent):
                                else:
                                        attribs.append((attrib, value))
                self.skinAttributes = attribs
-               return GUIComponent.applySkin(self, desktop)
+               return GUIComponent.applySkin(self, desktop, parent)
 
        def connectSelChanged(self, fnc):
                if not fnc in self.onSelectionChanged:
@@ -130,6 +131,10 @@ class ServiceList(HTMLComponent, GUIComponent):
                instance.selectionChanged.get().append(self.selectionChanged)
                self.setMode(self.mode)
 
+       def preWidgetRemove(self, instance):
+               instance.setContent(None)
+               instance.selectionChanged.get().remove(self.selectionChanged)
+
        def getRoot(self):
                return self.root