aboutsummaryrefslogtreecommitdiff
path: root/desktop/src
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2021-11-14 15:08:06 -0800
committerMicah Lee <micah@micahflee.com>2021-11-14 15:08:06 -0800
commitbfce4b005c34baa92ec8f34fd7f6476173f0bda0 (patch)
tree30f4266bbf86a0c52b132f9b19338f38d6cc8406 /desktop/src
parent94c588d0ce6ce76ffc7714621a04b207e0522c14 (diff)
downloadonionshare-bfce4b005c34baa92ec8f34fd7f6476173f0bda0.tar.gz
onionshare-bfce4b005c34baa92ec8f34fd7f6476173f0bda0.zip
Disable drag and drop in flatpak
Diffstat (limited to 'desktop/src')
-rw-r--r--desktop/src/onionshare/resources/locale/en.json1
-rw-r--r--desktop/src/onionshare/tab/mode/file_selection.py7
2 files changed, 8 insertions, 0 deletions
diff --git a/desktop/src/onionshare/resources/locale/en.json b/desktop/src/onionshare/resources/locale/en.json
index 868a6fa9..d405c702 100644
--- a/desktop/src/onionshare/resources/locale/en.json
+++ b/desktop/src/onionshare/resources/locale/en.json
@@ -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",
diff --git a/desktop/src/onionshare/tab/mode/file_selection.py b/desktop/src/onionshare/tab/mode/file_selection.py
index 6d1c2d65..daf347c0 100644
--- a/desktop/src/onionshare/tab/mode/file_selection.py
+++ b/desktop/src/onionshare/tab/mode/file_selection.py
@@ -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)