Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/menu/selection_menu.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/menu/selection_menu.py')
-rw-r--r--archinstall/lib/menu/selection_menu.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/archinstall/lib/menu/selection_menu.py b/archinstall/lib/menu/selection_menu.py
index 8dd6fcce..c6ac5852 100644
--- a/archinstall/lib/menu/selection_menu.py
+++ b/archinstall/lib/menu/selection_menu.py
@@ -188,6 +188,11 @@ class GeneralMenu:
self._menu_options: Dict[str, Selector] = {}
self._setup_selection_menu_options()
self.preview_size = preview_size
+ self._last_choice = None
+
+ @property
+ def last_choice(self):
+ return self._last_choice
def __enter__(self, *args :Any, **kwargs :Any) -> GeneralMenu:
self.is_context_mgr = True
@@ -325,6 +330,10 @@ class GeneralMenu:
if not self._process_selection(value):
break
+ # we get the last action key
+ actions = {str(v.description):k for k,v in self._menu_options.items()}
+ self._last_choice = actions[selection.value.strip()]
+
if not self.is_context_mgr:
self.__exit__()