From 44b6cb5d3b3cf5c0fda8ed34fba5ccbae891df14 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 13 Aug 2013 15:26:44 +0200 Subject: Bug #698723 - Crash on saving contact with categories --- addressbook/gui/contact-editor/e-contact-editor.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 0d3f41e2d5..8e126d0260 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -3308,23 +3308,13 @@ categories_response (GtkDialog *dialog, editor->categories_dialog = NULL; } -static gint -categories_editor_delete_event_cb (GtkWidget *widget, - GdkEvent *event, - gpointer data) -{ - if (GTK_IS_WIDGET (widget)) - gtk_widget_destroy (widget); - - return TRUE; -} - static void categories_clicked (GtkWidget *button, EContactEditor *editor) { gchar *categories = NULL; GtkDialog *dialog; + GtkWindow *window; GtkWidget *entry = e_builder_get_widget (editor->builder, "entry-categories"); if (entry && GTK_IS_ENTRY (entry)) @@ -3348,10 +3338,12 @@ categories_clicked (GtkWidget *button, dialog, "response", G_CALLBACK (categories_response), editor); - /* Close the category dialog if the editor is closed*/ - g_signal_connect_swapped ( - editor, "editor_closed", - G_CALLBACK (categories_editor_delete_event_cb), dialog); + window = GTK_WINDOW (dialog); + + /* Close the category dialog if the editor is closed */ + gtk_window_set_destroy_with_parent (window, TRUE); + gtk_window_set_modal (window, FALSE); + gtk_window_set_transient_for (window, eab_editor_get_window (EAB_EDITOR (editor))); gtk_widget_show (GTK_WIDGET (dialog)); g_free (categories); -- cgit v1.2.3