From fe311f591fc9ded696eed57bc41ef87791c45872 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Mon, 4 Dec 2017 18:43:40 +1100 Subject: [PATCH 1/2] #447 show alert and exit if the Settings dialog is canceled yet Tor is still not connected --- onionshare_gui/settings_dialog.py | 6 +++++- share/locale/en.json | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index fed4d1ab..df806a06 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -505,7 +505,11 @@ class SettingsDialog(QtWidgets.QDialog): Cancel button clicked. """ common.log('SettingsDialog', 'cancel_clicked') - self.close() + if not self.onion.connected_to_tor: + Alert(strings._('gui_tor_connection_canceled', True), QtWidgets.QMessageBox.Warning) + sys.exit() + else: + self.close() def help_clicked(self): """ diff --git a/share/locale/en.json b/share/locale/en.json index fedd1af4..0a985d82 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -112,5 +112,6 @@ "gui_tor_connection_ask_open_settings": "Open Settings", "gui_tor_connection_ask_quit": "Quit", "gui_tor_connection_error_settings": "Try adjusting how OnionShare connects to the Tor network in Settings.", + "gui_tor_connection_canceled": "OnionShare is disconnected from Tor.\n\nPlease re-open OnionShare and configure the Tor connection.", "share_via_onionshare": "Share via OnionShare" } From ba1f535dcbbb6c18367584b1d471568d6eea47b1 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Tue, 5 Dec 2017 11:27:16 +1100 Subject: [PATCH 2/2] Better wording when OnionShare can't connect to Tor and the attempt to configure settings is canceled --- share/locale/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/locale/en.json b/share/locale/en.json index 0a985d82..196436da 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -112,6 +112,6 @@ "gui_tor_connection_ask_open_settings": "Open Settings", "gui_tor_connection_ask_quit": "Quit", "gui_tor_connection_error_settings": "Try adjusting how OnionShare connects to the Tor network in Settings.", - "gui_tor_connection_canceled": "OnionShare is disconnected from Tor.\n\nPlease re-open OnionShare and configure the Tor connection.", + "gui_tor_connection_canceled": "OnionShare cannot connect to Tor.\n\nMake sure you're connected to the internet, then re-open OnionShare to configure the Tor connection.", "share_via_onionshare": "Share via OnionShare" }