| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 |
|
| 19 | (define-module (gnu installer newt parameters)
|
| 20 | #:use-module (gnu installer proxy)
|
| 21 | #:use-module (gnu installer steps)
|
| 22 | #:use-module (gnu installer newt page)
|
| 23 | #:use-module (guix build syscalls)
|
| 24 | #:use-module (guix i18n)
|
| 25 | #:use-module (ice-9 match)
|
| 26 | #:export (run-parameters-page))
|
| 27 |
|
| 28 | (define (run-proxy-page)
|
| 29 | (define proxy
|
| 30 | (run-input-page (G_ "Please enter the HTTP proxy URL. If you enter an \
|
| 31 | empty string, proxy usage will be disabled.")
|
| 32 | (G_ "HTTP proxy configuration")
|
| 33 | #:allow-empty-input? #t))
|
| 34 | (if (string=? proxy "")
|
| 35 | (clear-http-proxy)
|
| 36 | (set-http-proxy proxy)))
|
| 37 |
|
| 38 | (define (run-parameters-page keyboard-layout-selection)
|
| 39 | "Run a parameters page allowing to change the keyboard layout"
|
| 40 | (let* ((items
|
| 41 | (list
|
| 42 | (cons (G_ "Change keyboard layout") keyboard-layout-selection)
|
| 43 | (cons (G_ "Configure HTTP proxy") run-proxy-page)
|
| 44 | (cons (G_ "Reboot") reboot)))
|
| 45 | (result
|
| 46 | (run-listbox-selection-page
|
| 47 | #:info-text (G_ "Please choose one of the following parameters or \
|
| 48 | press ‘Back’ to go back to the installation process.")
|
| 49 | #:title (G_ "Installation parameters")
|
| 50 | #:listbox-items items
|
| 51 | #:listbox-item->text car
|
| 52 | #:sort-listbox-items? #f
|
| 53 | #:listbox-height 6
|
| 54 | #:button-text (G_ "Back"))))
|
| 55 | (match result
|
| 56 | ((_ . proc)
|
| 57 | (proc))
|
| 58 | (_ #f))))
|