FileBrowser: Added an empty item when there are no files in the current folder

This commit is contained in:
Manuel Cortez 2017-03-31 10:38:51 -06:00
parent cc40efe90b
commit 8da4180509

View File

@ -736,6 +736,12 @@ class fileBrowser(Listbox):
continue
files.append((os.path.abspath(i), i))
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
def getDir(self):