From 18573ba49cd22a2b399fc2abe8fc7af2cdbaf116 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sun, 20 May 2018 12:07:15 -0700 Subject: [PATCH] Remove REQUEST_UPLOAD_NEW_FILE_STARTED event, because it's not actually needed --- onionshare/web.py | 16 ++++------------ onionshare_gui/mode.py | 6 ------ onionshare_gui/onionshare_gui.py | 3 --- onionshare_gui/receive_mode/__init__.py | 6 ------ 4 files changed, 4 insertions(+), 27 deletions(-) diff --git a/onionshare/web.py b/onionshare/web.py index bf65ade6..70de16e7 100644 --- a/onionshare/web.py +++ b/onionshare/web.py @@ -52,11 +52,10 @@ class Web(object): REQUEST_CANCELED = 4 REQUEST_RATE_LIMIT = 5 REQUEST_CLOSE_SERVER = 6 - REQUEST_UPLOAD_NEW_FILE_STARTED = 7 - REQUEST_UPLOAD_FILE_RENAMED = 8 - REQUEST_UPLOAD_FINISHED = 9 - REQUEST_ERROR_DOWNLOADS_DIR_CANNOT_CREATE = 10 - REQUEST_ERROR_DOWNLOADS_DIR_NOT_WRITABLE = 11 + REQUEST_UPLOAD_FILE_RENAMED = 7 + REQUEST_UPLOAD_FINISHED = 8 + REQUEST_ERROR_DOWNLOADS_DIR_CANNOT_CREATE = 9 + REQUEST_ERROR_DOWNLOADS_DIR_NOT_WRITABLE = 10 def __init__(self, common, gui_mode, receive_mode=False): self.common = common @@ -740,13 +739,6 @@ class ReceiveModeRequest(Request): writable stream. """ if self.upload_request: - # Tell the GUI about the new file upload - self.web.add_request(Web.REQUEST_UPLOAD_NEW_FILE_STARTED, self.path, { - 'id': self.upload_id, - 'filename': filename, - 'total_bytes': total_content_length - }) - self.progress[filename] = { 'uploaded_bytes': 0, 'complete': False diff --git a/onionshare_gui/mode.py b/onionshare_gui/mode.py index c81d9895..d2579d2c 100644 --- a/onionshare_gui/mode.py +++ b/onionshare_gui/mode.py @@ -324,12 +324,6 @@ class Mode(QtWidgets.QWidget): """ pass - def handle_request_upload_new_file_started(self, event): - """ - Handle REQUEST_UPLOAD_NEW_FILE_STARTED event. - """ - pass - def handle_request_upload_file_renamed(self, event): """ Handle REQUEST_UPLOAD_FILE_RENAMED event. diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 80e5fba9..ad5dee88 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -387,9 +387,6 @@ class OnionShareGui(QtWidgets.QMainWindow): elif event["type"] == Web.REQUEST_CLOSE_SERVER: mode.handle_request_close_server(event) - elif event["type"] == Web.REQUEST_UPLOAD_NEW_FILE_STARTED: - mode.handle_request_upload_new_file_started(event) - elif event["type"] == Web.REQUEST_UPLOAD_FILE_RENAMED: mode.handle_request_upload_file_renamed(event) diff --git a/onionshare_gui/receive_mode/__init__.py b/onionshare_gui/receive_mode/__init__.py index 65d3905a..20ce3723 100644 --- a/onionshare_gui/receive_mode/__init__.py +++ b/onionshare_gui/receive_mode/__init__.py @@ -156,12 +156,6 @@ class ReceiveMode(Mode): self.stop_server() self.system_tray.showMessage(strings._('systray_close_server_title', True), strings._('systray_close_server_message', True)) - def handle_request_upload_new_file_started(self, event): - """ - Handle REQUEST_UPLOAD_NEW_FILE_STARTED event. - """ - pass - def handle_request_upload_file_renamed(self, event): """ Handle REQUEST_UPLOAD_FILE_RENAMED event.