diff --git a/onionshare_gui/tab/mode/receive_mode/__init__.py b/onionshare_gui/tab/mode/receive_mode/__init__.py index ba1fc8c4..c35a492c 100644 --- a/onionshare_gui/tab/mode/receive_mode/__init__.py +++ b/onionshare_gui/tab/mode/receive_mode/__init__.py @@ -24,7 +24,7 @@ from onionshare.web import Web from ..history import History, ToggleHistory, ReceiveHistoryItem from .. import Mode -from ....widgets import MinimumWidthWidget +from ....widgets import MinimumWidthWidget, Alert class ReceiveMode(Mode): @@ -135,6 +135,11 @@ class ReceiveMode(Mode): ) if selected_dir: + # If we're running inside a flatpak package, the data dir must be inside ~/OnionShare + if self.common.gui.is_flatpak: + if not selected_dir.startswith(os.path.expanduser("~/OnionShare")): + Alert(self.common, strings._("gui_receive_flatpak_data_dir")) + self.common.log( "ReceiveMode", "data_dir_button_clicked", diff --git a/share/locale/en.json b/share/locale/en.json index 5e19c42d..87cfd60f 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -22,6 +22,7 @@ "gui_receive_start_server": "Start Receive Mode", "gui_receive_stop_server": "Stop Receive Mode", "gui_receive_stop_server_autostop_timer": "Stop Receive Mode ({} remaining)", + "gui_receive_flatpak_data_dir": "Because you installed OnionShare using flatpak, you must save files to a folder in ~/OnionShare.", "gui_copy_url": "Copy Address", "gui_copy_hidservauth": "Copy HidServAuth", "gui_canceled": "Canceled", @@ -209,4 +210,4 @@ "mode_settings_receive_data_dir_label": "Save files to", "mode_settings_receive_data_dir_browse_button": "Browse", "mode_settings_website_disable_csp_checkbox": "Disable Content Security Policy header (allows your website to use third-party resources)" -} +} \ No newline at end of file