mirror of
https://github.com/onionshare/onionshare.git
synced 2025-07-27 00:25:45 -04:00
Move the readable file check from FileSelection to FileList, so files you drag-and-drop into OnionShare get checked as well
This commit is contained in:
parent
959f637b49
commit
c4ad835322
1 changed files with 5 additions and 4 deletions
|
@ -130,6 +130,10 @@ class FileList(QtWidgets.QListWidget):
|
|||
Add a file or directory to this widget.
|
||||
"""
|
||||
if filename not in self.filenames:
|
||||
if not os.access(filename, os.R_OK):
|
||||
Alert(strings._("not_a_readable_file", True).format(filename))
|
||||
return
|
||||
|
||||
self.filenames.append(filename)
|
||||
|
||||
fileinfo = QtCore.QFileInfo(filename)
|
||||
|
@ -214,9 +218,6 @@ class FileSelection(QtWidgets.QVBoxLayout):
|
|||
caption=strings._('gui_choose_files', True), options=QtWidgets.QFileDialog.ReadOnly)
|
||||
if filenames:
|
||||
for filename in filenames[0]:
|
||||
if not os.access(filename, os.R_OK):
|
||||
Alert(strings._("not_a_readable_file", True).format(filename))
|
||||
else:
|
||||
self.file_list.add_file(filename)
|
||||
self.update()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue