FileBrowser: Added an empty item when there are no files in the current folder
This commit is contained in:
parent
cc40efe90b
commit
8da4180509
@ -736,6 +736,12 @@ class fileBrowser(Listbox):
|
|||||||
continue
|
continue
|
||||||
files.append((os.path.abspath(i), i))
|
files.append((os.path.abspath(i), i))
|
||||||
folders.extend(files)
|
folders.extend(files)
|
||||||
|
# If there are no files or directories, let's say "empty"
|
||||||
|
# This will avoid the program to crash and will look nicer.
|
||||||
|
if len(folders) == 0:
|
||||||
|
folders.append(("collapse", _("empty")))
|
||||||
|
if len(folders)
|
||||||
|
|
||||||
return folders
|
return folders
|
||||||
|
|
||||||
def getDir(self):
|
def getDir(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user