When a share is active, disable the full advanced options group, not just the stealth checkbox

This commit is contained in:
Micah Lee 2016-12-29 14:35:57 -08:00
parent cd63dc37f1
commit 0ab29ff8af
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
2 changed files with 13 additions and 12 deletions

View File

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

View File

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