mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-11 15:29:38 -05:00
Remove sticky "Disconnected from Tor" message (patch thanks to @mig5)
This commit is contained in:
parent
de3c95cc50
commit
7da1ac187b
@ -232,7 +232,7 @@ class TabWidget(QtWidgets.QTabWidget):
|
||||
return
|
||||
|
||||
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.tabs[self.current_tab_id] = self.tor_settings_tab
|
||||
|
@ -117,7 +117,6 @@ class TorConnectionDialog(QtWidgets.QProgressDialog):
|
||||
def _connected_to_tor(self):
|
||||
self.common.log("TorConnectionDialog", "_connected_to_tor")
|
||||
self.active = False
|
||||
|
||||
# Close the dialog after connecting
|
||||
self.setValue(self.maximum())
|
||||
|
||||
@ -166,11 +165,12 @@ class TorConnectionWidget(QtWidgets.QWidget):
|
||||
success = QtCore.Signal()
|
||||
fail = QtCore.Signal(str)
|
||||
|
||||
def __init__(self, common):
|
||||
def __init__(self, common, status_bar):
|
||||
super(TorConnectionWidget, self).__init__(None)
|
||||
self.common = common
|
||||
self.common.log("TorConnectionWidget", "__init__")
|
||||
|
||||
self.status_bar = status_bar
|
||||
self.label = QtWidgets.QLabel(strings._("connecting_to_tor"))
|
||||
self.label.setAlignment(QtCore.Qt.AlignHCenter)
|
||||
|
||||
@ -245,6 +245,7 @@ class TorConnectionWidget(QtWidgets.QWidget):
|
||||
def _connected_to_tor(self):
|
||||
self.common.log("TorConnectionWidget", "_connected_to_tor")
|
||||
self.active = False
|
||||
self.status_bar.clearMessage()
|
||||
|
||||
# Close the dialog after connecting
|
||||
self.progress.setValue(self.progress.maximum())
|
||||
|
@ -41,12 +41,13 @@ class TorSettingsTab(QtWidgets.QWidget):
|
||||
|
||||
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__()
|
||||
|
||||
self.common = common
|
||||
self.common.log("TorSettingsTab", "__init__")
|
||||
|
||||
self.status_bar = status_bar
|
||||
self.meek = Meek(common, get_tor_paths=self.common.gui.get_tor_paths)
|
||||
|
||||
self.system = platform.system()
|
||||
@ -327,7 +328,7 @@ class TorSettingsTab(QtWidgets.QWidget):
|
||||
columns_wrapper.setLayout(columns_layout)
|
||||
|
||||
# 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.fail.connect(self.tor_con_fail)
|
||||
self.tor_con.hide()
|
||||
|
Loading…
Reference in New Issue
Block a user