ci: Use a valid 'current-guix'.
[jackhill/guix/guix.git] / gnu / installer / newt / menu.scm
CommitLineData
d0f3a672
MO
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu installer newt menu)
20 #:use-module (gnu installer steps)
21 #:use-module (gnu installer newt page)
22 #:use-module (guix i18n)
23 #:use-module (newt)
24 #:export (run-menu-page))
25
26(define (run-menu-page steps)
27 "Run a menu page, asking the user to select where to resume the install
28process from."
29 (define (steps->items steps)
30 (filter (lambda (step)
31 (installer-step-description step))
32 steps))
33
34 (run-listbox-selection-page
35 #:info-text (G_ "Choose where you want to resume the install.\
a7b2a464 36You can also abort the installation by pressing the Abort button.")
d0f3a672
MO
37 #:title (G_ "Installation menu")
38 #:listbox-items (steps->items steps)
39 #:listbox-item->text installer-step-description
40 #:sort-listbox-items? #f
41 #:button-text (G_ "Abort")
42 #:button-callback-procedure (lambda ()
43 (newt-finish)
44 (primitive-exit 1))))