From e3289853ca71aa3d5251f82215aca7c141835dad Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Wed, 31 Mar 2004 03:36:50 +0000 Subject: [ fixes bug #34777 ] 2004-03-30 Chris Toshok [ fixes bug #34777 ] * gui/contact-editor/e-contact-editor.c (file_as_entry_changed): set the window title to File As if the file as entry has something in it. "Contact Editor" otherwise. (set_entry_changed_signals): hook up the file-as-entry's "changed" signal. * gui/contact-list-editor/e-contact-list-editor.c (list_name_changed_cb): analogous fix, but "List Name" and "Contact List Editor". svn path=/trunk/; revision=25256 --- addressbook/ChangeLog | 14 ++++++++++++ addressbook/gui/contact-editor/e-contact-editor.c | 26 ++++++++++++++++++++-- .../contact-list-editor/e-contact-list-editor.c | 13 +++++++++++ 3 files changed, 51 insertions(+), 2 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index f785f272e6..b426e40064 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,17 @@ +2004-03-30 Chris Toshok + + [ fixes bug #34777 ] + + * gui/contact-editor/e-contact-editor.c (file_as_entry_changed): + set the window title to File As if the file as entry has something + in it. "Contact Editor" otherwise. + (set_entry_changed_signals): hook up the file-as-entry's "changed" + signal. + + * gui/contact-list-editor/e-contact-list-editor.c + (list_name_changed_cb): analogous fix, but "List Name" and + "Contact List Editor". + 2004-03-30 Chris Toshok [ fixes bug #53544 ] diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index c9833815ac..5e6ebd86e8 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -1138,7 +1138,6 @@ file_as_set_style(EContactEditor *editor, int style) GList *strings = NULL; GtkEntry *file_as = GTK_ENTRY(glade_xml_get_widget(editor->gui, "entry-file-as")); GtkWidget *widget; - if (!(file_as && GTK_IS_ENTRY(file_as))) return; @@ -1191,6 +1190,24 @@ name_entry_changed (GtkWidget *widget, EContactEditor *editor) widget_changed (widget, editor); } +static void +file_as_entry_changed (GtkWidget *widget, EContactEditor *editor) +{ + char *string = gtk_editable_get_chars(GTK_EDITABLE (widget), 0, -1); + char *title; + + if (string && *string) + title = string; + else + title = _("Contact Editor"); + + gtk_window_set_title (GTK_WINDOW (editor->app), title); + + g_free (string); + + widget_changed (widget, editor); +} + static void company_entry_changed (GtkWidget *widget, EContactEditor *editor) { @@ -1300,6 +1317,12 @@ set_entry_changed_signals(EContactEditor *editor) G_CALLBACK (name_entry_changed), editor); } + widget = glade_xml_get_widget(editor->gui, "entry-file-as"); + if (widget && GTK_IS_ENTRY(widget)) { + g_signal_connect (widget, "changed", + G_CALLBACK (file_as_entry_changed), editor); + } + widget = glade_xml_get_widget(editor->gui, "entry-company"); if (widget && GTK_IS_ENTRY(widget)) { g_signal_connect (widget, "changed", @@ -1314,7 +1337,6 @@ set_entry_changed_signals(EContactEditor *editor) set_entry_changed_signal_field(editor, "entry-categories"); set_entry_changed_signal_field(editor, "entry-jobtitle"); - set_entry_changed_signal_field(editor, "entry-file-as"); set_entry_changed_signal_field(editor, "entry-manager"); set_entry_changed_signal_field(editor, "entry-assistant"); set_entry_changed_signal_field(editor, "entry-office"); diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index 3b37240b5b..0c762ff982 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -742,7 +742,20 @@ remove_entry_cb (GtkWidget *w, EContactListEditor *editor) static void list_name_changed_cb (GtkWidget *w, EContactListEditor *editor) { + char *string = gtk_editable_get_chars(GTK_EDITABLE (w), 0, -1); + char *title; + editor->changed = TRUE; + + if (string && *string) + title = string; + else + title = _("Contact List Editor"); + + gtk_window_set_title (GTK_WINDOW (editor->app), title); + + g_free (string); + command_state_changed (editor); } -- cgit v1.2.3