]> saetta.ns0.it Git - zakform/tests/commitdiff
Test array in cgi. array
authorAndrea Zagli <azagli@libero.it>
Sat, 17 Jun 2017 09:55:00 +0000 (11:55 +0200)
committerAndrea Zagli <azagli@libero.it>
Sat, 17 Jun 2017 09:55:00 +0000 (11:55 +0200)
data/zakformtests/xml/cgi.xml
src/cgi_ini.c
src/gtk_ini.c

index d52e7aca19ef5b62a9ff243c0ae1568f3970ee3a..241d54ce867a096640d98ca25f3894b1a5bcdc23 100644 (file)
@@ -104,6 +104,39 @@ and                                         some            tabs
        <type>string</type>
   </element>
 
+  <element type="zak_form_element_array">
+       <name>array</name>
+       <type>string</type>
+       <!-- <signal-element-added>array_signal_element_added</signal-element-added> -->
+
+       <element type="zak_form_cgi_form_element_check">
+         <id>one</id>
+         <type>boolean</type>
+         <zak-cgi-text>One</zak-cgi-text>
+       </element>
+       <element type="zak_form_cgi_form_element_check">
+         <id>two</id>
+         <type>boolean</type>
+         <zak-cgi-text>Two</zak-cgi-text>
+       </element>
+       <element type="zak_form_cgi_form_element_check">
+         <id>three</id>
+         <type>boolean</type>
+         <zak-cgi-text>Three</zak-cgi-text>
+       </element>
+       <element type="zak_form_cgi_form_element_check">
+         <id>four</id>
+         <type>boolean</type>
+         <zak-cgi-text>Four</zak-cgi-text>
+         <default-value>TRUE</default-value>
+       </element>
+       <element type="zak_form_cgi_form_element_check">
+         <id>five</id>
+         <type>boolean</type>
+         <zak-cgi-text>Five</zak-cgi-text>
+       </element>
+  </element>
+
   <element type="zak_form_cgi_form_element_submit">
        <id>submit</id>
        <to-load>FALSE</to-load>
index 6668ec4d96a6387632165d4d1eebf86c949cf68a..9d0465da10b8eb7cc81b8aa434671b5e905f0759 100644 (file)
@@ -72,6 +72,7 @@ main (int argc, char *argv[])
                {
                        if (zak_cgi_main_is_post (zakcgimain))
                                {
+                                       sleep(10);
                                        /* validating the form */
                                        zak_form_cgi_form_bind (form);
                                        if (zak_form_form_is_valid (ZAK_FORM_FORM (form)))
index 950a797fc6a1e9684df545cb40b86675598c2b79..c6065ce2fc3b861c39680744b9c0b38d7dcd4264 100644 (file)
@@ -141,6 +141,12 @@ filters_toggled (GtkToggleButton *button,
                }
 }
 
+G_MODULE_EXPORT void
+array_signal_element_added (gpointer instance, GObject *element_added, gpointer user_data)
+{
+       zak_form_gtk_form_element_set_gtkbuilder ((ZakFormGtkFormElement *)element_added, builder);
+}
+
 int
 main (int argc, char *argv[])
 {