mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-06 22:09:15 -04:00
When Tor is disconnected, hide the Check for Updates button in the Settings tab
This commit is contained in:
parent
73b570f4b4
commit
d88005d550
2 changed files with 25 additions and 14 deletions
|
@ -154,6 +154,11 @@ class SettingsTab(QtWidgets.QWidget):
|
||||||
|
|
||||||
self.reload_settings()
|
self.reload_settings()
|
||||||
|
|
||||||
|
if self.common.gui.onion.connected_to_tor:
|
||||||
|
self.tor_is_connected()
|
||||||
|
else:
|
||||||
|
self.tor_is_disconnected()
|
||||||
|
|
||||||
def reload_settings(self):
|
def reload_settings(self):
|
||||||
# Load settings, and fill them in
|
# Load settings, and fill them in
|
||||||
self.old_settings = Settings(self.common)
|
self.old_settings = Settings(self.common)
|
||||||
|
@ -341,3 +346,9 @@ class SettingsTab(QtWidgets.QWidget):
|
||||||
else:
|
else:
|
||||||
self.check_for_updates_button.setEnabled(True)
|
self.check_for_updates_button.setEnabled(True)
|
||||||
self.save_button.setEnabled(True)
|
self.save_button.setEnabled(True)
|
||||||
|
|
||||||
|
def tor_is_connected(self):
|
||||||
|
self.check_for_updates_button.show()
|
||||||
|
|
||||||
|
def tor_is_disconnected(self):
|
||||||
|
self.check_for_updates_button.hide()
|
||||||
|
|
|
@ -378,20 +378,20 @@ class TabWidget(QtWidgets.QTabWidget):
|
||||||
|
|
||||||
def tor_is_connected(self):
|
def tor_is_connected(self):
|
||||||
for tab_id in self.tabs:
|
for tab_id in self.tabs:
|
||||||
if not (
|
if type(self.tabs[tab_id]) is SettingsTab:
|
||||||
type(self.tabs[tab_id]) is SettingsTab
|
self.tabs[tab_id].tor_is_connected()
|
||||||
or type(self.tabs[tab_id]) is TorSettingsTab
|
else:
|
||||||
):
|
if not type(self.tabs[tab_id]) is TorSettingsTab:
|
||||||
mode = self.tabs[tab_id].get_mode()
|
mode = self.tabs[tab_id].get_mode()
|
||||||
if mode:
|
if mode:
|
||||||
mode.tor_connection_started()
|
mode.tor_connection_started()
|
||||||
|
|
||||||
def tor_is_disconnected(self):
|
def tor_is_disconnected(self):
|
||||||
for tab_id in self.tabs:
|
for tab_id in self.tabs:
|
||||||
if not (
|
if type(self.tabs[tab_id]) is SettingsTab:
|
||||||
type(self.tabs[tab_id]) is SettingsTab
|
self.tabs[tab_id].tor_is_disconnected()
|
||||||
or type(self.tabs[tab_id]) is TorSettingsTab
|
else:
|
||||||
):
|
if not type(self.tabs[tab_id]) is TorSettingsTab:
|
||||||
mode = self.tabs[tab_id].get_mode()
|
mode = self.tabs[tab_id].get_mode()
|
||||||
if mode:
|
if mode:
|
||||||
mode.tor_connection_stopped()
|
mode.tor_connection_stopped()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue