]> saetta.ns0.it Git - zakform/gtk/commitdiff
Use of ZakFormElement::long_name.
authorAndrea Zagli <azagli@libero.it>
Sat, 2 Jan 2016 16:31:21 +0000 (17:31 +0100)
committerAndrea Zagli <azagli@libero.it>
Sat, 2 Jan 2016 16:31:21 +0000 (17:31 +0100)
src/form.c
src/formelement.c

index 1e07a358f8aa3e2add614d19f30bed42e62ec229..fcbdd15a070ec4bbe303064a08161a60e5538e69 100644 (file)
@@ -143,17 +143,22 @@ zak_form_gtk_form_is_valid (ZakFormGtkForm *form, GtkWidget *parent_window)
                        /* collect error messages */
                        for (i = 0; i < priv->ar_elements->len; i++)
                                {
-                                       ar_messages = zak_form_element_get_messages ((ZakFormElement *)g_ptr_array_index (priv->ar_elements, i));
+                                       ZakFormElement *element;
+
+                                       element = (ZakFormElement *)g_ptr_array_index (priv->ar_elements, i);
+                                       ar_messages = zak_form_element_get_messages (element);
                                        if (ar_messages != NULL)
                                                {
                                                        if (w_to_focus == NULL)
                                                                {
-                                                                       w_to_focus = zak_form_gtk_form_element_get_widget (ZAK_FORM_GTK_FORM_ELEMENT ((ZakFormElement *)g_ptr_array_index (priv->ar_elements, i)));
+                                                                       w_to_focus = zak_form_gtk_form_element_get_widget (ZAK_FORM_GTK_FORM_ELEMENT (element));
                                                                }
 
                                                        for (m = 0; m < ar_messages->len; m++)
                                                                {
-                                                                       g_string_append_printf (str, "\n - %s", (gchar *)g_ptr_array_index (ar_messages, m));
+                                                                       g_string_append_printf (str, "\n - «%s»: %s",
+                                                                                                                       zak_form_element_get_long_name (element),
+                                                                                                                       (gchar *)g_ptr_array_index (ar_messages, m));
                                                                }
                                                }
                                }
index 6c2dec144e163f9ab82db2bcdb37f1b43afde692..4cde39f1c3b7f54bc89f3fd1c66941f33dc1ddb3 100644 (file)
@@ -285,6 +285,9 @@ zak_form_gtk_form_element_set_label (ZakFormGtkFormElement *element, GtkWidget *
                        g_object_unref (priv->label);
                }
        priv->label = g_object_ref (label);
+
+       zak_form_element_set_long_name (ZAK_FORM_ELEMENT (element),
+                                                                       gtk_label_get_text (GTK_LABEL (priv->label)));
 }
 
 /* PRIVATE */