Skip to content

Commit

Permalink
Fix a couple of UI niggles: disable password form on submit, along wi…
Browse files Browse the repository at this point in the history
…th error message.
  • Loading branch information
ntoll authored and sssoleileraaa committed Mar 24, 2020
1 parent 94c1dfd commit 78f70fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions securedrop_client/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2613,6 +2613,7 @@ def start_animate_activestate(self):
padding-right: 20px;
"""
self.continue_button.setStyleSheet(css)
self.error_details.setStyleSheet("color: #ff66C4")

def start_animate_header(self):
self.header_icon.setVisible(False)
Expand All @@ -2625,6 +2626,7 @@ def stop_animate_activestate(self):
self.continue_button.setText(_('CONTINUE'))
css = "background-color: #2a319d; color: #fff; border: 2px solid #2a319d;"
self.continue_button.setStyleSheet(css)
self.error_details.setStyleSheet("color: #ff0064")

def stop_animate_header(self):
self.header_icon.setVisible(True)
Expand Down Expand Up @@ -2955,6 +2957,7 @@ def _run_preflight(self):
@pyqtSlot()
def _export_file(self, checked: bool = False):
self.start_animate_activestate()
self.passphrase_field.setDisabled(True)
self.controller.export_file_to_usb_drive(self.file_uuid, self.passphrase_field.text())

@pyqtSlot()
Expand Down Expand Up @@ -2985,6 +2988,7 @@ def _on_export_success(self):
@pyqtSlot(object)
def _on_export_failure(self, error: ExportError):
self.stop_animate_activestate()
self.passphrase_field.setDisabled(False)
self._update_dialog(error.status)

def _update_dialog(self, error_status: str):
Expand Down

0 comments on commit 78f70fa

Please sign in to comment.