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/wifi.scm | 243 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 gnu/installer/newt/wifi.scm (limited to 'gnu/installer/newt/wifi.scm') diff --git a/gnu/installer/newt/wifi.scm b/gnu/installer/newt/wifi.scm new file mode 100644 index 0000000000..6cac54399a --- /dev/null +++ b/gnu/installer/newt/wifi.scm @@ -0,0 +1,243 @@ +;;; 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 wifi) + #:use-module (gnu installer connman) + #:use-module (gnu installer steps) + #:use-module (gnu installer newt utils) + #:use-module (gnu installer newt page) + #:use-module (guix i18n) + #:use-module (guix records) + #:use-module (ice-9 format) + #:use-module (ice-9 popen) + #:use-module (ice-9 receive) + #:use-module (ice-9 regex) + #:use-module (ice-9 rdelim) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) + #:use-module (newt) + #:export (run-wifi-page)) + +;; This record associates a connman service to its key the listbox. +(define-record-type* + service-item make-service-item + service-item? + (service service-item-service) ; connman + (key service-item-key)) ; newt listbox-key + +(define (strength->string strength) + "Convert STRENGTH as an integer percentage into a text printable strength +bar using unicode characters. Taken from NetworkManager's +nmc_wifi_strength_bars." + (let ((quarter #\x2582) + (half #\x2584) + (three-quarter #\x2586) + (full #\x2588)) + (cond + ((> strength 80) + ;; ▂▄▆█ + (string quarter half three-quarter full)) + ((> strength 55) + ;; ▂▄▆_ + (string quarter half three-quarter #\_)) + ((> strength 30) + ;; ▂▄__ + (string quarter half #\_ #\_)) + ((> strength 5) + ;; ▂___ + (string quarter #\_ #\_ #\_)) + (else + ;; ____ + (string quarter #\_ #\_ #\_ #\_))))) + +(define (force-wifi-scan) + "Force a wifi scan. Raise a condition if no wifi technology is available." + (let* ((technologies (connman-technologies)) + (wifi-technology + (find (lambda (technology) + (string=? (technology-type technology) "wifi")) + technologies))) + (if wifi-technology + (connman-scan-technology wifi-technology) + (raise (condition + (&message + (message (G_ "Unable to find a wifi technology")))))))) + +(define (draw-scanning-page) + "Draw a page to indicate a wifi scan in in progress." + (draw-info-page (G_ "Scanning wifi for available networks, please wait.") + (G_ "Scan in progress"))) + +(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") + (G_ "Password required"))) + +(define (run-wrong-password-page service-name) + "Run a page to inform user of a wrong password input." + (run-error-page + (format #f (G_ "The password you entered for ~a is incorrect.") + service-name) + (G_ "Wrong password"))) + +(define (run-unknown-error-page service-name) + "Run a page to inform user that a connection error happened." + (run-error-page + (format #f + (G_ "An error occured while trying to connect to ~a, please retry.") + service-name) + (G_ "Connection error"))) + +(define (password-callback) + (run-wifi-password-page)) + +(define (connect-wifi-service listbox service-items) + "Connect to the wifi service selected in LISTBOX. SERVICE-ITEMS is the list +of records present in LISTBOX." + (let* ((listbox-key (current-listbox-entry listbox)) + (item (find (lambda (item) + (eq? (service-item-key item) listbox-key)) + service-items)) + (service (service-item-service item)) + (service-name (service-name service)) + (form (draw-connecting-page service-name))) + (dynamic-wind + (const #t) + (lambda () + (guard (c ((connman-password-error? c) + (run-wrong-password-page service-name) + #f) + ((connman-already-connected-error? c) + #t) + ((connman-connection-error? c) + (run-unknown-error-page service-name) + #f)) + (connman-connect-with-auth service password-callback))) + (lambda () + (destroy-form-and-pop form))))) + +(define (run-wifi-scan-page) + "Force a wifi scan and draw a page during the operation." + (let ((form (draw-scanning-page))) + (force-wifi-scan) + (destroy-form-and-pop form))) + +(define (wifi-services) + "Return all the connman services of wifi type." + (let ((services (connman-services))) + (filter (lambda (service) + (and (string=? (service-type service) "wifi") + (not (string-null? (service-name service))))) + services))) + +(define* (fill-wifi-services listbox wifi-services) + "Append all the services in WIFI-SERVICES to the given LISTBOX." + (clear-listbox listbox) + (map (lambda (service) + (let* ((text (service->text service)) + (key (append-entry-to-listbox listbox text))) + (service-item + (service service) + (key key)))) + wifi-services)) + +;; Maximum length of a wifi service name. +(define service-name-max-length (make-parameter 20)) + +;; Heigth of the listbox displaying wifi services. +(define wifi-listbox-heigth (make-parameter 20)) + +;; Information textbox width. +(define info-textbox-width (make-parameter 40)) + +(define (service->text service) + "Return a string composed of the name and the strength of the given +SERVICE. A '*' preceding the service name indicates that it is connected." + (let* ((name (service-name service)) + (padded-name (string-pad-right name + (service-name-max-length))) + (strength (service-strength service)) + (strength-string (strength->string strength)) + (state (service-state service)) + (connected? (or (string=? state "online") + (string=? state "ready")))) + (format #f "~c ~a ~a~%" + (if connected? #\* #\ ) + padded-name + strength-string))) + +(define (run-wifi-page) + "Run a page displaying available wifi networks in a listbox. Connect to the +network when the corresponding listbox entry is selected. A button allow to +force a wifi scan." + (let* ((listbox (make-listbox + -1 -1 + (wifi-listbox-heigth) + (logior FLAG-SCROLL FLAG-BORDER FLAG-RETURNEXIT))) + (form (make-form)) + (buttons-grid (make-grid 1 1)) + (middle-grid (make-grid 2 1)) + (info-text (G_ "Please select a wifi network.")) + (info-textbox + (make-reflowed-textbox -1 -1 info-text + (info-textbox-width) + #:flags FLAG-BORDER)) + (cancel-button (make-button -1 -1 (G_ "Cancel"))) + (scan-button (make-button -1 -1 (G_ "Scan"))) + (services (wifi-services)) + (service-items '())) + + (if (null? services) + (append-entry-to-listbox listbox (G_ "No wifi detected")) + (set! service-items (fill-wifi-services listbox services))) + + (set-grid-field middle-grid 0 0 GRID-ELEMENT-COMPONENT listbox) + (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) + + (add-components-to-form form + info-textbox + listbox scan-button + cancel-button) + (make-wrapped-grid-window + (basic-window-grid info-textbox middle-grid buttons-grid) + (G_ "Wifi selection")) + + (receive (exit-reason argument) + (run-form form) + (dynamic-wind + (const #t) + (lambda () + (when (eq? exit-reason 'exit-component) + (cond + ((components=? argument scan-button) + (run-wifi-scan-page) + (run-wifi-page)) + ((components=? argument cancel-button) + (raise + (condition + (&installer-step-abort)))) + ((components=? argument listbox) + (let ((result (connect-wifi-service listbox service-items))) + (unless result + (run-wifi-page))))))) + (lambda () + (destroy-form-and-pop form)))))) -- cgit v1.2.3 From 5cdb6bd2db0b465fa616a9fd36760b14844d5c48 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Wed, 5 Dec 2018 14:19:28 +0900 Subject: installer: Remove "selection" from all titles. * gnu/installer/newt/hostname.scm (run-hostname-page): Remove selection from page title, (run-variant-page): ditto. * gnu/installer/newt/keymap.scm (run-layout-page): Ditto. * gnu/installer/newt/locale.scm (run-layout-page): Ditto, (run-territory-page): ditto, (run-codeset-page): ditto, (run-modifier-page): ditto * gnu/installer/newt/network.scm (run-territory-page): Ditto. * gnu/installer/newt/timezone.scm (run-timezone-page): Ditto. * gnu/installer/newt/wifi.scm (run-wifi-page): Ditto. --- gnu/installer/newt/hostname.scm | 2 +- gnu/installer/newt/keymap.scm | 4 ++-- gnu/installer/newt/locale.scm | 8 ++++---- gnu/installer/newt/network.scm | 2 +- gnu/installer/newt/timezone.scm | 2 +- gnu/installer/newt/wifi.scm | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'gnu/installer/newt/wifi.scm') diff --git a/gnu/installer/newt/hostname.scm b/gnu/installer/newt/hostname.scm index acbee64a6a..a8209bc2de 100644 --- a/gnu/installer/newt/hostname.scm +++ b/gnu/installer/newt/hostname.scm @@ -23,4 +23,4 @@ (define (run-hostname-page) (run-input-page (G_ "Please enter the system hostname") - (G_ "Hostname selection"))) + (G_ "Hostname"))) diff --git a/gnu/installer/newt/keymap.scm b/gnu/installer/newt/keymap.scm index 219ac3f8e2..0c9432bba2 100644 --- a/gnu/installer/newt/keymap.scm +++ b/gnu/installer/newt/keymap.scm @@ -29,7 +29,7 @@ #:export (run-keymap-page)) (define (run-layout-page layouts layout->text) - (let ((title (G_ "Layout selection"))) + (let ((title (G_ "Layout"))) (run-listbox-selection-page #:title title #:info-text (G_ "Please choose your keyboard layout.") @@ -43,7 +43,7 @@ (&installer-step-abort))))))) (define (run-variant-page variants variant->text) - (let ((title (G_ "Variant selection"))) + (let ((title (G_ "Variant"))) (run-listbox-selection-page #:title title #:info-text (G_ "Please choose a variant for your keyboard layout.") diff --git a/gnu/installer/newt/locale.scm b/gnu/installer/newt/locale.scm index 5444a07598..599a6b0ecf 100644 --- a/gnu/installer/newt/locale.scm +++ b/gnu/installer/newt/locale.scm @@ -30,7 +30,7 @@ #:export (run-locale-page)) (define (run-language-page languages language->text) - (let ((title (G_ "Language selection"))) + (let ((title (G_ "Language"))) (run-listbox-selection-page #:title title #:info-text (G_ "Choose the language to be used for the installation \ @@ -46,7 +46,7 @@ language for the installed system.") (&installer-step-abort))))))) (define (run-territory-page territories territory->text) - (let ((title (G_ "Location selection"))) + (let ((title (G_ "Location"))) (run-listbox-selection-page #:title title #:info-text (G_ "Choose your location. This is a shortlist of locations \ @@ -61,7 +61,7 @@ based on the language you selected.") (&installer-step-abort))))))) (define (run-codeset-page codesets) - (let ((title (G_ "Codeset selection"))) + (let ((title (G_ "Codeset"))) (run-listbox-selection-page #:title title #:info-text (G_ "Choose your codeset. If UTF-8 is available, it should be \ @@ -77,7 +77,7 @@ preferred.") (&installer-step-abort))))))) (define (run-modifier-page modifiers modifier->text) - (let ((title (G_ "Modifier selection"))) + (let ((title (G_ "Modifier"))) (run-listbox-selection-page #:title title #:info-text (G_ "Choose your modifier.") diff --git a/gnu/installer/newt/network.scm b/gnu/installer/newt/network.scm index c6ba69d4e8..45989ac2ac 100644 --- a/gnu/installer/newt/network.scm +++ b/gnu/installer/newt/network.scm @@ -56,7 +56,7 @@ Internet and return the selected technology. For now, only technologies with (run-listbox-selection-page #:info-text (G_ "The install process requires an internet access.\ Please select a network technology.") - #:title (G_ "Technology selection") + #:title (G_ "Internet access") #:listbox-items (technology-items) #:listbox-item->text technology->text #:button-text (G_ "Cancel") diff --git a/gnu/installer/newt/timezone.scm b/gnu/installer/newt/timezone.scm index a2c9b458f5..874f4a0734 100644 --- a/gnu/installer/newt/timezone.scm +++ b/gnu/installer/newt/timezone.scm @@ -55,7 +55,7 @@ returned." (define (loop path) (let ((timezones (locate-childrens timezone-tree path))) (run-listbox-selection-page - #:title (G_ "Timezone selection") + #:title (G_ "Timezone") #:info-text (G_ "Please select a timezone.") #:listbox-items timezones #:listbox-item->text identity diff --git a/gnu/installer/newt/wifi.scm b/gnu/installer/newt/wifi.scm index 6cac54399a..de443345f6 100644 --- a/gnu/installer/newt/wifi.scm +++ b/gnu/installer/newt/wifi.scm @@ -219,7 +219,7 @@ force a wifi scan." cancel-button) (make-wrapped-grid-window (basic-window-grid info-textbox middle-grid buttons-grid) - (G_ "Wifi selection")) + (G_ "Wifi")) (receive (exit-reason argument) (run-form 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/wifi.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/wifi.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