diff options
Diffstat (limited to 'src/anastasis/anastasis-gtk_action.c')
-rw-r--r-- | src/anastasis/anastasis-gtk_action.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/anastasis/anastasis-gtk_action.c b/src/anastasis/anastasis-gtk_action.c index 14f7cac..a597eb2 100644 --- a/src/anastasis/anastasis-gtk_action.c +++ b/src/anastasis/anastasis-gtk_action.c @@ -515,11 +515,15 @@ action_user_attributes_collecting (void) const char *attr_type; const char *attr_uuid; const char *attr_name; + bool optional = false; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("widget", &widget_name)), GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_bool ("optional", + &optional)), + GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("tooltip", &attr_tooltip)), GNUNET_JSON_spec_string ("type", @@ -535,6 +539,7 @@ action_user_attributes_collecting (void) }; struct GNUNET_HashCode uh; GtkWidget *w = NULL; + char *l = NULL; GNUNET_assert (GNUNET_OK == GNUNET_JSON_parse (id_attr, @@ -558,19 +563,12 @@ action_user_attributes_collecting (void) } GNUNET_free (data_name); } - if ( (NULL != widget_name) && - (NULL != w) && - (NULL != attr_label) ) - { - char *label_widget; - - GNUNET_asprintf (&label_widget, - "%s_label", - widget_name); - update_label (label_widget, - attr_label); - GNUNET_free (label_widget); - } + if (optional) + GNUNET_asprintf (&l, + _ ("%s (optional)"), + attr_label); + else + l = GNUNET_strdup (attr_label); if ( (NULL != widget_name) && (NULL != w) ) { @@ -607,9 +605,10 @@ action_user_attributes_collecting (void) if (NULL == w) w = create_attribute_widget (&uh, attr_type, - attr_label, + l, attr_tooltip, id_attr); + GNUNET_free (l); if (NULL != w) { json_t *ia; |