guix-commits
[Top][All Lists]
Advanced

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

121/197: installer: Note which types of file system are supported.


From: Danny Milosavljevic
Subject: 121/197: installer: Note which types of file system are supported.
Date: Mon, 3 Jul 2017 20:37:11 -0400 (EDT)

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

commit 68fbfde88e08f756c57361f11b5d0588126f2ad7
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]