From 9aaf62bf4bcf15fa38fbb625adc35d3dbc4d2240 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Tue, 21 Dec 2004 20:47:40 +0000 Subject: Fixes #29309 2004-12-21 JP Rosevear Fixes #29309 * e-table-header-item.h: add field chooser dialog data member * e-table-header-item.c: remove weak pointer ref (ethi_popup_field_chooser): if we already have a dialog, just present it, otherwise create a new one and listen for its destruction svn path=/trunk/; revision=28169 --- widgets/table/e-table-header-item.c | 20 +++++++++++++++++--- widgets/table/e-table-header-item.h | 1 + 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'widgets') diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 44d54dd4e3..265d29fed0 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -141,6 +141,11 @@ ethi_dispose (GObject *object){ g_object_unref (ethi->full_header); ethi->full_header = NULL; + + if (ethi->etfcd) + g_object_remove_weak_pointer (G_OBJECT (ethi->etfcd), (gpointer *)ði->etfcd); + + if (ethi->config) g_object_unref (ethi->config); ethi->config = NULL; @@ -1377,13 +1382,22 @@ ethi_popup_remove_column(GtkWidget *widget, EthiHeaderInfo *info) static void ethi_popup_field_chooser(GtkWidget *widget, EthiHeaderInfo *info) { - GtkWidget *etfcd = e_table_field_chooser_dialog_new(); - g_object_set(etfcd, + if (info->ethi->etfcd) { + gtk_window_present (GTK_WINDOW (info->ethi->etfcd)); + + return; + } + + info->ethi->etfcd = e_table_field_chooser_dialog_new(); + g_object_add_weak_pointer (G_OBJECT (info->ethi->etfcd), (gpointer *)&info->ethi->etfcd); + + g_object_set(info->ethi->etfcd, "full_header", info->ethi->full_header, "header", info->ethi->eth, "dnd_code", info->ethi->dnd_code, NULL); - gtk_widget_show(etfcd); + + gtk_widget_show(info->ethi->etfcd); } static void diff --git a/widgets/table/e-table-header-item.h b/widgets/table/e-table-header-item.h index eafc50dc63..d1e539888c 100644 --- a/widgets/table/e-table-header-item.h +++ b/widgets/table/e-table-header-item.h @@ -95,6 +95,7 @@ typedef struct { ETableHeader *full_header; ETable *table; ETree *tree; + GtkWidget *etfcd; void *config; /* For keyboard navigation*/ -- cgit v1.2.3