Reload settings in connection tab when tor settings tab closed

This commit is contained in:
Saptak S 2021-12-09 14:38:11 +05:30
parent df85ea0f60
commit 24152e8b4d
No known key found for this signature in database
GPG Key ID: 7B7F1772C0C6FCBF
2 changed files with 9 additions and 1 deletions

View File

@ -138,7 +138,7 @@ class AutoConnectTab(QtWidgets.QWidget):
"""
self.common.log("AutoConnectTab", "autoconnect_checking")
if self.auto_connect_enabled:
self.enable_autoconnect_checkbox.setCheckState(QtCore.Qt.Checked)
self.enable_autoconnect_checkbox.setChecked(True)
self.connect_clicked()
def toggle_auto_connect(self):
@ -191,3 +191,8 @@ class AutoConnectTab(QtWidgets.QWidget):
self.connect_button.show()
self.configure_button.show()
self.error_label.setText(msg)
def reload_settings(self):
self.curr_settings.load()
self.auto_connect_enabled = self.curr_settings.get("auto_connect")
self.enable_autoconnect_checkbox.setChecked(self.auto_connect_enabled)

View File

@ -382,6 +382,9 @@ class TabWidget(QtWidgets.QTabWidget):
def close_tor_settings_tab(self):
self.common.log("TabWidget", "close_tor_settings_tab")
for tab_id in self.tabs:
if type(self.tabs[tab_id]) is AutoConnectTab:
self.tabs[tab_id].reload_settings()
for tab_id in self.tabs:
if type(self.tabs[tab_id]) is TorSettingsTab:
index = self.indexOf(self.tabs[tab_id])