mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-13 05:01:23 -05:00
Shows the Main window before starting to connect to Tor on autoconnect enabled
This commit is contained in:
parent
51e49c01f1
commit
97a604a4c8
@ -132,6 +132,11 @@ class AutoConnectTab(QtWidgets.QWidget):
|
|||||||
|
|
||||||
self.setLayout(self.layout)
|
self.setLayout(self.layout)
|
||||||
|
|
||||||
|
def check_autoconnect(self):
|
||||||
|
"""
|
||||||
|
After rendering, check if autoconnect was clicked, then start connecting
|
||||||
|
"""
|
||||||
|
self.common.log("AutoConnectTab", "autoconnect_checking")
|
||||||
if self.auto_connect_enabled:
|
if self.auto_connect_enabled:
|
||||||
self.enable_autoconnect_checkbox.setCheckState(QtCore.Qt.Checked)
|
self.enable_autoconnect_checkbox.setCheckState(QtCore.Qt.Checked)
|
||||||
self.connect_clicked()
|
self.connect_clicked()
|
||||||
|
@ -174,6 +174,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
|||||||
)
|
)
|
||||||
self.close_dialog.setDefaultButton(self.close_dialog.reject_button)
|
self.close_dialog.setDefaultButton(self.close_dialog.reject_button)
|
||||||
|
|
||||||
|
# Check for autoconnect
|
||||||
|
self.tabs.check_autoconnect_tab()
|
||||||
|
|
||||||
def tor_connection_canceled(self):
|
def tor_connection_canceled(self):
|
||||||
"""
|
"""
|
||||||
If the user cancels before Tor finishes connecting, ask if they want to
|
If the user cancels before Tor finishes connecting, ask if they want to
|
||||||
|
@ -169,6 +169,10 @@ class TabWidget(QtWidgets.QTabWidget):
|
|||||||
else:
|
else:
|
||||||
self.open_connection_tab()
|
self.open_connection_tab()
|
||||||
|
|
||||||
|
def check_autoconnect_tab(self):
|
||||||
|
if type(self.tabs[0]) is AutoConnectTab:
|
||||||
|
self.tabs[0].check_autoconnect()
|
||||||
|
|
||||||
def load_tab(self, mode_settings_id):
|
def load_tab(self, mode_settings_id):
|
||||||
# Load the tab's mode settings
|
# Load the tab's mode settings
|
||||||
mode_settings = ModeSettings(self.common, id=mode_settings_id)
|
mode_settings = ModeSettings(self.common, id=mode_settings_id)
|
||||||
|
@ -409,6 +409,10 @@ class TorSettingsTab(QtWidgets.QWidget):
|
|||||||
self.old_settings = Settings(self.common)
|
self.old_settings = Settings(self.common)
|
||||||
self.old_settings.load()
|
self.old_settings.load()
|
||||||
|
|
||||||
|
# Check if autoconnect was enabled
|
||||||
|
if self.old_settings.get("auto_connect"):
|
||||||
|
self.autoconnect_checkbox.setCheckState(QtCore.Qt.Checked)
|
||||||
|
|
||||||
connection_type = self.old_settings.get("connection_type")
|
connection_type = self.old_settings.get("connection_type")
|
||||||
if connection_type == "bundled":
|
if connection_type == "bundled":
|
||||||
if self.connection_type_bundled_radio.isEnabled():
|
if self.connection_type_bundled_radio.isEnabled():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user