Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/menu/selection_menu.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/menu/selection_menu.py')
-rw-r--r--archinstall/lib/menu/selection_menu.py39
1 files changed, 13 insertions, 26 deletions
diff --git a/archinstall/lib/menu/selection_menu.py b/archinstall/lib/menu/selection_menu.py
index a82e8a70..14278999 100644
--- a/archinstall/lib/menu/selection_menu.py
+++ b/archinstall/lib/menu/selection_menu.py
@@ -313,15 +313,6 @@ class GeneralMenu:
if exec_ret_val and self._check_mandatory_status():
return False
return True
- """ old behaviour
- # we allow for a callback after we get the result
- self.post_callback(selector_name,result)
- # we have a callback, by option, to determine if we can exit the menu. Only if ALL mandatory fields are written
- if selector.exec_func:
- if selector.exec_func(result) and self._check_mandatory_status():
- return False
- """
- return True
def _set_kb_language(self):
""" general for ArchInstall"""
@@ -474,9 +465,9 @@ class GlobalMenu(GeneralMenu):
self._menu_options['!superusers'] = \
Selector(
_('Specify superuser account'),
- lambda x: self._create_superuser_account(),
+ lambda: self._create_superuser_account(),
dependencies_not=['!root-password'],
- display_func=lambda x: list(x.keys()) if x else '')
+ display_func=lambda x: self._display_superusers())
self._menu_options['!users'] = \
Selector(
_('Specify user account'),
@@ -564,8 +555,6 @@ class GlobalMenu(GeneralMenu):
missing += 1
if not check('audio'):
missing += 1
- if not check('timezone'):
- missing += 1
if not check('!root-password') and not check('!superusers'):
missing += 1
if not check('harddrives'):
@@ -579,14 +568,6 @@ class GlobalMenu(GeneralMenu):
def _set_root_password(self):
prompt = str(_('Enter root password (leave blank to disable root): '))
password = get_password(prompt=prompt)
-
- # TODO: Do we really wanna wipe the !superusers and !users if root password is set?
- # What if they set a superuser first, but then decides to set a root password?
- if password is not None:
- self._menu_options.get('!superusers').set_current_selection(None)
- storage['arguments']['!users'] = {}
- storage['arguments']['!superusers'] = {}
-
return password
def _select_encrypted_password(self):
@@ -640,11 +621,17 @@ class GlobalMenu(GeneralMenu):
return profile
def _create_superuser_account(self):
- superuser = ask_for_superuser_account(str(_('Create a required super-user with sudo privileges: ')), forced=True)
- return superuser
+ superusers = ask_for_superuser_account(str(_('Enter a username to create an additional superuser (leave blank to skip): ')))
+ return superusers if superusers else None
def _create_user_account(self):
- users, superusers = ask_for_additional_users(str(_('Enter a username to create an additional user (leave blank to skip): ')))
- storage['arguments']['!superusers'] = {**storage['arguments'].get('!superusers', {}), **superusers}
-
+ users = ask_for_additional_users(str(_('Enter a username to create an additional user (leave blank to skip): ')))
return users
+
+ def _display_superusers(self):
+ superusers = self._data_store.get('!superusers', {})
+
+ if self._menu_options.get('!root-password').has_selection():
+ return list(superusers.keys()) if superusers else '[]'
+ else:
+ return list(superusers.keys()) if superusers else ''