Skip to content

Commit 3b275a7

Browse files
committed
Warn when network selection was skipped instead of making it mandatory
Replace the mandatory network_config menu requirement with a yellow warning on the final confirmation screen, shown only when the user skipped the network menu entirely. Explicitly picking "No network configuration" is treated as a conscious choice and does not trigger the warning. - Drop mandatory=True from the network_config global menu item - Rename NicType.NONE menu label from "No network" to "No network configuration" (an installed system still has an NIC; only the install-time configuration is absent) - Add ConfigurationOutput.get_install_warnings() and render them in confirm_config when show_install_warnings=True - guided.py and minimal.py enable the warning on the confirm screen - Reuse the existing "No network configuration" msgid in .pot; add the warning string; update Ukrainian translations accordingly
1 parent ccc378b commit 3b275a7

7 files changed

Lines changed: 33 additions & 12 deletions

File tree

archinstall/lib/configuration.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from archinstall.lib.crypt import encrypt
1111
from archinstall.lib.menu.helpers import Confirmation, Selection
1212
from archinstall.lib.menu.util import get_password, prompt_dir
13+
from archinstall.lib.models.network import NetworkConfiguration
1314
from archinstall.lib.output import debug, logger, warn
1415
from archinstall.lib.translationhandler import tr
1516
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup
@@ -58,10 +59,13 @@ def write_debug(self) -> None:
5859
debug(' -- Chosen configuration --')
5960
debug(self.user_config_to_json())
6061

61-
async def confirm_config(self) -> bool:
62+
async def confirm_config(self, show_install_warnings: bool = False) -> bool:
6263
header = f'{tr("The specified configuration will be applied")}. '
6364
header += tr('Would you like to continue?') + '\n'
6465

66+
if show_install_warnings:
67+
header += self._render_install_warnings()
68+
6569
group = MenuItemGroup.yes_no()
6670
group.set_preview_for_all(lambda x: self.user_config_to_json())
6771

@@ -79,6 +83,22 @@ async def confirm_config(self) -> bool:
7983

8084
return True
8185

86+
def get_install_warnings(self) -> list[str]:
87+
warnings: list[str] = []
88+
89+
if not isinstance(self._config.network_config, NetworkConfiguration):
90+
warnings.append(tr('Warning: no network configuration selected. Network will need to be set up manually on the installed system.'))
91+
92+
return warnings
93+
94+
def _render_install_warnings(self) -> str:
95+
warnings = self.get_install_warnings()
96+
97+
if not warnings:
98+
return ''
99+
100+
return '\n' + '\n'.join(f'[yellow]{w}[/]' for w in warnings) + '\n'
101+
82102
def _is_valid_path(self, dest_path: Path) -> bool:
83103
dest_path_ok = dest_path.exists() and dest_path.is_dir()
84104
if not dest_path_ok:

archinstall/lib/global_menu.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ def _get_menu_options(self) -> list[MenuItem]:
139139
action=select_network,
140140
value={},
141141
preview_action=self._prev_network_config,
142-
mandatory=True,
143142
key='network_config',
144143
),
145144
MenuItem(

archinstall/lib/models/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def display_msg(self) -> str:
2525
case NicType.MANUAL:
2626
return tr('Manual configuration')
2727
case NicType.NONE:
28-
return tr('No network')
28+
return tr('No network configuration')
2929

3030

3131
class _NicSerialization(TypedDict):

archinstall/locales/base.pot

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,9 +633,6 @@ msgstr ""
633633
msgid "Manual configuration"
634634
msgstr ""
635635

636-
msgid "No network"
637-
msgstr ""
638-
639636
msgid "Mark/Unmark a partition as compressed (btrfs only)"
640637
msgstr ""
641638

@@ -2180,6 +2177,11 @@ msgstr ""
21802177
msgid "Recommended: Network Manager for desktop, Manual for server"
21812178
msgstr ""
21822179

2180+
msgid ""
2181+
"Warning: no network configuration selected. Network will need to be set up "
2182+
"manually on the installed system."
2183+
msgstr ""
2184+
21832185
msgid "No packages found"
21842186
msgstr ""
21852187

archinstall/locales/uk/LC_MESSAGES/base.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ msgid "Define users with sudo privilege: "
483483
msgstr "Визначте користувачів із привілеєм sudo: "
484484

485485
msgid "No network configuration"
486-
msgstr "Відсутня конфігурація мережі"
486+
msgstr "Без налаштування мережі"
487487

488488
msgid "Set desired subvolumes on a btrfs partition"
489489
msgstr "Встановіть потрібні підтома на розділі btrfs"
@@ -646,9 +646,6 @@ msgstr "Оберіть інтерфейс для додавання"
646646
msgid "Manual configuration"
647647
msgstr "Ручне налаштування"
648648

649-
msgid "No network"
650-
msgstr "Без мережі"
651-
652649
msgid "Mark/Unmark a partition as compressed (btrfs only)"
653650
msgstr "Позначити/зняти позначку розділу як стисненого (лише btrfs)"
654651

@@ -2121,6 +2118,9 @@ msgstr "Оберіть конфігурацію мережі"
21212118
msgid "Recommended: Network Manager for desktop, Manual for server"
21222119
msgstr "Рекомендовано: Network Manager для робочого столу, ручне налаштування для сервера"
21232120

2121+
msgid "Warning: no network configuration selected. Network will need to be set up manually on the installed system."
2122+
msgstr "Попередження: конфігурацію мережі не обрано. Мережу доведеться налаштувати вручну на встановленій системі."
2123+
21242124
msgid "No packages found"
21252125
msgstr "Пакети не знайдено"
21262126

archinstall/scripts/guided.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def main(arch_config_handler: ArchConfigHandler | None = None) -> None:
216216

217217
if not arch_config_handler.args.silent:
218218
aborted = False
219-
res: bool = tui.run(config.confirm_config)
219+
res: bool = tui.run(lambda: config.confirm_config(show_install_warnings=True))
220220

221221
if not res:
222222
debug('Installation aborted')

archinstall/scripts/minimal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ async def main(arch_config_handler: ArchConfigHandler | None = None) -> None:
7777

7878
if not arch_config_handler.args.silent:
7979
aborted = False
80-
res: bool = tui.run(config.confirm_config)
80+
res: bool = tui.run(lambda: config.confirm_config(show_install_warnings=True))
8181

8282
if not res:
8383
debug('Installation aborted')

0 commit comments

Comments
 (0)