Opens TorSettingsTab when clicked on network settings

This commit is contained in:
Saptak S 2021-11-30 03:23:16 +05:30
parent 1cde115f6e
commit e2dbe6089a
No known key found for this signature in database
GPG key ID: 7B7F1772C0C6FCBF
2 changed files with 6 additions and 2 deletions

View file

@ -36,13 +36,14 @@ class AutoConnectTab(QtWidgets.QWidget):
close_this_tab = QtCore.Signal() close_this_tab = QtCore.Signal()
tor_is_connected = QtCore.Signal() tor_is_connected = QtCore.Signal()
tor_is_disconnected = QtCore.Signal() tor_is_disconnected = QtCore.Signal()
def __init__(self, common, tab_id, status_bar): def __init__(self, common, tab_id, status_bar, parent=None):
super(AutoConnectTab, self).__init__() super(AutoConnectTab, self).__init__()
self.common = common self.common = common
self.common.log("AutoConnectTab", "__init__") self.common.log("AutoConnectTab", "__init__")
self.status_bar = status_bar self.status_bar = status_bar
self.tab_id = tab_id self.tab_id = tab_id
self.parent = parent
# Was auto connected? # Was auto connected?
self.curr_settings = Settings(common) self.curr_settings = Settings(common)
@ -145,6 +146,9 @@ class AutoConnectTab(QtWidgets.QWidget):
) )
self.curr_settings.save() self.curr_settings.save()
def open_tor_settings(self):
self.parent.open_tor_settings_tab()
def connect_clicked(self): def connect_clicked(self):
""" """
Connect button clicked. Try to connect to tor. Connect button clicked. Try to connect to tor.

View file

@ -214,7 +214,7 @@ class TabWidget(QtWidgets.QTabWidget):
self.setCurrentIndex(self.indexOf(self.tabs[tab_id])) self.setCurrentIndex(self.indexOf(self.tabs[tab_id]))
return return
connection_tab = AutoConnectTab(self.common, self.current_tab_id, self.status_bar) 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.close_this_tab.connect(self.close_connection_tab)
self.tabs[self.current_tab_id] = connection_tab self.tabs[self.current_tab_id] = connection_tab
self.current_tab_id += 1 self.current_tab_id += 1