mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-16 01:37:25 -05:00
Properly handle errors for using stealth onion services in the GUI, instead of crashing in the background (#144)
This commit is contained in:
parent
286573bda5
commit
6eed7258a7
@ -50,7 +50,12 @@ class OnionShare(object):
|
|||||||
self.transparent_torification = transparent_torification
|
self.transparent_torification = transparent_torification
|
||||||
|
|
||||||
# use stealth onion service
|
# use stealth onion service
|
||||||
|
self.set_stealth(stealth)
|
||||||
|
|
||||||
|
def set_stealth(self, stealth):
|
||||||
self.stealth = stealth
|
self.stealth = stealth
|
||||||
|
if self.onion:
|
||||||
|
self.onion.stealth = stealth
|
||||||
|
|
||||||
def choose_port(self):
|
def choose_port(self):
|
||||||
"""
|
"""
|
||||||
|
@ -176,6 +176,10 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
|||||||
self.starting_server_error.emit(e.args[0])
|
self.starting_server_error.emit(e.args[0])
|
||||||
return
|
return
|
||||||
|
|
||||||
|
except onionshare.onion.TorTooOld as e:
|
||||||
|
self.starting_server_error.emit(e.args[0])
|
||||||
|
return
|
||||||
|
|
||||||
t = threading.Thread(target=start_onion_service, kwargs={'self': self})
|
t = threading.Thread(target=start_onion_service, kwargs={'self': self})
|
||||||
t.daemon = True
|
t.daemon = True
|
||||||
t.start()
|
t.start()
|
||||||
|
@ -66,9 +66,9 @@ class Options(QtWidgets.QVBoxLayout):
|
|||||||
When the 'stealth' checkbox is toggled, let the onionshare app know.
|
When the 'stealth' checkbox is toggled, let the onionshare app know.
|
||||||
"""
|
"""
|
||||||
if state == 2:
|
if state == 2:
|
||||||
self.app.stealth = True
|
self.app.set_stealth(True)
|
||||||
else:
|
else:
|
||||||
self.app.stealth = False
|
self.app.set_stealth(False)
|
||||||
|
|
||||||
def set_stealth_enabled(self, enabled):
|
def set_stealth_enabled(self, enabled):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user