Remove REQUEST_UPLOAD_NEW_FILE_STARTED event, because it's not actually needed

This commit is contained in:
Micah Lee 2018-05-20 12:07:15 -07:00
parent 9857d9fce8
commit 18573ba49c
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
4 changed files with 4 additions and 27 deletions

View File

@ -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

View File

@ -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.

View File

@ -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)

View File

@ -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.