installer: Show, don't Hide.

* gnu/installer/newt/user.scm (run-user-add-page): Change the input
visibility checkbox's text to ‘Show’, and default to unchecked.
* gnu/installer/newt/page.scm (run-input-page): Likewise.
Rename INPUT-HIDE-CHECKBOX? argument to INPUT-VISIBILITY-CHECKBOX?.
This commit is contained in:
Tobias Geerinckx-Rice 2019-06-08 05:04:36 +02:00
parent f27cb0f1dd
commit 55c43108ac
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79
2 changed files with 9 additions and 7 deletions

View File

@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -75,7 +76,7 @@ this page to TITLE."
#:key #:key
(allow-empty-input? #f) (allow-empty-input? #f)
(default-text #f) (default-text #f)
(input-hide-checkbox? #f) (input-visibility-checkbox? #f)
(input-field-width 40) (input-field-width 40)
(input-flags 0)) (input-flags 0))
"Run a page to prompt user for an input. The given TEXT will be displayed "Run a page to prompt user for an input. The given TEXT will be displayed
@ -88,8 +89,8 @@ input box, such as FLAG-PASSWORD."
input-field-width input-field-width
#:flags FLAG-BORDER)) #:flags FLAG-BORDER))
(input-visible-cb (input-visible-cb
(make-checkbox -1 -1 (G_ "Hide") #\x "x ")) (make-checkbox -1 -1 (G_ "Show") #\space "x "))
(input-flags* (if input-hide-checkbox? (input-flags* (if input-visibility-checkbox?
(logior FLAG-PASSWORD FLAG-SCROLL (logior FLAG-PASSWORD FLAG-SCROLL
input-flags) input-flags)
input-flags)) input-flags))
@ -102,7 +103,7 @@ input box, such as FLAG-PASSWORD."
(apply (apply
horizontal-stacked-grid horizontal-stacked-grid
GRID-ELEMENT-COMPONENT input-entry GRID-ELEMENT-COMPONENT input-entry
`(,@(if input-hide-checkbox? `(,@(if input-visibility-checkbox?
(list GRID-ELEMENT-COMPONENT input-visible-cb) (list GRID-ELEMENT-COMPONENT input-visible-cb)
'()))) '())))
GRID-ELEMENT-COMPONENT ok-button)) GRID-ELEMENT-COMPONENT ok-button))

View File

@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -55,7 +56,7 @@ REAL-NAME, and HOME-DIRECTORY as the initial values in the form."
(entry-home-directory (make-entry -1 -1 entry-width (entry-home-directory (make-entry -1 -1 entry-width
#:initial-value home-directory)) #:initial-value home-directory))
(password-visible-cb (password-visible-cb
(make-checkbox -1 -1 (G_ "Hide") #\x "x ")) (make-checkbox -1 -1 (G_ "Show") #\space "x "))
(entry-password (make-entry -1 -1 entry-width (entry-password (make-entry -1 -1 entry-width
#:flags (logior FLAG-PASSWORD #:flags (logior FLAG-PASSWORD
FLAG-SCROLL))) FLAG-SCROLL)))
@ -156,7 +157,7 @@ a thunk, if the confirmation doesn't match PASSWORD, and return its result."
(run-input-page (G_ "Please confirm the password.") (run-input-page (G_ "Please confirm the password.")
(G_ "Password confirmation required") (G_ "Password confirmation required")
#:allow-empty-input? #t #:allow-empty-input? #t
#:input-hide-checkbox? #t)) #:input-visibility-checkbox? #t))
(if (string=? password confirmation) (if (string=? password confirmation)
password password
@ -173,7 +174,7 @@ a thunk, if the confirmation doesn't match PASSWORD, and return its result."
(run-input-page (G_ "Please choose a password for the system \ (run-input-page (G_ "Please choose a password for the system \
administrator (\"root\").") administrator (\"root\").")
(G_ "System administrator password") (G_ "System administrator password")
#:input-hide-checkbox? #t)) #:input-visibility-checkbox? #t))
(confirm-password password run-root-password-page)) (confirm-password password run-root-password-page))