aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-editor
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-10-19 11:32:55 +0800
committerChris Lahey <clahey@src.gnome.org>2000-10-19 11:32:55 +0800
commit6cb2f5ffe5aa4dc13eccf122ab763252aed0b025 (patch)
treee15e782baf931c8ac247e78db067b501f7d39bcd /addressbook/gui/contact-editor
parentf3533f595d179df1f433501bf7eaa0f5dbc3478c (diff)
downloadgsoc2013-evolution-6cb2f5ffe5aa4dc13eccf122ab763252aed0b025.tar
gsoc2013-evolution-6cb2f5ffe5aa4dc13eccf122ab763252aed0b025.tar.gz
gsoc2013-evolution-6cb2f5ffe5aa4dc13eccf122ab763252aed0b025.tar.bz2
gsoc2013-evolution-6cb2f5ffe5aa4dc13eccf122ab763252aed0b025.tar.lz
gsoc2013-evolution-6cb2f5ffe5aa4dc13eccf122ab763252aed0b025.tar.xz
gsoc2013-evolution-6cb2f5ffe5aa4dc13eccf122ab763252aed0b025.tar.zst
gsoc2013-evolution-6cb2f5ffe5aa4dc13eccf122ab763252aed0b025.zip
Added the function e_card_delivery_address_to_label.
2000-10-18 Christopher James Lahey <clahey@helixcode.com> * backend/ebook/e-card.c, backend/ebook/e-card.h: Added the function e_card_delivery_address_to_label. * contact-editor/e-contact-editor-address.c: Fixed a potential crash. * contact-editor/e-contact-editor.c: Made this save the changed data to the string version of the address. svn path=/trunk/; revision=6023
Diffstat (limited to 'addressbook/gui/contact-editor')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-address.c4
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c20
2 files changed, 14 insertions, 10 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor-address.c b/addressbook/gui/contact-editor/e-contact-editor-address.c
index fbba8c9454..7df9cb8cb4 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-address.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-address.c
@@ -205,8 +205,10 @@ static void
extract_info(EContactEditorAddress *editor)
{
ECardDeliveryAddress *address = editor->address;
- if (!address)
+ if (!address) {
address = e_card_delivery_address_new();
+ editor->address = address;
+ }
address->street = extract_field(editor, "entry-street" );
address->po = extract_field(editor, "entry-po" );
address->ext = extract_field(editor, "entry-ext" );
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index abf7f2fe77..cbff738340 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -533,22 +533,24 @@ full_addr_clicked(GtkWidget *button, EContactEditor *editor)
result = gnome_dialog_run (dialog);
if (result == 0) {
ECardDeliveryAddress *new_address;
+ GtkWidget *address_widget;
gtk_object_get(GTK_OBJECT(dialog),
"address", &new_address,
NULL);
e_card_simple_set_delivery_address(editor->simple, editor->address_choice, new_address);
- e_card_delivery_address_free(new_address);
-#if 0
- GtkWidget *fname_widget;
- fname_widget = glade_xml_get_widget(editor->gui, "text-address");
- if (fname_widget && GTK_IS_ENTRY(fname_widget)) {
- char *full_name = e_card_delivery_address_to_string(address);
- e_utf8_gtk_entry_set_text(GTK_ENTRY(fname_widget), full_name);
- g_free(full_name);
+ address_widget = glade_xml_get_widget(editor->gui, "text-address");
+ if (address_widget && GTK_IS_EDITABLE(address_widget)) {
+ char *string = e_card_delivery_address_to_string(new_address);
+ e_utf8_gtk_editable_set_text(GTK_EDITABLE(address_widget), string);
+ g_free(string);
+ } else {
+ ECardAddrLabel *address = e_card_delivery_address_to_label(new_address);
+ e_card_simple_set_address(editor->simple, editor->address_choice, address);
+ e_card_address_label_free(address);
}
-#endif
+ e_card_delivery_address_free(new_address);
}
gtk_object_unref(GTK_OBJECT(dialog));
}