Merge pull request #1798 from onionshare/show-bridge-options-on-click-use-bridge

Fix reacting to 'Use a bridge' checkbox state change
This commit is contained in:
Saptak Sengupta 2023-10-25 13:55:02 +05:30 committed by GitHub
commit ea076e453b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,7 +97,7 @@ class TorSettingsTab(QtWidgets.QWidget):
self.bridge_use_checkbox = QtWidgets.QCheckBox( self.bridge_use_checkbox = QtWidgets.QCheckBox(
strings._("gui_settings_bridge_use_checkbox") strings._("gui_settings_bridge_use_checkbox")
) )
self.bridge_use_checkbox.stateChanged.connect( self.bridge_use_checkbox.clicked.connect(
self.bridge_use_checkbox_state_changed self.bridge_use_checkbox_state_changed
) )
@ -529,15 +529,17 @@ class TorSettingsTab(QtWidgets.QWidget):
self.connection_type_socks.hide() self.connection_type_socks.hide()
self.connection_type_bridges_radio_group.show() self.connection_type_bridges_radio_group.show()
def bridge_use_checkbox_state_changed(self, state): def bridge_use_checkbox_state_changed(self):
""" """
'Use a bridge' checkbox changed 'Use a bridge' checkbox changed
""" """
if state == QtCore.Qt.Checked: if self.bridge_use_checkbox.isChecked():
self.common.log("TorSettingsTab", "bridge_use_checkbox_state_changed", "Use bridge checkbox toggled on")
self.bridge_settings.show() self.bridge_settings.show()
self.bridge_builtin_radio.click() self.bridge_builtin_radio.click()
self.bridge_builtin_dropdown.setCurrentText("obfs4") self.bridge_builtin_dropdown.setCurrentText("obfs4")
else: else:
self.common.log("TorSettingsTab", "bridge_use_checkbox_state_changed", "Use bridge checkbox toggled off")
self.bridge_settings.hide() self.bridge_settings.hide()
def bridge_builtin_radio_toggled(self, checked): def bridge_builtin_radio_toggled(self, checked):