Fix reacting to 'Use a bridge' checkbox state change

This commit is contained in:
Miguel Jacq 2023-10-24 10:58:44 +11:00
parent f880a931bb
commit 30ad1caee3
No known key found for this signature in database
GPG Key ID: 59B3F0C24135C6A9

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