From 29310c0c67025e0ca16f7731055a4c7a427306e5 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 12 Nov 2011 15:21:43 -0500 Subject: EConfig: Debugability improvements. --- e-util/e-config.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'e-util') diff --git a/e-util/e-config.c b/e-util/e-config.c index f8e459497e..06117c2a9f 100644 --- a/e-util/e-config.c +++ b/e-util/e-config.c @@ -138,11 +138,11 @@ config_finalize (GObject *object) while (link != NULL) { struct _widget_node *node = link->data; - /* disconnect the gtk_widget_destroyed function from the widget */ + /* disconnect the ec_widget_destroyed function from the widget */ if (node->widget) g_signal_handlers_disconnect_matched ( node->widget, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, &node->widget); + 0, 0, NULL, NULL, node); g_free (node); @@ -559,6 +559,16 @@ ec_assistant_forward (gint current_page, return next_page; } +static void +ec_widget_destroyed (GtkWidget *widget, + struct _widget_node *node) +{ + /* Use our own function instead of gtk_widget_destroyed() + * so it's easier to trap EConfig widgets in a debugger. */ + + node->widget = NULL; +} + static void ec_rebuild (EConfig *emp) { @@ -829,6 +839,7 @@ ec_rebuild (EConfig *emp) } else { gtk_assistant_prepend_page (GTK_ASSISTANT (assistant), page); } + gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, item->type == E_CONFIG_PAGE ? GTK_ASSISTANT_PAGE_CONTENT : GTK_ASSISTANT_PAGE_PROGRESS); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, translated_label); gtk_widget_show_all (page); @@ -860,7 +871,9 @@ ec_rebuild (EConfig *emp) sectionnode = NULL; wn->widget = page; if (page) - g_signal_connect (page, "destroy", G_CALLBACK(gtk_widget_destroyed), &wn->widget); + g_signal_connect ( + page, "destroy", + G_CALLBACK (ec_widget_destroyed), wn); break; case E_CONFIG_SECTION: case E_CONFIG_SECTION_TABLE: @@ -962,7 +975,9 @@ ec_rebuild (EConfig *emp) sectionno++; wn->widget = section; if (section) - g_signal_connect (section, "destroy", G_CALLBACK(gtk_widget_destroyed), &wn->widget); + g_signal_connect ( + section, "destroy", + G_CALLBACK (ec_widget_destroyed), wn); sectionnode = wn; break; case E_CONFIG_ITEM: @@ -1001,7 +1016,9 @@ ec_rebuild (EConfig *emp) wn->widget = w; if (w) { - g_signal_connect (w, "destroy", G_CALLBACK(gtk_widget_destroyed), &wn->widget); + g_signal_connect ( + w, "destroy", + G_CALLBACK (ec_widget_destroyed), wn); itemno++; if (gtk_widget_get_visible (w)) -- cgit v1.2.3