X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/08fca93e7f2a37a452399d08c5c84b969b7e52af..c0d78035b8c76e719bf7c05ff3812eb5a6ce9fe3:/lib/python/Components/MediaPlayer.py diff --git a/lib/python/Components/MediaPlayer.py b/lib/python/Components/MediaPlayer.py index b6b2e432..c271c3c6 100644 --- a/lib/python/Components/MediaPlayer.py +++ b/lib/python/Components/MediaPlayer.py @@ -50,7 +50,7 @@ def PlaylistEntryComponent(serviceref, state): return res -class PlayList(HTMLComponent, GUIComponent, MenuList): +class PlayList(MenuList, HTMLComponent, GUIComponent): def __init__(self): GUIComponent.__init__(self) self.l = eListboxPythonMultiContent() @@ -61,14 +61,17 @@ class PlayList(HTMLComponent, GUIComponent, MenuList): self.oldCurrPlaying = -1 def clear(self): - self.list = [] + del self.list[:] self.l.setList(self.list) - - def GUIcreate(self, parent): - self.instance = eListbox(parent) - self.instance.setContent(self.l) - self.instance.setItemHeight(32) - + self.currPlaying = 0 + self.oldCurrPlaying = -1 + + GUI_WIDGET = eListbox + + def postWidgetCreate(self, instance): + instance.setContent(self.l) + instance.setItemHeight(32) + def getSelection(self): return self.l.getCurrentSelection()[0] @@ -79,10 +82,10 @@ class PlayList(HTMLComponent, GUIComponent, MenuList): self.list.append(PlaylistEntryComponent(serviceref, STATE_NONE)) def deleteFile(self, index): - if self.currPlaying > index: + if self.currPlaying >= index: self.currPlaying -= 1 - self.list = self.list[:index] + self.list[index + 1:] - + del self.list[index] + def setCurrentPlaying(self, index): self.oldCurrPlaying = self.currPlaying self.currPlaying = index @@ -121,4 +124,4 @@ class PlayList(HTMLComponent, GUIComponent, MenuList): return list def __len__(self): - return len(self.list) \ No newline at end of file + return len(self.list)