aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2007-11-23 17:45:46 +0800
committerMilan Crha <mcrha@src.gnome.org>2007-11-23 17:45:46 +0800
commitfe9f7e3ec70f318f8a58b35cb138faa0c34c6ed1 (patch)
treeb56e28abdf1f5711a15318a61d10d0e0304614ed
parent906aa2cf6afa48c8431c62c0e9632434d6776086 (diff)
downloadgsoc2013-evolution-fe9f7e3ec70f318f8a58b35cb138faa0c34c6ed1.tar.gz
gsoc2013-evolution-fe9f7e3ec70f318f8a58b35cb138faa0c34c6ed1.tar.zst
gsoc2013-evolution-fe9f7e3ec70f318f8a58b35cb138faa0c34c6ed1.zip
** Fix for bug #495711
2007-11-23 Milan Crha <mcrha@redhat.com> ** 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
-rw-r--r--addressbook/ChangeLog9
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c18
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.h1
3 files changed, 23 insertions, 5 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index b1716b477c..9badf8e50d 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,12 @@
+2007-11-23 Milan Crha <mcrha@redhat.com>
+
+ ** 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.
+
2007-11-18 Gilles Dartiguelongue <gdartigu@svn.gnome.org>
** Fix bug #495875
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;
};