From cc857a39bb203dcaef7427070920fd973a0150cc Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sat, 19 Jan 2019 20:43:25 -0800 Subject: [PATCH] Finish removing web event REQUEST_CLOSE_SERVER, which used to be a receive mode feature to allow the Tor Browser user to close the server, but we removed --- onionshare/web/web.py | 9 ++++----- onionshare_gui/mode/__init__.py | 6 ------ onionshare_gui/mode/receive_mode/__init__.py | 9 +-------- onionshare_gui/mode/share_mode/__init__.py | 2 +- onionshare_gui/onionshare_gui.py | 3 --- 5 files changed, 6 insertions(+), 23 deletions(-) diff --git a/onionshare/web/web.py b/onionshare/web/web.py index 0f156941..df838df7 100644 --- a/onionshare/web/web.py +++ b/onionshare/web/web.py @@ -35,11 +35,10 @@ class Web(object): REQUEST_OTHER = 3 REQUEST_CANCELED = 4 REQUEST_RATE_LIMIT = 5 - REQUEST_CLOSE_SERVER = 6 - REQUEST_UPLOAD_FILE_RENAMED = 7 - REQUEST_UPLOAD_SET_DIR = 8 - REQUEST_UPLOAD_FINISHED = 9 - REQUEST_ERROR_DOWNLOADS_DIR_CANNOT_CREATE = 10 + REQUEST_UPLOAD_FILE_RENAMED = 6 + REQUEST_UPLOAD_SET_DIR = 7 + REQUEST_UPLOAD_FINISHED = 8 + REQUEST_ERROR_DOWNLOADS_DIR_CANNOT_CREATE = 9 def __init__(self, common, is_gui, mode='share'): self.common = common diff --git a/onionshare_gui/mode/__init__.py b/onionshare_gui/mode/__init__.py index 5110289f..edc1777d 100644 --- a/onionshare_gui/mode/__init__.py +++ b/onionshare_gui/mode/__init__.py @@ -312,12 +312,6 @@ class Mode(QtWidgets.QWidget): """ pass - def handle_request_close_server(self, event): - """ - Handle REQUEST_CLOSE_SERVER event. - """ - pass - def handle_request_upload_file_renamed(self, event): """ Handle REQUEST_UPLOAD_FILE_RENAMED event. diff --git a/onionshare_gui/mode/receive_mode/__init__.py b/onionshare_gui/mode/receive_mode/__init__.py index 2ebf1feb..62f96924 100644 --- a/onionshare_gui/mode/receive_mode/__init__.py +++ b/onionshare_gui/mode/receive_mode/__init__.py @@ -103,7 +103,7 @@ class ReceiveMode(Mode): 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.server_status_label.setText(strings._('gui_receive_mode_timeout_waiting')) self.web.receive_mode.can_upload = False return False @@ -159,13 +159,6 @@ class ReceiveMode(Mode): 'progress': event["data"]["progress"] }) - def handle_request_close_server(self, event): - """ - Handle REQUEST_CLOSE_SERVER event. - """ - self.stop_server() - self.system_tray.showMessage(strings._('systray_close_server_title'), strings._('systray_close_server_message')) - def handle_request_upload_file_renamed(self, event): """ Handle REQUEST_UPLOAD_FILE_RENAMED event. diff --git a/onionshare_gui/mode/share_mode/__init__.py b/onionshare_gui/mode/share_mode/__init__.py index f7150c1e..5dd2315e 100644 --- a/onionshare_gui/mode/share_mode/__init__.py +++ b/onionshare_gui/mode/share_mode/__init__.py @@ -138,7 +138,7 @@ class ShareMode(Mode): return True # A download is probably still running - hold off on stopping the share else: - self.server_status_label.setText(strings._('timeout_download_still_running')) + self.server_status_label.setText(strings._('gui_share_mode_timeout_waiting')) return False def start_server_custom(self): diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index eab3261e..3d5f5f0a 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -384,9 +384,6 @@ class OnionShareGui(QtWidgets.QMainWindow): elif event["type"] == Web.REQUEST_CANCELED: mode.handle_request_canceled(event) - elif event["type"] == Web.REQUEST_CLOSE_SERVER: - mode.handle_request_close_server(event) - elif event["type"] == Web.REQUEST_UPLOAD_FILE_RENAMED: mode.handle_request_upload_file_renamed(event)