diff options
author | Miguel Jacq <mig@mig5.net> | 2021-08-27 17:59:52 +1000 |
---|---|---|
committer | Miguel Jacq <mig@mig5.net> | 2021-08-27 17:59:52 +1000 |
commit | 06344f23ad7561bf0fc568d1b77d10578ade64b6 (patch) | |
tree | 24e594ac848573797de505eefe0327d3b2b3d0d9 /desktop | |
parent | 41ddeb08b943cfa3bb80132f11e2a459f68ce2f9 (diff) | |
download | onionshare-06344f23ad7561bf0fc568d1b77d10578ade64b6.tar.gz onionshare-06344f23ad7561bf0fc568d1b77d10578ade64b6.zip |
Clean up some inefficient code, and re-word the 'too old for stealth' dialog message
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/src/onionshare/resources/locale/en.json | 2 | ||||
-rw-r--r-- | desktop/src/onionshare/tab/mode/__init__.py | 15 |
2 files changed, 6 insertions, 11 deletions
diff --git a/desktop/src/onionshare/resources/locale/en.json b/desktop/src/onionshare/resources/locale/en.json index 0d2bdd66..1e71bced 100644 --- a/desktop/src/onionshare/resources/locale/en.json +++ b/desktop/src/onionshare/resources/locale/en.json @@ -87,7 +87,7 @@ "gui_server_autostop_timer_expired": "The auto-stop timer already ran out. Please adjust it to start sharing.", "gui_server_autostart_timer_expired": "The scheduled time has already passed. Please adjust it to start sharing.", "gui_autostop_timer_cant_be_earlier_than_autostart_timer": "The auto-stop time can't be the same or earlier than the auto-start time. Please adjust it to start sharing.", - "gui_server_doesnt_support_stealth": "Sorry, this version of Tor doesn't support stealth (Client Authorization). Please try with a newer version of Tor.", + "gui_server_doesnt_support_stealth": "Sorry, this version of Tor doesn't support stealth (Client Authentication). Please try with a newer version of Tor, or use 'public' mode if it doesn't need to be private.", "share_via_onionshare": "Share via OnionShare", "gui_share_url_description": "<b>Anyone</b> with this OnionShare address and private key can <b>download</b> your files using the <b>Tor Browser</b>: <img src='{}' />", "gui_share_url_public_description": "<b>Anyone</b> with this OnionShare address can <b>download</b> your files using the <b>Tor Browser</b>: <img src='{}' />", diff --git a/desktop/src/onionshare/tab/mode/__init__.py b/desktop/src/onionshare/tab/mode/__init__.py index ed9191b0..c0c80368 100644 --- a/desktop/src/onionshare/tab/mode/__init__.py +++ b/desktop/src/onionshare/tab/mode/__init__.py @@ -248,15 +248,16 @@ class Mode(QtWidgets.QWidget): def start_onion_thread(self, obtain_onion_early=False): # If we tried to start with Client Auth and our Tor is too old to support it, # bail out early - can_start = True if ( not self.server_status.local_only and not self.app.onion.supports_stealth and not self.settings.get("general", "public") ): - can_start = False - - if can_start: + self.stop_server() + self.start_server_error( + strings._("gui_server_doesnt_support_stealth") + ) + else: self.common.log("Mode", "start_server", "Starting an onion thread") self.obtain_onion_early = obtain_onion_early self.onion_thread = OnionThread(self) @@ -265,12 +266,6 @@ class Mode(QtWidgets.QWidget): self.onion_thread.error.connect(self.starting_server_error.emit) self.onion_thread.start() - else: - self.stop_server() - self.start_server_error( - strings._("gui_server_doesnt_support_stealth") - ) - def start_scheduled_service(self, obtain_onion_early=False): # We start a new OnionThread with the saved scheduled key from settings self.common.settings.load() |