in client/securedrop_client/gui/conversation/export/whistleflow_dialog.py [0:0]
def __init__(self, device: Export, summary: str, file_locations: list[str]) -> None:
super().__init__()
self.setStyleSheet(self.DIALOG_CSS)
self._device = device
self._file_locations = file_locations
self.file_name = SecureQLabel(
summary, wordwrap=False, max_length=self.FILENAME_WIDTH_PX
).text()
# Hold onto the error status we receive from the Export VM
self.error_status: ExportStatus | None = None
# Connect device signals to slots
self._device.whistleflow_preflight_check_succeeded.connect(
self._on_export_preflight_check_succeeded
)
self._device.whistleflow_preflight_check_failed.connect(
self._on_export_preflight_check_failed
)
self._device.export_completed.connect(self._on_export_succeeded)
# # For now, connect both success and error signals to close the print dialog.
self._device.whistleflow_call_failure.connect(self._on_export_failed)
self._device.whistleflow_call_success.connect(self._on_export_succeeded)
# Connect parent signals to slots
self.continue_button.setEnabled(False)
self.continue_button.clicked.connect(self._run_preflight)
# Dialog content
self.starting_header = _(
"Preparing to export:<br />" '<span style="font-weight:normal">{}</span>'
).format(self.file_name)
self.ready_header = _(
"Ready to export:<br />" '<span style="font-weight:normal">{}</span>'
).format(self.file_name)
self.success_header = _("Export successful")
self.error_header = _("Export failed")
self.starting_message = _(
"<h2>Understand the risks before exporting files</h2>"
"<b>Malware</b>"
"<br />"
"This workstation lets you open files securely. If you open files on another "
"computer, any embedded malware may spread to your computer or network. If you are "
"unsure how to manage this risk, please print the file, or contact your "
"administrator."
"<br /><br />"
"<b>Anonymity</b>"
"<br />"
"Files submitted by sources may contain information or hidden metadata that "
"identifies who they are. To protect your sources, please consider redacting files "
"before working with them on network-connected computers."
)
self.generic_error_message = _("See your administrator for help.")
self.success_message = _(
"Remember to be careful when working with files outside of your Workstation machine."
)
self._show_starting_instructions()
self.start_animate_header()
self._run_preflight()