From 7e982f222364610165286a991451a23e93ea2695 Mon Sep 17 00:00:00 2001 From: Saptak S Date: Thu, 9 Dec 2021 03:43:19 +0530 Subject: [PATCH] Opens connect tab if persistent tab is there --- desktop/src/onionshare/main_window.py | 3 +++ desktop/src/onionshare/tab_widget.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/desktop/src/onionshare/main_window.py b/desktop/src/onionshare/main_window.py index 80d9b5c1..4ad5c14c 100644 --- a/desktop/src/onionshare/main_window.py +++ b/desktop/src/onionshare/main_window.py @@ -147,6 +147,9 @@ class MainWindow(QtWidgets.QMainWindow): if len(self.common.settings.get("persistent_tabs")) > 0: for mode_settings_id in self.common.settings.get("persistent_tabs"): self.tabs.load_tab(mode_settings_id) + # If not connected to tor in beginning, show autoconnect tab + if not self.common.gui.onion.connected_to_tor: + self.tabs.new_tab_clicked() else: # Start with opening the first tab self.tabs.new_tab_clicked() diff --git a/desktop/src/onionshare/tab_widget.py b/desktop/src/onionshare/tab_widget.py index 972792fd..b5df855e 100644 --- a/desktop/src/onionshare/tab_widget.py +++ b/desktop/src/onionshare/tab_widget.py @@ -220,6 +220,8 @@ class TabWidget(QtWidgets.QTabWidget): connection_tab = AutoConnectTab(self.common, self.current_tab_id, self.status_bar, parent=self) connection_tab.close_this_tab.connect(self.close_connection_tab) + connection_tab.tor_is_connected.connect(self.tor_is_connected) + connection_tab.tor_is_disconnected.connect(self.tor_is_disconnected) self.tabs[self.current_tab_id] = connection_tab self.current_tab_id += 1 index = self.addTab(connection_tab, strings._("gui_autoconnect_start"))