mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-24 23:09:42 -05:00
Ensure Tab timer starts once tor is connected
This commit is contained in:
parent
a7eff6c999
commit
a96991713b
@ -244,17 +244,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
break
|
||||
self.tabs.open_settings_tab(from_autoconnect, active_tab=active_tab)
|
||||
|
||||
def settings_have_changed(self):
|
||||
self.common.log("OnionShareGui", "settings_have_changed")
|
||||
|
||||
if self.common.gui.onion.is_authenticated():
|
||||
self.status_bar.clearMessage()
|
||||
|
||||
# Tell each tab that settings have changed
|
||||
for index in range(self.tabs.count()):
|
||||
tab = self.tabs.widget(index)
|
||||
tab.settings_have_changed()
|
||||
|
||||
def bring_to_front(self):
|
||||
self.common.log("MainWindow", "bring_to_front")
|
||||
self.raise_()
|
||||
|
@ -315,10 +315,6 @@ class SettingsTab(QtWidgets.QWidget):
|
||||
|
||||
return settings
|
||||
|
||||
def settings_have_changed(self):
|
||||
# Global settings have changed
|
||||
self.common.log("SettingsTab", "settings_have_changed")
|
||||
|
||||
def _update_autoupdate_timestamp(self, autoupdate_timestamp):
|
||||
self.common.log("SettingsTab", "_update_autoupdate_timestamp")
|
||||
|
||||
|
@ -564,6 +564,8 @@ class Mode(QtWidgets.QWidget):
|
||||
self.content_widget.show()
|
||||
self.tor_not_connected_widget.hide()
|
||||
self.primary_action.show()
|
||||
if not self.tab.timer.isActive():
|
||||
self.tab.timer.start(500)
|
||||
|
||||
def tor_connection_stopped(self):
|
||||
"""
|
||||
|
@ -630,20 +630,6 @@ class Tab(QtWidgets.QWidget):
|
||||
else:
|
||||
return None
|
||||
|
||||
def settings_have_changed(self):
|
||||
# Global settings have changed
|
||||
self.common.log("Tab", "settings_have_changed")
|
||||
|
||||
# We might've stopped the main requests timer if a Tor connection failed. If we've reloaded
|
||||
# settings, we probably succeeded in obtaining a new connection. If so, restart the timer.
|
||||
if not self.common.gui.local_only:
|
||||
if self.common.gui.onion.is_authenticated():
|
||||
mode = self.get_mode()
|
||||
if mode:
|
||||
if not self.timer.isActive():
|
||||
self.timer.start(500)
|
||||
mode.on_reload_settings()
|
||||
|
||||
def close_tab(self):
|
||||
self.common.log("Tab", "close_tab")
|
||||
if self.mode is None:
|
||||
|
@ -903,7 +903,3 @@ class TorSettingsTab(QtWidgets.QWidget):
|
||||
|
||||
# Wait 1ms for the event loop to finish, then quit
|
||||
QtCore.QTimer.singleShot(1, self.common.gui.qtapp.quit)
|
||||
|
||||
def settings_have_changed(self):
|
||||
# Global settings have changed
|
||||
self.common.log("TorSettingsTab", "settings_have_changed")
|
||||
|
Loading…
Reference in New Issue
Block a user