]> saetta.ns0.it Git - zakform/libzakform/commitdiff
Added function ZakFormForm::set_editable.
authorAndrea Zagli <azagli@libero.it>
Tue, 15 Dec 2015 10:29:24 +0000 (11:29 +0100)
committerAndrea Zagli <azagli@libero.it>
Tue, 15 Dec 2015 10:29:24 +0000 (11:29 +0100)
src/form.c
src/form.h

index 9afc9a6f7d537066cc79d8dd78fa692717c77ce2..8c5cf71e98eed446944a8a419cd4d178b50dd9ce 100644 (file)
@@ -433,6 +433,31 @@ zak_form_form_set_as_original (ZakFormForm *zakform)
                }
 }
 
+/**
+ * zak_form_form_set_editable:
+ * @zakform:
+ * @editable:
+ *
+ */
+void
+zak_form_form_set_editable (ZakFormForm *zakform, gboolean editable)
+{
+       guint i;
+
+       ZakFormFormPrivate *priv;
+
+       g_return_if_fail (ZAK_FORM_IS_FORM (zakform));
+
+       priv = zak_form_form_get_instance_private (zakform);
+
+       for (i = 0; i < priv->ar_elements->len; i++)
+               {
+                       ZakFormElement *element = (ZakFormElement *)g_ptr_array_index (priv->ar_elements, i);
+
+                       zak_form_element_set_editable (element, editable);
+               }
+}
+
 /**
  * zak_form_form_is_valid:
  * @zakform:
index dc3d3291336b7e43355ee51f345637044624895b..2c882a83c1c93d29386df97729c13cc8cb7198fe 100644 (file)
@@ -56,6 +56,8 @@ void zak_form_form_set_as_original (ZakFormForm *zakform);
 gboolean zak_form_form_is_valid (ZakFormForm *zakform);
 gboolean zak_form_form_is_changed (ZakFormForm *zakform);
 
+void zak_form_form_set_editable (ZakFormForm *zakform, gboolean editable);
+
 gboolean zak_form_form_load (ZakFormForm *zakform, ZakFormIProvider *provider);
 gboolean zak_form_form_insert (ZakFormForm *zakform, ZakFormIProvider *provider);
 gboolean zak_form_form_update (ZakFormForm *zakform, ZakFormIProvider *provider);