aboutsummaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2021-11-14 17:16:21 -0800
committerMicah Lee <micah@micahflee.com>2021-11-14 17:16:21 -0800
commit0f63c89a5929182e9ea120075fe47d58536ce2fc (patch)
treed685425c5adc4a04fbd6af0db18d2f3872a9310b /desktop
parent70248ed4a5ee12ce5d8526db5a1916e202e784e3 (diff)
downloadonionshare-0f63c89a5929182e9ea120075fe47d58536ce2fc.tar.gz
onionshare-0f63c89a5929182e9ea120075fe47d58536ce2fc.zip
Detect Flatpak via environment variable
Diffstat (limited to 'desktop')
-rw-r--r--desktop/src/onionshare/tab/mode/file_selection.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/desktop/src/onionshare/tab/mode/file_selection.py b/desktop/src/onionshare/tab/mode/file_selection.py
index 40ca1685..c75e9db6 100644
--- a/desktop/src/onionshare/tab/mode/file_selection.py
+++ b/desktop/src/onionshare/tab/mode/file_selection.py
@@ -186,7 +186,7 @@ class FileList(QtWidgets.QListWidget):
dragEnterEvent for dragging files and directories into the 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"):
+ if self.common.is_flatpak():
Alert(self.common, strings._("gui_dragdrop_sandbox_flatpak").format())
event.ignore()
return
@@ -213,7 +213,7 @@ class FileList(QtWidgets.QListWidget):
dragLeaveEvent for dragging files and directories into the 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"):
+ if self.common.is_flatpak():
event.ignore()
return
@@ -227,7 +227,7 @@ class FileList(QtWidgets.QListWidget):
dragMoveEvent for dragging files and directories into the 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"):
+ if self.common.is_flatpak():
event.ignore()
return
@@ -242,7 +242,7 @@ class FileList(QtWidgets.QListWidget):
dropEvent for dragging files and directories into the 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"):
+ if self.common.is_flatpak():
event.ignore()
return
@@ -365,12 +365,7 @@ class FileSelection(QtWidgets.QVBoxLayout):
# Sandboxes (for masOS, Flatpak, etc.) need separate add files and folders buttons, in
# order to use native file selection dialogs
-
- # macOS
- if self.common.platform == "Darwin":
- self.sandbox = True
- # Flatpack
- elif self.common.platform == "Linux" and os.path.exists("/app/manifest.json"):
+ if self.common.platform == "Darwin" or self.common.is_flatpak():
self.sandbox = True
else:
self.sandbox = False