mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-27 03:32:59 -03:00
Send settings object to the AutoConnectFirstLaunchWidget so we can set the checkbox properly when returning from TorSettingsTab
This commit is contained in:
parent
1fd43b316b
commit
042fed2e55
1 changed files with 7 additions and 2 deletions
|
@ -77,7 +77,7 @@ class AutoConnectTab(QtWidgets.QWidget):
|
||||||
self.image.setLayout(image_layout)
|
self.image.setLayout(image_layout)
|
||||||
|
|
||||||
# First launch widget
|
# First launch widget
|
||||||
self.first_launch_widget = AutoConnectFirstLaunchWidget(self.common)
|
self.first_launch_widget = AutoConnectFirstLaunchWidget(self.common, self.curr_settings)
|
||||||
self.first_launch_widget.toggle_auto_connect.connect(self.toggle_auto_connect)
|
self.first_launch_widget.toggle_auto_connect.connect(self.toggle_auto_connect)
|
||||||
self.first_launch_widget.connect_clicked.connect(
|
self.first_launch_widget.connect_clicked.connect(
|
||||||
self.first_launch_widget_connect_clicked
|
self.first_launch_widget_connect_clicked
|
||||||
|
@ -285,17 +285,22 @@ class AutoConnectFirstLaunchWidget(QtWidgets.QWidget):
|
||||||
connect_clicked = QtCore.Signal()
|
connect_clicked = QtCore.Signal()
|
||||||
open_tor_settings = QtCore.Signal()
|
open_tor_settings = QtCore.Signal()
|
||||||
|
|
||||||
def __init__(self, common):
|
def __init__(self, common, settings):
|
||||||
super(AutoConnectFirstLaunchWidget, self).__init__()
|
super(AutoConnectFirstLaunchWidget, self).__init__()
|
||||||
self.common = common
|
self.common = common
|
||||||
self.common.log("AutoConnectFirstLaunchWidget", "__init__")
|
self.common.log("AutoConnectFirstLaunchWidget", "__init__")
|
||||||
|
|
||||||
|
self.settings = settings
|
||||||
|
|
||||||
# Description and checkbox
|
# Description and checkbox
|
||||||
description_label = QtWidgets.QLabel(strings._("gui_autoconnect_description"))
|
description_label = QtWidgets.QLabel(strings._("gui_autoconnect_description"))
|
||||||
description_label.setWordWrap(True)
|
description_label.setWordWrap(True)
|
||||||
self.enable_autoconnect_checkbox = ToggleCheckbox(
|
self.enable_autoconnect_checkbox = ToggleCheckbox(
|
||||||
strings._("gui_enable_autoconnect_checkbox")
|
strings._("gui_enable_autoconnect_checkbox")
|
||||||
)
|
)
|
||||||
|
self.enable_autoconnect_checkbox.setChecked(
|
||||||
|
self.settings.get("auto_connect")
|
||||||
|
)
|
||||||
self.enable_autoconnect_checkbox.clicked.connect(self._toggle_auto_connect)
|
self.enable_autoconnect_checkbox.clicked.connect(self._toggle_auto_connect)
|
||||||
self.enable_autoconnect_checkbox.setFixedWidth(400)
|
self.enable_autoconnect_checkbox.setFixedWidth(400)
|
||||||
self.enable_autoconnect_checkbox.setStyleSheet(
|
self.enable_autoconnect_checkbox.setStyleSheet(
|
||||||
|
|
Loading…
Add table
Reference in a new issue