diff options
author | Miguel Jacq <mig@mig5.net> | 2018-12-05 18:19:35 +1100 |
---|---|---|
committer | Miguel Jacq <mig@mig5.net> | 2018-12-05 18:19:35 +1100 |
commit | d15e00061a4488aa3ac513671a99ce1213f90a51 (patch) | |
tree | c720d0713c919f9088998d222e368bfa1f71927f | |
parent | 17aa34edd912dd7dae95fc3d65d86c6cfb54fa83 (diff) | |
download | onionshare-d15e00061a4488aa3ac513671a99ce1213f90a51.tar.gz onionshare-d15e00061a4488aa3ac513671a99ce1213f90a51.zip |
Keep the upload running in the GUI if the timer has run out
-rw-r--r-- | onionshare_gui/mode/receive_mode/__init__.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/onionshare_gui/mode/receive_mode/__init__.py b/onionshare_gui/mode/receive_mode/__init__.py index d6c0c351..c53f1ea1 100644 --- a/onionshare_gui/mode/receive_mode/__init__.py +++ b/onionshare_gui/mode/receive_mode/__init__.py @@ -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): """ |