Merge branch '910_flatpak' into 1111_snap

This commit is contained in:
Micah Lee 2020-06-30 15:03:36 -07:00
commit 6aec241872
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
5 changed files with 15 additions and 4 deletions

View File

@ -37,6 +37,9 @@ class GuiCommon:
self.qtapp = qtapp
self.local_only = local_only
# Are we running in a flatpak package?
self.is_flatpak = os.path.exists("/.flatpak-info")
# Load settings
self.common.load_settings()

View File

@ -17,6 +17,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import os
from PyQt5 import QtCore, QtWidgets, QtGui
from onionshare import strings
@ -24,7 +25,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 +136,12 @@ 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"))
break
self.common.log(
"ReceiveMode",
"data_dir_button_clicked",

2
poetry.lock generated
View File

@ -440,7 +440,7 @@ docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"]
testing = ["jaraco.itertools", "func-timeout"]
[metadata]
content-hash = "974866ba15b5dd7ce72394ff778fab36b4fb47e4cd60eea175c847279211355f"
content-hash = "51f613f53d242cdb3aa8d028c2cba34debbfa3fed6f9f267a25159dc1e287667"
python-versions = "^3.6"
[metadata.files]

View File

@ -33,8 +33,8 @@ pytest-faulthandler = "*"
pytest-qt = "*"
six = "*"
urllib3 = "*"
setuptools = "*"
pyinstaller = {version = "*", platform = "darwin"}
setuptools = {version = "*", platform = "windows"}
[build-system]
requires = ["poetry>=0.12"]

View File

@ -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)"
}
}