Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/profile
diff options
context:
space:
mode:
authorDaniel Girtler <girtler.daniel@gmail.com>2024-03-08 00:43:51 +1100
committerGitHub <noreply@github.com>2024-03-07 14:43:51 +0100
commit08a6d402c4792cae95aec196460dc67aadd86f3c (patch)
treea646e7f2366387750208bbd25d4e06b0f191d9d3 /archinstall/lib/profile
parentf927fb6e6a17123c05c6595bbdb45ed771596ab9 (diff)
Fix 2215 | Display installed packages for all profile submenus (#2355)
* Display all packages to be installed * Display all packages to be installed
Diffstat (limited to 'archinstall/lib/profile')
-rw-r--r--archinstall/lib/profile/profile_menu.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/archinstall/lib/profile/profile_menu.py b/archinstall/lib/profile/profile_menu.py
index d9e47190..aba75a88 100644
--- a/archinstall/lib/profile/profile_menu.py
+++ b/archinstall/lib/profile/profile_menu.py
@@ -40,6 +40,7 @@ class ProfileMenu(AbstractSubMenu):
lambda preset: self._select_gfx_driver(preset),
display_func=lambda x: x.value if x else None,
dependencies=['profile'],
+ preview_func=self._preview_gfx,
default=self._preset.gfx_driver if self._preset.profile and self._preset.profile.is_graphic_driver_supported() else None,
enabled=self._preset.profile.is_graphic_driver_supported() if self._preset.profile else False
)
@@ -67,6 +68,7 @@ class ProfileMenu(AbstractSubMenu):
def _select_profile(self, preset: Optional[Profile]) -> Optional[Profile]:
profile = select_profile(preset)
+
if profile is not None:
if not profile.is_graphic_driver_supported():
self._menu_options['gfx_driver'].set_enabled(False)
@@ -105,12 +107,28 @@ class ProfileMenu(AbstractSubMenu):
return driver
+ def _preview_gfx(self) -> Optional[str]:
+ driver: Optional[GfxDriver] = self._menu_options['gfx_driver'].current_selection
+
+ if driver:
+ return driver.packages_text()
+
+ return None
+
def _preview_profile(self) -> Optional[str]:
profile: Optional[Profile] = self._menu_options['profile'].current_selection
+ text = ''
if profile:
- names = profile.current_selection_names()
- return '\n'.join(names)
+ if (sub_profiles := profile.current_selection) is not None:
+ text += str(_('Selected profiles: '))
+ text += ', '.join([p.name for p in sub_profiles]) + '\n'
+
+ if packages := profile.packages_text(include_sub_packages=True):
+ text += f'{packages}'
+
+ if text:
+ return text
return None