Skip to content

Commit

Permalink
Handle error case after preflight failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
rocodes committed Feb 5, 2024
1 parent 27525f5 commit 251f5b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,13 @@ def end_wizard_with_error(self, error: ExportStatus) -> None:
end the wizard.
"""
if isinstance(self.currentPage(), PreflightPage):
self.next()
# Update its status so it shows error next self.currentPage()
# self.next()
logger.debug("On preflight page")
else:
while self.currentId() > Pages.ERROR:
self.back()
page = self.currentPage()
page.set_complete(False)
page.update_content(error)

def _create_preflight(self) -> QWizardPage:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def stop_animate_header(self) -> None:

@pyqtSlot(object)
def on_status_received(self, status: ExportStatus) -> None:
logger.debug(f"Child page received status {status.value}")
self.status = status
self.completeChanged.emit()
# Some children (not the Prefight Page) may wish to call update_content here
Expand Down Expand Up @@ -237,6 +238,7 @@ def nextId(self):
else:
return Pages.INSERT_USB

@pyqtSlot(object)
def on_status_received(self, status: ExportStatus):
self.stop_animate_header()
if status in (ExportStatus.DEVICE_LOCKED, ExportStatus.DEVICE_WRITABLE):
Expand All @@ -259,6 +261,9 @@ def on_status_received(self, status: ExportStatus):
self.body.setText(body)
self.status = status

def isComplete(self) -> bool:
return False


class InsertUSBPage(ExportWizardPage):
def __init__(self, export, summary):
Expand Down

0 comments on commit 251f5b0

Please sign in to comment.