X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/ed40f6f85c9c07c3c1224ae20601082c0309a631..d007f7c3fe25146548e8050757756aa5375de9e9:/lib/python/Components/FileList.py?ds=sidebyside diff --git a/lib/python/Components/FileList.py b/lib/python/Components/FileList.py index b85b8ea3..3b02817c 100644 --- a/lib/python/Components/FileList.py +++ b/lib/python/Components/FileList.py @@ -58,12 +58,24 @@ class FileList(MenuList, HTMLComponent, GUIComponent): self.changeDir(directory) self.l.setFont(0, gFont("Regular", 18)) - + self.l.setItemHeight(23) + self.serviceHandler = eServiceCenter.getInstance() + def getSelection(self): if self.l.getCurrentSelection() is None: return None return self.l.getCurrentSelection()[0] + def getSelectionIndex(self): + return self.l.getCurrentSelectionIndex() + + def getCurrentEvent(self): + l = self.l.getCurrentSelection() + if not l or l[0][1] == True: + return None + else: + return self.serviceHandler.info(l[0][0]).getEvent(l[0][0]) + def getFileList(self): return self.list @@ -186,4 +198,16 @@ class FileList(MenuList, HTMLComponent, GUIComponent): def postWidgetCreate(self, instance): instance.setContent(self.l) - instance.setItemHeight(23) + + def execBegin(self): + harddiskmanager.on_partition_list_change.append(self.partitionListChanged) + + def execEnd(self): + harddiskmanager.on_partition_list_change.remove(self.partitionListChanged) + + def refresh(self): + self.changeDir(self.current_directory, self.getFilename()) + + def partitionListChanged(self, action, device): + if self.current_directory is None: + self.refresh()