From 76e4c87d13f12e219c61987b34d87ba00f008826 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Mon, 22 Aug 2005 10:30:02 +0000 Subject: Commiting Devashish patch for #241219. 2005-08-19 Devashish Sharma 2005-08-22 Srinivasa Ragavan * Commiting Devashish patch for #241219. 2005-08-19 Devashish Sharma svn path=/trunk/; revision=30195 --- addressbook/gui/contact-editor/e-contact-editor.c | 29 +++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'addressbook/gui') diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 59f7b2cb78..50aef51334 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -2543,12 +2543,27 @@ full_name_clicked (GtkWidget *button, EContactEditor *editor) gtk_widget_destroy (GTK_WIDGET (dialog)); } +static void +response (GtkDialog *dialog, int response, EContactEditor *editor) +{ + char *categories = NULL; + GtkWidget *entry = glade_xml_get_widget(editor->gui, "entry-categories"); + + if (response == GTK_RESPONSE_OK) { + categories = e_categories_dialog_get_categories (E_CATEGORIES_DIALOG (dialog)); + if (entry && GTK_IS_ENTRY(entry)) + gtk_entry_set_text (GTK_ENTRY (entry), categories); + else + e_contact_set (editor->contact, E_CONTACT_CATEGORIES, categories); + } + gtk_widget_destroy(GTK_WIDGET(dialog)); +} + static void categories_clicked (GtkWidget *button, EContactEditor *editor) { char *categories = NULL; GtkDialog *dialog; - int result; GtkWidget *entry = glade_xml_get_widget(editor->gui, "entry-categories"); if (entry && GTK_IS_ENTRY(entry)) @@ -2561,18 +2576,12 @@ categories_clicked (GtkWidget *button, EContactEditor *editor) g_free (categories); return; } + + g_signal_connect(dialog, "response", + G_CALLBACK (response), editor); gtk_widget_show(GTK_WIDGET(dialog)); - result = gtk_dialog_run (dialog); g_free (categories); - if (result == GTK_RESPONSE_OK) { - categories = e_categories_dialog_get_categories (E_CATEGORIES_DIALOG (dialog)); - if (entry && GTK_IS_ENTRY(entry)) - gtk_entry_set_text (GTK_ENTRY (entry), categories); - else - e_contact_set (editor->contact, E_CONTACT_CATEGORIES, categories); - } - gtk_widget_destroy(GTK_WIDGET(dialog)); } static void -- cgit v1.2.3