[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/12: installer: Add callback parameter for forms.
From: |
John Darrington |
Subject: |
01/12: installer: Add callback parameter for forms. |
Date: |
Sun, 15 Jan 2017 15:45:39 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 9c9c3c268e8568ecd07a6d10711b7d743399806f
Author: John Darrington <address@hidden>
Date: Sat Jan 14 13:16:14 2017 +0100
installer: Add callback parameter for forms.
* gurses/form.scm (make-form): New optional callback parameter.
---
gurses/form.scm | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/gurses/form.scm b/gurses/form.scm
index 226fcd0..13254f5 100644
--- a/gurses/form.scm
+++ b/gurses/form.scm
@@ -21,6 +21,7 @@
#:export (form-set-value!)
#:export (make-form)
#:export (field-cursor-position)
+ #:export (field-symbol)
#:export (form-post)
#:export (form-items)
#:export (form-window)
@@ -44,13 +45,14 @@
(cursor-position field-cursor-position field-set-cursor-position!))
(define-record-type <form>
- (make-form' current-item enabled)
+ (make-form' current-item enabled callback)
form?
(current-item form-current-item form-set-current-item!)
(enabled form-enabled? form-set-enabled!)
(items form-items form-set-items!)
(tabpos form-tabpos form-set-tabpos!) ;; X Position of the entries
- (window form-window form-set-window!))
+ (window form-window form-set-window!)
+ (callback form-callback))
(define (form-update-cursor form)
"Updates the cursor for FIELD in FORM"
@@ -105,8 +107,8 @@ label eq? to N"
(field-value ff)
(loop (1+ idx)))))))))
-(define (make-form items)
- (let ((form (make-form' 0 #t)))
+(define* (make-form items #:optional (callback #f))
+ (let ((form (make-form' 0 #t callback)))
(form-set-items! form
(list->array
1 (map-in-order
@@ -191,8 +193,10 @@ label eq? to N"
((eq? ch #\enq)
;; Move to end of field
(cursor-move form f (string-length (field-value f))))
-
)
+ (when (form-callback form)
+ ((form-callback form) form))
+
(refresh (form-window form)))))
(define (form-set-current-field form which)
- branch wip-installer updated (3673cd8 -> ac6599d), John Darrington, 2017/01/15
- 08/12: installer: Correct bug detecting a wireless interface., John Darrington, 2017/01/15
- 01/12: installer: Add callback parameter for forms.,
John Darrington <=
- 04/12: installer: Add the notion of uuids to prospective filesystems., John Darrington, 2017/01/15
- 05/12: installer: Add a predicate to ensure the partitions have been formatted., John Darrington, 2017/01/15
- 09/12: installer: Exit the format page after all partitions are successfully formatted., John Darrington, 2017/01/15
- 11/12: installer: Replace one usage of car with match., John Darrington, 2017/01/15
- 10/12: installer: Do not perform tasks more than once., John Darrington, 2017/01/15
- 12/12: installer: Correct bug where the timezone page returned to the wrong page., John Darrington, 2017/01/15
- 02/12: installer: Remove mkfs capability from mount points page., John Darrington, 2017/01/15
- 06/12: installer: Changed N_ to M_ since N_ is used for another purpose in guix/ui.scm, John Darrington, 2017/01/15
- 07/12: installer: Whitespace changes only, John Darrington, 2017/01/15
- 03/12: installer: Add a dedicated make to format filesystems., John Darrington, 2017/01/15