From 82e77d6d8e73f418ae75d975324dbfa59218c4cd Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sat, 15 Apr 2000 00:14:42 +0000 Subject: Added a note field. 2000-04-14 Christopher James Lahey * addressbook/backend/ebook/e-card.c, addressbook/backend/ebook/e-card.h, addressbook/backend/pas/pas-backend-file.c, addressbook/backend/pas/pas-backend-ldap.c, addressbook/contact-editor/e-contact-editor.c: Added a note field. From shell/ChangeLog: 2000-04-14 Christopher James Lahey * e-shell-view.c: Made the left pane of the shell view not autoresize. svn path=/trunk/; revision=2444 --- addressbook/backend/ebook/e-card.c | 47 +++++++++++++++++------------- addressbook/backend/ebook/e-card.h | 7 +++-- addressbook/backend/pas/pas-backend-file.c | 1 + addressbook/backend/pas/pas-backend-ldap.c | 2 +- 4 files changed, 33 insertions(+), 24 deletions(-) (limited to 'addressbook/backend') diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c index 2f4e1d23b8..8c41b82648 100644 --- a/addressbook/backend/ebook/e-card.c +++ b/addressbook/backend/ebook/e-card.c @@ -33,6 +33,7 @@ enum { ARG_BIRTH_DATE, ARG_URL, ARG_TITLE, + ARG_NOTE, ARG_ID }; @@ -61,6 +62,7 @@ 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_title(ECard *card, VObject *object); +static void parse_note(ECard *card, VObject *object); static void parse_id(ECard *card, VObject *object); static ECardPhoneFlags get_phone_flags (VObject *vobj); @@ -83,6 +85,7 @@ struct { { VCAdrProp, parse_address }, { VCURLProp, parse_url }, { VCTitleProp, parse_title }, + { VCNoteProp, parse_note }, { VCUniqueStringProp, parse_id } }; @@ -274,6 +277,9 @@ char if (card->title) addPropValue(vobj, VCTitleProp, card->title); + + if (card->note) + addPropValue(vobj, VCNoteProp, card->note); if (card->id) addPropValue (vobj, VCUniqueStringProp, card->id); @@ -485,6 +491,14 @@ parse_title(ECard *card, VObject *vobj) assign_string(vobj, &(card->title)); } +static void +parse_note(ECard *card, VObject *vobj) +{ + if (card->note) + g_free(card->note); + assign_string(vobj, &(card->note)); +} + static void parse_id(ECard *card, VObject *vobj) { @@ -541,6 +555,8 @@ e_card_class_init (ECardClass *klass) GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_URL); gtk_object_add_arg_type ("ECard::title", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_TITLE); + gtk_object_add_arg_type ("ECard::note", + GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_NOTE); gtk_object_add_arg_type ("ECard::id", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ID); @@ -631,9 +647,10 @@ e_card_destroy (GtkObject *object) if (card->url) g_free(card->url); - if (card->title) g_free(card->title); + if (card->note) + g_free(card->note); if (card->email) gtk_object_unref(GTK_OBJECT(card->email)); @@ -678,6 +695,11 @@ e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id) g_free(card->title); card->title = g_strdup(GTK_VALUE_STRING(*arg)); break; + case ARG_NOTE: + if (card->note) + g_free (card->note); + card->note = g_strdup(GTK_VALUE_STRING(*arg)); + break; case ARG_ID: if (card->id) g_free(card->id); @@ -733,6 +755,9 @@ e_card_get_arg (GtkObject *object, GtkArg *arg, guint arg_id) case ARG_TITLE: GTK_VALUE_STRING(*arg) = card->title; break; + case ARG_NOTE: + GTK_VALUE_STRING(*arg) = card->note; + break; case ARG_ID: GTK_VALUE_STRING(*arg) = card->id; break; @@ -759,6 +784,7 @@ e_card_init (ECard *card) card->address = NULL; card->url = NULL; card->title = NULL; + card->note = NULL; #if 0 c = g_new0 (ECard, 1); @@ -768,7 +794,6 @@ e_card_init (ECard *card) c->role = c->comment = c->categories = - c->url = c->uid = e_card_prop_str_empty (); c->photo.type = PHOTO_JPEG; @@ -807,7 +832,6 @@ e_card_init (ECard *card) c->comment.prop.type = PROP_COMMENT; c->rev.prop.type = PROP_REV; c->sound.prop.type = PROP_SOUND; - c->url.prop.type = PROP_URL; c->uid.prop.type = PROP_UID; c->key.prop.type = PROP_KEY; @@ -877,7 +901,6 @@ e_card_free (ECard *card) e_card_prop_str_free (& card->role); e_card_prop_str_free (& card->categories); e_card_prop_str_free (& card->comment); - e_card_prop_str_free (& card->url); e_card_prop_str_free (& card->uid); /* address is a little more complicated */ @@ -1123,8 +1146,6 @@ get_CardProperty (VObject *o) if (has (vo, VCContentIDProp)) prop.value = VAL_CID; - else if (has (vo, VCURLValueProp)) - prop.value = VAL_URL; break; case PROP_ENCODING: @@ -1703,16 +1724,6 @@ e_card_construct_from_vobject (ECard *card, prop = &crd->sound.prop; crd->sound = get_CardSound (o); break; - case PROP_URL: - prop = &crd->url.prop; - crd->url.str = g_strdup (str_val (o)); - free (the_str); - break; - case PROP_UID: - prop = &crd->uid.prop; - crd->uid.str = g_strdup (str_val (o)); - free (the_str); - break; case PROP_VERSION: { char *str; @@ -1814,9 +1825,6 @@ add_CardProperty (VObject *o, CardProperty *prop) case VAL_CID: addProp (o, VCContentIDProp); break; - case VAL_URL: - addProp (o, VCURLValueProp); - break; case VAL_INLINE: /* Do nothing: INLINE is the default. Avoids file clutter. */ break; @@ -2260,7 +2268,6 @@ card_to_string (Card *crd) add_SoundType (string, crd->sound.type); }*/ - add_CardStrProperty_to_string (string, _ ("\nURL: "), &crd->url); add_CardStrProperty_to_string (string, _ ("\nUnique String: "), &crd->uid); if (crd->key.prop.used) { diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h index 19221488a5..5288c63c43 100644 --- a/addressbook/backend/ebook/e-card.h +++ b/addressbook/backend/ebook/e-card.h @@ -44,12 +44,13 @@ struct _ECard { ECardDate *bday; /* The person's birthday. */ + char *note; + -#if 0 - ECardOrg *org; /* The person's organization. */ -#endif char *title; /* The person's title w/in his org */ #if 0 + ECardOrg *org; /* The person's organization. */ + char *role; /* The person's role w/in his org */ ECardPhoto *logo; /* This person's org's logo. */ diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c index e7ed1925f0..7ec225703d 100644 --- a/addressbook/backend/pas/pas-backend-file.c +++ b/addressbook/backend/pas/pas-backend-file.c @@ -237,6 +237,7 @@ static struct prop_info { { "email", "email", PROP_TYPE_LIST, compare_email }, { "phone", "phone", PROP_TYPE_LIST, compare_phone }, { "address", "address", PROP_TYPE_LIST, compare_address }, + { "note", "note", PROP_TYPE_NORMAL, NULL }, }; static int num_prop_infos = sizeof(prop_info_table) / sizeof(prop_info_table[0]); diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c index e702c7166e..9b98a0ce1f 100644 --- a/addressbook/backend/pas/pas-backend-ldap.c +++ b/addressbook/backend/pas/pas-backend-ldap.c @@ -606,7 +606,7 @@ struct prop_info { { "full_name", "cn", PROP_TYPE_NORMAL, NULL }, { "title", "title", PROP_TYPE_NORMAL, NULL }, { "email", "mail", PROP_TYPE_LIST, construct_email_list }, - { "phone", "telephoneNumber", PROP_TYPE_LIST, construct_phone_list } + { "phone", "telephoneNumber", PROP_TYPE_LIST, construct_phone_list }, }; static int num_prop_infos = sizeof(prop_info_table) / sizeof(prop_info_table[0]); -- cgit v1.2.3