Disable drag and drop in flatpak

This commit is contained in:
Micah Lee 2021-11-14 15:08:06 -08:00
parent 94c588d0ce
commit bfce4b005c
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
2 changed files with 8 additions and 0 deletions

View file

@ -10,6 +10,7 @@
"gui_add_files": "Add Files",
"gui_add_folder": "Add Folder",
"gui_remove": "Remove",
"gui_dragdrop_sandbox_flatpak": "To make the Flatpak sandbox more secure, drag and drop is not supported. Use the Add Files and Add Folder buttons to browse for files instead.",
"gui_file_selection_remove_all": "Remove All",
"gui_choose_items": "Choose",
"gui_share_start_server": "Start sharing",

View file

@ -243,6 +243,13 @@ class FileList(QtWidgets.QListWidget):
"""
Add a file or directory to this widget.
"""
# Drag and drop doesn't work in Flatpak, because of the sandbox
if self.common.platform == "Linux" and os.path.exists("/app/manifest.json"):
Alert(
self.common, strings._("gui_dragdrop_sandbox_flatpak").format(filename)
)
return
filenames = []
for index in range(self.count()):
filenames.append(self.item(index).filename)