From 35a19a616aee602a849097411cc0254a27c3f9b7 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Mar 2022 03:03:37 +1100 Subject: Menu option save config (#1009) * Add new save config menu option * Update * Fixed issue with merging * Fixed merge issue (I think) Co-authored-by: Daniel Girtler Co-authored-by: Anton Hvornum --- archinstall/lib/menu/menu.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'archinstall/lib/menu/menu.py') diff --git a/archinstall/lib/menu/menu.py b/archinstall/lib/menu/menu.py index d7b1605d..c52ed8f3 100644 --- a/archinstall/lib/menu/menu.py +++ b/archinstall/lib/menu/menu.py @@ -12,7 +12,6 @@ import logging if TYPE_CHECKING: _: Any - class Menu(TerminalMenu): def __init__( self, @@ -24,6 +23,9 @@ class Menu(TerminalMenu): sort :bool = True, preset_values :Union[str, List[str]] = None, cursor_index :int = None, + preview_command=None, + preview_size=0.75, + preview_title='Info', **kwargs ): """ @@ -54,6 +56,15 @@ class Menu(TerminalMenu): :param cursor_index: The position where the cursor will be located. If it is not in range (number of elements of the menu) it goes to the first position :type cursor_index: int + :param preview_command: A function that should return a string that will be displayed in a preview window when a menu selection item is in focus + :type preview_command: Callable + + :param preview_size: Size of the preview window in ratio to the full window + :type preview_size: float + + :param preview_title: Title of the preview window + :type preview_title: str + :param kwargs : any SimpleTerminal parameter """ # we guarantee the inmutability of the options outside the class. @@ -123,6 +134,9 @@ class Menu(TerminalMenu): # show_search_hint=True, preselected_entries=self.preset_values, cursor_index=self.cursor_index, + preview_command=preview_command, + preview_size=preview_size, + preview_title=preview_title, **kwargs, ) -- cgit v1.2.3-54-g00ecf