[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
91/197: installer: Add callback parameter for forms.
From: |
Danny Milosavljevic |
Subject: |
91/197: installer: Add callback parameter for forms. |
Date: |
Mon, 3 Jul 2017 20:37:06 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 3cf3a08803c7aab8671d61beccab8490732c8f0a
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)
- 77/197: installer: New procedure: page-enter., (continued)
- 77/197: installer: New procedure: page-enter., Danny Milosavljevic, 2017/07/03
- 82/197: installer: Rename 'file-browser.scm' to 'key-map.scm'., Danny Milosavljevic, 2017/07/03
- 63/197: installer: Change essid --> wireless., Danny Milosavljevic, 2017/07/03
- 70/197: installer: Rename "file-browser" -> "time-zone"., Danny Milosavljevic, 2017/07/03
- 81/197: installer: Make all windows with ports scrollable., Danny Milosavljevic, 2017/07/03
- 62/197: installer: Add page with which the wifi password can be entered., Danny Milosavljevic, 2017/07/03
- 75/197: installer: Remove pointless calls to delwin., Danny Milosavljevic, 2017/07/03
- 87/197: installer: Minor cleanup., Danny Milosavljevic, 2017/07/03
- 79/197: installer: Rename "Back" buttons to "Cancel"., Danny Milosavljevic, 2017/07/03
- 98/197: installer: Correct bug detecting a wireless interface., Danny Milosavljevic, 2017/07/03
- 91/197: installer: Add callback parameter for forms.,
Danny Milosavljevic <=
- 95/197: installer: Add a predicate to ensure the partitions have been formatted., Danny Milosavljevic, 2017/07/03
- 102/197: installer: Correct bug where the timezone page returned to the wrong page., Danny Milosavljevic, 2017/07/03
- 119/197: gurses: Allow menu update to work for panel windows., Danny Milosavljevic, 2017/07/03
- 103/197: installer: Avoid exception when the device to format cannot be found., Danny Milosavljevic, 2017/07/03
- 116/197: installer: Fix bug in config generation., Danny Milosavljevic, 2017/07/03
- 105/197: installer: Extend the 'file-system' concept to include swap spaces., Danny Milosavljevic, 2017/07/03
- 83/197: installer: "Setup" --> "Set up", Danny Milosavljevic, 2017/07/03
- 92/197: installer: Remove mkfs capability from mount points page., Danny Milosavljevic, 2017/07/03
- 118/197: installer: Distinguish between Wifi encryption methods., Danny Milosavljevic, 2017/07/03
- 127/197: gurses: Remove box from form popup window., Danny Milosavljevic, 2017/07/03