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
This commit is contained in:
Christopher James Lahey
2000-04-15 00:14:42 +00:00
committed by Chris Lahey
parent b8681b4d25
commit 82e77d6d8e
10 changed files with 86 additions and 26 deletions

View File

@ -1,3 +1,11 @@
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.
2000-04-15 Ettore Perazzoli <ettore@helixcode.com>
* addressbook/backend/ebook/e-card-cursor.h: #include

View File

@ -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) {

View File

@ -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. */

View File

@ -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]);

View File

@ -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]);

View File

@ -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", &note,
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);
}
}

View File

@ -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", &note,
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);
}
}

View File

@ -1,3 +1,7 @@
2000-04-14 Christopher James Lahey <clahey@helixcode.com>
* e-xml-utils.c: Fixing a warning.
2000-04-14 Christopher James Lahey <clahey@helixcode.com>
* e-xml-utils.c: Add g_return_if_fails.

View File

@ -1,3 +1,8 @@
2000-04-14 Christopher James Lahey <clahey@helixcode.com>
* e-shell-view.c: Made the left pane of the shell view not
autoresize.
2000-04-09 Matt Loper <matt@helixcode.com>
* e-shell-view.c (e_shell_view_setup): Set the default height

View File

@ -106,7 +106,7 @@ e_shell_view_setup_shortcut_display (EShellView *eshell_view)
gtk_paned_set_position (GTK_PANED (eshell_view->shortcut_hpaned), 100);
gtk_paned_pack1 (GTK_PANED (eshell_view->shortcut_hpaned),
eshell_view->shortcut_bar, FALSE, TRUE);
eshell_view->shortcut_bar, FALSE, FALSE);
gtk_widget_show (eshell_view->shortcut_bar);
gnome_app_set_contents (GNOME_APP (eshell_view), eshell_view->shortcut_hpaned);
@ -309,7 +309,7 @@ e_shell_view_new (EShell *eshell, EFolder *efolder, gboolean show_shortcut_bar)
if (eshell_view->shortcut_displayed){
gtk_paned_pack2 (
GTK_PANED (eshell_view->shortcut_hpaned),
eshell_view->priv->notebook, FALSE, TRUE);
eshell_view->priv->notebook, TRUE, TRUE);
}
else {
gnome_app_set_contents (GNOME_APP (eshell_view),