diff options
| author | Mathieu Othacehe <m.othacehe@gmail.com> | 2018-12-05 14:36:22 +0900 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2019-01-17 14:04:23 +0100 |
| commit | c088b2e47f6675199f1ef545df7d04d4532e64e3 (patch) | |
| tree | 335f80e187ea1da73fbb39a1ca296166e714db90 /gnu/installer | |
| parent | dc5f3275ecbddc804875899e9e457299a835d7ab (diff) | |
installer: Do not ask for keyboard model.
Suppose that the keyboard model is "pc105".
* gnu/installer.scm (apply-keymap): Remove model ...
* gnu/installer/newt/keymap.scm (run-keymap-page): passed here.
(run-model-page): remove procedure
* gnu/installer/record.scm (installer): Edit keymap-page prototype in comment.
* gnu/installer/keymap.scm (default-keyboard-model): New exported parameter.
Diffstat (limited to 'gnu/installer')
| -rw-r--r-- | gnu/installer/keymap.scm | 4 | ||||
| -rw-r--r-- | gnu/installer/newt.scm | 5 | ||||
| -rw-r--r-- | gnu/installer/newt/keymap.scm | 44 | ||||
| -rw-r--r-- | gnu/installer/newt/locale.scm | 6 | ||||
| -rw-r--r-- | gnu/installer/record.scm | 2 |
5 files changed, 16 insertions, 45 deletions
diff --git a/gnu/installer/keymap.scm b/gnu/installer/keymap.scm index 78065aa6c62..d9f8656855d 100644 --- a/gnu/installer/keymap.scm +++ b/gnu/installer/keymap.scm | |||
| @@ -46,6 +46,7 @@ | |||
| 46 | x11-keymap-variant-name | 46 | x11-keymap-variant-name |
| 47 | x11-keymap-variant-description | 47 | x11-keymap-variant-description |
| 48 | 48 | ||
| 49 | default-keyboard-model | ||
| 49 | xkb-rules->models+layouts | 50 | xkb-rules->models+layouts |
| 50 | kmscon-update-keymap)) | 51 | kmscon-update-keymap)) |
| 51 | 52 | ||
| @@ -68,6 +69,9 @@ | |||
| 68 | (name x11-keymap-variant-name) ;string | 69 | (name x11-keymap-variant-name) ;string |
| 69 | (description x11-keymap-variant-description)) ;string | 70 | (description x11-keymap-variant-description)) ;string |
| 70 | 71 | ||
| 72 | ;; Assume all modern keyboards have this model. | ||
| 73 | (define default-keyboard-model (make-parameter "pc105")) | ||
| 74 | |||
| 71 | (define (xkb-rules->models+layouts file) | 75 | (define (xkb-rules->models+layouts file) |
| 72 | "Parse FILE and return two values, the list of supported X11-KEYMAP-MODEL | 76 | "Parse FILE and return two values, the list of supported X11-KEYMAP-MODEL |
| 73 | and X11-KEYMAP-LAYOUT records. FILE is an XML file from the X Keyboard | 77 | and X11-KEYMAP-LAYOUT records. FILE is an XML file from the X Keyboard |
diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index 77a7e6dca2e..1f51b111a89 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm | |||
| @@ -68,9 +68,8 @@ | |||
| 68 | (define (menu-page steps) | 68 | (define (menu-page steps) |
| 69 | (run-menu-page steps)) | 69 | (run-menu-page steps)) |
| 70 | 70 | ||
| 71 | (define* (keymap-page #:key models layouts) | 71 | (define* (keymap-page layouts) |
| 72 | (run-keymap-page #:models models | 72 | (run-keymap-page layouts)) |
| 73 | #:layouts layouts)) | ||
| 74 | 73 | ||
| 75 | (define (network-page) | 74 | (define (network-page) |
| 76 | (run-network-page)) | 75 | (run-network-page)) |
diff --git a/gnu/installer/newt/keymap.scm b/gnu/installer/newt/keymap.scm index 0c9432bba2a..0c38a79e198 100644 --- a/gnu/installer/newt/keymap.scm +++ b/gnu/installer/newt/keymap.scm | |||
| @@ -56,43 +56,13 @@ | |||
| 56 | (condition | 56 | (condition |
| 57 | (&installer-step-abort))))))) | 57 | (&installer-step-abort))))))) |
| 58 | 58 | ||
| 59 | (define (run-model-page models model->text) | 59 | (define* (run-keymap-page layouts) |
| 60 | (let ((title (G_ "Keyboard model selection"))) | 60 | "Run a page asking the user to select a keyboard layout and variant. LAYOUTS |
| 61 | (run-listbox-selection-page | 61 | is a list of supported X11-KEYMAP-LAYOUT. Return a list of two elements, the |
| 62 | #:title title | 62 | names of the selected keyboard layout and variant." |
| 63 | #:info-text (G_ "Please choose your keyboard model.") | ||
| 64 | #:listbox-items models | ||
| 65 | #:listbox-item->text model->text | ||
| 66 | #:listbox-default-item (find (lambda (model) | ||
| 67 | (string=? (x11-keymap-model-name model) | ||
| 68 | "pc105")) | ||
| 69 | models) | ||
| 70 | #:sort-listbox-items? #f | ||
| 71 | #:button-text (G_ "Back") | ||
| 72 | #:button-callback-procedure | ||
| 73 | (lambda _ | ||
| 74 | (raise | ||
| 75 | (condition | ||
| 76 | (&installer-step-abort))))))) | ||
| 77 | |||
| 78 | (define* (run-keymap-page #:key models layouts) | ||
| 79 | "Run a page asking the user to select a keyboard model, layout and | ||
| 80 | variant. MODELS and LAYOUTS are lists of supported X11-KEYMAP-MODEL and | ||
| 81 | X11-KEYMAP-LAYOUT. Return a list of three elements, the names of the selected | ||
| 82 | keyboard model, layout and variant." | ||
| 83 | (define keymap-steps | 63 | (define keymap-steps |
| 84 | (list | 64 | (list |
| 85 | (installer-step | 65 | (installer-step |
| 86 | (id 'model) | ||
| 87 | (compute | ||
| 88 | (lambda _ | ||
| 89 | ;; TODO: Understand why (run-model-page models x11-keymap-model-name) | ||
| 90 | ;; fails with: warning: possibly unbound variable | ||
| 91 | ;; `%x11-keymap-model-description-procedure. | ||
| 92 | (run-model-page models (lambda (model) | ||
| 93 | (x11-keymap-model-description | ||
| 94 | model)))))) | ||
| 95 | (installer-step | ||
| 96 | (id 'layout) | 66 | (id 'layout) |
| 97 | (compute | 67 | (compute |
| 98 | (lambda _ | 68 | (lambda _ |
| @@ -120,13 +90,11 @@ keyboard model, layout and variant." | |||
| 120 | variant))))))))) | 90 | variant))))))))) |
| 121 | 91 | ||
| 122 | (define (format-result result) | 92 | (define (format-result result) |
| 123 | (let ((model (x11-keymap-model-name | 93 | (let ((layout (x11-keymap-layout-name |
| 124 | (result-step result 'model))) | ||
| 125 | (layout (x11-keymap-layout-name | ||
| 126 | (result-step result 'layout))) | 94 | (result-step result 'layout))) |
| 127 | (variant (and=> (result-step result 'variant) | 95 | (variant (and=> (result-step result 'variant) |
| 128 | (lambda (variant) | 96 | (lambda (variant) |
| 129 | (x11-keymap-variant-name variant))))) | 97 | (x11-keymap-variant-name variant))))) |
| 130 | (list model layout (or variant "")))) | 98 | (list layout (or variant "")))) |
| 131 | (format-result | 99 | (format-result |
| 132 | (run-installer-steps #:steps keymap-steps))) | 100 | (run-installer-steps #:steps keymap-steps))) |
diff --git a/gnu/installer/newt/locale.scm b/gnu/installer/newt/locale.scm index 599a6b0ecfa..028372c1941 100644 --- a/gnu/installer/newt/locale.scm +++ b/gnu/installer/newt/locale.scm | |||
| @@ -143,7 +143,7 @@ glibc locale string and return it." | |||
| 143 | (installer-step | 143 | (installer-step |
| 144 | (id 'territory) | 144 | (id 'territory) |
| 145 | (compute | 145 | (compute |
| 146 | (lambda (result) | 146 | (lambda (result _) |
| 147 | (let ((locales (filter-locales supported-locales result))) | 147 | (let ((locales (filter-locales supported-locales result))) |
| 148 | ;; Stop the process if the language returned by the previous step | 148 | ;; Stop the process if the language returned by the previous step |
| 149 | ;; is matching one and only one supported locale. | 149 | ;; is matching one and only one supported locale. |
| @@ -161,7 +161,7 @@ glibc locale string and return it." | |||
| 161 | (installer-step | 161 | (installer-step |
| 162 | (id 'codeset) | 162 | (id 'codeset) |
| 163 | (compute | 163 | (compute |
| 164 | (lambda (result) | 164 | (lambda (result _) |
| 165 | (let ((locales (filter-locales supported-locales result))) | 165 | (let ((locales (filter-locales supported-locales result))) |
| 166 | ;; Same as above but we now have a language and a territory to | 166 | ;; Same as above but we now have a language and a territory to |
| 167 | ;; narrow down the search of a locale. | 167 | ;; narrow down the search of a locale. |
| @@ -173,7 +173,7 @@ glibc locale string and return it." | |||
| 173 | (installer-step | 173 | (installer-step |
| 174 | (id 'modifier) | 174 | (id 'modifier) |
| 175 | (compute | 175 | (compute |
| 176 | (lambda (result) | 176 | (lambda (result _) |
| 177 | (let ((locales (filter-locales supported-locales result))) | 177 | (let ((locales (filter-locales supported-locales result))) |
| 178 | ;; Same thing with a language, a territory and a codeset this time. | 178 | ;; Same thing with a language, a territory and a codeset this time. |
| 179 | (break-on-locale-found locales) | 179 | (break-on-locale-found locales) |
diff --git a/gnu/installer/record.scm b/gnu/installer/record.scm index bf740406996..ba7625e65a5 100644 --- a/gnu/installer/record.scm +++ b/gnu/installer/record.scm | |||
| @@ -57,9 +57,9 @@ | |||
| 57 | (exit installer-exit) | 57 | (exit installer-exit) |
| 58 | ;; procedure (key arguments) -> void | 58 | ;; procedure (key arguments) -> void |
| 59 | (exit-error installer-exit-error) | 59 | (exit-error installer-exit-error) |
| 60 | ;; procedure (#:key models layouts) -> (list model layout variant) | ||
| 61 | ;; procedure void -> void | 60 | ;; procedure void -> void |
| 62 | (final-page installer-final-page) | 61 | (final-page installer-final-page) |
| 62 | ;; procedure (layouts) -> (list layout variant) | ||
| 63 | (keymap-page installer-keymap-page) | 63 | (keymap-page installer-keymap-page) |
| 64 | ;; procedure: (#:key supported-locales iso639-languages iso3166-territories) | 64 | ;; procedure: (#:key supported-locales iso639-languages iso3166-territories) |
| 65 | ;; -> glibc-locale | 65 | ;; -> glibc-locale |
