re-add isTop param to FileList and use it in MediaPlayer (thanks to PieterG)
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 9 Jul 2008 11:12:48 +0000 (11:12 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 9 Jul 2008 11:12:48 +0000 (11:12 +0000)
lib/python/Components/FileList.py
lib/python/Plugins/Extensions/MediaPlayer/plugin.py

index e064d0527305fe41c98477675f60dff2c00704a6..54106fba2e7fb98f709326eaa70f24e43c46f84d 100644 (file)
@@ -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):
index 942dc919c275b0694e87f57b994cf7fff9cb6a82..bca85518689eeaedd3c3a7ec231b67ef7843c8d9 100644 (file)
@@ -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