From e7591e2a541eccd80ddee3494f8f140a039e979a Mon Sep 17 00:00:00 2001 From: Sushma Rai Date: Fri, 22 Jul 2005 11:12:02 +0000 Subject: Showing the file_as name in the contact editor dialog title. Patch by "Arunprakash ". Fixes #235830. svn path=/trunk/; revision=29848 --- addressbook/gui/contact-editor/e-contact-editor.c | 33 ++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 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 04b5be12ee..e42986341d 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -517,20 +517,26 @@ name_entry_changed (GtkWidget *widget, EContactEditor *editor) string = gtk_entry_get_text (GTK_ENTRY (widget)); editor->name = e_contact_name_from_string (string); file_as_set_style (editor, style); + + if (string && !*string) + gtk_window_set_title (GTK_WINDOW (editor->app), _("Contact Editor")); } static void file_as_entry_changed (GtkWidget *widget, EContactEditor *editor) { char *string = gtk_editable_get_chars (GTK_EDITABLE (widget), 0, -1); - char *title; + gchar *title = _("Contact Editor"); - if (string && *string) - title = string; - else - title = _("Contact Editor"); + if (string && *string) { + title = g_strconcat (title, " - ", string, NULL); + gtk_window_set_title (GTK_WINDOW (editor->app), title); + g_free (title); + } + else { + gtk_window_set_title (GTK_WINDOW (editor->app), title); + } - gtk_window_set_title (GTK_WINDOW (editor->app), title); g_free (string); } @@ -2247,6 +2253,8 @@ static void fill_in_simple (EContactEditor *editor) { EContactName *name; + gchar *title = _("Contact Editor"); + gchar *filename; gint i; for (i = 0; i < G_N_ELEMENTS (simple_field_map); i++) { @@ -2276,6 +2284,19 @@ fill_in_simple (EContactEditor *editor) editor->name = name; + /* Update the contact editor title */ + + filename = (gchar *) e_contact_get (editor->contact, E_CONTACT_FILE_AS); + + if (filename) { + title = g_strconcat (title, " - ", filename, NULL); + gtk_window_set_title (GTK_WINDOW (editor->app), title); + g_free (title); + } + else { + gtk_window_set_title (GTK_WINDOW (editor->app), title); + } + /* Update file_as combo options */ update_file_as_combo (editor); -- cgit v1.2.3