Skip to content

Commit

Permalink
Let parent handle dialog close via pyqtSignal on PrintTranscriptDialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
rocodes committed Mar 20, 2024
1 parent 9272508 commit b31da3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -24,7 +24,6 @@ def __init__(self, device: Export, file_name: str, filepath: List[str]) -> None:

def _print_transcript(self) -> None:
self._device.print(self.transcript_location)
self.close()

@pyqtSlot()
def _on_print_preflight_check_succeeded(self) -> None:
Expand All @@ -35,7 +34,6 @@ def _on_print_preflight_check_succeeded(self) -> None:
if not self.continue_button.isEnabled():
self.continue_button.clicked.disconnect()
self.continue_button.clicked.connect(self._print_transcript)

self.continue_button.setEnabled(True)
self.continue_button.setFocus()
return
Expand Down
Expand Up @@ -90,7 +90,9 @@ def test_PrintTranscriptDialog__print_transcript(mocker, print_transcript_dialog

print_transcript_dialog._print_transcript()

print_transcript_dialog.close.assert_called_once_with()
# Dialog.close() should not be called directly; it is closed only
# after receiving the completed signal from the QProcess
print_transcript_dialog.close.assert_not_called()


def test_PrintTranscriptDialog__on_print_preflight_check_succeeded(mocker, print_transcript_dialog):
Expand Down

0 comments on commit b31da3e

Please sign in to comment.