mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Make checking the persistent checkbox update the mode_settings dict, so closing tabs will catch that it's persistent
This commit is contained in:
parent
b017b3268c
commit
555ae9114f
@ -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()
|
||||
|
@ -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():
|
||||
|
Loading…
Reference in New Issue
Block a user