mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Check current index tab for autoconnect
Currently, we were testing the first tab for autoconnect. However, in case of persistent tabs, that doesn't work. Since autoconnect is the last tab that gets added in that case. So we need to check the current active tab
This commit is contained in:
parent
4208d04ed2
commit
8c50b4ad67
@ -169,8 +169,19 @@ class TabWidget(QtWidgets.QTabWidget):
|
|||||||
self.open_connection_tab()
|
self.open_connection_tab()
|
||||||
|
|
||||||
def check_autoconnect_tab(self):
|
def check_autoconnect_tab(self):
|
||||||
if type(self.tabs[0]) is AutoConnectTab:
|
tab = self.widget(self.currentIndex())
|
||||||
self.tabs[0].check_autoconnect()
|
if not tab:
|
||||||
|
self.common.log(
|
||||||
|
"TabWidget",
|
||||||
|
"check_autoconnect",
|
||||||
|
f"tab at index {self.currentIndex()} does not exist",
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
tab_id = tab.tab_id
|
||||||
|
self.common.log("TabWidget", "check_autoconnect", f"Tab to check autoconnect: {tab_id}")
|
||||||
|
if type(self.tabs[tab_id]) is AutoConnectTab:
|
||||||
|
self.tabs[tab_id].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
|
||||||
|
Loading…
Reference in New Issue
Block a user