Skip to content

Commit

Permalink
Use wizard instead of exportdialog
Browse files Browse the repository at this point in the history
  • Loading branch information
rocodes committed Jan 30, 2024
1 parent 36a25c7 commit 3be223d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
7 changes: 4 additions & 3 deletions client/securedrop_client/gui/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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()


Expand Down Expand Up @@ -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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down
6 changes: 3 additions & 3 deletions client/securedrop_client/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 3be223d

Please sign in to comment.