index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Werner Llácer <wllacer@gmail.com> | 2022-03-10 09:42:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-10 09:42:03 +0100 |
commit | a6b1cab0779c534543ab385649dcd5cbdd83f3bf (patch) | |
tree | 5d58c9e2d12836d8817cd988bb69d2603d10e4be /archinstall/lib/menu/menu.py | |
parent | f7aba1d31c0556b38ee48270ba530359bc274ebf (diff) |
-rw-r--r-- | archinstall/lib/menu/menu.py | 15 |
diff --git a/archinstall/lib/menu/menu.py b/archinstall/lib/menu/menu.py index c52ed8f3..d254e0f9 100644 --- a/archinstall/lib/menu/menu.py +++ b/archinstall/lib/menu/menu.py @@ -26,6 +26,7 @@ class Menu(TerminalMenu): preview_command=None, preview_size=0.75, preview_title='Info', + header :Union[List[str],str] = None, **kwargs ): """ @@ -65,6 +66,9 @@ class Menu(TerminalMenu): :param preview_title: Title of the preview window :type preview_title: str + param: header one or more header lines for the menu + type param: string or list + :param kwargs : any SimpleTerminal parameter """ # we guarantee the inmutability of the options outside the class. @@ -104,10 +108,15 @@ class Menu(TerminalMenu): self.default_option = default_option self.multi = multi menu_title = f'\n{title}\n\n' - - if skip: + if header: + separator = '\n ' + if not isinstance(header,(list,tuple)): + header = [header,] + if skip: + menu_title += str(_("Use ESC to skip\n")) + menu_title += separator + separator.join(header) + elif skip: menu_title += str(_("Use ESC to skip\n\n")) - if default_option: # if a default value was specified we move that one # to the top of the list and mark it as default as well |