introduce a couple more installstates

This commit is contained in:
Michael Hudson-Doyle 2020-10-09 13:39:09 +13:00
parent f7c3f04887
commit 7303d68847
3 changed files with 12 additions and 6 deletions

View File

@ -166,6 +166,8 @@ class InstallState(enum.Enum):
NOT_STARTED = enum.auto()
NEEDS_CONFIRMATION = enum.auto()
RUNNING = enum.auto()
POST_WAIT = enum.auto()
POST_RUNNING = enum.auto()
UU_RUNNING = enum.auto()
UU_CANCELLING = enum.auto()
DONE = enum.auto()

View File

@ -291,9 +291,6 @@ class InstallProgressController(SubiquityTuiController):
log.debug('curtin_install completed: %s', cp.returncode)
self.update_state(InstallState.DONE)
log.debug('After curtin install OK')
def cancel(self):
pass
@ -316,15 +313,16 @@ class InstallProgressController(SubiquityTuiController):
await self.curtin_install(context=context)
self.update_state(InstallState.POST_WAIT)
await asyncio.wait(
{e.wait() for e in self.model.postinstall_events})
await self.drain_curtin_events(context=context)
await self.postinstall(context=context)
self.update_state(InstallState.POST_RUNNING)
self.ui.set_header(_("Installation complete!"))
self.progress_view.set_status(_("Finished install!"))
await self.postinstall(context=context)
if self.model.network.has_network:
self.update_state(InstallState.UU_RUNNING)

View File

@ -146,6 +146,12 @@ class ProgressView(BaseView):
elif state == InstallState.RUNNING:
self.title = _("Installing system")
btns = [self.view_log_btn]
elif state == InstallState.POST_WAIT:
self.title = _("Installing system")
btns = [self.view_log_btn]
elif state == InstallState.POST_RUNNING:
self.title = _("Installing system")
btns = [self.view_log_btn]
elif state == InstallState.UU_RUNNING:
self.title = _("Install complete!")
self.reboot_btn.base_widget.set_label(