Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/menu/menu.py
diff options
context:
space:
mode:
authorWerner Llácer <wllacer@gmail.com>2022-03-10 09:42:03 +0100
committerGitHub <noreply@github.com>2022-03-10 09:42:03 +0100
commita6b1cab0779c534543ab385649dcd5cbdd83f3bf (patch)
tree5d58c9e2d12836d8817cd988bb69d2603d10e4be /archinstall/lib/menu/menu.py
parentf7aba1d31c0556b38ee48270ba530359bc274ebf (diff)
Additions to Listmgr et alia (#1028)
* Permit multiple default actions as a list * Define headers for list at ListManager and Menu * small corrections for default values * Make subvolume info work. The real marker that signifies that a mounted subvolume exist is the bracket notation nor the at sign
Diffstat (limited to 'archinstall/lib/menu/menu.py')
-rw-r--r--archinstall/lib/menu/menu.py15
1 files changed, 12 insertions, 3 deletions
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