Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion archinstall/lib/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand All @@ -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:
Expand Down
7 changes: 5 additions & 2 deletions archinstall/lib/network/network_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 8 additions & 0 deletions archinstall/locales/base.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""

Expand Down
6 changes: 6 additions & 0 deletions archinstall/locales/uk/LC_MESSAGES/base.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 "Пакети не знайдено"

Expand Down
2 changes: 1 addition & 1 deletion archinstall/scripts/guided.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion archinstall/scripts/minimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down