installer: Recommended services are pre-selected.

* gnu/installer/services.scm (<system-service>)[recommended?]: New
field.
* gnu/installer/newt/services.scm (run-desktop-environments-cbt-page):
Pass #:selection to 'run-checkbox-tree-page', computed from the
'recommended?' field of each service.
(run-networking-cbt-page): Likewise.
This commit is contained in:
Ludovic Courtès 2019-04-28 21:45:16 +02:00
parent 7253c2b629
commit 1d9fcdacf9
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
2 changed files with 32 additions and 24 deletions

View File

@ -31,36 +31,40 @@
(define (run-desktop-environments-cbt-page) (define (run-desktop-environments-cbt-page)
"Run a page allowing the user to choose between various desktop "Run a page allowing the user to choose between various desktop
environments." environments."
(run-checkbox-tree-page (let ((items (filter desktop-system-service? %system-services)))
#:info-text (G_ "Please select the desktop(s) environment(s) you wish to \ (run-checkbox-tree-page
#:info-text (G_ "Please select the desktop(s) environment(s) you wish to \
install. If you select multiple desktops environments, you will be able to \ install. If you select multiple desktops environments, you will be able to \
choose the one to use on the log-in screen.") choose the one to use on the log-in screen.")
#:title (G_ "Desktop environment") #:title (G_ "Desktop environment")
#:items (filter desktop-system-service? %system-services) #:items items
#:item->text system-service-name ;no i18n for DE names #:selection (map system-service-recommended? items)
#:checkbox-tree-height 5 #:item->text system-service-name ;no i18n for DE names
#:exit-button-callback-procedure #:checkbox-tree-height 8
(lambda () #:exit-button-callback-procedure
(raise (lambda ()
(condition (raise
(&installer-step-abort)))))) (condition
(&installer-step-abort)))))))
(define (run-networking-cbt-page) (define (run-networking-cbt-page)
"Run a page allowing the user to select networking services." "Run a page allowing the user to select networking services."
(run-checkbox-tree-page (let ((items (filter (lambda (service)
#:info-text (G_ "You can now select networking services to run on your \ (eq? 'networking (system-service-type service)))
%system-services)))
(run-checkbox-tree-page
#:info-text (G_ "You can now select networking services to run on your \
system.") system.")
#:title (G_ "Network service") #:title (G_ "Network service")
#:items (filter (lambda (service) #:items items
(eq? 'networking (system-service-type service))) #:selection (map system-service-recommended? items)
%system-services) #:item->text (compose G_ system-service-name)
#:item->text (compose G_ system-service-name) #:checkbox-tree-height 5
#:checkbox-tree-height 5 #:exit-button-callback-procedure
#:exit-button-callback-procedure (lambda ()
(lambda () (raise
(raise (condition
(condition (&installer-step-abort)))))))
(&installer-step-abort))))))
(define (run-network-management-page) (define (run-network-management-page)
"Run a page to select among several network management methods." "Run a page to select among several network management methods."

View File

@ -23,7 +23,9 @@
#:export (system-service? #:export (system-service?
system-service-name system-service-name
system-service-type system-service-type
system-service-recommended?
system-service-snippet system-service-snippet
system-service-packages
desktop-system-service? desktop-system-service?
networking-system-service? networking-system-service?
@ -36,6 +38,8 @@
system-service? system-service?
(name system-service-name) ;string (name system-service-name) ;string
(type system-service-type) ;'desktop | 'networking (type system-service-type) ;'desktop | 'networking
(recommended? system-service-recommended? ;Boolean
(default #f))
(snippet system-service-snippet ;list of sexps (snippet system-service-snippet ;list of sexps
(default '())) (default '()))
(packages system-service-packages ;list of sexps (packages system-service-packages ;list of sexps