Keep the upload running in the GUI if the timer has run out

This commit is contained in:
Miguel Jacq 2018-12-05 18:19:35 +11:00
parent 17aa34edd9
commit d15e00061a
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6

View File

@ -96,8 +96,16 @@ class ReceiveMode(Mode):
""" """
The shutdown timer expired, should we stop the server? Returns a bool The shutdown timer expired, should we stop the server? Returns a bool
""" """
# TODO: wait until the final upload is done before stoppign the server? # If there were no attempts to upload files, or all uploads are done, we can stop
return True if self.web.receive_mode.upload_count == 0 or not self.web.receive_mode.uploads_in_progress:
self.server_status.stop_server()
self.server_status_label.setText(strings._('close_on_timeout'))
return True
# An upload is probably still running - hold off on stopping the share, but block new shares.
else:
self.server_status_label.setText(strings._('timeout_upload_still_running'))
self.web.receive_mode.can_upload = False
return False
def start_server_custom(self): def start_server_custom(self):
""" """