allow styleable TemplatedMultiContent lists
[enigma2.git] / lib / python / Components / MediaPlayer.py
index 50de290dfbfc19eee91586205cf07e107fa8c56a..87ba977c0cbc9dba8ff39389289da66a9a52d6d7 100644 (file)
@@ -40,7 +40,7 @@ def PlaylistEntryComponent(serviceref, state):
 
        if png is not None:
                res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 5, 0, 16, 16, png))
-    
+
        return res
 
 class PlayList(MenuList):
@@ -64,6 +64,10 @@ class PlayList(MenuList):
        def addFile(self, serviceref):
                self.list.append(PlaylistEntryComponent(serviceref, STATE_NONE))
 
+       def updateFile(self, index, newserviceref):
+               if index < len(self.list):
+                   self.list[index] = PlaylistEntryComponent(newserviceref, STATE_NONE)
+
        def deleteFile(self, index):
                if self.currPlaying >= index:
                        self.currPlaying -= 1
@@ -72,6 +76,7 @@ class PlayList(MenuList):
        def setCurrentPlaying(self, index):
                self.oldCurrPlaying = self.currPlaying
                self.currPlaying = index
+               self.moveToIndex(index)
 
        def updateState(self, state):
                if len(self.list) > self.oldCurrPlaying and self.oldCurrPlaying != -1: