From c7ece85320454c809b84798b6b5847f22fea5dcc Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 27 Dec 2021 22:57:49 +0100 Subject: fix #7083: highlight next 'bad' user attribute --- src/anastasis/anastasis-gtk_action.c | 50 +++++------------------------------- 1 file changed, 7 insertions(+), 43 deletions(-) (limited to 'src/anastasis/anastasis-gtk_action.c') diff --git a/src/anastasis/anastasis-gtk_action.c b/src/anastasis/anastasis-gtk_action.c index 823f5f6..8ad386f 100644 --- a/src/anastasis/anastasis-gtk_action.c +++ b/src/anastasis/anastasis-gtk_action.c @@ -392,6 +392,11 @@ create_attribute_widget (const struct GNUNET_HashCode *uh, "changed", G_CALLBACK (&AG_identity_changed), NULL)); + GNUNET_assert (0 < + g_signal_connect (w, + "style-updated", + G_CALLBACK (>k_widget_queue_draw), + NULL)); gtk_widget_set_tooltip_text (w, tooltip); gtk_box_pack_start (box, /* parent */ @@ -459,47 +464,6 @@ create_attribute_widget (const struct GNUNET_HashCode *uh, } -/** - * Expand base @a name of a widget based on the @a type to - * create the name of the widget with the data. - * - * @param name base name of the widget - * @param type type of the widget - * @return NULL on error - */ -static char * -expand_name (const char *name, - const char *type) -{ - static struct - { - const char *type; - const char *suffix; - } type_map [] = { - { .type = "string", - .suffix = "entry" }, - { .type = "date", - .suffix = "cal" }, - { .type = NULL, - .suffix = NULL } - }; - char *data_widget; - - for (unsigned int i = 0; NULL != type_map[i].type; i++) - { - if (0 != strcmp (type_map[i].type, - type)) - continue; - GNUNET_asprintf (&data_widget, - "%s_%s", - name, - type_map[i].suffix); - return data_widget; - } - return NULL; -} - - /** * Update GtkLabel @a name, setting text to @a value. * @@ -585,8 +549,8 @@ action_user_attributes_collecting (void) { char *data_name; - data_name = expand_name (widget_name, - attr_type); + data_name = AG_expand_name (widget_name, + attr_type); w = GTK_WIDGET (GCG_get_main_window_object (data_name)); if (NULL == w) { -- cgit v1.2.3