diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-04-15 08:14:42 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-04-15 08:14:42 +0800 |
commit | 82e77d6d8e73f418ae75d975324dbfa59218c4cd (patch) | |
tree | 260698e8c301d03f914c8f755abceb6c5cb7530b /addressbook | |
parent | b8681b4d2546a139781f8f6aea05c0fd29343f30 (diff) | |
download | gsoc2013-evolution-82e77d6d8e73f418ae75d975324dbfa59218c4cd.tar gsoc2013-evolution-82e77d6d8e73f418ae75d975324dbfa59218c4cd.tar.gz gsoc2013-evolution-82e77d6d8e73f418ae75d975324dbfa59218c4cd.tar.bz2 gsoc2013-evolution-82e77d6d8e73f418ae75d975324dbfa59218c4cd.tar.lz gsoc2013-evolution-82e77d6d8e73f418ae75d975324dbfa59218c4cd.tar.xz gsoc2013-evolution-82e77d6d8e73f418ae75d975324dbfa59218c4cd.tar.zst gsoc2013-evolution-82e77d6d8e73f418ae75d975324dbfa59218c4cd.zip |
Added a note field.
2000-04-14 Christopher James Lahey <clahey@helixcode.com>
* 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 <clahey@helixcode.com>
* e-shell-view.c: Made the left pane of the shell view not
autoresize.
svn path=/trunk/; revision=2444
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/backend/ebook/e-card.c | 47 | ||||
-rw-r--r-- | addressbook/backend/ebook/e-card.h | 7 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-backend-file.c | 1 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-backend-ldap.c | 2 | ||||
-rw-r--r-- | addressbook/contact-editor/e-contact-editor.c | 17 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 17 |
6 files changed, 67 insertions, 24 deletions
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); @@ -486,6 +492,14 @@ parse_title(ECard *card, VObject *vobj) } 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) { if ( card->id ) @@ -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]); diff --git a/addressbook/contact-editor/e-contact-editor.c b/addressbook/contact-editor/e-contact-editor.c index 2e0d2219a5..5461fe3993 100644 --- a/addressbook/contact-editor/e-contact-editor.c +++ b/addressbook/contact-editor/e-contact-editor.c @@ -584,6 +584,7 @@ fill_in_info(EContactEditor *editor) ECardList *email_list; char *title; char *url; + char *note; const ECardDeliveryAddress *address; const ECardPhone *phone; GtkEditable *editable; @@ -599,6 +600,7 @@ fill_in_info(EContactEditor *editor) "email", &email_list, "url", &url, "title", &title, + "note", ¬e, NULL); position = 0; @@ -645,6 +647,12 @@ fill_in_info(EContactEditor *editor) gtk_editable_delete_text(editable, 0, -1); if (title) gtk_editable_insert_text(editable, title, strlen(title), &position); + + position = 0; + editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "text-comments")); + gtk_editable_delete_text(editable, 0, -1); + if (note) + gtk_editable_insert_text(editable, note, strlen(note), &position); } } @@ -660,6 +668,7 @@ extract_info(EContactEditor *editor) ECardList *email_list; char *url; char *title; + char *note; const ECardDeliveryAddress *address; const ECardPhone *phone; ECardDeliveryAddress *address_copy; @@ -760,5 +769,13 @@ extract_info(EContactEditor *editor) NULL); g_free(title); + editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "text-comments")); + note = gtk_editable_get_chars(editable, 0, -1); + if (note && *note) + gtk_object_set(GTK_OBJECT(card), + "note", note, + NULL); + g_free(note); + } } diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 2e0d2219a5..5461fe3993 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -584,6 +584,7 @@ fill_in_info(EContactEditor *editor) ECardList *email_list; char *title; char *url; + char *note; const ECardDeliveryAddress *address; const ECardPhone *phone; GtkEditable *editable; @@ -599,6 +600,7 @@ fill_in_info(EContactEditor *editor) "email", &email_list, "url", &url, "title", &title, + "note", ¬e, NULL); position = 0; @@ -645,6 +647,12 @@ fill_in_info(EContactEditor *editor) gtk_editable_delete_text(editable, 0, -1); if (title) gtk_editable_insert_text(editable, title, strlen(title), &position); + + position = 0; + editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "text-comments")); + gtk_editable_delete_text(editable, 0, -1); + if (note) + gtk_editable_insert_text(editable, note, strlen(note), &position); } } @@ -660,6 +668,7 @@ extract_info(EContactEditor *editor) ECardList *email_list; char *url; char *title; + char *note; const ECardDeliveryAddress *address; const ECardPhone *phone; ECardDeliveryAddress *address_copy; @@ -760,5 +769,13 @@ extract_info(EContactEditor *editor) NULL); g_free(title); + editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "text-comments")); + note = gtk_editable_get_chars(editable, 0, -1); + if (note && *note) + gtk_object_set(GTK_OBJECT(card), + "note", note, + NULL); + g_free(note); + } } |