From a3c8b4759bbbccc27780197a5e34e603a2babcec Mon Sep 17 00:00:00 2001 From: Ro Date: Tue, 30 Jan 2024 11:25:42 -0500 Subject: [PATCH] Use wizard instead of exportdialog --- client/securedrop_client/gui/actions.py | 7 ++++--- .../securedrop_client/gui/conversation/export/__init__.py | 1 + .../gui/conversation/export/export_wizard.py | 1 - .../gui/conversation/export/export_wizard_page.py | 4 +--- client/securedrop_client/gui/widgets.py | 6 +++--- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/client/securedrop_client/gui/actions.py b/client/securedrop_client/gui/actions.py index ecca684662..8478fa6e54 100644 --- a/client/securedrop_client/gui/actions.py +++ b/client/securedrop_client/gui/actions.py @@ -16,7 +16,8 @@ from securedrop_client.conversation import Transcript as ConversationTranscript from securedrop_client.db import Source from securedrop_client.gui.base import ModalDialog -from securedrop_client.gui.conversation import ExportDevice, ExportDialog +from securedrop_client.gui.conversation import ExportDevice +from securedrop_client.gui.conversation.export import ExportWizard from securedrop_client.gui.conversation import ( PrintTranscriptDialog as PrintConversationTranscriptDialog, ) @@ -235,7 +236,7 @@ def _on_triggered(self) -> None: # by the operating system. with open(file_path, "r") as f: export_device = ExportDevice() - dialog = ExportDialog(export_device, TRANSCRIPT_FILENAME, [str(file_path)]) + dialog = ExportWizard(export_device, TRANSCRIPT_FILENAME, [str(file_path)]) dialog.exec() @@ -332,7 +333,7 @@ def _prepare_to_export(self) -> None: else: summary = _("all files and transcript") - dialog = ExportDialog( + dialog = ExportWizard( export_device, summary, [str(file_location) for file_location in file_locations], diff --git a/client/securedrop_client/gui/conversation/export/__init__.py b/client/securedrop_client/gui/conversation/export/__init__.py index 8de6acbe77..0c53d0ff16 100644 --- a/client/securedrop_client/gui/conversation/export/__init__.py +++ b/client/securedrop_client/gui/conversation/export/__init__.py @@ -2,3 +2,4 @@ from .export_dialog import ExportDialog # noqa: F401 from .print_dialog import PrintDialog # noqa: F401 from .print_transcript_dialog import PrintTranscriptDialog # noqa: F401 +from .export_wizard import ExportWizard # noqa: F401 diff --git a/client/securedrop_client/gui/conversation/export/export_wizard.py b/client/securedrop_client/gui/conversation/export/export_wizard.py index 6fa13e6881..1f080e0e9b 100644 --- a/client/securedrop_client/gui/conversation/export/export_wizard.py +++ b/client/securedrop_client/gui/conversation/export/export_wizard.py @@ -178,7 +178,6 @@ def rewind(self, target: Pages) -> None: """ Navigate back to target page. """ - print(f"current: {self.currentId()}, target: {target}") while self.currentId() > target: self.back() diff --git a/client/securedrop_client/gui/conversation/export/export_wizard_page.py b/client/securedrop_client/gui/conversation/export/export_wizard_page.py index 46b08db6e9..f14cf3560c 100644 --- a/client/securedrop_client/gui/conversation/export/export_wizard_page.py +++ b/client/securedrop_client/gui/conversation/export/export_wizard_page.py @@ -195,11 +195,9 @@ def keyPressEvent(self, event: QKeyEvent) -> None: @pyqtSlot(object) def on_status_received(self, status: ExportStatus) -> None: - print(f"received {status.value}") - logger.debug(f"received {status.value}") self.status = status self.completeChanged.emit() - # Some children may wish to call update_content here + # Some children (not the Prefight Page) may wish to call update_content here def update_content(self, status: ExportStatus) -> None: """ diff --git a/client/securedrop_client/gui/widgets.py b/client/securedrop_client/gui/widgets.py index 38c15e0633..4c8155dab1 100644 --- a/client/securedrop_client/gui/widgets.py +++ b/client/securedrop_client/gui/widgets.py @@ -81,6 +81,7 @@ ) from securedrop_client.gui.base import SecureQLabel, SvgLabel, SvgPushButton, SvgToggleButton from securedrop_client.gui.conversation import DeleteConversationDialog +from securedrop_client.gui.conversation.export import ExportWizard from securedrop_client.gui.datetime_helpers import format_datetime_local from securedrop_client.gui.source import DeleteSourceDialog from securedrop_client.logic import Controller @@ -2461,9 +2462,8 @@ def _on_export_clicked(self) -> None: export_device = conversation.ExportDevice() - self.export_dialog = conversation.ExportDialog( - export_device, self.file.filename, [file_location] - ) + self.export_dialog = ExportWizard(export_device, self.file.filename, [file_location]) + # fka conversation.ExportDialog self.export_dialog.show() @pyqtSlot()