diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-04-16 19:36:03 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-04-16 19:36:03 +0800 |
commit | 23c29cbcf654883e1243f51adb4bfe3556477cff (patch) | |
tree | 6f2435672bfe00d39a675e1bd02f72bd9c30be7c /addressbook/backend | |
parent | 9aa111c5c129c90ede69ae644280004529f63839 (diff) | |
download | gsoc2013-evolution-23c29cbcf654883e1243f51adb4bfe3556477cff.tar gsoc2013-evolution-23c29cbcf654883e1243f51adb4bfe3556477cff.tar.gz gsoc2013-evolution-23c29cbcf654883e1243f51adb4bfe3556477cff.tar.bz2 gsoc2013-evolution-23c29cbcf654883e1243f51adb4bfe3556477cff.tar.lz gsoc2013-evolution-23c29cbcf654883e1243f51adb4bfe3556477cff.tar.xz gsoc2013-evolution-23c29cbcf654883e1243f51adb4bfe3556477cff.tar.zst gsoc2013-evolution-23c29cbcf654883e1243f51adb4bfe3556477cff.zip |
Added orginization and role fields.
2000-04-16 Christopher James Lahey <clahey@helixcode.com>
* addressbook/backend/ebook/e-card.c,
addressbook/backend/ebook/e-card.h,
addressbook/backend/ebook/test-card.c,
addressbook/backend/pas/pas-backend-file.c,
addressbook/gui/minicard/e-minicard.c: Added orginization and role
fields.
* addressbook/contact-editor/contact-editor.glade,
addressbook/contact-editor/e-contact-editor-strings.h: Renamed
some incorrectly named fields.
* addressbook/contact-editor/e-contact-editor.c: Added
orginization and role fields as well as hooking up the birth date
field.
* addressbook/gui/minicard/e-minicard-view.c: Added a missing include.
svn path=/trunk/; revision=2458
Diffstat (limited to 'addressbook/backend')
-rw-r--r-- | addressbook/backend/ebook/e-card.c | 73 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-card.h | 3 | ||||
-rw-r--r-- | addressbook/backend/ebook/test-card.c | 14 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-backend-file.c | 3 |
4 files changed, 84 insertions, 9 deletions
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c index 8c41b82648..bc5b253b17 100644 --- a/addressbook/backend/ebook/e-card.c +++ b/addressbook/backend/ebook/e-card.c @@ -32,7 +32,9 @@ enum { ARG_EMAIL, ARG_BIRTH_DATE, ARG_URL, + ARG_ORG, ARG_TITLE, + ARG_ROLE, ARG_NOTE, ARG_ID }; @@ -61,7 +63,9 @@ 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 void parse_org(ECard *card, VObject *object); static void parse_title(ECard *card, VObject *object); +static void parse_role(ECard *card, VObject *object); static void parse_note(ECard *card, VObject *object); static void parse_id(ECard *card, VObject *object); @@ -84,7 +88,9 @@ struct { { VCTelephoneProp, parse_phone }, { VCAdrProp, parse_address }, { VCURLProp, parse_url }, + { VCOrgProp, parse_org }, { VCTitleProp, parse_title }, + { VCBusinessRoleProp, parse_role }, { VCNoteProp, parse_note }, { VCUniqueStringProp, parse_id } }; @@ -275,8 +281,19 @@ char if (card->url) addPropValue(vobj, VCURLProp, card->url); + if (card->org) { + VObject *orgprop; + orgprop = addProp(vobj, VCOrgProp); + + if (card->org) + addPropValue(orgprop, VCOrgNameProp, card->org); + } + if (card->title) addPropValue(vobj, VCTitleProp, card->title); + + if (card->role) + addPropValue(vobj, VCBusinessRoleProp, card->role); if (card->note) addPropValue(vobj, VCNoteProp, card->note); @@ -337,7 +354,6 @@ char add_CardProperty (vprop, &crd->geopos.prop); } - add_CardStrProperty (vobj, VCTitleProp, &crd->title); add_CardStrProperty (vobj, VCBusinessRoleProp, &crd->role); if (crd->logo.prop.used) { @@ -484,6 +500,19 @@ parse_url(ECard *card, VObject *vobj) } static void +parse_org(ECard *card, VObject *vobj) +{ + char *temp; + + temp = e_v_object_get_child_value(vobj, VCOrgNameProp); + if (temp) { + if (card->org) + g_free(card->org); + card->org = temp; + } +} + +static void parse_title(ECard *card, VObject *vobj) { if ( card->title ) @@ -492,6 +521,14 @@ parse_title(ECard *card, VObject *vobj) } static void +parse_role(ECard *card, VObject *vobj) +{ + if (card->role) + g_free(card->role); + assign_string(vobj, &(card->role)); +} + +static void parse_note(ECard *card, VObject *vobj) { if (card->note) @@ -553,8 +590,12 @@ e_card_class_init (ECardClass *klass) GTK_TYPE_POINTER, GTK_ARG_READWRITE, ARG_BIRTH_DATE); gtk_object_add_arg_type ("ECard::url", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_URL); + gtk_object_add_arg_type ("ECard::org", + GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ORG); gtk_object_add_arg_type ("ECard::title", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_TITLE); + gtk_object_add_arg_type ("ECard::role", + GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ROLE); gtk_object_add_arg_type ("ECard::note", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_NOTE); gtk_object_add_arg_type ("ECard::id", @@ -647,8 +688,12 @@ e_card_destroy (GtkObject *object) if (card->url) g_free(card->url); + if (card->org) + g_free(card->org); if (card->title) g_free(card->title); + if (card->role) + g_free(card->role); if (card->note) g_free(card->note); @@ -690,11 +735,21 @@ e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) g_free(card->url); card->url = g_strdup(GTK_VALUE_STRING(*arg)); break; + case ARG_ORG: + if (card->org) + g_free(card->org); + card->org = g_strdup(GTK_VALUE_STRING(*arg)); + break; case ARG_TITLE: if ( card->title ) g_free(card->title); card->title = g_strdup(GTK_VALUE_STRING(*arg)); break; + case ARG_ROLE: + if (card->role) + g_free(card->role); + card->role = g_strdup(GTK_VALUE_STRING(*arg)); + break; case ARG_NOTE: if (card->note) g_free (card->note); @@ -752,9 +807,15 @@ e_card_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) case ARG_URL: GTK_VALUE_STRING(*arg) = card->url; break; + case ARG_ORG: + GTK_VALUE_STRING(*arg) = card->org; + break; case ARG_TITLE: GTK_VALUE_STRING(*arg) = card->title; break; + case ARG_ROLE: + GTK_VALUE_STRING(*arg) = card->role; + break; case ARG_NOTE: GTK_VALUE_STRING(*arg) = card->note; break; @@ -783,7 +844,9 @@ e_card_init (ECard *card) card->phone = NULL; card->address = NULL; card->url = NULL; + card->org = NULL; card->title = NULL; + card->role = NULL; card->note = NULL; #if 0 @@ -824,7 +887,6 @@ e_card_init (ECard *card) c->mailer.prop.type = PROP_MAILER; c->timezn.prop.type = PROP_TIMEZN; c->geopos.prop.type = PROP_GEOPOS; - c->title.prop.type = PROP_TITLE; c->role.prop.type = PROP_ROLE; c->logo.prop.type = PROP_LOGO; c->org.prop.type = PROP_ORG; @@ -897,7 +959,6 @@ e_card_free (ECard *card) e_card_sound_free (card->sound); e_card_prop_str_free (& card->mailer); - e_card_prop_str_free (& card->title); e_card_prop_str_free (& card->role); e_card_prop_str_free (& card->categories); e_card_prop_str_free (& card->comment); @@ -1682,11 +1743,6 @@ e_card_construct_from_vobject (ECard *card, prop = &crd->geopos.prop; crd->geopos = strtoCardGeoPos (str_val (o)); break; - case PROP_TITLE: - prop = &crd->title.prop; - crd->title.str = g_strdup (str_val (o)); - free (the_str); - break; case PROP_ROLE: prop = &crd->role.prop; crd->role.str = g_strdup (str_val (o)); @@ -2232,7 +2288,6 @@ card_to_string (Card *crd) free (str); } - add_CardStrProperty_to_string (string, _ ("\nTitle: "), &crd->title); add_CardStrProperty_to_string (string, _ ("\nBusiness Role: "), &crd->role); /* if (crd->logo.prop.used) { diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h index 5288c63c43..e70b3337c2 100644 --- a/addressbook/backend/ebook/e-card.h +++ b/addressbook/backend/ebook/e-card.h @@ -47,7 +47,10 @@ struct _ECard { char *note; + char *org; /* The person's organization. */ + char *role; /* The person's role w/in his ord */ char *title; /* The person's title w/in his org */ + #if 0 ECardOrg *org; /* The person's organization. */ diff --git a/addressbook/backend/ebook/test-card.c b/addressbook/backend/ebook/test-card.c index e31495ec3b..598900c9e5 100644 --- a/addressbook/backend/ebook/test-card.c +++ b/addressbook/backend/ebook/test-card.c @@ -8,8 +8,12 @@ " \ "N:Friedman;Nat;D;Mr. " \ +"ORG:Helix Code, Inc. +" \ "TITLE:Head Geek " \ +"ROLE:Programmer/Executive +" \ "BDAY:1977-08-06 " \ "TEL;WORK:617 679 1984 @@ -62,7 +66,9 @@ main (int argc, char **argv) /* Fields */ char *fname; + char *org; char *title; + char *role; ECardName *name; ECardList *address; ECardList *phone; @@ -95,7 +101,9 @@ main (int argc, char **argv) "address", &address, "phone", &phone, "email", &email, + "org", &org, "title", &title, + "role", &role, "birth_date", &bday, NULL); if ( fname ) { @@ -115,9 +123,15 @@ main (int argc, char **argv) if ( name->suffix ) printf(" suffix : %s\n", name->suffix); } + if ( org ) { + printf("Company : %s\n", org); + } if ( title ) { printf("Title : %s\n", title); } + if ( role ) { + printf("Profession : %s\n", role); + } if ( bday ) { printf("BDay : %4d-%02d-%02d\n", bday->year, bday->month, bday->day); } diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c index 7ec225703d..67b4d50881 100644 --- a/addressbook/backend/pas/pas-backend-file.c +++ b/addressbook/backend/pas/pas-backend-file.c @@ -234,6 +234,9 @@ static struct prop_info { { "full_name", "full_name", PROP_TYPE_NORMAL, NULL }, { "url", "url", PROP_TYPE_NORMAL, NULL }, { "mailer", "mailer", PROP_TYPE_NORMAL, NULL }, + { "org", "org", PROP_TYPE_NORMAL, NULL }, + { "title", "title", PROP_TYPE_NORMAL, NULL }, + { "role", "role", PROP_TYPE_NORMAL, NULL }, { "email", "email", PROP_TYPE_LIST, compare_email }, { "phone", "phone", PROP_TYPE_LIST, compare_phone }, { "address", "address", PROP_TYPE_LIST, compare_address }, |