diff --git a/archinstall/lib/configuration.py b/archinstall/lib/configuration.py index 0f22190e0d..3e9135bfb0 100644 --- a/archinstall/lib/configuration.py +++ b/archinstall/lib/configuration.py @@ -124,10 +124,13 @@ def as_summary(self) -> str: label_width = max(len(label) for label, _ in rows) + 2 return '\n'.join(f'{label:<{label_width}}{value}' for label, value in rows) - async def confirm_config(self) -> bool: + async def confirm_config(self, show_install_warnings: bool = False) -> bool: header = f'{tr("The specified configuration will be applied")}. ' header += tr('Would you like to continue?') + '\n' + if show_install_warnings: + header += self._render_install_warnings() + group = MenuItemGroup.yes_no() group.set_preview_for_all(lambda x: self.user_config_to_json()) @@ -145,6 +148,22 @@ async def confirm_config(self) -> bool: return True + def get_install_warnings(self) -> list[str]: + warnings: list[str] = [] + + if not isinstance(self._config.network_config, NetworkConfiguration): + warnings.append(tr('Warning: no network configuration selected. Network will need to be set up manually on the installed system.')) + + return warnings + + def _render_install_warnings(self) -> str: + warnings = self.get_install_warnings() + + if not warnings: + return '' + + return '\n' + '\n'.join(f'[yellow]{w}[/]' for w in warnings) + '\n' + def _is_valid_path(self, dest_path: Path) -> bool: dest_path_ok = dest_path.exists() and dest_path.is_dir() if not dest_path_ok: diff --git a/archinstall/lib/network/network_menu.py b/archinstall/lib/network/network_menu.py index bcf546981a..2e95a82ebb 100644 --- a/archinstall/lib/network/network_menu.py +++ b/archinstall/lib/network/network_menu.py @@ -172,14 +172,17 @@ async def select_network(preset: NetworkConfiguration | None) -> NetworkConfigur """ items = [MenuItem(n.display_msg(), value=n) for n in NicType] - group = MenuItemGroup(items, sort_items=True) + group = MenuItemGroup(items, sort_items=False) if preset: group.set_selected_by_value(preset.type) + header = tr('Choose network configuration') + '\n' + header += tr('Recommended: Network Manager for desktop, Manual for server') + '\n' + result = await Selection[NicType]( group, - header=tr('Choose network configuration'), + header=header, allow_reset=True, allow_skip=True, ).show() diff --git a/archinstall/locales/base.pot b/archinstall/locales/base.pot index b7e1184bc1..f0b311d445 100644 --- a/archinstall/locales/base.pot +++ b/archinstall/locales/base.pot @@ -2192,6 +2192,14 @@ msgstr "" msgid "Choose network configuration" msgstr "" +msgid "Recommended: Network Manager for desktop, Manual for server" +msgstr "" + +msgid "" +"Warning: no network configuration selected. Network will need to be set up " +"manually on the installed system." +msgstr "" + msgid "No packages found" msgstr "" diff --git a/archinstall/locales/uk/LC_MESSAGES/base.po b/archinstall/locales/uk/LC_MESSAGES/base.po index 88bf9ede5a..a13d825cfe 100644 --- a/archinstall/locales/uk/LC_MESSAGES/base.po +++ b/archinstall/locales/uk/LC_MESSAGES/base.po @@ -2133,6 +2133,12 @@ msgstr "Оберіть інтерфейс" msgid "Choose network configuration" msgstr "Оберіть конфігурацію мережі" +msgid "Recommended: Network Manager for desktop, Manual for server" +msgstr "Рекомендовано: Network Manager для робочого столу, ручне налаштування для сервера" + +msgid "Warning: no network configuration selected. Network will need to be set up manually on the installed system." +msgstr "Попередження: конфігурацію мережі не обрано. Мережу доведеться налаштувати вручну на встановленій системі." + msgid "No packages found" msgstr "Пакети не знайдено" diff --git a/archinstall/scripts/guided.py b/archinstall/scripts/guided.py index 5cdcdad9d2..2122848083 100644 --- a/archinstall/scripts/guided.py +++ b/archinstall/scripts/guided.py @@ -226,7 +226,7 @@ def main(arch_config_handler: ArchConfigHandler | None = None) -> None: if not arch_config_handler.args.silent: aborted = False - res: bool = tui.run(config.confirm_config) + res: bool = tui.run(lambda: config.confirm_config(show_install_warnings=True)) if not res: debug('Installation aborted') diff --git a/archinstall/scripts/minimal.py b/archinstall/scripts/minimal.py index 4e89714260..681d4266b0 100644 --- a/archinstall/scripts/minimal.py +++ b/archinstall/scripts/minimal.py @@ -77,7 +77,7 @@ async def main(arch_config_handler: ArchConfigHandler | None = None) -> None: if not arch_config_handler.args.silent: aborted = False - res: bool = tui.run(config.confirm_config) + res: bool = tui.run(lambda: config.confirm_config(show_install_warnings=True)) if not res: debug('Installation aborted')