[Pkg-privacy-commits] [onionshare] 34/256: Properly handle errors for using stealth onion services in the GUI, instead of crashing in the background (#144)
Ulrike Uhlig
ulrike at moszumanska.debian.org
Fri May 26 12:53:07 UTC 2017
This is an automated email from the git hooks/post-receive script.
ulrike pushed a commit to branch master
in repository onionshare.
commit 6eed7258a7957c44edafa422abdb70f6146f5576
Author: Micah Lee <micah at micahflee.com>
Date: Fri Dec 23 19:08:18 2016 -0800
Properly handle errors for using stealth onion services in the GUI, instead of crashing in the background (#144)
---
onionshare/onionshare.py | 5 +++++
onionshare_gui/onionshare_gui.py | 4 ++++
onionshare_gui/options.py | 4 ++--
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py
index 5798335..c87b781 100644
--- a/onionshare/onionshare.py
+++ b/onionshare/onionshare.py
@@ -50,7 +50,12 @@ class OnionShare(object):
self.transparent_torification = transparent_torification
# use stealth onion service
+ self.set_stealth(stealth)
+
+ def set_stealth(self, stealth):
self.stealth = stealth
+ if self.onion:
+ self.onion.stealth = stealth
def choose_port(self):
"""
diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py
index db32a95..f002903 100644
--- a/onionshare_gui/onionshare_gui.py
+++ b/onionshare_gui/onionshare_gui.py
@@ -176,6 +176,10 @@ class OnionShareGui(QtWidgets.QMainWindow):
self.starting_server_error.emit(e.args[0])
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.daemon = True
t.start()
diff --git a/onionshare_gui/options.py b/onionshare_gui/options.py
index 74645fc..0f4b626 100644
--- a/onionshare_gui/options.py
+++ b/onionshare_gui/options.py
@@ -66,9 +66,9 @@ class Options(QtWidgets.QVBoxLayout):
When the 'stealth' checkbox is toggled, let the onionshare app know.
"""
if state == 2:
- self.app.stealth = True
+ self.app.set_stealth(True)
else:
- self.app.stealth = False
+ self.app.set_stealth(False)
def set_stealth_enabled(self, enabled):
"""
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onionshare.git
More information about the Pkg-privacy-commits
mailing list