Make checking the persistent checkbox update the mode_settings dict, so closing tabs will catch that it's persistent

This commit is contained in:
Micah Lee 2019-10-27 18:48:25 -07:00
parent b017b3268c
commit 555ae9114f
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
2 changed files with 10 additions and 4 deletions

View File

@ -72,7 +72,7 @@ class Mode(QtWidgets.QWidget):
self.header_label.setStyleSheet(self.common.gui.css["mode_header_label"])
self.header_label.setAlignment(QtCore.Qt.AlignHCenter)
self.mode_settings = ModeSettings(self.common, self.tab.tab_id)
self.mode_settings = ModeSettings(self.common, self.tab)
self.mode_settings.change_persistent.connect(self.change_persistent)
header_layout = QtWidgets.QVBoxLayout()

View File

@ -29,10 +29,10 @@ class ModeSettings(QtWidgets.QWidget):
change_persistent = QtCore.pyqtSignal(int, bool)
def __init__(self, common, tab_id):
def __init__(self, common, tab):
super(ModeSettings, self).__init__()
self.common = common
self.tab_id = tab_id
self.tab = tab
# Downstream Mode need to fill in this layout with its settings
self.mode_specific_layout = QtWidgets.QVBoxLayout()
@ -128,7 +128,13 @@ class ModeSettings(QtWidgets.QWidget):
self.client_auth_checkbox.hide()
def persistent_checkbox_clicked(self):
self.change_persistent.emit(self.tab_id, self.persistent_checkbox.isChecked())
self.tab.tab_settings["persistent"][
"enabled"
] = self.persistent_checkbox.isChecked()
self.change_persistent.emit(
self.tab.tab_id, self.persistent_checkbox.isChecked()
)
def toggle_advanced_clicked(self):
if self.advanced_widget.isVisible():