installer: Include empty variant in keyboard layout selection.
Previously for Azerbaijani, no Latin layout but only the Cyrillic variant could be selected. * gnu/installer/newt/keymap.scm (add-empty-variant): New procedure. (run-keymap-page): Use it to insert an empty variant.
This commit is contained in:
parent
91c231a222
commit
7bc71025cc
@ -104,14 +104,21 @@ different layout at any time from the parameters menu.")))
|
|||||||
(append (sort main layout<?)
|
(append (sort main layout<?)
|
||||||
(sort others layout<?)))))
|
(sort others layout<?)))))
|
||||||
|
|
||||||
|
(define (add-empty-variant variants)
|
||||||
|
"Prepend #f to VARIANTS so the user has the option to select no variant.
|
||||||
|
The resulting layout may be different from all other variants (e.g. for
|
||||||
|
Azerbaijani)."
|
||||||
|
(cons #f variants))
|
||||||
|
|
||||||
(define (sort-variants variants)
|
(define (sort-variants variants)
|
||||||
"Sort VARIANTS list by putting the international variant ahead and return it."
|
"Sort VARIANTS list by putting the international variant ahead and return it."
|
||||||
(call-with-values
|
(call-with-values
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(partition
|
(partition
|
||||||
(lambda (variant)
|
(lambda (variant)
|
||||||
(let ((name (x11-keymap-variant-name variant)))
|
(and variant
|
||||||
(string=? name "altgr-intl")))
|
(let ((name (x11-keymap-variant-name variant)))
|
||||||
|
(string=? name "altgr-intl"))))
|
||||||
variants))
|
variants))
|
||||||
(cut append <> <>)))
|
(cut append <> <>)))
|
||||||
|
|
||||||
@ -180,10 +187,14 @@ options."
|
|||||||
;; Return #f if the layout does not have any variant.
|
;; Return #f if the layout does not have any variant.
|
||||||
(and (not (null? variants))
|
(and (not (null? variants))
|
||||||
(run-variant-page
|
(run-variant-page
|
||||||
(sort-variants variants)
|
(sort-variants (add-empty-variant variants))
|
||||||
(lambda (variant)
|
(lambda (variant)
|
||||||
(gettext (x11-keymap-variant-description variant)
|
(if variant
|
||||||
"xkeyboard-config"))))))))))
|
(gettext (x11-keymap-variant-description variant)
|
||||||
|
"xkeyboard-config")
|
||||||
|
;; Text to opt for no variant at all:
|
||||||
|
(gettext (x11-keymap-layout-description layout)
|
||||||
|
"xkeyboard-config")))))))))))
|
||||||
|
|
||||||
(define (format-result result)
|
(define (format-result result)
|
||||||
(let ((layout (x11-keymap-layout-name
|
(let ((layout (x11-keymap-layout-name
|
||||||
|
Loading…
Reference in New Issue
Block a user