From: Andrea Zagli Date: Tue, 15 Dec 2015 10:29:24 +0000 (+0100) Subject: Added function ZakFormForm::set_editable. X-Git-Tag: debian/0.0.1-1~19 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=7ebaca6c7684628ef481a38d32c5a55fd0917f8f;p=zakform%2Flibzakform Added function ZakFormForm::set_editable. --- diff --git a/src/form.c b/src/form.c index 9afc9a6..8c5cf71 100644 --- a/src/form.c +++ b/src/form.c @@ -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: diff --git a/src/form.h b/src/form.h index dc3d329..2c882a8 100644 --- a/src/form.h +++ b/src/form.h @@ -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);