mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-10 11:47:27 -03:00
Clean up some inefficient code, and re-word the 'too old for stealth' dialog message
This commit is contained in:
parent
41ddeb08b9
commit
06344f23ad
2 changed files with 6 additions and 11 deletions
|
@ -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='{}' />",
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue