3535from archinstall .lib .pacman .pacman_menu import PacmanMenu
3636from archinstall .lib .translationhandler import Language , tr , translation_handler
3737from archinstall .lib .utils .format import as_table
38- from archinstall .tui .components import tui
38+ from archinstall .tui .components import get_status_prefix , tui
3939from archinstall .tui .menu_item import MenuItem , MenuItemGroup , MsgLevelType , PreviewResult
4040
4141
@@ -64,30 +64,6 @@ def __init__(
6464 super ().__init__ (self ._item_group , config = arch_config , title = title )
6565 self ._update_item_labels ()
6666
67- def _get_status_prefix (self , item : MenuItem ) -> str :
68- """
69- Returns a rich-formatted status prefix icon depending on item state:
70- - [✓] (Green) for configured items
71- - [!] (Red) for missing mandatory or required items
72- - [•] (Yellow) for unconfigured optional items
73- """
74- if item .read_only or item .key in (SpecialMenuKey .SAVE .value , SpecialMenuKey .INSTALL .value , SpecialMenuKey .ABORT .value ):
75- return ''
76-
77- if item .key == 'auth_config' :
78- auth_config : AuthenticationConfiguration | None = item .value
79- is_auth_valid = auth_config is not None and (auth_config .root_enc_password is not None or auth_config .has_superuser ())
80- if is_auth_valid :
81- return '[bold green][✓][/bold green] '
82- return '[bold red][!][/bold red] '
83-
84- if item .has_value ():
85- return '[bold green][✓][/bold green] '
86- elif item .mandatory :
87- return '[bold red][!][/bold red] '
88- else :
89- return '[bold yellow][•][/bold yellow] '
90-
9167 def _update_item_labels (self ) -> None :
9268 """
9369 Re-applies translated titles and status prefixes to all active menu items.
@@ -98,7 +74,7 @@ def _update_item_labels(self) -> None:
9874 for item in self ._item_group .items :
9975 if item .key in new_options :
10076 base_title = new_options [item .key ]
101- prefix = self . _get_status_prefix (item )
77+ prefix = get_status_prefix (item )
10278 item .text = f'{ prefix } { base_title } '
10379
10480 def _wrap_action (self , item : MenuItem , action : Callable [..., Any ]) -> Callable [..., Any ]:
0 commit comments