menu.scm 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. (define-module (gnu installer newt menu)
  19. #:use-module (gnu installer steps)
  20. #:use-module (gnu installer newt page)
  21. #:use-module (guix i18n)
  22. #:use-module (newt)
  23. #:export (run-menu-page))
  24. (define (run-menu-page steps)
  25. "Run a menu page, asking the user to select where to resume the install
  26. process from."
  27. (define (steps->items steps)
  28. (filter (lambda (step)
  29. (installer-step-description step))
  30. steps))
  31. (run-listbox-selection-page
  32. #:info-text (G_ "Choose where you want to resume the install.\
  33. You can also abort the installation by pressing the Abort button.")
  34. #:title (G_ "Installation menu")
  35. #:listbox-items (steps->items steps)
  36. #:listbox-item->text installer-step-description
  37. #:sort-listbox-items? #f
  38. #:button-text (G_ "Abort")
  39. #:button-callback-procedure (lambda ()
  40. (newt-finish)
  41. (primitive-exit 1))))