From 5edd4dd22c6c635beeff63156760cf2fab5b531b Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Fri, 3 Nov 2017 12:58:45 +1100 Subject: [PATCH] #468 If the server is stopped before a download is completed, emit the Canceled message in the progress bar --- onionshare_gui/onionshare_gui.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 8e84acac..022ca0b0 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -376,9 +376,6 @@ class OnionShareGui(QtWidgets.QMainWindow): if self.new_download: self.vbar.setValue(self.vbar.maximum()) self.new_download = False - # only check for requests if the server is running - if self.server_status.status != self.server_status.STATUS_STARTED: - return events = [] @@ -415,6 +412,9 @@ class OnionShareGui(QtWidgets.QMainWindow): # close on finish? if not web.get_stay_open(): self.server_status.stop_server() + else: + if self.server_status.status == self.server_status.STATUS_STOPPED: + self.downloads.cancel_download(event["data"]["id"]) elif event["type"] == web.REQUEST_CANCELED: self.downloads.cancel_download(event["data"]["id"])