From fe9f7e3ec70f318f8a58b35cb138faa0c34c6ed1 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 23 Nov 2007 09:45:46 +0000 Subject: ** Fix for bug #495711 2007-11-23 Milan Crha ** Fix for bug #495711 * gui/contact-editor/e-contact-editor.h: (struct _EContactEditor): * gui/contact-editor/e-contact-editor.c: (full_name_response), (full_name_clicked), (e_contact_editor_init): Keep track of previously created Full Name dialog and reuse it. svn path=/trunk/; revision=34575 --- addressbook/gui/contact-editor/e-contact-editor.c | 18 +++++++++++++----- addressbook/gui/contact-editor/e-contact-editor.h | 1 + 2 files changed, 14 insertions(+), 5 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 b1b30f0c33..9a78f9c381 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -2619,7 +2619,8 @@ full_name_response (GtkDialog *dialog, int response, EContactEditor *editor) file_as_set_style(editor, style); } - gtk_widget_hide (GTK_WIDGET (dialog)); + gtk_widget_destroy (GTK_WIDGET (dialog)); + editor->fullname_dialog = NULL; } static gint @@ -2627,18 +2628,23 @@ full_name_editor_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer d { if (widget) { if (GTK_IS_WIDGET (widget)) - gtk_widget_destroy(widget); - } + gtk_widget_destroy (widget); + } return TRUE; } static void full_name_clicked (GtkWidget *button, EContactEditor *editor) { - GtkDialog *dialog = GTK_DIALOG (e_contact_editor_fullname_new (editor->name)); + GtkDialog *dialog; gboolean fullname_supported; + if (editor->fullname_dialog) { + gtk_window_present (GTK_WINDOW (editor->fullname_dialog)); + return; + } + dialog = GTK_DIALOG (e_contact_editor_fullname_new (editor->name)); fullname_supported = is_field_supported (editor, E_CONTACT_FULL_NAME); g_object_set (dialog, @@ -2652,7 +2658,8 @@ full_name_clicked (GtkWidget *button, EContactEditor *editor) g_signal_connect_swapped (EAB_EDITOR (editor), "editor_closed", G_CALLBACK (full_name_editor_delete_event_cb), GTK_WIDGET (dialog)); - gtk_widget_show (GTK_WIDGET(dialog)); + gtk_widget_show (GTK_WIDGET (dialog)); + editor->fullname_dialog = GTK_WIDGET (dialog); } @@ -3326,6 +3333,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) e_contact_editor->image_changed = FALSE; e_contact_editor->in_async_call = FALSE; e_contact_editor->target_editable = TRUE; + e_contact_editor->fullname_dialog = NULL; e_contact_editor->categories_dialog = NULL; e_contact_editor->load_source_id = 0; diff --git a/addressbook/gui/contact-editor/e-contact-editor.h b/addressbook/gui/contact-editor/e-contact-editor.h index 10dd305347..e63c868158 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.h +++ b/addressbook/gui/contact-editor/e-contact-editor.h @@ -102,6 +102,7 @@ struct _EContactEditor /* signal ids for "writable_status" */ int target_editable_id; + GtkWidget *fullname_dialog; GtkWidget *categories_dialog; }; -- cgit v1.2.3