Remove sticky "Disconnected from Tor" message (patch thanks to @mig5)

This commit is contained in:
Micah Lee 2021-11-06 19:20:36 -07:00
parent de3c95cc50
commit 7da1ac187b
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
3 changed files with 7 additions and 5 deletions

View File

@ -232,7 +232,7 @@ class TabWidget(QtWidgets.QTabWidget):
return return
self.tor_settings_tab = TorSettingsTab( self.tor_settings_tab = TorSettingsTab(
self.common, self.current_tab_id, self.are_tabs_active() self.common, self.current_tab_id, self.are_tabs_active(), self.status_bar
) )
self.tor_settings_tab.close_this_tab.connect(self.close_tor_settings_tab) self.tor_settings_tab.close_this_tab.connect(self.close_tor_settings_tab)
self.tabs[self.current_tab_id] = self.tor_settings_tab self.tabs[self.current_tab_id] = self.tor_settings_tab

View File

@ -117,7 +117,6 @@ class TorConnectionDialog(QtWidgets.QProgressDialog):
def _connected_to_tor(self): def _connected_to_tor(self):
self.common.log("TorConnectionDialog", "_connected_to_tor") self.common.log("TorConnectionDialog", "_connected_to_tor")
self.active = False self.active = False
# Close the dialog after connecting # Close the dialog after connecting
self.setValue(self.maximum()) self.setValue(self.maximum())
@ -166,11 +165,12 @@ class TorConnectionWidget(QtWidgets.QWidget):
success = QtCore.Signal() success = QtCore.Signal()
fail = QtCore.Signal(str) fail = QtCore.Signal(str)
def __init__(self, common): def __init__(self, common, status_bar):
super(TorConnectionWidget, self).__init__(None) super(TorConnectionWidget, self).__init__(None)
self.common = common self.common = common
self.common.log("TorConnectionWidget", "__init__") self.common.log("TorConnectionWidget", "__init__")
self.status_bar = status_bar
self.label = QtWidgets.QLabel(strings._("connecting_to_tor")) self.label = QtWidgets.QLabel(strings._("connecting_to_tor"))
self.label.setAlignment(QtCore.Qt.AlignHCenter) self.label.setAlignment(QtCore.Qt.AlignHCenter)
@ -245,6 +245,7 @@ class TorConnectionWidget(QtWidgets.QWidget):
def _connected_to_tor(self): def _connected_to_tor(self):
self.common.log("TorConnectionWidget", "_connected_to_tor") self.common.log("TorConnectionWidget", "_connected_to_tor")
self.active = False self.active = False
self.status_bar.clearMessage()
# Close the dialog after connecting # Close the dialog after connecting
self.progress.setValue(self.progress.maximum()) self.progress.setValue(self.progress.maximum())

View File

@ -41,12 +41,13 @@ class TorSettingsTab(QtWidgets.QWidget):
close_this_tab = QtCore.Signal() close_this_tab = QtCore.Signal()
def __init__(self, common, tab_id, are_tabs_active): def __init__(self, common, tab_id, are_tabs_active, status_bar):
super(TorSettingsTab, self).__init__() super(TorSettingsTab, self).__init__()
self.common = common self.common = common
self.common.log("TorSettingsTab", "__init__") self.common.log("TorSettingsTab", "__init__")
self.status_bar = status_bar
self.meek = Meek(common, get_tor_paths=self.common.gui.get_tor_paths) self.meek = Meek(common, get_tor_paths=self.common.gui.get_tor_paths)
self.system = platform.system() self.system = platform.system()
@ -327,7 +328,7 @@ class TorSettingsTab(QtWidgets.QWidget):
columns_wrapper.setLayout(columns_layout) columns_wrapper.setLayout(columns_layout)
# Tor connection widget # Tor connection widget
self.tor_con = TorConnectionWidget(self.common) self.tor_con = TorConnectionWidget(self.common, self.status_bar)
self.tor_con.success.connect(self.tor_con_success) self.tor_con.success.connect(self.tor_con_success)
self.tor_con.fail.connect(self.tor_con_fail) self.tor_con.fail.connect(self.tor_con_fail)
self.tor_con.hide() self.tor_con.hide()