Skip to content

Commit

Permalink
Set status messages in the event handlers for downloading files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ntoll committed Oct 31, 2018
1 parent f40149f commit ea28530
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions securedrop_client/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ def on_file_click(self, source_db_object, message):
sdk_object = sdclientapi.Reply(uuid=message.uuid)
sdk_object.filename = message.filename
sdk_object.source_uuid = source_db_object.uuid
self.set_status(_('Downloading {}'.format(sdk_object.filename)))
self.call_api(func, self.on_file_download,
self.on_download_timeout, sdk_object, self.data_dir,
current_object=message)
Expand All @@ -444,6 +445,8 @@ def on_file_download(self, result, current_object):
# Refresh the current source conversation, bearing in mind
# that the user may have navigated to another source.
self.gui.show_conversation_for(self.gui.current_source)
self.set_status(
'Finished downloading {}'.format(current_object.filename))
else:
# Update the UI in some way to indicate a failure state.
self.set_status("Failed to download file, please try again.")
Expand Down

0 comments on commit ea28530

Please sign in to comment.