From 219360d12da62712ecc59b859944a7a8ab987332 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Mon, 21 Sep 2020 14:01:23 +1200 Subject: [PATCH] fixes for how install failures are presented some of these have been around for a while :/ --- subiquity/controllers/installprogress.py | 10 ++++++---- subiquity/ui/frame.py | 2 ++ subiquitycore/controllerset.py | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/subiquity/controllers/installprogress.py b/subiquity/controllers/installprogress.py index 9e979ec0..01aeee85 100644 --- a/subiquity/controllers/installprogress.py +++ b/subiquity/controllers/installprogress.py @@ -150,11 +150,13 @@ class InstallProgressController(SubiquityTuiController): ErrorReportKind.INSTALL_FAIL, "install failed", interrupt=False, **kw) self.progress_view.finish_all() - self.progress_view.set_status(('info_error', - _("An error has occurred"))) - self.ui.set_body(self.make_ui()) + self.progress_view.set_status( + ('info_error', _("An error has occurred"))) + if not self.showing: + self.app.controllers.index = self.controller_index - 1 + self.app.next_screen() if crash_report is not None: - self.progress_view.show_error(crash_report) + self.app.show_error_report(crash_report) def logged_command(self, cmd): return ['systemd-cat', '--level-prefix=false', diff --git a/subiquity/ui/frame.py b/subiquity/ui/frame.py index 8314f546..798d917e 100644 --- a/subiquity/ui/frame.py +++ b/subiquity/ui/frame.py @@ -36,6 +36,8 @@ class SubiquityUI(SubiquityCoreUI): return super().keypress(size, key) def set_body(self, widget): + if widget is self.body: + return super().set_body(widget) if isinstance(widget, BaseView): for overlay in self.app.global_overlays: diff --git a/subiquitycore/controllerset.py b/subiquitycore/controllerset.py index 227a2388..140dcd4d 100644 --- a/subiquitycore/controllerset.py +++ b/subiquitycore/controllerset.py @@ -41,6 +41,7 @@ class ControllerSet: else: inst = klass(*self.init_args) setattr(self, name, inst) + inst.controller_index = len(self.instances) self.instances.append(inst) def load_all(self):