From 786c9c39bc0826737e99f0c750ea30033cdbc202 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 30 Mar 2020 12:24:56 +0200 Subject: installer: Add a help page. * gnu/installer/newt/help.scm: New file. * gnu/local.mk (INSTALLER_MODULES): Add it. * po/guix/POTFILES.in: Add it. * gnu/installer/record.scm (): Add 'help-menu' and 'help-page' fields, (installer-help-menu, installer-help-page): new exported procedures. * gnu/installer/newt.scm (init): Set the help line, (help-menu, help-page): new procedures used ... (newt-installer): ... here. * gnu/installer/newt/keymap.scm (run-layout-page): Add a context argument to differenciate the help context from the main one, (run-keymap-page): add a context argument and pass it to run-layout-page. * gnu/installer.scm (compute-keymap-step): Add a context argument and pass it to 'installer-keymap-page', (installer-steps): set the help menu and pass the appropriate context to compute-keymap-step calls, (guile-newt): update to revision 2. --- gnu/installer/newt.scm | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'gnu/installer/newt.scm') diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index 6c44b4acf6..7ac015eaad 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2018 Mathieu Othacehe +;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +21,7 @@ (define-module (gnu installer newt) #:use-module (gnu installer utils) #:use-module (gnu installer newt ethernet) #:use-module (gnu installer newt final) + #:use-module (gnu installer newt help) #:use-module (gnu installer newt hostname) #:use-module (gnu installer newt keymap) #:use-module (gnu installer newt locale) @@ -44,7 +45,9 @@ (define-module (gnu installer newt) (define (init) (newt-init) (clear-screen) - (set-screen-size!)) + (set-screen-size!) + (push-help-line + (format #f (G_ "Press for help.")))) (define (exit) (newt-finish) @@ -91,8 +94,8 @@ (define (welcome-page logo) (define (menu-page steps) (run-menu-page steps)) -(define* (keymap-page layouts) - (run-keymap-page layouts)) +(define* (keymap-page layouts context) + (run-keymap-page layouts #:context context)) (define (network-page) (run-network-page)) @@ -109,6 +112,12 @@ (define (partition-page) (define (services-page) (run-services-page)) +(define (help-menu menu-proc) + (newt-set-help-callback menu-proc)) + +(define (help-page keyboard-layout-selection) + (run-help-page keyboard-layout-selection)) + (define newt-installer (installer (name 'newt) @@ -125,4 +134,6 @@ (define newt-installer (user-page user-page) (partition-page partition-page) (services-page services-page) - (welcome-page welcome-page))) + (welcome-page welcome-page) + (help-menu help-menu) + (help-page help-page))) -- cgit v1.2.3