Respect --local-only

This commit is contained in:
Micah Lee 2021-11-06 20:17:02 -07:00
parent 7b162b4bc7
commit 7448f76f2e
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -128,7 +128,10 @@ class Mode(QtWidgets.QWidget):
self.wrapper_layout.addWidget(self.tor_not_connected_widget) self.wrapper_layout.addWidget(self.tor_not_connected_widget)
self.setLayout(self.wrapper_layout) self.setLayout(self.wrapper_layout)
self.tor_connection_init() if self.common.gui.onion.is_authenticated():
self.tor_connection_started()
else:
self.tor_connection_stopped()
def init(self): def init(self):
""" """
@ -554,15 +557,6 @@ class Mode(QtWidgets.QWidget):
""" """
self.history.cancel(event["data"]["id"]) self.history.cancel(event["data"]["id"])
def tor_connection_init(self):
"""
Figure out if Tor is connected and display the right widget
"""
if self.common.gui.onion.is_authenticated():
self.tor_connection_started()
else:
self.tor_connection_stopped()
def tor_connection_started(self): def tor_connection_started(self):
""" """
This is called on every Mode when Tor is connected This is called on every Mode when Tor is connected
@ -574,5 +568,9 @@ class Mode(QtWidgets.QWidget):
""" """
This is called on every Mode when Tor is disconnected This is called on every Mode when Tor is disconnected
""" """
if self.common.gui.local_only:
self.tor_connection_started()
return
self.content_widget.hide() self.content_widget.hide()
self.tor_not_connected_widget.show() self.tor_not_connected_widget.show()