Merge pull request #752 from mig5/receiver-mode-gui-hold-timeout-share-open-til-upload-finished

Hold a share open if its timer has expired but a file is still uploading.
This commit is contained in:
Micah Lee 2018-12-05 09:13:54 -08:00 committed by GitHub
commit 73fdc0ffc4
13 changed files with 98 additions and 111 deletions

View file

@ -96,8 +96,16 @@ class ReceiveMode(Mode):
"""
The shutdown timer expired, should we stop the server? Returns a bool
"""
# TODO: wait until the final upload is done before stoppign the server?
return True
# If there were no attempts to upload files, or all uploads are done, we can stop
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):
"""