diff --git a/subiquity/controllers/installprogress.py b/subiquity/controllers/installprogress.py index 32fd5ffa..c1942b0f 100644 --- a/subiquity/controllers/installprogress.py +++ b/subiquity/controllers/installprogress.py @@ -239,14 +239,14 @@ class InstallProgressController(BaseController): def default(self): self.progress_view_showing = True - self.ui.set_body(self.progress_view) if self.install_state == InstallState.RUNNING: - self.ui.set_header(_("Installing system")) - self.ui.set_footer(_("Thank you for using Ubuntu!")) + self.progress_view.title = _("Installing system") + self.progress_view.footer = _("Thank you for using Ubuntu!") elif self.install_state == InstallState.DONE: - self.ui.set_header(_("Install complete!")) - self.ui.set_footer(_("Thank you for using Ubuntu!")) + self.progress_view.title = _("Install complete!") + self.progress_view.footer = _("Thank you for using Ubuntu!") elif self.install_state == InstallState.ERROR: - self.ui.set_header(_('An error occurred during installation')) - self.ui.set_footer(_('Please report this error in Launchpad')) + self.progress_view.title = _('An error occurred during installation') + self.progress_view.footer = _('Please report this error in Launchpad') + self.ui.set_body(self.progress_view) diff --git a/subiquity/ui/views/identity.py b/subiquity/ui/views/identity.py index 41bebee1..f64b056f 100644 --- a/subiquity/ui/views/identity.py +++ b/subiquity/ui/views/identity.py @@ -29,6 +29,9 @@ from subiquitycore.ui.buttons import ( ok_btn, other_btn, ) +from subiquitycore.ui.container import ( + ListBox, + ) from subiquitycore.ui.interactive import ( PasswordEditor, StringEditor, @@ -273,13 +276,14 @@ class IdentityView(BaseView): connect_signal(self.form.ssh_import_id.widget, 'select', self._select_ssh_import_id) self.form.import_username.enabled = False + + self.form_rows = ListBox(self.form.as_rows()) super().__init__( screen( - self.form.as_rows(), + self.form_rows, [self.form.done_btn], excerpt=_(self.excerpt), focus_buttons=False)) - self.form_rows = self._w[1] def _check_password(self, sender, new_text): password = self.form.password.value diff --git a/subiquitycore/ui/anchors.py b/subiquitycore/ui/anchors.py index ef7135b9..04f8d293 100644 --- a/subiquitycore/ui/anchors.py +++ b/subiquitycore/ui/anchors.py @@ -27,19 +27,14 @@ class Header(WidgetWrap): :returns: Header() """ - def __init__(self, title=None, excerpt=None): - widgets = [Text("")] - if title is not None: - widgets.append( - Padding.center_79(Text(title))) - widgets.append(Text("")) - widgets = [Color.frame_header(Pile(widgets))] - if excerpt is not None: - widgets.extend([ - Text(""), - Padding.center_79(Text(excerpt)), - ]) - super().__init__(Pile(widgets)) + def __init__(self, title): + super().__init__( + Color.frame_header( + Pile([ + Text(""), + Padding.center_79(Text(title)), + Text(""), + ]))) class StepsProgressBar(ProgressBar): diff --git a/subiquitycore/ui/frame.py b/subiquitycore/ui/frame.py index d7c97619..39255751 100644 --- a/subiquitycore/ui/frame.py +++ b/subiquitycore/ui/frame.py @@ -27,7 +27,7 @@ log = logging.getLogger('subiquitycore.ui.frame') class SubiquityUI(WidgetWrap): def __init__(self): - self.header = Header() + self.header = Header("") self.body = Body() self.footer = Footer("", 0, 1) self.frame = Frame(self.body, header=self.header, footer=self.footer) @@ -38,7 +38,13 @@ class SubiquityUI(WidgetWrap): def keypress(self, size, key): return super().keypress(size, key) + def set_header(self, title=None): + self.frame.header = Header(title) + + def set_footer(self, message): + self.frame.footer = Footer(message, self.progress_current, self.progress_completion) + def set_body(self, widget): - self.frame.header = Header(_(widget.title)) + self.set_header(_(widget.title)) self.frame.body = widget - self.frame.footer = Footer(_(widget.footer), self.progress_current, self.progress_completion) + self.set_footer(_(widget.footer))