diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-04-09 11:04:47 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-04-09 11:04:47 +0800 |
commit | 75513364f1db91b894cacb8853d9486e74b45caf (patch) | |
tree | e658f21e6fd1407de3a6b041b41988b2d9b9d447 /addressbook/backend | |
parent | 2baf1a70830fc9a0a4cd9ef210c92c147490aeb3 (diff) | |
download | gsoc2013-evolution-75513364f1db91b894cacb8853d9486e74b45caf.tar.gz gsoc2013-evolution-75513364f1db91b894cacb8853d9486e74b45caf.tar.zst gsoc2013-evolution-75513364f1db91b894cacb8853d9486e74b45caf.zip |
Made the contact editor load from an ECard.
2000-04-08 Christopher James Lahey <clahey@helixcode.com>
* addressbook/contact-editor/Makefile.am,
addressbook/contact-editor/e-contact-editor.c,
addressbook/contact-editor/e-contact-editor.h,
addressbook/contact-editor/test-editor.c: Made the contact editor
load from an ECard.
* addressbook/backend/ebook/e-card.c,
addressbook/backend/ebook/e-card.h,
addressbook/gui/minicard/e-minicard.c: Added support for the URL
field.
svn path=/trunk/; revision=2349
Diffstat (limited to 'addressbook/backend')
-rw-r--r-- | addressbook/backend/ebook/e-card.c | 28 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-card.h | 2 |
2 files changed, 26 insertions, 4 deletions
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c index ea7e2ba373..227643fe8c 100644 --- a/addressbook/backend/ebook/e-card.c +++ b/addressbook/backend/ebook/e-card.c @@ -30,7 +30,8 @@ enum { ARG_ADDRESS, ARG_PHONE, ARG_EMAIL, - ARG_BIRTH_DATE + ARG_BIRTH_DATE, + ARG_URL }; #if 0 @@ -56,6 +57,7 @@ static void parse_name(ECard *card, VObject *object); static void parse_email(ECard *card, VObject *object); static void parse_phone(ECard *card, VObject *object); static void parse_address(ECard *card, VObject *object); +static void parse_url(ECard *card, VObject *object); static ECardPhoneFlags get_phone_flags (VObject *vobj); static void set_phone_flags (VObject *vobj, ECardPhoneFlags flags); @@ -74,7 +76,8 @@ struct { { VCBirthDateProp, parse_bday }, { VCEmailAddressProp, parse_email }, { VCTelephoneProp, parse_phone }, - { VCAdrProp, parse_address } + { VCAdrProp, parse_address }, + { VCURLProp, parse_url } }; /** @@ -251,6 +254,9 @@ char addPropValue(vobj, VCBirthDateProp, value); g_free(value); } + + if ( card->url ) + addPropValue(vobj, VCURLProp, card->url); #if 0 @@ -447,6 +453,14 @@ parse_address(ECard *card, VObject *vobj) } static void +parse_url(ECard *card, VObject *vobj) +{ + if ( card->url ) + g_free(card->url); + assign_string(vobj, &(card->url)); +} + +static void parse_attribute(ECard *card, VObject *vobj) { ParsePropertyFunc function = g_hash_table_lookup(E_CARD_CLASS(GTK_OBJECT(card)->klass)->attribute_jump_table, vObjectName(vobj)); @@ -490,6 +504,8 @@ e_card_class_init (ECardClass *klass) GTK_TYPE_OBJECT, GTK_ARG_READABLE, ARG_EMAIL); gtk_object_add_arg_type ("ECard::birth_date", GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_BIRTH_DATE); + gtk_object_add_arg_type ("ECard::url", + GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_URL); object_class->destroy = e_card_destroy; @@ -609,6 +625,10 @@ e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) g_free(card->bday); card->bday = GTK_VALUE_POINTER(*arg); break; + case ARG_URL: + if ( card->url ) + g_free(card->url); + card->url = GTK_VALUE_STRING(*arg); default: return; } @@ -653,6 +673,9 @@ e_card_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) case ARG_BIRTH_DATE: GTK_VALUE_POINTER(*arg) = card->bday; break; + case ARG_URL: + GTK_VALUE_STRING(*arg) = card->url; + break; default: arg->type = GTK_TYPE_INVALID; break; @@ -674,6 +697,7 @@ e_card_init (ECard *card) card->email = NULL; card->phone = NULL; card->address = NULL; + card->url = NULL; #if 0 c = g_new0 (ECard, 1); diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h index a8e1324b20..1f230159fb 100644 --- a/addressbook/backend/ebook/e-card.h +++ b/addressbook/backend/ebook/e-card.h @@ -40,10 +40,8 @@ struct _ECard { #endif ECardList *phone; /* Phone numbers (ECardPhone *) */ ECardList *email; /* Email addresses (char *) */ -#if 0 char *url; /* The person's web page. */ -#endif ECardDate *bday; /* The person's birthday. */ #if 0 |