Move more logic from OnionShareGui into ShareMode, when reloading settings

This commit is contained in:
Micah Lee 2018-04-25 08:49:43 -07:00
parent dd7d97dbbb
commit f149530834
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
2 changed files with 10 additions and 5 deletions

View File

@ -314,11 +314,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
if self.onion.is_authenticated():
if not self.timer.isActive():
self.timer.start(500)
# 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()
self.share_mode.on_reload_settings()
self.status_bar.clearMessage()
# If we switched off the shutdown timeout setting, ensure the widget is hidden.

View File

@ -243,6 +243,15 @@ class ShareMode(QtWidgets.QWidget):
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))
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):
# Show or hide primary action layout
file_count = self.file_selection.file_list.count()