[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/20: installer: New procedure: page-enter.
From: |
John Darrington |
Subject: |
05/20: installer: New procedure: page-enter. |
Date: |
Thu, 12 Jan 2017 20:41:03 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 0335e73589ef50dbbfdbc5fdcd55edf66e1c3d1b
Author: John Darrington <address@hidden>
Date: Fri Jan 6 21:17:47 2017 +0100
installer: New procedure: page-enter.
* gnu/system/installer/page.scm (page-enter): New procedure.
* gnu/system/installer/file-browser.scm,
gnu/system/installer/filesystems.scm,
gnu/system/installer/guixsd-installer.scm,
gnu/system/installer/network.scm,
gnu/system/installer/time-zone.scm,
gnu/system/installer/wireless.scm: Use it where appropriate.
---
gnu/system/installer/file-browser.scm | 3 +--
gnu/system/installer/filesystems.scm | 7 ++-----
gnu/system/installer/guixsd-installer.scm | 6 ++----
gnu/system/installer/network.scm | 11 ++++-------
gnu/system/installer/page.scm | 6 ++++++
gnu/system/installer/time-zone.scm | 3 +--
gnu/system/installer/wireless.scm | 4 +---
7 files changed, 17 insertions(+), 23 deletions(-)
diff --git a/gnu/system/installer/file-browser.scm
b/gnu/system/installer/file-browser.scm
index e0af0ec..f07b97c 100644
--- a/gnu/system/installer/file-browser.scm
+++ b/gnu/system/installer/file-browser.scm
@@ -65,8 +65,7 @@
(if (eq? 'directory (stat:type (stat new-dir)))
(let ((p (make-file-browser
page new-dir)))
- (set! page-stack (cons p page-stack))
- ((page-refresh p) p))
+ (page-enter p))
(begin
(system* "loadkeys" i)
(set! key-map i)
diff --git a/gnu/system/installer/filesystems.scm
b/gnu/system/installer/filesystems.scm
index 9631e7e..011c6f3 100644
--- a/gnu/system/installer/filesystems.scm
+++ b/gnu/system/installer/filesystems.scm
@@ -183,9 +183,7 @@
mount-point-page-key-handler)))
(page-set-datum! next 'device name)
- (set! page-stack (cons next page-stack))
- ((page-refresh next) next)
- ))
+ (page-enter next)))
((buttons-key-matches-symbol? nav ch 'back)
(page-leave))
@@ -195,8 +193,7 @@
(let ((errstr (filesystem-task-incomplete-reason)))
(if errstr
(let ((next (make-dialog page errstr)))
- (set! page-stack (cons next page-stack))
- ((page-refresh next) next))
+ (page-enter next))
(begin
(page-leave))
))))
diff --git a/gnu/system/installer/guixsd-installer.scm
b/gnu/system/installer/guixsd-installer.scm
index c1a1cd1..b73839d 100644
--- a/gnu/system/installer/guixsd-installer.scm
+++ b/gnu/system/installer/guixsd-installer.scm
@@ -168,8 +168,7 @@
(p (make-file-browser
page keymap-directory
page-stack)))
- (set! page-stack (cons p page-stack))
- ((page-refresh p) p)))))))
+ (page-enter p)))))))
(define (do-task task-name page)
"Queue the task whose name is TASK-NAME and any dependencies"
@@ -263,8 +262,7 @@
stdscr (gettext "GuixSD Installer")
main-page-refresh main-page-key-handler)))
- (set! page-stack (cons page page-stack))
- ((page-refresh page) (car page-stack))
+ (page-enter page)
(let loop ((ch (getch stdscr)))
(let ((current-page (car page-stack)))
((page-key-handler current-page) current-page ch)
diff --git a/gnu/system/installer/network.scm b/gnu/system/installer/network.scm
index d59bbda..4607a1d 100644
--- a/gnu/system/installer/network.scm
+++ b/gnu/system/installer/network.scm
@@ -92,10 +92,9 @@
(eq? 'wireless (assq-ref (menu-get-current-item menu) 'class)))
(let ((next (make-wireless-page page (N_ "Wireless interface setup")
- (assq-ref (menu-get-current-item menu)
'name))))
- (set! page-stack (cons next page-stack))
- ((page-refresh next) next)))
-
+ (assq-ref (menu-get-current-item menu)
'name))))
+ (page-enter next)))
+
((select-key? ch)
(let ((item (menu-get-current-item menu)))
(when (eq? (assq-ref item 'class) 'ethernet)
@@ -107,9 +106,7 @@
"Ping"
ping-page-refresh
ping-page-key-handler)))
-
- (set! page-stack (cons next page-stack))
- ((page-refresh next) next)))
+ (page-enter next)))
((buttons-key-matches-symbol? nav ch 'continue)
diff --git a/gnu/system/installer/page.scm b/gnu/system/installer/page.scm
index 59361d1..aaae044 100644
--- a/gnu/system/installer/page.scm
+++ b/gnu/system/installer/page.scm
@@ -23,6 +23,7 @@
#:export (page-refresh)
#:export (page-initialised?)
#:export (page-set-initialised!)
+ #:export (page-enter)
#:export (page-leave)
#:export (page-set-wwin!)
#:export (page-wwin)
@@ -58,3 +59,8 @@
(define* (page-leave #:optional (return-point #f))
(set! page-stack
(or return-point (cdr page-stack))))
+
+(define (page-enter p)
+ (set! page-stack (cons p page-stack))
+ ((page-refresh p) p))
+
diff --git a/gnu/system/installer/time-zone.scm
b/gnu/system/installer/time-zone.scm
index 00f2858..8b676ff 100644
--- a/gnu/system/installer/time-zone.scm
+++ b/gnu/system/installer/time-zone.scm
@@ -70,8 +70,7 @@
(if (page-datum page 'stem)
(string-append (page-datum page 'stem) "/" i)
i))
- (set! page-stack (cons p page-stack))
- ((page-refresh p) p))
+ (page-enter p))
(begin
(set! time-zone
(if (page-datum page 'stem)
diff --git a/gnu/system/installer/wireless.scm
b/gnu/system/installer/wireless.scm
index dda9195..c1e42a0 100644
--- a/gnu/system/installer/wireless.scm
+++ b/gnu/system/installer/wireless.scm
@@ -78,9 +78,7 @@
(N_ "Passphrase entry")
(page-datum page 'ifce)
(assq-ref (menu-get-current-item menu) 'essid))))
- (set! page-stack (cons next page-stack))
- ((page-refresh next) next))))
-
+ (page-enter next))))
(std-menu-key-handler menu ch)
- branch wip-installer updated (9c4d060 -> 3673cd8), John Darrington, 2017/01/12
- 02/20: installer: Remove explicit calls to curs-set from pages., John Darrington, 2017/01/12
- 01/20: installer: Correct behaviour of push-cursor and pop-cursor procedures., John Darrington, 2017/01/12
- 12/20: installer: "Setup" --> "Set up", John Darrington, 2017/01/12
- 03/20: installer: Remove pointless calls to delwin., John Darrington, 2017/01/12
- 14/20: installer: Use "lspci -mm" instead of "lspci -m"., John Darrington, 2017/01/12
- 17/20: installer: Use a cleaner method of detecting wireless capability for ethernet interfaces., John Darrington, 2017/01/12
- 09/20: installer: Make all windows with ports scrollable., John Darrington, 2017/01/12
- 08/20: installer: Ignore case in button accelerators., John Darrington, 2017/01/12
- 05/20: installer: New procedure: page-enter.,
John Darrington <=
- 11/20: installer: Add installer source files to the manifest of translatables., John Darrington, 2017/01/12
- 15/20: installer: slurp: Ignore blank lines in output., John Darrington, 2017/01/12
- 04/20: installer: New procedure "page-leave"., John Darrington, 2017/01/12
- 18/20: guix: Add IFF_RUNNING to exported syscall constants., John Darrington, 2017/01/12
- 20/20: installer: Enable direct scrolling to top or bottom of menus., John Darrington, 2017/01/12
- 19/20: installer: Make the network menu more reliable., John Darrington, 2017/01/12
- 07/20: installer: Rename "Back" buttons to "Cancel"., John Darrington, 2017/01/12
- 13/20: installer: Use guix build syscalls module for network interrogation., John Darrington, 2017/01/12
- 10/20: installer: Rename 'file-browser.scm' to 'key-map.scm'., John Darrington, 2017/01/12
- 06/20: installer: Ensure that the cursor visibility is updated on each page., John Darrington, 2017/01/12