X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/9ede0c7dfec7b949e13970725e370189035eb4c7..c0d78035b8c76e719bf7c05ff3812eb5a6ce9fe3:/lib/python/Components/MediaPlayer.py diff --git a/lib/python/Components/MediaPlayer.py b/lib/python/Components/MediaPlayer.py index 31799c5b..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] @@ -81,8 +84,8 @@ class PlayList(HTMLComponent, GUIComponent, MenuList): def deleteFile(self, 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)