From 08e634b2b5d572d1cabe831415fdb6d1a77a345f Mon Sep 17 00:00:00 2001 From: Devashish Sharma Date: Tue, 28 Feb 2006 04:45:42 +0000 Subject: Fix for Bug #332498: Orphaned category editor crashes evo. svn path=/trunk/; revision=31600 --- addressbook/ChangeLog | 6 ++++++ addressbook/gui/contact-editor/e-contact-editor.c | 19 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index b49e6cfbd6..b4741de467 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,9 @@ +2006-02-27 Devashish Sharma + + * gui/contact-editor/e-contact-editor.c: Fix for Bug #332498: orphaned + category editor crashes Evo. + Close the category editor when the contact editor is closed. + 2006-02-27 Devashish Sharma * gui/component/addressbook-view.c (selector_tree_drag_data_received) : diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 2097eee1f6..120a73f13f 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -2622,7 +2622,7 @@ response (GtkDialog *dialog, int response, EContactEditor *editor) else e_contact_set (editor->contact, E_CONTACT_CATEGORIES, (char *)categories); } - gtk_widget_destroy(GTK_WIDGET(dialog)); + gtk_widget_hide(GTK_WIDGET(dialog)); } static gboolean @@ -2635,6 +2635,15 @@ categories_key_press_event( GtkWidget *widget, GdkEventKey *event, EContactEdito return FALSE; } +static gint +editor_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) +{ + if (widget) + if (GTK_IS_WIDGET (widget)) + gtk_widget_destroy(widget); + return TRUE; +} + static void categories_clicked (GtkWidget *button, EContactEditor *editor) { @@ -2656,7 +2665,11 @@ categories_clicked (GtkWidget *button, EContactEditor *editor) g_signal_connect (GTK_WIDGET (dialog), "key-press-event", G_CALLBACK (categories_key_press_event), editor); g_signal_connect(dialog, "response", - G_CALLBACK (response), editor); + G_CALLBACK (response), editor); + + /* Close the category dialog if the editor is closed*/ + g_signal_connect_swapped (EAB_EDITOR (editor), "editor_closed", + G_CALLBACK (editor_delete_event_cb), GTK_WIDGET (dialog)); gtk_widget_show(GTK_WIDGET(dialog)); g_free (categories); @@ -3137,7 +3150,7 @@ static gint app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) { EContactEditor *ce; - + ce = E_CONTACT_EDITOR (data); /* if we're saving, don't allow the dialog to close */ -- cgit