diff options
author | Christopher James Lahey <clahey@ximian.com> | 2002-01-10 08:28:33 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2002-01-10 08:28:33 +0800 |
commit | f3e790f416d00968fa0e8eaeb36824e58fc5af16 (patch) | |
tree | a0d770a74a4c50c7f604f5cb3fc5c7d1bbfd5bc3 | |
parent | 42e8edbe5c6bbb0ea247f256e113a07949432017 (diff) | |
download | gsoc2013-evolution-f3e790f416d00968fa0e8eaeb36824e58fc5af16.tar gsoc2013-evolution-f3e790f416d00968fa0e8eaeb36824e58fc5af16.tar.gz gsoc2013-evolution-f3e790f416d00968fa0e8eaeb36824e58fc5af16.tar.bz2 gsoc2013-evolution-f3e790f416d00968fa0e8eaeb36824e58fc5af16.tar.lz gsoc2013-evolution-f3e790f416d00968fa0e8eaeb36824e58fc5af16.tar.xz gsoc2013-evolution-f3e790f416d00968fa0e8eaeb36824e58fc5af16.tar.zst gsoc2013-evolution-f3e790f416d00968fa0e8eaeb36824e58fc5af16.zip |
Choose the first filled in address field here. Fixes Ximian bug #2222.
2002-01-09 Christopher James Lahey <clahey@ximian.com>
* gui/contact-editor/e-contact-editor.c (set_fields): Choose the
first filled in address field here. Fixes Ximian bug #2222.
svn path=/trunk/; revision=15280
-rw-r--r-- | addressbook/ChangeLog | 5 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 28 |
2 files changed, 30 insertions, 3 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 961792a387..5285965d96 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,8 @@ +2002-01-09 Christopher James Lahey <clahey@ximian.com> + + * gui/contact-editor/e-contact-editor.c (set_fields): Choose the + first filled in address field here. Fixes Ximian bug #2222. + 2002-01-03 Joe Shaw <joe@ximian.com> * backend/ebook/test-card.c: Add a test for getting arbitrary diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index ea28563cc1..bfd78ebe2d 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -1908,7 +1908,7 @@ _address_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEdito gtk_check_menu_item_set_show_toggle(GTK_CHECK_MENU_ITEM(editor->address_info[i].widget), TRUE); } - + result = _arrow_pressed (widget, button, editor, editor->address_popup, &editor->address_list, &editor->address_info, "label-address", "text-address", "Add new Address type"); if (result != -1) { @@ -1941,6 +1941,8 @@ static void set_fields(EContactEditor *editor) { GtkWidget *entry; + GtkWidget *label_widget; + int i; entry = glade_xml_get_widget(editor->gui, "entry-phone1"); if (entry && GTK_IS_ENTRY(entry)) @@ -1961,8 +1963,28 @@ set_fields(EContactEditor *editor) entry = glade_xml_get_widget(editor->gui, "entry-email1"); if (entry && GTK_IS_ENTRY(entry)) set_field(GTK_ENTRY(entry), e_card_simple_get_email(editor->simple, editor->email_choice)); - - set_address_field(editor, -1); + + + + e_contact_editor_build_address_ui (editor); + + for (i = 0; i < E_CARD_SIMPLE_ADDRESS_ID_LAST; i++) { + const ECardAddrLabel *address = e_card_simple_get_address(editor->simple, i); + + if (address && address->data && *address->data) + break; + } + if (i == E_CARD_SIMPLE_ADDRESS_ID_LAST) + i = 0; + + label_widget = glade_xml_get_widget(editor->gui, "label-address"); + if (label_widget && GTK_IS_LABEL(label_widget)) { + gtk_object_set(GTK_OBJECT(label_widget), + "label", _(g_list_nth_data(editor->address_list, i)), + NULL); + } + + set_address_field(editor, i); } static void |