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:
authorDaniel <blackrabbit256@gmail.com>2022-03-01 03:03:37 +1100
committerGitHub <noreply@github.com>2022-02-28 17:03:37 +0100
commit35a19a616aee602a849097411cc0254a27c3f9b7 (patch)
tree5b1db96f151fae55f7b76e06066fc747daf6b070 /archinstall/lib/menu/menu.py
parent04e3880d8f41a87889690609e20ab1220700c163 (diff)
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 <girtler.daniel@gmail.com> Co-authored-by: Anton Hvornum <anton.feeds@gmail.com>
Diffstat (limited to 'archinstall/lib/menu/menu.py')
-rw-r--r--archinstall/lib/menu/menu.py16
1 files changed, 15 insertions, 1 deletions
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,
)