From 9ced0f376bb7d4b9351a03da2415e26126b6418c Mon Sep 17 00:00:00 2001
From: Ludovic Courtès <ludo@gnu.org>
Date: Sun, 12 Jan 2020 21:59:01 +0100
Subject: installer: Add an "Edit" button on the final page.

Fixes <https://bugs.gnu.org/36885>.
Reported by <lukasbf@tutanota.com>.

* gnu/installer/newt/page.scm (edit-file): New procedure.
(run-file-textbox-page): Add #:edit-button? and #:editor-locale
parameters.  Remove 'file-text' and add 'edit-button', and add it
to the horizontal stacked grid when EXIT-BUTTON? is true.  Wrap
body in 'loop'.  Handle case where ARGUMENT is EDIT-BUTTON by calling
'loop'.
* gnu/installer/newt/final.scm (run-config-display-page): Add #:locale
parameter.  Pass #:edit-button? and #:editor-locale to
'run-file-textbox-page'.
(run-final-page): Pass LOCALE to 'run-config-display-page'.
---
 gnu/installer/newt/final.scm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'gnu/installer/newt/final.scm')

diff --git a/gnu/installer/newt/final.scm b/gnu/installer/newt/final.scm
index e375282613..061bcd3f78 100644
--- a/gnu/installer/newt/final.scm
+++ b/gnu/installer/newt/final.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,7 +36,7 @@ (define* (strip-prefix file #:optional (prefix (%installer-target-dir)))
       (string-drop file (string-length prefix))
       file))
 
-(define (run-config-display-page)
+(define* (run-config-display-page #:key locale)
   (let ((width (%configuration-file-width))
         (height (nearest-exact-integer
                  (/ (screen-rows) 2))))
@@ -50,6 +50,8 @@ (define (run-config-display-page)
                          (strip-prefix (%installer-configuration-file)))
      #:title (G_ "Configuration file")
      #:file (%installer-configuration-file)
+     #:edit-button? #t
+     #:editor-locale locale
      #:info-textbox-width width
      #:file-textbox-width width
      #:file-textbox-height height
@@ -95,7 +97,7 @@ (define (run-final-page result prev-steps)
           (with-mounted-partitions
            user-partitions
            (configuration->file configuration)
-           (run-config-display-page)
+           (run-config-display-page #:locale locale)
            (run-install-shell locale #:users users))))
     (if install-ok?
         (run-install-success-page)
-- 
cgit v1.2.3