mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Move more logic from OnionShareGui into ShareMode, when reloading settings
This commit is contained in:
parent
dd7d97dbbb
commit
f149530834
@ -314,11 +314,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
|||||||
if self.onion.is_authenticated():
|
if self.onion.is_authenticated():
|
||||||
if not self.timer.isActive():
|
if not self.timer.isActive():
|
||||||
self.timer.start(500)
|
self.timer.start(500)
|
||||||
# If there were some files listed for sharing, we should be ok to
|
self.share_mode.on_reload_settings()
|
||||||
# re-enable the 'Start Sharing' button now.
|
|
||||||
if self.server_status.file_selection.get_num_files() > 0:
|
|
||||||
self.primary_action.show()
|
|
||||||
self.info_widget.show()
|
|
||||||
self.status_bar.clearMessage()
|
self.status_bar.clearMessage()
|
||||||
|
|
||||||
# If we switched off the shutdown timeout setting, ensure the widget is hidden.
|
# If we switched off the shutdown timeout setting, ensure the widget is hidden.
|
||||||
|
@ -243,6 +243,15 @@ class ShareMode(QtWidgets.QWidget):
|
|||||||
self.update_downloads_in_progress(self.downloads_in_progress)
|
self.update_downloads_in_progress(self.downloads_in_progress)
|
||||||
self.system_tray.showMessage(strings._('systray_download_canceled_title', True), strings._('systray_download_canceled_message', True))
|
self.system_tray.showMessage(strings._('systray_download_canceled_title', True), strings._('systray_download_canceled_message', True))
|
||||||
|
|
||||||
|
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_widget.show()
|
||||||
|
|
||||||
def update_primary_action(self):
|
def update_primary_action(self):
|
||||||
# Show or hide primary action layout
|
# Show or hide primary action layout
|
||||||
file_count = self.file_selection.file_list.count()
|
file_count = self.file_selection.file_list.count()
|
||||||
|
Loading…
Reference in New Issue
Block a user