sort the list of filenames being shared

This commit is contained in:
Micah Lee 2014-08-28 16:26:56 -07:00
parent 9ed128938f
commit 36914114f9
2 changed files with 3 additions and 0 deletions

View File

@ -27,6 +27,8 @@ def set_file_info(filenames):
info['size'] = helpers.dir_size(filename)
info['size_human'] = helpers.human_readable_filesize(info['size'])
file_info['dirs'].append(info)
file_info['files'] = sorted(file_info['files'], key=lambda k: k['basename'])
file_info['dirs'] = sorted(file_info['dirs'], key=lambda k: k['basename'])
# zip up the files and folders
z = helpers.ZipWriter()

View File

@ -12,6 +12,7 @@ class FileList(QtGui.QListWidget):
super(FileList, self).__init__(parent)
self.setAcceptDrops(True)
self.setIconSize(QtCore.QSize(32, 32))
self.setSortingEnabled(True)
# drag and drop label
self.drop_label = QtGui.QLabel(QtCore.QString(strings._('gui_drag_and_drop')), parent=self)