[Pkg-privacy-commits] [onionshare] 41/256: When you uncheck the advanced options checkbox, also uncheck all advanced options

Ulrike Uhlig ulrike at moszumanska.debian.org
Fri May 26 12:53:08 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 0e44a2e1fc8c62ff8183eed9d147993f04c24959
Author: Micah Lee <micah at micahflee.com>
Date:   Wed Dec 28 14:43:47 2016 -0800

    When you uncheck the advanced options checkbox, also uncheck all advanced options
---
 onionshare_gui/options.py | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/onionshare_gui/options.py b/onionshare_gui/options.py
index 538f562..f1acff2 100644
--- a/onionshare_gui/options.py
+++ b/onionshare_gui/options.py
@@ -51,6 +51,7 @@ class Options(QtWidgets.QVBoxLayout):
         advanced_group.setCheckable(True)
         advanced_group.setChecked(False)
         advanced_group.setFlat(True)
+        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)
@@ -63,12 +64,21 @@ class Options(QtWidgets.QVBoxLayout):
         """
         When the 'close automatically' checkbox is toggled, let the web app know.
         """
-        if state > 0:
-            self.web.set_stay_open(False)
-            self.app.stay_open = False
-        else:
+        if state == 0:
             self.web.set_stay_open(True)
             self.app.stay_open = True
+        else:
+            self.web.set_stay_open(False)
+            self.app.stay_open = False
+
+    def advanced_options_changed(self, checked):
+        """
+        When the 'advanced options' checkbox is unchecked, uncheck all advanced
+        options, and let the onionshare app know.
+        """
+        if not checked:
+            self.stealth.setChecked(False)
+            self.app.set_stealth(False)
 
     def stealth_changed(self, state):
         """

-- 
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