diff options
author | Micah Lee <micah@micahflee.com> | 2018-10-25 21:38:20 -0700 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2018-10-25 21:38:20 -0700 |
commit | 65b4afeba34c23aa3fe856e4fadbe7f1d20c8a2d (patch) | |
tree | 7b76cc3028b1b2b3990980ac05ed1ad51472f3eb /onionshare | |
parent | 6233487ecdaed7c4a678a01889703bfd0dec0787 (diff) | |
download | onionshare-65b4afeba34c23aa3fe856e4fadbe7f1d20c8a2d.tar.gz onionshare-65b4afeba34c23aa3fe856e4fadbe7f1d20c8a2d.zip |
Communicate the receive mode dir to the GUI, so clicking the open folder button opens the file manager to the correct directory
Diffstat (limited to 'onionshare')
-rw-r--r-- | onionshare/web/receive_mode.py | 7 | ||||
-rw-r--r-- | onionshare/web/web.py | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/onionshare/web/receive_mode.py b/onionshare/web/receive_mode.py index 66e00240..edaf8bbc 100644 --- a/onionshare/web/receive_mode.py +++ b/onionshare/web/receive_mode.py @@ -125,6 +125,13 @@ class ReceiveModeWeb(object): 'new_filename': basename }) + # Tell the GUI the receive mode directory for this file + self.web.add_request(self.web.REQUEST_UPLOAD_SET_DIR, request.path, { + 'id': request.upload_id, + 'filename': basename, + 'dir': receive_mode_dir + }) + self.common.log('ReceiveModeWeb', 'define_routes', '/upload, uploaded {}, saving to {}'.format(f.filename, local_path)) print(strings._('receive_mode_received_file').format(local_path)) f.save(local_path) diff --git a/onionshare/web/web.py b/onionshare/web/web.py index 2ae011b7..a423b2e1 100644 --- a/onionshare/web/web.py +++ b/onionshare/web/web.py @@ -37,8 +37,9 @@ class Web(object): REQUEST_RATE_LIMIT = 5 REQUEST_CLOSE_SERVER = 6 REQUEST_UPLOAD_FILE_RENAMED = 7 - REQUEST_UPLOAD_FINISHED = 8 - REQUEST_ERROR_DOWNLOADS_DIR_CANNOT_CREATE = 9 + REQUEST_UPLOAD_SET_DIR = 8 + REQUEST_UPLOAD_FINISHED = 9 + REQUEST_ERROR_DOWNLOADS_DIR_CANNOT_CREATE = 10 def __init__(self, common, is_gui, mode='share'): self.common = common |