From d0f3a672dcbdfefd3556b6a21985ff0e35eed3be Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Fri, 16 Nov 2018 20:43:55 +0900 Subject: gnu: Add graphical installer support. * configure.ac: Require that guile-newt is available. * gnu/installer.scm: New file. * gnu/installer/aux-files/logo.txt: New file. * gnu/installer/build-installer.scm: New file. * gnu/installer/connman.scm: New file. * gnu/installer/keymap.scm: New file. * gnu/installer/locale.scm: New file. * gnu/installer/newt.scm: New file. * gnu/installer/newt/ethernet.scm: New file. * gnu/installer/newt/hostname.scm: New file. * gnu/installer/newt/keymap.scm: New file. * gnu/installer/newt/locale.scm: New file. * gnu/installer/newt/menu.scm: New file. * gnu/installer/newt/network.scm: New file. * gnu/installer/newt/page.scm: New file. * gnu/installer/newt/timezone.scm: New file. * gnu/installer/newt/user.scm: New file. * gnu/installer/newt/utils.scm: New file. * gnu/installer/newt/welcome.scm: New file. * gnu/installer/newt/wifi.scm: New file. * gnu/installer/steps.scm: New file. * gnu/installer/timezone.scm: New file. * gnu/installer/utils.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add previous files. * gnu/system.scm: Export %root-account. * gnu/system/install.scm (%installation-services): Use kmscon instead of linux VT for all tty. (installation-os)[users]: Add the graphical installer as shell of the root account. [packages]: Add font related packages. * po/guix/POTFILES.in: Add installer files. --- gnu/installer/newt/page.scm | 313 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 313 insertions(+) create mode 100644 gnu/installer/newt/page.scm (limited to 'gnu/installer/newt/page.scm') diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm new file mode 100644 index 0000000000..bcede3e333 --- /dev/null +++ b/gnu/installer/newt/page.scm @@ -0,0 +1,313 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2018 Mathieu Othacehe +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu installer newt page) + #:use-module (gnu installer newt utils) + #:use-module (guix i18n) + #:use-module (ice-9 match) + #:use-module (ice-9 receive) + #:use-module (newt) + #:export (draw-info-page + draw-connecting-page + run-input-page + run-error-page + run-listbox-selection-page + run-scale-page)) + +;;; Commentary: +;;; +;;; Some helpers around guile-newt to draw or run generic pages. The +;;; difference between 'draw' and 'run' terms comes from newt library. A page +;;; is drawn when the form it contains does not expect any user +;;; interaction. In that case, it is necessary to call (newt-refresh) to force +;;; the page to be displayed. When a form is 'run', it is blocked waiting for +;;; any action from the user (press a button, input some text, ...). +;;; +;;; Code: + +(define (draw-info-page text title) + "Draw an informative page with the given TEXT as content. Set the title of +this page to TITLE." + (let* ((text-box + (make-reflowed-textbox -1 -1 text 40 + #:flags FLAG-BORDER)) + (grid (make-grid 1 1)) + (form (make-form))) + (set-grid-field grid 0 0 GRID-ELEMENT-COMPONENT text-box) + (add-component-to-form form text-box) + (make-wrapped-grid-window grid title) + (draw-form form) + ;; This call is imperative, otherwise the form won't be displayed. See the + ;; explanation in the above commentary. + (newt-refresh) + form)) + +(define (draw-connecting-page service-name) + "Draw a page to indicate a connection in in progress." + (draw-info-page + (format #f (G_ "Connecting to ~a, please wait.") service-name) + (G_ "Connection in progress"))) + +(define* (run-input-page text title + #:key + (allow-empty-input? #f) + (input-field-width 40)) + "Run a page to prompt user for an input. The given TEXT will be displayed +above the input field. The page title is set to TITLE. Unless +allow-empty-input? is set to #t, an error page will be displayed if the user +enters an empty input." + (let* ((text-box + (make-reflowed-textbox -1 -1 text + input-field-width + #:flags FLAG-BORDER)) + (grid (make-grid 1 3)) + (input-entry (make-entry -1 -1 20)) + (ok-button (make-button -1 -1 (G_ "Ok"))) + (form (make-form))) + + (set-grid-field grid 0 0 GRID-ELEMENT-COMPONENT text-box) + (set-grid-field grid 0 1 GRID-ELEMENT-COMPONENT input-entry + #:pad-top 1) + (set-grid-field grid 0 2 GRID-ELEMENT-COMPONENT ok-button + #:pad-top 1) + + (add-components-to-form form text-box input-entry ok-button) + (make-wrapped-grid-window grid title) + (let ((error-page (lambda () + (run-error-page (G_ "Please enter a non empty input") + (G_ "Empty input"))))) + (let loop () + (receive (exit-reason argument) + (run-form form) + (let ((input (entry-value input-entry))) + (if (and (not allow-empty-input?) + (eq? exit-reason 'exit-component) + (string=? input "")) + (begin + ;; Display the error page. + (error-page) + ;; Set the focus back to the input input field. + (set-current-component form input-entry) + (loop)) + (begin + (destroy-form-and-pop form) + input)))))))) + +(define (run-error-page text title) + "Run a page to inform the user of an error. The page contains the given TEXT +to explain the error and an \"OK\" button to acknowledge the error. The title +of the page is set to TITLE." + (let* ((text-box + (make-reflowed-textbox -1 -1 text 40 + #:flags FLAG-BORDER)) + (grid (make-grid 1 2)) + (ok-button (make-button -1 -1 "Ok")) + (form (make-form))) + + (set-grid-field grid 0 0 GRID-ELEMENT-COMPONENT text-box) + (set-grid-field grid 0 1 GRID-ELEMENT-COMPONENT ok-button + #:pad-top 1) + + ;; Set the background color to red to indicate something went wrong. + (newt-set-color COLORSET-ROOT "white" "red") + (add-components-to-form form text-box ok-button) + (make-wrapped-grid-window grid title) + (run-form form) + ;; Restore the background to its original color. + (newt-set-color COLORSET-ROOT "white" "blue") + (destroy-form-and-pop form))) + +(define* (run-listbox-selection-page #:key + info-text + title + (info-textbox-width 50) + listbox-items + listbox-item->text + (listbox-height 20) + (listbox-default-item #f) + (listbox-allow-multiple? #f) + (sort-listbox-items? #t) + button-text + (button-callback-procedure + (const #t)) + (listbox-callback-procedure + (const #t))) + "Run a page asking the user to select an item in a listbox. The page +contains, stacked vertically from the top to the bottom, an informative text +set to INFO-TEXT, a listbox and a button. The listbox will be filled with +LISTBOX-ITEMS converted to text by applying the procedure LISTBOX-ITEM->TEXT +on every item. The selected item from LISTBOX-ITEMS is returned. The button +text is set to BUTTON-TEXT and the procedure BUTTON-CALLBACK-PROCEDURE called +when it is pressed. The procedure LISTBOX-CALLBACK-PROCEDURE is called when an +item from the listbox is selected (by pressing the key). + +INFO-TEXTBOX-WIDTH is the width of the textbox where INFO-TEXT will be +displayed. LISTBOX-HEIGHT is the height of the listbox. + +If LISTBOX-DEFAULT-ITEM is set to the value of one of the items in +LISTBOX-ITEMS, it will be selected by default. Otherwise, the first element of +the listbox is selected. + +If LISTBOX-ALLOW-MULTIPLE? is set to #t, multiple items from the listbox can +be selected (using the key). It that case, a list containing the +selected items will be returned. + +If SORT-LISTBOX-ITEMS? is set to #t, the listbox items are sorted using +'string<=' procedure (after being converted to text)." + + (define (fill-listbox listbox items) + "Append the given ITEMS to LISTBOX, once they have been converted to text +with LISTBOX-ITEM->TEXT. Each item appended to the LISTBOX is given a key by +newt. Save this key by returning an association list under the form: + + ((NEWT-LISTBOX-KEY . ITEM) ...) + +where NEWT-LISTBOX-KEY is the key returned by APPEND-ENTRY-TO-LISTBOX, when +ITEM was inserted into LISTBOX." + (map (lambda (item) + (let* ((text (listbox-item->text item)) + (key (append-entry-to-listbox listbox text))) + (cons key item))) + items)) + + (define (sort-listbox-items listbox-items) + "Return LISTBOX-ITEMS sorted using the 'string<=' procedure on the text +corresponding to each item in the list." + (let* ((items (map (lambda (item) + (cons item (listbox-item->text item))) + listbox-items)) + (sorted-items + (sort items (lambda (a b) + (let ((text-a (cdr a)) + (text-b (cdr b))) + (string<= text-a text-b)))))) + (map car sorted-items))) + + (define (set-default-item listbox listbox-keys default-item) + "Set the default item of LISTBOX to DEFAULT-ITEM. LISTBOX-KEYS is the +association list returned by the FILL-LISTBOX procedure. It is used because +the current listbox item has to be selected by key." + (for-each (match-lambda + ((key . item) + (when (equal? item default-item) + (set-current-listbox-entry-by-key listbox key)))) + listbox-keys)) + + (let* ((listbox (make-listbox + -1 -1 + listbox-height + (logior FLAG-SCROLL FLAG-BORDER FLAG-RETURNEXIT + (if listbox-allow-multiple? + FLAG-MULTIPLE + 0)))) + (form (make-form)) + (info-textbox + (make-reflowed-textbox -1 -1 info-text + info-textbox-width + #:flags FLAG-BORDER)) + (button (make-button -1 -1 button-text)) + (grid (vertically-stacked-grid + GRID-ELEMENT-COMPONENT info-textbox + GRID-ELEMENT-COMPONENT listbox + GRID-ELEMENT-COMPONENT button)) + (sorted-items (if sort-listbox-items? + (sort-listbox-items listbox-items) + listbox-items)) + (keys (fill-listbox listbox sorted-items))) + + (when listbox-default-item + (set-default-item listbox keys listbox-default-item)) + + (add-form-to-grid grid form #t) + (make-wrapped-grid-window grid title) + + (receive (exit-reason argument) + (run-form form) + (dynamic-wind + (const #t) + (lambda () + (when (eq? exit-reason 'exit-component) + (cond + ((components=? argument button) + (button-callback-procedure)) + ((components=? argument listbox) + (if listbox-allow-multiple? + (let* ((entries (listbox-selection listbox)) + (items (map (lambda (entry) + (assoc-ref keys entry)) + entries))) + (listbox-callback-procedure items) + items) + (let* ((entry (current-listbox-entry listbox)) + (item (assoc-ref keys entry))) + (listbox-callback-procedure item) + item)))))) + (lambda () + (destroy-form-and-pop form)))))) + +(define* (run-scale-page #:key + title + info-text + (info-textbox-width 50) + (scale-width 40) + (scale-full-value 100) + scale-update-proc + (max-scale-update 5)) + "Run a page with a progress bar (called 'scale' in newt). The given +INFO-TEXT is displayed in a textbox above the scale. The width of the textbox +is set to INFO-TEXTBOX-WIDTH. The width of the scale is set to +SCALE-WIDTH. SCALE-FULL-VALUE indicates the value that correspond to 100% of +the scale. + +The procedure SCALE-UPDATE-PROC shall return a new scale +value. SCALE-UPDATE-PROC will be called until the returned value is superior +or equal to SCALE-FULL-VALUE, but no more than MAX-SCALE-UPDATE times. An +error is raised if the MAX-SCALE-UPDATE limit is reached." + (let* ((info-textbox + (make-reflowed-textbox -1 -1 info-text + info-textbox-width + #:flags FLAG-BORDER)) + (scale (make-scale -1 -1 scale-width scale-full-value)) + (grid (vertically-stacked-grid + GRID-ELEMENT-COMPONENT info-textbox + GRID-ELEMENT-COMPONENT scale)) + (form (make-form))) + + (add-form-to-grid grid form #t) + (make-wrapped-grid-window grid title) + + (draw-form form) + ;; This call is imperative, otherwise the form won't be displayed. See the + ;; explanation in the above commentary. + (newt-refresh) + + (dynamic-wind + (const #t) + (lambda () + (let loop ((i max-scale-update) + (last-value 0)) + (let ((value (scale-update-proc last-value))) + (set-scale-value scale value) + ;; Same as above. + (newt-refresh) + (unless (>= value scale-full-value) + (if (> i 0) + (loop (- i 1) value) + (error "Max scale updates reached.")))))) + (lambda () + (destroy-form-and-pop form))))) -- cgit v1.2.3 From 29d8d9196bcf7a87eeb891bfb35eb2447836bbeb Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Wed, 5 Dec 2018 14:47:49 +0900 Subject: installer: Add new pages. * gnu/installer/newt/page.scm (run-scale-page): New exported procedure, (run-checkbox-tree-page): ditto, (run-file-textbox-page): ditto. --- gnu/installer/newt/page.scm | 250 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 231 insertions(+), 19 deletions(-) (limited to 'gnu/installer/newt/page.scm') diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm index bcede3e333..10849b81eb 100644 --- a/gnu/installer/newt/page.scm +++ b/gnu/installer/newt/page.scm @@ -17,17 +17,22 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu installer newt page) + #:use-module (gnu installer utils) #:use-module (gnu installer newt utils) #:use-module (guix i18n) #:use-module (ice-9 match) #:use-module (ice-9 receive) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (newt) #:export (draw-info-page draw-connecting-page run-input-page run-error-page run-listbox-selection-page - run-scale-page)) + run-scale-page + run-checkbox-tree-page + run-file-textbox-page)) ;;; Commentary: ;;; @@ -66,6 +71,7 @@ this page to TITLE." (define* (run-input-page text title #:key (allow-empty-input? #f) + (default-text #f) (input-field-width 40)) "Run a page to prompt user for an input. The given TEXT will be displayed above the input field. The page title is set to TITLE. Unless @@ -80,6 +86,9 @@ enters an empty input." (ok-button (make-button -1 -1 (G_ "Ok"))) (form (make-form))) + (when default-text + (set-entry-text input-entry default-text)) + (set-grid-field grid 0 0 GRID-ELEMENT-COMPONENT text-box) (set-grid-field grid 0 1 GRID-ELEMENT-COMPONENT input-entry #:pad-top 1) @@ -142,10 +151,18 @@ of the page is set to TITLE." (listbox-default-item #f) (listbox-allow-multiple? #f) (sort-listbox-items? #t) + (allow-delete? #f) + (skip-item-procedure? + (const #f)) button-text (button-callback-procedure (const #t)) + (button2-text #f) + (button2-callback-procedure + (const #t)) (listbox-callback-procedure + identity) + (hotkey-callback-procedure (const #t))) "Run a page asking the user to select an item in a listbox. The page contains, stacked vertically from the top to the bottom, an informative text @@ -168,7 +185,15 @@ be selected (using the key). It that case, a list containing the selected items will be returned. If SORT-LISTBOX-ITEMS? is set to #t, the listbox items are sorted using -'string<=' procedure (after being converted to text)." +'string<=' procedure (after being converted to text). + +If ALLOW-DELETE? is #t, the form will return if the key is pressed, +otherwise nothing will happend. + +Each time the listbox current item changes, call SKIP-ITEM-PROCEDURE? with the +current listbox item as argument. If it returns #t, skip the element and jump +to the next/previous one depending on the previous item, otherwise do +nothing." (define (fill-listbox listbox items) "Append the given ITEMS to LISTBOX, once they have been converted to text @@ -198,6 +223,21 @@ corresponding to each item in the list." (string<= text-a text-b)))))) (map car sorted-items))) + ;; Store the last selected listbox item's key. + (define last-listbox-key (make-parameter #f)) + + (define (previous-key keys key) + (let ((index (list-index (cut eq? key <>) keys))) + (and index + (> index 0) + (list-ref keys (- index 1))))) + + (define (next-key keys key) + (let ((index (list-index (cut eq? key <>) keys))) + (and index + (< index (- (length keys) 1)) + (list-ref keys (+ index 1))))) + (define (set-default-item listbox listbox-keys default-item) "Set the default item of LISTBOX to DEFAULT-ITEM. LISTBOX-KEYS is the association list returned by the FILL-LISTBOX procedure. It is used because @@ -221,18 +261,55 @@ the current listbox item has to be selected by key." info-textbox-width #:flags FLAG-BORDER)) (button (make-button -1 -1 button-text)) + (button2 (and button2-text + (make-button -1 -1 button2-text))) (grid (vertically-stacked-grid GRID-ELEMENT-COMPONENT info-textbox GRID-ELEMENT-COMPONENT listbox - GRID-ELEMENT-COMPONENT button)) + GRID-ELEMENT-SUBGRID + (apply + horizontal-stacked-grid + GRID-ELEMENT-COMPONENT button + `(,@(if button2 + (list GRID-ELEMENT-COMPONENT button2) + '()))))) (sorted-items (if sort-listbox-items? (sort-listbox-items listbox-items) listbox-items)) (keys (fill-listbox listbox sorted-items))) + ;; On every listbox element change, check if we need to skip it. If yes, + ;; depending on the 'last-listbox-key', jump forward or backward. If no, + ;; do nothing. + (add-component-callback + listbox + (lambda (component) + (let* ((current-key (current-listbox-entry listbox)) + (listbox-keys (map car keys)) + (last-key (last-listbox-key)) + (item (assoc-ref keys current-key)) + (prev-key (previous-key listbox-keys current-key)) + (next-key (next-key listbox-keys current-key))) + ;; Update last-listbox-key before a potential call to + ;; set-current-listbox-entry-by-key, because it will immediately + ;; cause this callback to be called for the new entry. + (last-listbox-key current-key) + (when (skip-item-procedure? item) + (when (eq? prev-key last-key) + (if next-key + (set-current-listbox-entry-by-key listbox next-key) + (set-current-listbox-entry-by-key listbox prev-key))) + (when (eq? next-key last-key) + (if prev-key + (set-current-listbox-entry-by-key listbox prev-key) + (set-current-listbox-entry-by-key listbox next-key))))))) + (when listbox-default-item (set-default-item listbox keys listbox-default-item)) + (when allow-delete? + (form-add-hotkey form KEY-DELETE)) + (add-form-to-grid grid form #t) (make-wrapped-grid-window grid title) @@ -241,22 +318,28 @@ the current listbox item has to be selected by key." (dynamic-wind (const #t) (lambda () - (when (eq? exit-reason 'exit-component) - (cond - ((components=? argument button) - (button-callback-procedure)) - ((components=? argument listbox) - (if listbox-allow-multiple? - (let* ((entries (listbox-selection listbox)) - (items (map (lambda (entry) - (assoc-ref keys entry)) - entries))) - (listbox-callback-procedure items) - items) - (let* ((entry (current-listbox-entry listbox)) - (item (assoc-ref keys entry))) - (listbox-callback-procedure item) - item)))))) + (case exit-reason + ((exit-component) + (cond + ((components=? argument button) + (button-callback-procedure)) + ((and button2 + (components=? argument button2)) + (button2-callback-procedure)) + ((components=? argument listbox) + (if listbox-allow-multiple? + (let* ((entries (listbox-selection listbox)) + (items (map (lambda (entry) + (assoc-ref keys entry)) + entries))) + (listbox-callback-procedure items)) + (let* ((entry (current-listbox-entry listbox)) + (item (assoc-ref keys entry))) + (listbox-callback-procedure item)))))) + ((exit-hotkey) + (let* ((entry (current-listbox-entry listbox)) + (item (assoc-ref keys entry))) + (hotkey-callback-procedure argument item))))) (lambda () (destroy-form-and-pop form)))))) @@ -311,3 +394,132 @@ error is raised if the MAX-SCALE-UPDATE limit is reached." (error "Max scale updates reached.")))))) (lambda () (destroy-form-and-pop form))))) + +(define* (run-checkbox-tree-page #:key + info-text + title + items + item->text + (info-textbox-width 50) + (checkbox-tree-height 10) + (ok-button-callback-procedure + (const #t)) + (cancel-button-callback-procedure + (const #t))) + "Run a page allowing the user to select one or multiple items among ITEMS in +a checkbox list. The page contains vertically stacked from the top to the +bottom, an informative text set to INFO-TEXT, the checkbox list and two +buttons, 'Ok' and 'Cancel'. The page title's is set to TITLE. ITEMS are +converted to text using ITEM->TEXT before being displayed in the checkbox +list. + +INFO-TEXTBOX-WIDTH is the width of the textbox where INFO-TEXT will be +displayed. CHECKBOX-TREE-HEIGHT is the height of the checkbox list. + +OK-BUTTON-CALLBACK-PROCEDURE is called when the 'Ok' button is pressed. +CANCEL-BUTTON-CALLBACK-PROCEDURE is called when the 'Cancel' button is +pressed. + +This procedure returns the list of checked items in the checkbox list among +ITEMS when 'Ok' is pressed." + (define (fill-checkbox-tree checkbox-tree items) + (map + (lambda (item) + (let* ((item-text (item->text item)) + (key (add-entry-to-checkboxtree checkbox-tree item-text 0))) + (cons key item))) + items)) + + (let* ((checkbox-tree + (make-checkboxtree -1 -1 + checkbox-tree-height + FLAG-BORDER)) + (info-textbox + (make-reflowed-textbox -1 -1 info-text + info-textbox-width + #:flags FLAG-BORDER)) + (ok-button (make-button -1 -1 (G_ "Ok"))) + (cancel-button (make-button -1 -1 (G_ "Cancel"))) + (grid (vertically-stacked-grid + GRID-ELEMENT-COMPONENT info-textbox + GRID-ELEMENT-COMPONENT checkbox-tree + GRID-ELEMENT-SUBGRID + (horizontal-stacked-grid + GRID-ELEMENT-COMPONENT ok-button + GRID-ELEMENT-COMPONENT cancel-button))) + (keys (fill-checkbox-tree checkbox-tree items)) + (form (make-form))) + + (add-form-to-grid grid form #t) + (make-wrapped-grid-window grid title) + + (receive (exit-reason argument) + (run-form form) + (dynamic-wind + (const #t) + (lambda () + (case exit-reason + ((exit-component) + (cond + ((components=? argument ok-button) + (let* ((entries (current-checkbox-selection checkbox-tree)) + (current-items (map (lambda (entry) + (assoc-ref keys entry)) + entries))) + (ok-button-callback-procedure) + current-items)) + ((components=? argument cancel-button) + (cancel-button-callback-procedure)))))) + (lambda () + (destroy-form-and-pop form)))))) + +(define* (run-file-textbox-page #:key + info-text + title + file + (info-textbox-width 50) + (file-textbox-width 50) + (file-textbox-height 30) + (ok-button-callback-procedure + (const #t)) + (cancel-button-callback-procedure + (const #t))) + (let* ((info-textbox + (make-reflowed-textbox -1 -1 info-text + info-textbox-width + #:flags FLAG-BORDER)) + (file-text (read-all file)) + (file-textbox + (make-textbox -1 -1 + file-textbox-width + file-textbox-height + (logior FLAG-SCROLL FLAG-BORDER))) + (ok-button (make-button -1 -1 (G_ "Ok"))) + (cancel-button (make-button -1 -1 (G_ "Cancel"))) + (grid (vertically-stacked-grid + GRID-ELEMENT-COMPONENT info-textbox + GRID-ELEMENT-COMPONENT file-textbox + GRID-ELEMENT-SUBGRID + (horizontal-stacked-grid + GRID-ELEMENT-COMPONENT ok-button + GRID-ELEMENT-COMPONENT cancel-button))) + (form (make-form))) + + (set-textbox-text file-textbox file-text) + (add-form-to-grid grid form #t) + (make-wrapped-grid-window grid title) + + (receive (exit-reason argument) + (run-form form) + (dynamic-wind + (const #t) + (lambda () + (case exit-reason + ((exit-component) + (cond + ((components=? argument ok-button) + (ok-button-callback-procedure)) + ((components=? argument cancel-button) + (cancel-button-callback-procedure)))))) + (lambda () + (destroy-form-and-pop form)))))) -- cgit v1.2.3 From 7d812901daf0259d5d381199168d6d2994ce00ac Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Wed, 5 Dec 2018 19:50:17 +0900 Subject: installer: Turn "Cancel" buttons into "Exit" buttons. This change and previous ones were, Suggested-by: Thorsten Wilms here: https://lists.gnu.org/archive/html/guix-devel/2018-11/msg00330.html gnu/installer/newt/ethernet.scm: Turn cancel into exit. gnu/installer/newt/final.scm: Ditto. gnu/installer/newt/keymap.scm: Ditto. gnu/installer/newt/locale.scm: Ditto. gnu/installer/newt/network.scm: Ditto. gnu/installer/newt/page.scm: Ditto. gnu/installer/newt/partition.scm: Ditto. gnu/installer/newt/services.scm: Ditto. gnu/installer/newt/timezone.scm: Ditto. gnu/installer/newt/user.scm: Ditto. gnu/installer/newt/wifi.scm: Ditto. --- gnu/installer/newt/ethernet.scm | 2 +- gnu/installer/newt/final.scm | 2 +- gnu/installer/newt/keymap.scm | 2 +- gnu/installer/newt/locale.scm | 2 +- gnu/installer/newt/network.scm | 2 +- gnu/installer/newt/page.scm | 24 ++++++++++++------------ gnu/installer/newt/partition.scm | 34 +++++++++++++++++----------------- gnu/installer/newt/services.scm | 2 +- gnu/installer/newt/timezone.scm | 2 +- gnu/installer/newt/user.scm | 4 ++-- gnu/installer/newt/wifi.scm | 8 ++++---- 11 files changed, 42 insertions(+), 42 deletions(-) (limited to 'gnu/installer/newt/page.scm') diff --git a/gnu/installer/newt/ethernet.scm b/gnu/installer/newt/ethernet.scm index 2b02653777..d1f357243b 100644 --- a/gnu/installer/newt/ethernet.scm +++ b/gnu/installer/newt/ethernet.scm @@ -72,7 +72,7 @@ connection is pending." #:title (G_ "Ethernet connection") #:listbox-items services #:listbox-item->text ethernet-service->text - #:button-text (G_ "Cancel") + #:button-text (G_ "Exit") #:button-callback-procedure (lambda _ (raise diff --git a/gnu/installer/newt/final.scm b/gnu/installer/newt/final.scm index 023777cc0a..81af949de1 100644 --- a/gnu/installer/newt/final.scm +++ b/gnu/installer/newt/final.scm @@ -42,7 +42,7 @@ new system will be created from this file when pression the Ok button.") #:info-textbox-width width #:file-textbox-width width #:file-textbox-height height - #:cancel-button-callback-procedure + #:exit-button-callback-procedure (lambda () (raise (condition diff --git a/gnu/installer/newt/keymap.scm b/gnu/installer/newt/keymap.scm index 4bdae51340..9178a4341a 100644 --- a/gnu/installer/newt/keymap.scm +++ b/gnu/installer/newt/keymap.scm @@ -35,7 +35,7 @@ #:info-text (G_ "Please choose your keyboard layout.") #:listbox-items layouts #:listbox-item->text layout->text - #:button-text (G_ "Cancel") + #:button-text (G_ "Exit") #:button-callback-procedure (lambda _ (raise diff --git a/gnu/installer/newt/locale.scm b/gnu/installer/newt/locale.scm index 4de78f3330..4fa07df81e 100644 --- a/gnu/installer/newt/locale.scm +++ b/gnu/installer/newt/locale.scm @@ -45,7 +45,7 @@ installed system.") #:listbox-items languages #:listbox-item->text language->text #:sort-listbox-items? #f - #:button-text (G_ "Cancel") + #:button-text (G_ "Exit") #:button-callback-procedure (lambda _ (raise diff --git a/gnu/installer/newt/network.scm b/gnu/installer/newt/network.scm index 4912959147..ee6af0674e 100644 --- a/gnu/installer/newt/network.scm +++ b/gnu/installer/newt/network.scm @@ -59,7 +59,7 @@ Internet and return the selected technology. For now, only technologies with #:title (G_ "Internet access") #:listbox-items (technology-items) #:listbox-item->text technology->text - #:button-text (G_ "Cancel") + #:button-text (G_ "Exit") #:button-callback-procedure (lambda _ (raise diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm index 10849b81eb..98cbbb9c05 100644 --- a/gnu/installer/newt/page.scm +++ b/gnu/installer/newt/page.scm @@ -404,12 +404,12 @@ error is raised if the MAX-SCALE-UPDATE limit is reached." (checkbox-tree-height 10) (ok-button-callback-procedure (const #t)) - (cancel-button-callback-procedure + (exit-button-callback-procedure (const #t))) "Run a page allowing the user to select one or multiple items among ITEMS in a checkbox list. The page contains vertically stacked from the top to the bottom, an informative text set to INFO-TEXT, the checkbox list and two -buttons, 'Ok' and 'Cancel'. The page title's is set to TITLE. ITEMS are +buttons, 'Ok' and 'Exit'. The page title's is set to TITLE. ITEMS are converted to text using ITEM->TEXT before being displayed in the checkbox list. @@ -417,7 +417,7 @@ INFO-TEXTBOX-WIDTH is the width of the textbox where INFO-TEXT will be displayed. CHECKBOX-TREE-HEIGHT is the height of the checkbox list. OK-BUTTON-CALLBACK-PROCEDURE is called when the 'Ok' button is pressed. -CANCEL-BUTTON-CALLBACK-PROCEDURE is called when the 'Cancel' button is +EXIT-BUTTON-CALLBACK-PROCEDURE is called when the 'Exit' button is pressed. This procedure returns the list of checked items in the checkbox list among @@ -439,14 +439,14 @@ ITEMS when 'Ok' is pressed." info-textbox-width #:flags FLAG-BORDER)) (ok-button (make-button -1 -1 (G_ "Ok"))) - (cancel-button (make-button -1 -1 (G_ "Cancel"))) + (exit-button (make-button -1 -1 (G_ "Exit"))) (grid (vertically-stacked-grid GRID-ELEMENT-COMPONENT info-textbox GRID-ELEMENT-COMPONENT checkbox-tree GRID-ELEMENT-SUBGRID (horizontal-stacked-grid GRID-ELEMENT-COMPONENT ok-button - GRID-ELEMENT-COMPONENT cancel-button))) + GRID-ELEMENT-COMPONENT exit-button))) (keys (fill-checkbox-tree checkbox-tree items)) (form (make-form))) @@ -468,8 +468,8 @@ ITEMS when 'Ok' is pressed." entries))) (ok-button-callback-procedure) current-items)) - ((components=? argument cancel-button) - (cancel-button-callback-procedure)))))) + ((components=? argument exit-button) + (exit-button-callback-procedure)))))) (lambda () (destroy-form-and-pop form)))))) @@ -482,7 +482,7 @@ ITEMS when 'Ok' is pressed." (file-textbox-height 30) (ok-button-callback-procedure (const #t)) - (cancel-button-callback-procedure + (exit-button-callback-procedure (const #t))) (let* ((info-textbox (make-reflowed-textbox -1 -1 info-text @@ -495,14 +495,14 @@ ITEMS when 'Ok' is pressed." file-textbox-height (logior FLAG-SCROLL FLAG-BORDER))) (ok-button (make-button -1 -1 (G_ "Ok"))) - (cancel-button (make-button -1 -1 (G_ "Cancel"))) + (exit-button (make-button -1 -1 (G_ "Exit"))) (grid (vertically-stacked-grid GRID-ELEMENT-COMPONENT info-textbox GRID-ELEMENT-COMPONENT file-textbox GRID-ELEMENT-SUBGRID (horizontal-stacked-grid GRID-ELEMENT-COMPONENT ok-button - GRID-ELEMENT-COMPONENT cancel-button))) + GRID-ELEMENT-COMPONENT exit-button))) (form (make-form))) (set-textbox-text file-textbox file-text) @@ -519,7 +519,7 @@ ITEMS when 'Ok' is pressed." (cond ((components=? argument ok-button) (ok-button-callback-procedure)) - ((components=? argument cancel-button) - (cancel-button-callback-procedure)))))) + ((components=? argument exit-button) + (exit-button-callback-procedure)))))) (lambda () (destroy-form-and-pop form)))))) diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index 806337a9cb..1d5e4538e4 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -32,7 +32,7 @@ #:use-module (parted) #:export (run-partioning-page)) -(define (button-cancel-action) +(define (button-exit-action) "Raise the &installer-step-abort condition." (raise (condition @@ -48,8 +48,8 @@ #:title (G_ "Partition scheme") #:listbox-items items #:listbox-item->text cdr - #:button-text (G_ "Cancel") - #:button-callback-procedure button-cancel-action))) + #:button-text (G_ "Exit") + #:button-callback-procedure button-exit-action))) (car result))) (define (draw-formating-page) @@ -71,8 +71,8 @@ DEVICES list." #:title (G_ "Disk") #:listbox-items (device-items) #:listbox-item->text cdr - #:button-text (G_ "Cancel") - #:button-callback-procedure button-cancel-action)) + #:button-text (G_ "Exit") + #:button-callback-procedure button-exit-action)) (device (car result))) device)) @@ -84,7 +84,7 @@ Be careful, all data on the disk will be lost.") #:title (G_ "Partition table") #:listbox-items '("msdos" "gpt") #:listbox-item->text identity - #:button-text (G_ "Cancel") + #:button-text (G_ "Exit") #:button-callback-procedure button-callback)) (define (run-type-page partition) @@ -103,8 +103,8 @@ Be careful, all data on the disk will be lost.") #:listbox-items items #:listbox-item->text symbol->string #:sort-listbox-items? #f - #:button-text (G_ "Cancel") - #:button-callback-procedure button-cancel-action))) + #:button-text (G_ "Exit") + #:button-callback-procedure button-exit-action))) (define (run-fs-type-page) "Run a page asking the user to select a file-system type." @@ -114,8 +114,8 @@ Be careful, all data on the disk will be lost.") #:listbox-items '(ext4 btrfs fat32 swap) #:listbox-item->text user-fs-type-name #:sort-listbox-items? #f - #:button-text (G_ "Cancel") - #:button-callback-procedure button-cancel-action)) + #:button-text (G_ "Exit") + #:button-callback-procedure button-exit-action)) (define (inform-can-create-partition? user-partition) "Return #t if it is possible to create USER-PARTITION. This is determined by @@ -563,7 +563,7 @@ edit it." path)) (result (choice-window (G_ "Delete disk") (G_ "Ok") - (G_ "Cancel") + (G_ "Exit") info-text))) (case result ((1) @@ -584,7 +584,7 @@ edit it." number-str)) (result (choice-window (G_ "Delete partition") (G_ "Ok") - (G_ "Cancel") + (G_ "Exit") info-text))) (case result ((1) @@ -616,8 +616,8 @@ At least one partition must have its mounting point set to '/'.") #:allow-delete? #t #:button-text (G_ "Ok") #:button-callback-procedure button-ok-action - #:button2-text (G_ "Cancel") - #:button2-callback-procedure button-cancel-action + #:button2-text (G_ "Exit") + #:button2-callback-procedure button-exit-action #:listbox-callback-procedure listbox-action #:hotkey-callback-procedure hotkey-action))) (if (eq? result #t) @@ -664,8 +664,8 @@ At least one partition must have its mounting point set to '/'.") #:title (G_ "Partitioning method") #:listbox-items items #:listbox-item->text cdr - #:button-text (G_ "Cancel") - #:button-callback-procedure button-cancel-action)) + #:button-text (G_ "Exit") + #:button-callback-procedure button-exit-action)) (method (car result))) (case method ((entire) @@ -674,7 +674,7 @@ At least one partition must have its mounting point set to '/'.") (disk (if disk-type (disk-new device) (let* ((label (run-label-page - button-cancel-action)) + button-exit-action)) (disk (mklabel device label))) (disk-commit disk) disk))) diff --git a/gnu/installer/newt/services.scm b/gnu/installer/newt/services.scm index 80fac43dc8..6bcb6244ae 100644 --- a/gnu/installer/newt/services.scm +++ b/gnu/installer/newt/services.scm @@ -38,7 +38,7 @@ choose the one to use on the log-in screen with F1.") #:items %desktop-environments #:item->text desktop-environment-name #:checkbox-tree-height 5 - #:cancel-button-callback-procedure + #:exit-button-callback-procedure (lambda () (raise (condition diff --git a/gnu/installer/newt/timezone.scm b/gnu/installer/newt/timezone.scm index 874f4a0734..6c96ee55b1 100644 --- a/gnu/installer/newt/timezone.scm +++ b/gnu/installer/newt/timezone.scm @@ -60,7 +60,7 @@ returned." #:listbox-items timezones #:listbox-item->text identity #:button-text (if (null? path) - (G_ "Cancel") + (G_ "Exit") (G_ "Back")) #:button-callback-procedure (if (null? path) diff --git a/gnu/installer/newt/user.scm b/gnu/installer/newt/user.scm index 8337d628ae..c043f53def 100644 --- a/gnu/installer/newt/user.scm +++ b/gnu/installer/newt/user.scm @@ -116,7 +116,7 @@ '() (list GRID-ELEMENT-COMPONENT del-button))))) (ok-button (make-button -1 -1 (G_ "Ok"))) - (cancel-button (make-button -1 -1 (G_ "Cancel"))) + (exit-button (make-button -1 -1 (G_ "Exit"))) (title "User creation") (grid (vertically-stacked-grid @@ -126,7 +126,7 @@ GRID-ELEMENT-SUBGRID listbox-button-grid) GRID-ELEMENT-SUBGRID (horizontal-stacked-grid GRID-ELEMENT-COMPONENT ok-button - GRID-ELEMENT-COMPONENT cancel-button))) + GRID-ELEMENT-COMPONENT exit-button))) (sorted-users (sort users (lambda (a b) (string<= (user-name a) (user-name b))))) diff --git a/gnu/installer/newt/wifi.scm b/gnu/installer/newt/wifi.scm index de443345f6..c744e826a9 100644 --- a/gnu/installer/newt/wifi.scm +++ b/gnu/installer/newt/wifi.scm @@ -198,7 +198,7 @@ force a wifi scan." (make-reflowed-textbox -1 -1 info-text (info-textbox-width) #:flags FLAG-BORDER)) - (cancel-button (make-button -1 -1 (G_ "Cancel"))) + (exit-button (make-button -1 -1 (G_ "Exit"))) (scan-button (make-button -1 -1 (G_ "Scan"))) (services (wifi-services)) (service-items '())) @@ -211,12 +211,12 @@ force a wifi scan." (set-grid-field middle-grid 1 0 GRID-ELEMENT-COMPONENT scan-button #:anchor ANCHOR-TOP #:pad-left 2) - (set-grid-field buttons-grid 0 0 GRID-ELEMENT-COMPONENT cancel-button) + (set-grid-field buttons-grid 0 0 GRID-ELEMENT-COMPONENT exit-button) (add-components-to-form form info-textbox listbox scan-button - cancel-button) + exit-button) (make-wrapped-grid-window (basic-window-grid info-textbox middle-grid buttons-grid) (G_ "Wifi")) @@ -231,7 +231,7 @@ force a wifi scan." ((components=? argument scan-button) (run-wifi-scan-page) (run-wifi-page)) - ((components=? argument cancel-button) + ((components=? argument exit-button) (raise (condition (&installer-step-abort)))) -- cgit v1.2.3 From d700d131be31bd2838206bfc13ddd418affb185b Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Wed, 5 Dec 2018 22:08:33 +0900 Subject: installer: Make sure every sentence is dot terminated. gnu/installer/newt/hostname.scm: Finish sentences by a dot. gnu/installer/newt/network.scm: Ditto. gnu/installer/newt/page.scm: Ditto. gnu/installer/newt/partition.scm: Ditto. gnu/installer/newt/user.scm: Ditto. gnu/installer/newt/wifi.scm: Ditto. --- gnu/installer/newt/hostname.scm | 2 +- gnu/installer/newt/network.scm | 2 +- gnu/installer/newt/page.scm | 2 +- gnu/installer/newt/partition.scm | 12 ++++++------ gnu/installer/newt/user.scm | 2 +- gnu/installer/newt/wifi.scm | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'gnu/installer/newt/page.scm') diff --git a/gnu/installer/newt/hostname.scm b/gnu/installer/newt/hostname.scm index a8209bc2de..7783fa6360 100644 --- a/gnu/installer/newt/hostname.scm +++ b/gnu/installer/newt/hostname.scm @@ -22,5 +22,5 @@ #:export (run-hostname-page)) (define (run-hostname-page) - (run-input-page (G_ "Please enter the system hostname") + (run-input-page (G_ "Please enter the system hostname.") (G_ "Hostname"))) diff --git a/gnu/installer/newt/network.scm b/gnu/installer/newt/network.scm index 64fab2ae9f..f263b7df9d 100644 --- a/gnu/installer/newt/network.scm +++ b/gnu/installer/newt/network.scm @@ -113,7 +113,7 @@ FULL-VALUE tentatives, spaced by 1 second." (let* ((full-value 5)) (run-scale-page #:title (G_ "Checking connectivity") - #:info-text (G_ "Waiting internet access is established") + #:info-text (G_ "Waiting internet access is established.") #:scale-full-value full-value #:scale-update-proc (lambda (value) diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm index 98cbbb9c05..c6577c8a8c 100644 --- a/gnu/installer/newt/page.scm +++ b/gnu/installer/newt/page.scm @@ -98,7 +98,7 @@ enters an empty input." (add-components-to-form form text-box input-entry ok-button) (make-wrapped-grid-window grid title) (let ((error-page (lambda () - (run-error-page (G_ "Please enter a non empty input") + (run-error-page (G_ "Please enter a non empty input.") (G_ "Empty input"))))) (let loop () (receive (exit-reason argument) diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index 04d6192cd0..a3d48eef21 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -98,7 +98,7 @@ Be careful, all data on the disk will be lost.") '() '(extended))))) (run-listbox-selection-page - #:info-text (G_ "Please select a partition type") + #:info-text (G_ "Please select a partition type.") #:title (G_ "Partition type") #:listbox-items items #:listbox-item->text symbol->string @@ -109,7 +109,7 @@ Be careful, all data on the disk will be lost.") (define (run-fs-type-page) "Run a page asking the user to select a file-system type." (run-listbox-selection-page - #:info-text (G_ "Please select the file-system type for this partition") + #:info-text (G_ "Please select the file-system type for this partition.") #:title (G_ "File-system type") #:listbox-items '(ext4 btrfs fat32 swap) #:listbox-item->text user-fs-type-name @@ -123,17 +123,17 @@ calling CAN-CREATE-PARTITION? procedure. If an exception is raised, catch it an inform the user with an appropriate error-page and return #f." (guard (c ((max-primary-exceeded? c) (run-error-page - (G_ "Primary partitions count exceeded") + (G_ "Primary partitions count exceeded.") (G_ "Creation error")) #f) ((extended-creation-error? c) (run-error-page - (G_ "Extended partition creation error") + (G_ "Extended partition creation error.") (G_ "Creation error")) #f) ((logical-creation-error? c) (run-error-page - (G_ "Logical partition creation error") + (G_ "Logical partition creation error.") (G_ "Creation error")) #f)) (can-create-partition? user-partition))) @@ -625,7 +625,7 @@ At least one partition must have its mounting point set to '/'.") (guard (c ((no-root-mount-point? c) (run-error-page - (G_ "No root mount point found") + (G_ "No root mount point found.") (G_ "Missing mount point")) #f)) (check-user-partitions user-partitions)))) diff --git a/gnu/installer/newt/user.scm b/gnu/installer/newt/user.scm index c043f53def..f65dbb30e5 100644 --- a/gnu/installer/newt/user.scm +++ b/gnu/installer/newt/user.scm @@ -72,7 +72,7 @@ title) (let ((error-page (lambda () - (run-error-page (G_ "Empty inputs are not allowed") + (run-error-page (G_ "Empty inputs are not allowed.") (G_ "Empty input"))))) (receive (exit-reason argument) (run-form form) diff --git a/gnu/installer/newt/wifi.scm b/gnu/installer/newt/wifi.scm index c744e826a9..59e40e327e 100644 --- a/gnu/installer/newt/wifi.scm +++ b/gnu/installer/newt/wifi.scm @@ -86,7 +86,7 @@ nmc_wifi_strength_bars." (define (run-wifi-password-page) "Run a page prompting user for a password and return it." - (run-input-page (G_ "Please enter the wifi password") + (run-input-page (G_ "Please enter the wifi password.") (G_ "Password required"))) (define (run-wrong-password-page service-name) -- cgit v1.2.3 From 3d0f6a055c366a5414c35262bb4b31c0f602fcd3 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Thu, 6 Dec 2018 11:00:43 +0900 Subject: installer: Make exit button optional for run-file-textbox-page. * gnu/installer/newt/page.scm (run-file-textbox-page)[exit-button?]: New argument. --- gnu/installer/newt/page.scm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gnu/installer/newt/page.scm') diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm index c6577c8a8c..c0d7547293 100644 --- a/gnu/installer/newt/page.scm +++ b/gnu/installer/newt/page.scm @@ -480,6 +480,7 @@ ITEMS when 'Ok' is pressed." (info-textbox-width 50) (file-textbox-width 50) (file-textbox-height 30) + (exit-button? #t) (ok-button-callback-procedure (const #t)) (exit-button-callback-procedure @@ -500,9 +501,12 @@ ITEMS when 'Ok' is pressed." GRID-ELEMENT-COMPONENT info-textbox GRID-ELEMENT-COMPONENT file-textbox GRID-ELEMENT-SUBGRID - (horizontal-stacked-grid + (apply + horizontal-stacked-grid GRID-ELEMENT-COMPONENT ok-button - GRID-ELEMENT-COMPONENT exit-button))) + `(,@(if exit-button? + (list GRID-ELEMENT-COMPONENT exit-button) + '()))))) (form (make-form))) (set-textbox-text file-textbox file-text) @@ -519,7 +523,8 @@ ITEMS when 'Ok' is pressed." (cond ((components=? argument ok-button) (ok-button-callback-procedure)) - ((components=? argument exit-button) + ((and exit-button? + (components=? argument exit-button)) (exit-button-callback-procedure)))))) (lambda () (destroy-form-and-pop form)))))) -- cgit v1.2.3 From ebb36deccc84b1d4414a2b54a3e1df7e7ba94cff Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sun, 6 Jan 2019 11:04:14 +0100 Subject: installer: Rename "Ok" buttons to "OK". * gnu/installer/newt/page.scm: s/Ok/OK/. * gnu/installer/newt/partition.scm: Ditto. * gnu/installer/newt/user.scm: Ditto. --- gnu/installer/newt/page.scm | 8 ++++---- gnu/installer/newt/partition.scm | 8 ++++---- gnu/installer/newt/user.scm | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'gnu/installer/newt/page.scm') diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm index c0d7547293..edf0b8c999 100644 --- a/gnu/installer/newt/page.scm +++ b/gnu/installer/newt/page.scm @@ -83,7 +83,7 @@ enters an empty input." #:flags FLAG-BORDER)) (grid (make-grid 1 3)) (input-entry (make-entry -1 -1 20)) - (ok-button (make-button -1 -1 (G_ "Ok"))) + (ok-button (make-button -1 -1 (G_ "OK"))) (form (make-form))) (when default-text @@ -125,7 +125,7 @@ of the page is set to TITLE." (make-reflowed-textbox -1 -1 text 40 #:flags FLAG-BORDER)) (grid (make-grid 1 2)) - (ok-button (make-button -1 -1 "Ok")) + (ok-button (make-button -1 -1 "OK")) (form (make-form))) (set-grid-field grid 0 0 GRID-ELEMENT-COMPONENT text-box) @@ -438,7 +438,7 @@ ITEMS when 'Ok' is pressed." (make-reflowed-textbox -1 -1 info-text info-textbox-width #:flags FLAG-BORDER)) - (ok-button (make-button -1 -1 (G_ "Ok"))) + (ok-button (make-button -1 -1 (G_ "OK"))) (exit-button (make-button -1 -1 (G_ "Exit"))) (grid (vertically-stacked-grid GRID-ELEMENT-COMPONENT info-textbox @@ -495,7 +495,7 @@ ITEMS when 'Ok' is pressed." file-textbox-width file-textbox-height (logior FLAG-SCROLL FLAG-BORDER))) - (ok-button (make-button -1 -1 (G_ "Ok"))) + (ok-button (make-button -1 -1 (G_ "OK"))) (exit-button (make-button -1 -1 (G_ "Exit"))) (grid (vertically-stacked-grid GRID-ELEMENT-COMPONENT info-textbox diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index 56e9dafd49..84d77c1639 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -414,7 +414,7 @@ partition. Leave this field empty if you don't want to set a mounting point.") #:listbox-item->text cdr #:sort-listbox-items? #f #:listbox-default-item default-item - #:button-text (G_ "Ok") + #:button-text (G_ "OK") #:listbox-callback-procedure listbox-action #:button-callback-procedure button-action))) (match result @@ -594,7 +594,7 @@ edit it." (format #f (G_ "Are you sure you want to delete everything on disk ~a?") file-name)) (result (choice-window (G_ "Delete disk") - (G_ "Ok") + (G_ "OK") (G_ "Exit") info-text))) (case result @@ -615,7 +615,7 @@ edit it." (format #f (G_ "Are you sure you want to delete partition ~a?") number-str)) (result (choice-window (G_ "Delete partition") - (G_ "Ok") + (G_ "OK") (G_ "Exit") info-text))) (case result @@ -653,7 +653,7 @@ by pressing the Exit button.~%~%"))) #:sort-listbox-items? #f #:skip-item-procedure? skip-item? #:allow-delete? #t - #:button-text (G_ "Ok") + #:button-text (G_ "OK") #:button-callback-procedure button-ok-action #:button2-text (G_ "Exit") #:button2-callback-procedure button-exit-action diff --git a/gnu/installer/newt/user.scm b/gnu/installer/newt/user.scm index f65dbb30e5..59b1913cfc 100644 --- a/gnu/installer/newt/user.scm +++ b/gnu/installer/newt/user.scm @@ -41,7 +41,7 @@ (entry-home-directory (make-entry -1 -1 entry-width)) (entry-grid (make-grid 2 2)) (button-grid (make-grid 1 1)) - (ok-button (make-button -1 -1 (G_ "Ok"))) + (ok-button (make-button -1 -1 (G_ "OK"))) (grid (make-grid 1 2)) (title (G_ "User creation")) (set-entry-grid-field @@ -115,7 +115,7 @@ `(,@(if (null? users) '() (list GRID-ELEMENT-COMPONENT del-button))))) - (ok-button (make-button -1 -1 (G_ "Ok"))) + (ok-button (make-button -1 -1 (G_ "OK"))) (exit-button (make-button -1 -1 (G_ "Exit"))) (title "User creation") (grid -- cgit v1.2.3