guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

17/26: installer: Note which types of file system are supported.


From: John Darrington
Subject: 17/26: installer: Note which types of file system are supported.
Date: Sun, 22 Jan 2017 12:09:25 +0000 (UTC)

jmd pushed a commit to branch wip-installer
in repository guix.

commit 871b7a3a6fde3b65242ee0ab4a43b9d19e850a67
Author: John Darrington <address@hidden>
Date:   Thu Jan 19 08:06:38 2017 +0100

    installer: Note which types of file system are supported.
    
    * gurses/form.scm (<field>): Add members "choices" and "popup".
    * gnu/system/installer/mount-point.scm (my-fields): Declare the acceptable 
file
    system types.
---
 gnu/system/installer/mount-point.scm |    3 ++-
 gurses/form.scm                      |   19 ++++++++++++++-----
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/gnu/system/installer/mount-point.scm 
b/gnu/system/installer/mount-point.scm
index d610fe4..598d9bf 100644
--- a/gnu/system/installer/mount-point.scm
+++ b/gnu/system/installer/mount-point.scm
@@ -36,7 +36,8 @@
      str)))
 
 (define my-fields `((mount-point ,(M_ "Mount Point") 40)
-                    (fs-type     ,(M_ "File System Type") 10)
+                    (fs-type     ,(M_ "File System Type")
+                                  ("ext2" "ext3" "ext4" "btrfs" "swap"))
                     (label       ,(M_ "Label") 16)))
 
 (define (mount-point-refresh page)
diff --git a/gurses/form.scm b/gurses/form.scm
index bfa7620..a92a00b 100644
--- a/gurses/form.scm
+++ b/gurses/form.scm
@@ -38,12 +38,14 @@
   #:use-module (srfi srfi-9))
 
 (define-record-type <field>
-  (make-field symbol label size value cursor-position)
+  (make-field symbol label size choices popup value cursor-position)
   field?
   (symbol          field-symbol)
   (label           field-label)
-  (size            field-size)
-  (value           field-value    field-set-value!)
+  (size            field-size)     ; The maximum length of values for this 
field
+  (choices         field-choices)  ; A list of acceptable values for this field
+  (popup           field-popup     field-set-popup!)
+  (value           field-value     field-set-value!)
   (cursor-position field-cursor-position field-set-cursor-position!))
 
 (define-record-type <form>
@@ -125,8 +127,15 @@ label eq? to N"
                      1 (map-in-order
                         (lambda (x)
                            (match x
-                                  ((symbol label size)
-                                   (make-field symbol label size "" 0))))
+                                  ((symbol label (? list? things))
+                                   (make-field symbol label
+                                               (apply max
+                                                      (map (lambda (x)
+                                                             (string-length x))
+                                                           things))
+                                               things #f "" 0))
+                                  ((symbol label (? integer? size))
+                                   (make-field symbol label size #f #f "" 0))))
                         items)))
     form))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]