mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-23 05:01:24 -05:00
Adds autoconnect settings in tor settings tab
This commit is contained in:
parent
bbdfea218e
commit
51e49c01f1
@ -303,6 +303,24 @@ class TorSettingsTab(QtWidgets.QWidget):
|
||||
)
|
||||
connection_type_radio_group.setLayout(connection_type_radio_group_layout)
|
||||
|
||||
# Quickstart settings
|
||||
self.autoconnect_checkbox = QtWidgets.QCheckBox(
|
||||
strings._("gui_enable_autoconnect_checkbox")
|
||||
)
|
||||
self.autoconnect_checkbox.toggled.connect(
|
||||
self.autoconnect_toggled
|
||||
)
|
||||
left_column_settings = QtWidgets.QVBoxLayout()
|
||||
connection_type_radio_group.setFixedHeight(300)
|
||||
left_column_settings.addWidget(connection_type_radio_group)
|
||||
left_column_settings.addSpacing(20)
|
||||
left_column_settings.addWidget(self.autoconnect_checkbox)
|
||||
left_column_settings.addStretch()
|
||||
left_column_settings.setContentsMargins(0, 0, 0, 0)
|
||||
left_column_setting_widget = QtWidgets.QWidget()
|
||||
left_column_setting_widget.setLayout(left_column_settings)
|
||||
|
||||
|
||||
# The Bridges options are not exclusive (enabling Bridges offers obfs4 or custom bridges)
|
||||
connection_type_bridges_radio_group_layout = QtWidgets.QVBoxLayout()
|
||||
connection_type_bridges_radio_group_layout.addWidget(self.bridges)
|
||||
@ -322,7 +340,7 @@ class TorSettingsTab(QtWidgets.QWidget):
|
||||
|
||||
# Settings are in columns
|
||||
columns_layout = QtWidgets.QHBoxLayout()
|
||||
columns_layout.addWidget(connection_type_radio_group)
|
||||
columns_layout.addWidget(left_column_setting_widget)
|
||||
columns_layout.addSpacing(20)
|
||||
columns_layout.addLayout(connection_type_layout, stretch=1)
|
||||
columns_wrapper = QtWidgets.QWidget()
|
||||
@ -477,6 +495,12 @@ class TorSettingsTab(QtWidgets.QWidget):
|
||||
self.bridge_use_checkbox.setCheckState(QtCore.Qt.Unchecked)
|
||||
self.bridge_settings.hide()
|
||||
|
||||
def autoconnect_toggled(self):
|
||||
"""
|
||||
Auto connect checkbox clicked
|
||||
"""
|
||||
self.common.log("TorSettingsTab", "autoconnect_checkbox_clicked")
|
||||
|
||||
def active_tabs_changed(self, are_tabs_active):
|
||||
if are_tabs_active:
|
||||
self.main_widget.hide()
|
||||
@ -777,6 +801,9 @@ class TorSettingsTab(QtWidgets.QWidget):
|
||||
settings = Settings(self.common)
|
||||
settings.load() # To get the last update timestamp
|
||||
|
||||
# autoconnect
|
||||
settings.set("auto_connect", self.autoconnect_checkbox.isChecked())
|
||||
|
||||
# Tor connection
|
||||
if self.connection_type_bundled_radio.isChecked():
|
||||
settings.set("connection_type", "bundled")
|
||||
|
Loading…
Reference in New Issue
Block a user