[Pkg-privacy-commits] [onionshare] 57/256: When a share is active, disable the full advanced options group, not just the stealth checkbox

Ulrike Uhlig ulrike at moszumanska.debian.org
Fri May 26 12:53:13 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 0ab29ff8afa0a041396be85b296309969fb6d331
Author: Micah Lee <micah at micahflee.com>
Date:   Thu Dec 29 14:35:57 2016 -0800

    When a share is active, disable the full advanced options group, not just the stealth checkbox
---
 onionshare_gui/onionshare_gui.py |  4 ++--
 onionshare_gui/options.py        | 21 +++++++++++----------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py
index 439b221..ead6a60 100644
--- a/onionshare_gui/onionshare_gui.py
+++ b/onionshare_gui/onionshare_gui.py
@@ -161,7 +161,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
         self.app.choose_port()
 
         # disable the stealth option
-        self.options.set_stealth_enabled(False)
+        self.options.set_advanced_enabled(False)
 
         # start onionshare http service in new thread
         t = threading.Thread(target=web.start, args=(self.app.port, self.app.stay_open, self.app.transparent_torification))
@@ -250,7 +250,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
             web.stop(self.app.port)
         self.app.cleanup()
         self.filesize_warning.hide()
-        self.options.set_stealth_enabled(True)
+        self.options.set_advanced_enabled(True)
         self.stop_server_finished.emit()
 
     @staticmethod
diff --git a/onionshare_gui/options.py b/onionshare_gui/options.py
index f1acff2..7c284aa 100644
--- a/onionshare_gui/options.py
+++ b/onionshare_gui/options.py
@@ -47,18 +47,18 @@ class Options(QtWidgets.QVBoxLayout):
         self.stealth.stateChanged.connect(self.stealth_changed)
 
         # advanced options group
-        advanced_group = QtWidgets.QGroupBox(strings._("gui_advanced_options", True))
-        advanced_group.setCheckable(True)
-        advanced_group.setChecked(False)
-        advanced_group.setFlat(True)
-        advanced_group.toggled.connect(self.advanced_options_changed)
+        self.advanced_group = QtWidgets.QGroupBox(strings._("gui_advanced_options", True))
+        self.advanced_group.setCheckable(True)
+        self.advanced_group.setChecked(False)
+        self.advanced_group.setFlat(True)
+        self.advanced_group.toggled.connect(self.advanced_options_changed)
         advanced_group_layout = QtWidgets.QVBoxLayout()
         advanced_group_layout.addWidget(self.stealth)
-        advanced_group.setLayout(advanced_group_layout)
+        self.advanced_group.setLayout(advanced_group_layout)
 
         # add the widgets
         self.addWidget(self.close_automatically)
-        self.addWidget(advanced_group)
+        self.addWidget(self.advanced_group)
 
     def stay_open_changed(self, state):
         """
@@ -89,9 +89,10 @@ class Options(QtWidgets.QVBoxLayout):
         else:
             self.app.set_stealth(False)
 
-    def set_stealth_enabled(self, enabled):
+    def set_advanced_enabled(self, enabled):
         """
         You cannot toggle stealth after an onion service has started. This method
-        disables and re-enabled the stealth checkbox.
+        disables and re-enabled the advanced options group, including the stealth
+        checkbox.
         """
-        self.stealth.setEnabled(enabled)
+        self.advanced_group.setEnabled(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