installer: network: Do not show an empty technology list.

If no technology is detected, ask the user if he prefers to continue or to
exit the installer.

* gnu/installer/newt/network.scm (run-technology-page): Run a choice-window if
technology-items procedure returns an empty list.
This commit is contained in:
Mathieu Othacehe 2018-12-05 21:58:26 +09:00 committed by Ludovic Courtès
parent 9e58d4e90e
commit 77c00b1e57
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 26 additions and 12 deletions

View File

@ -53,18 +53,32 @@ Internet and return the selected technology. For now, only technologies with
(string=? type "wifi")))) (string=? type "wifi"))))
(connman-technologies))) (connman-technologies)))
(let ((items (technology-items)))
(if (null? items)
(case (choice-window
(G_ "Internet access")
(G_ "Continue")
(G_ "Exit")
(G_ "The install process requires an internet access, but no \
network device were found. Do you want to continue anyway?"))
((1) (raise
(condition
(&installer-step-break))))
((2) (raise
(condition
(&installer-step-abort)))))
(run-listbox-selection-page (run-listbox-selection-page
#:info-text (G_ "The install process requires an internet access.\ #:info-text (G_ "The install process requires an internet access.\
Please select a network technology.") Please select a network device.")
#:title (G_ "Internet access") #:title (G_ "Internet access")
#:listbox-items (technology-items) #:listbox-items items
#:listbox-item->text technology->text #:listbox-item->text technology->text
#:button-text (G_ "Exit") #:button-text (G_ "Exit")
#:button-callback-procedure #:button-callback-procedure
(lambda _ (lambda _
(raise (raise
(condition (condition
(&installer-step-abort)))))) (&installer-step-abort))))))))
(define (find-technology-by-type technologies type) (define (find-technology-by-type technologies type)
"Find and return a technology with the given TYPE in TECHNOLOGIES list." "Find and return a technology with the given TYPE in TECHNOLOGIES list."