From 100dc74896a9b2a921770118caaa104dae1a408c Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Wed, 9 Jul 2008 11:12:48 +0000 Subject: [PATCH] re-add isTop param to FileList and use it in MediaPlayer (thanks to PieterG) --- lib/python/Components/FileList.py | 5 +++-- lib/python/Plugins/Extensions/MediaPlayer/plugin.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/python/Components/FileList.py b/lib/python/Components/FileList.py index e064d052..54106fba 100644 --- a/lib/python/Components/FileList.py +++ b/lib/python/Components/FileList.py @@ -44,7 +44,7 @@ def FileEntryComponent(name, absolute = None, isDir = False): return res class FileList(MenuList): - def __init__(self, directory, showDirectories = True, showFiles = True, showMountpoints = True, matchingPattern = None, useServiceRef = False, inhibitDirs = False, inhibitMounts = False, enableWrapAround = False, additionalExtensions = None): + def __init__(self, directory, showDirectories = True, showFiles = True, showMountpoints = True, matchingPattern = None, useServiceRef = False, inhibitDirs = False, inhibitMounts = False, isTop = False, enableWrapAround = False, additionalExtensions = None): MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent) self.additional_extensions = additionalExtensions self.mountpoints = [] @@ -54,6 +54,7 @@ class FileList(MenuList): self.showDirectories = showDirectories self.showMountpoints = showMountpoints self.showFiles = showFiles + self.isTop = isTop # example: matching .nfi and .ts files: "^.*\.(nfi|ts)" self.matchingPattern = matchingPattern self.inhibitDirs = inhibitDirs or [] @@ -162,7 +163,7 @@ class FileList(MenuList): directories.append(directory + x + "/") files.remove(x) - if directory is not None and self.showDirectories: + if directory is not None and self.showDirectories and not self.isTop: if directory == self.current_mountpoint and self.showMountpoints: self.list.append(FileEntryComponent(name = "<" +_("List of Storage Devices") + ">", absolute = None, isDir = True)) elif (directory != "/") and not (self.inhibitMounts and self.getMountpoint(directory) in self.inhibitMounts): diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py index 942dc919..bca85518 100644 --- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py @@ -532,7 +532,7 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB def copyDirectory(self, directory, recursive = True): print "copyDirectory", directory - filelist = FileList(directory, useServiceRef = True) + filelist = FileList(directory, useServiceRef = True, isTop = True) for x in filelist.getFileList(): if x[0][1] == True: #isDir -- 2.30.2