[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
174/197: installer: Provide the ability to add new users.
From: |
Danny Milosavljevic |
Subject: |
174/197: installer: Provide the ability to add new users. |
Date: |
Mon, 3 Jul 2017 20:37:20 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 3f252a57ab7960beca350a8366a372d32d5e7718
Author: John Darrington <address@hidden>
Date: Tue Feb 7 09:09:12 2017 +0100
installer: Provide the ability to add new users.
* gnu/system/installer/misc.scm (users) : Delete test data.
* gnu/system/installer/user-edit.scm (user-edit-page-init): Do not
initialise fields if the account is #f.
* gnu/system/installer/users.scm (users-page-key-handler): Add handler
for the "add" button.
---
gnu/system/installer/misc.scm | 17 +----------------
gnu/system/installer/user-edit.scm | 26 ++++++++++++++------------
gnu/system/installer/users.scm | 9 ++++++---
3 files changed, 21 insertions(+), 31 deletions(-)
diff --git a/gnu/system/installer/misc.scm b/gnu/system/installer/misc.scm
index c3cc93c..f1d1ac7 100644
--- a/gnu/system/installer/misc.scm
+++ b/gnu/system/installer/misc.scm
@@ -75,19 +75,4 @@
(t . ,normal)))
-(define users
- (list
- (user-account
- (name "fred")
- (supplementary-groups '("video" "audio" "desktop"))
- (group "users")
- (comment "Fred Bloggs")
- (home-directory "/home/empty")
- )
-
- (user-account
- (name "john")
- (group "users")
- (comment "John Darrington")
- (home-directory "/home/john")
- )))
+(define users '())
diff --git a/gnu/system/installer/user-edit.scm
b/gnu/system/installer/user-edit.scm
index 27b8c2e..b3f62d6 100644
--- a/gnu/system/installer/user-edit.scm
+++ b/gnu/system/installer/user-edit.scm
@@ -35,13 +35,14 @@
(name ,(M_ "User Name") 40)
(home ,(M_ "Home Directory") 16)))
-(define (make-user-edit-page parent title)
+(define (make-user-edit-page parent title account)
(let ((page (make-page (page-surface parent)
title
user-edit-refresh
1
user-edit-page-key-handler)))
+ (page-set-datum! page 'account account)
(page-set-datum! page 'parent parent)
page))
@@ -132,18 +133,19 @@
(page-set-datum! p 'navigation nav)
- (addstr*
- text-window
- (format #f
- (gettext
- "The user is currently with properties as follows. You may
change any of the details here as required.")))
-
- (form-post form fw)
-
(let ((acc (page-datum p 'account)))
- (form-set-value! form 'name (user-account-name acc))
- (form-set-value! form 'comment (user-account-comment acc))
- (form-set-value! form 'home (user-account-home-directory acc)))
+ (addstr*
+ text-window
+ (if acc
+ (format #f (M_ "This user account currently has the following details.
You may change any details here as required."))
+ (format #f (M_ "Enter the details of the new user below."))))
+
+ (form-post form fw)
+
+ (when acc
+ (form-set-value! form 'name (user-account-name acc))
+ (form-set-value! form 'comment (user-account-comment acc))
+ (form-set-value! form 'home (user-account-home-directory acc))))
(push-cursor (page-cursor-visibility p))
(buttons-post nav bwin)
diff --git a/gnu/system/installer/users.scm b/gnu/system/installer/users.scm
index 4234095..214d58a 100644
--- a/gnu/system/installer/users.scm
+++ b/gnu/system/installer/users.scm
@@ -78,10 +78,13 @@
(menu-set-active! menu #t))
((select-key? ch)
- (let* ((account (menu-get-current-item menu))
- (next (make-user-edit-page page "Edit User")))
+ (let* ((account (menu-get-current-item menu)))
+ (if account
+ (page-enter (make-user-edit-page page "Edit User"
account)))))
- (page-set-datum! next 'account account)
+ ((buttons-key-matches-symbol? nav ch 'add)
+ (let* (
+ (next (make-user-edit-page page "Add New User" #f)))
(page-enter next)))
((buttons-key-matches-symbol? nav ch 'continue)
- 154/197: installer: Main page: Redisplay translatable strings upon refresh., (continued)
- 154/197: installer: Main page: Redisplay translatable strings upon refresh., Danny Milosavljevic, 2017/07/03
- 157/197: installer: Replace 'file-browser' with 'key-map'., Danny Milosavljevic, 2017/07/03
- 161/197: installer: Improve i18n in ping page., Danny Milosavljevic, 2017/07/03
- 162/197: gurses: Avoid one use of car/cdr., Danny Milosavljevic, 2017/07/03
- 166/197: installer: Provide verbose description of locale., Danny Milosavljevic, 2017/07/03
- 167/197: installer: Fix bug when changing languages., Danny Milosavljevic, 2017/07/03
- 156/197: installer: New page to select language., Danny Milosavljevic, 2017/07/03
- 168/197: installer: Fix the startup locale., Danny Milosavljevic, 2017/07/03
- 173/197: installer: Remove whitespace., Danny Milosavljevic, 2017/07/03
- 01/197: gnu: Add graphical installer, Danny Milosavljevic, 2017/07/03
- 174/197: installer: Provide the ability to add new users.,
Danny Milosavljevic <=
- 178/197: installer: Infer likely entries for user accounts from the gecos field., Danny Milosavljevic, 2017/07/03
- 180/197: installer: Use a different mount-point for each install attempt., Danny Milosavljevic, 2017/07/03
- 183/197: installer: Specify a pid file for wpa_supplicant., Danny Milosavljevic, 2017/07/03
- 181/197: installer: Make the install attempts counter global., Danny Milosavljevic, 2017/07/03
- 186/197: installer: Return to network page after passphrase entry., Danny Milosavljevic, 2017/07/03
- 185/197: installer: Avoid flicker in network page., Danny Milosavljevic, 2017/07/03
- 169/197: installer: Add users page., Danny Milosavljevic, 2017/07/03
- 193/197: install: %installation-services: Make mingetty-service autologin to the installer., Danny Milosavljevic, 2017/07/03
- 196/197: installer: Add imports., Danny Milosavljevic, 2017/07/03
- 195/197: installer: Emit (gnu bootloader grub) import., Danny Milosavljevic, 2017/07/03