mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Merge pull request #1638 from mig5/start_timer_on_tor_connected
Ensure Tab timer starts once tor is connected
This commit is contained in:
commit
5d6f155066
@ -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):
|
||||
"""
|
||||
|
@ -149,11 +149,5 @@ class ChatMode(Mode):
|
||||
"""
|
||||
self.primary_action.hide()
|
||||
|
||||
def on_reload_settings(self):
|
||||
"""
|
||||
We should be ok to re-enable the 'Start Receive Mode' button now.
|
||||
"""
|
||||
self.primary_action.show()
|
||||
|
||||
def update_primary_action(self):
|
||||
self.common.log("ChatMode", "update_primary_action")
|
||||
|
@ -409,12 +409,6 @@ class ReceiveMode(Mode):
|
||||
self.history.in_progress_count -= 1
|
||||
self.history.update_in_progress()
|
||||
|
||||
def on_reload_settings(self):
|
||||
"""
|
||||
We should be ok to re-enable the 'Start Receive Mode' button now.
|
||||
"""
|
||||
self.primary_action.show()
|
||||
|
||||
def reset_info_counters(self):
|
||||
"""
|
||||
Set the info counters back to zero.
|
||||
|
@ -362,16 +362,6 @@ class ShareMode(Mode):
|
||||
strings._("systray_share_canceled_message"),
|
||||
)
|
||||
|
||||
def on_reload_settings(self):
|
||||
"""
|
||||
If there were some files listed for sharing, we should be ok to re-enable
|
||||
the 'Start Sharing' button now.
|
||||
"""
|
||||
if self.server_status.file_selection.get_num_files() > 0:
|
||||
self.primary_action.show()
|
||||
self.info_label.show()
|
||||
self.remove_all_button.show()
|
||||
|
||||
def update_primary_action(self):
|
||||
self.common.log("ShareMode", "update_primary_action")
|
||||
|
||||
|
@ -317,16 +317,6 @@ class WebsiteMode(Mode):
|
||||
"""
|
||||
self.primary_action.hide()
|
||||
|
||||
def on_reload_settings(self):
|
||||
"""
|
||||
If there were some files listed for sharing, we should be ok to re-enable
|
||||
the 'Start Sharing' button now.
|
||||
"""
|
||||
if self.server_status.file_selection.get_num_files() > 0:
|
||||
self.primary_action.show()
|
||||
self.info_label.show()
|
||||
self.remove_all_button.show()
|
||||
|
||||
def update_primary_action(self):
|
||||
self.common.log("WebsiteMode", "update_primary_action")
|
||||
|
||||
|
@ -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