aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/backend/ebook/e-card.c78
-rw-r--r--addressbook/backend/ebook/e-card.h7
-rw-r--r--addressbook/backend/ebook/test-card.c15
-rw-r--r--addressbook/backend/pas/pas-backend-file.c2
-rw-r--r--addressbook/contact-editor/contact-editor.glade4
-rw-r--r--addressbook/contact-editor/e-contact-editor.c51
-rw-r--r--addressbook/gui/contact-editor/contact-editor.glade4
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c51
8 files changed, 206 insertions, 6 deletions
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index bc5b253b17..180b5308fc 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -33,8 +33,11 @@ enum {
ARG_BIRTH_DATE,
ARG_URL,
ARG_ORG,
+ ARG_ORG_UNIT,
ARG_TITLE,
ARG_ROLE,
+ ARG_NICKNAME,
+ ARG_FBURL,
ARG_NOTE,
ARG_ID
};
@@ -66,6 +69,8 @@ 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_nickname(ECard *card, VObject *object);
+static void parse_fburl(ECard *card, VObject *object);
static void parse_note(ECard *card, VObject *object);
static void parse_id(ECard *card, VObject *object);
@@ -91,6 +96,8 @@ struct {
{ VCOrgProp, parse_org },
{ VCTitleProp, parse_title },
{ VCBusinessRoleProp, parse_role },
+ { "NICKNAME", parse_nickname },
+ { "FBURL", parse_fburl },
{ VCNoteProp, parse_note },
{ VCUniqueStringProp, parse_id }
};
@@ -281,12 +288,14 @@ char
if (card->url)
addPropValue(vobj, VCURLProp, card->url);
- if (card->org) {
+ if (card->org || card->org_unit) {
VObject *orgprop;
orgprop = addProp(vobj, VCOrgProp);
if (card->org)
addPropValue(orgprop, VCOrgNameProp, card->org);
+ if (card->org_unit)
+ addPropValue(orgprop, VCOrgUnitProp, card->org_unit);
}
if (card->title)
@@ -295,6 +304,12 @@ char
if (card->role)
addPropValue(vobj, VCBusinessRoleProp, card->role);
+ if (card->nickname)
+ addPropValue(vobj, "NICKNAME", card->nickname);
+
+ if (card->fburl)
+ addPropValue(vobj, "FBURL", card->fburl);
+
if (card->note)
addPropValue(vobj, VCNoteProp, card->note);
@@ -510,6 +525,12 @@ parse_org(ECard *card, VObject *vobj)
g_free(card->org);
card->org = temp;
}
+ temp = e_v_object_get_child_value(vobj, VCOrgUnitProp);
+ if (temp) {
+ if (card->org_unit)
+ g_free(card->org_unit);
+ card->org_unit = temp;
+ }
}
static void
@@ -529,6 +550,22 @@ parse_role(ECard *card, VObject *vobj)
}
static void
+parse_nickname(ECard *card, VObject *vobj)
+{
+ if (card->nickname)
+ g_free(card->nickname);
+ assign_string(vobj, &(card->nickname));
+}
+
+static void
+parse_fburl(ECard *card, VObject *vobj)
+{
+ if (card->fburl)
+ g_free(card->fburl);
+ assign_string(vobj, &(card->fburl));
+}
+
+static void
parse_note(ECard *card, VObject *vobj)
{
if (card->note)
@@ -592,10 +629,16 @@ e_card_class_init (ECardClass *klass)
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::org_unit",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_ORG_UNIT);
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::nickname",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_NICKNAME);
+ gtk_object_add_arg_type ("ECard::fburl",
+ GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_FBURL);
gtk_object_add_arg_type ("ECard::note",
GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_NOTE);
gtk_object_add_arg_type ("ECard::id",
@@ -690,10 +733,16 @@ e_card_destroy (GtkObject *object)
g_free(card->url);
if (card->org)
g_free(card->org);
+ if (card->org_unit)
+ g_free(card->org_unit);
if (card->title)
g_free(card->title);
if (card->role)
g_free(card->role);
+ if (card->nickname)
+ g_free(card->nickname);
+ if (card->fburl)
+ g_free(card->fburl);
if (card->note)
g_free(card->note);
@@ -740,6 +789,11 @@ e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
g_free(card->org);
card->org = g_strdup(GTK_VALUE_STRING(*arg));
break;
+ case ARG_ORG_UNIT:
+ if (card->org_unit)
+ g_free(card->org_unit);
+ card->org_unit = g_strdup(GTK_VALUE_STRING(*arg));
+ break;
case ARG_TITLE:
if ( card->title )
g_free(card->title);
@@ -750,6 +804,16 @@ e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
g_free(card->role);
card->role = g_strdup(GTK_VALUE_STRING(*arg));
break;
+ case ARG_NICKNAME:
+ if (card->nickname)
+ g_free(card->nickname);
+ card->nickname = g_strdup(GTK_VALUE_STRING(*arg));
+ break;
+ case ARG_FBURL:
+ if (card->fburl)
+ g_free(card->fburl);
+ card->fburl = g_strdup(GTK_VALUE_STRING(*arg));
+ break;
case ARG_NOTE:
if (card->note)
g_free (card->note);
@@ -810,12 +874,21 @@ e_card_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
case ARG_ORG:
GTK_VALUE_STRING(*arg) = card->org;
break;
+ case ARG_ORG_UNIT:
+ GTK_VALUE_STRING(*arg) = card->org_unit;
+ break;
case ARG_TITLE:
GTK_VALUE_STRING(*arg) = card->title;
break;
case ARG_ROLE:
GTK_VALUE_STRING(*arg) = card->role;
break;
+ case ARG_NICKNAME:
+ GTK_VALUE_STRING(*arg) = card->nickname;
+ break;
+ case ARG_FBURL:
+ GTK_VALUE_STRING(*arg) = card->fburl;
+ break;
case ARG_NOTE:
GTK_VALUE_STRING(*arg) = card->note;
break;
@@ -845,8 +918,11 @@ e_card_init (ECard *card)
card->address = NULL;
card->url = NULL;
card->org = NULL;
+ card->org_unit = NULL;
card->title = NULL;
card->role = NULL;
+ card->nickname = NULL;
+ card->fburl = NULL;
card->note = NULL;
#if 0
diff --git a/addressbook/backend/ebook/e-card.h b/addressbook/backend/ebook/e-card.h
index e70b3337c2..15a5ca74c7 100644
--- a/addressbook/backend/ebook/e-card.h
+++ b/addressbook/backend/ebook/e-card.h
@@ -48,9 +48,14 @@ struct _ECard {
char *org; /* The person's organization. */
- char *role; /* The person's role w/in his ord */
+ char *org_unit; /* The person's organization unit. */
+ char *role; /* The person's role w/in his org */
char *title; /* The person's title w/in his org */
+ char *nickname; /* The person's nickname */
+
+ char *fburl; /* Free Busy URL */
+
#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 598900c9e5..a60569548b 100644
--- a/addressbook/backend/ebook/test-card.c
+++ b/addressbook/backend/ebook/test-card.c
@@ -67,8 +67,11 @@ main (int argc, char **argv)
/* Fields */
char *fname;
char *org;
+ char *org_unit;
char *title;
char *role;
+ char *nickname;
+ char *fburl;
ECardName *name;
ECardList *address;
ECardList *phone;
@@ -102,8 +105,11 @@ main (int argc, char **argv)
"phone", &phone,
"email", &email,
"org", &org,
+ "org_unit", &org_unit,
"title", &title,
"role", &role,
+ "nickname", &nickname,
+ "fburl", &fburl,
"birth_date", &bday,
NULL);
if ( fname ) {
@@ -126,12 +132,21 @@ main (int argc, char **argv)
if ( org ) {
printf("Company : %s\n", org);
}
+ if ( org_unit ) {
+ printf("Department : %s\n", org_unit);
+ }
if ( title ) {
printf("Title : %s\n", title);
}
if ( role ) {
printf("Profession : %s\n", role);
}
+ if ( nickname ) {
+ printf("Nickname : %s\n", nickname);
+ }
+ if ( fburl ) {
+ printf("Free Busy URL : %s\n", fburl);
+ }
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 67b4d50881..02ad7866b2 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -235,8 +235,10 @@ static struct prop_info {
{ "url", "url", PROP_TYPE_NORMAL, NULL },
{ "mailer", "mailer", PROP_TYPE_NORMAL, NULL },
{ "org", "org", PROP_TYPE_NORMAL, NULL },
+ { "org_unit", "org_unit", PROP_TYPE_NORMAL, NULL },
{ "title", "title", PROP_TYPE_NORMAL, NULL },
{ "role", "role", PROP_TYPE_NORMAL, NULL },
+ { "nickname", "nickname", 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 },
diff --git a/addressbook/contact-editor/contact-editor.glade b/addressbook/contact-editor/contact-editor.glade
index 1a7cf84a6e..e97c6999dd 100644
--- a/addressbook/contact-editor/contact-editor.glade
+++ b/addressbook/contact-editor/contact-editor.glade
@@ -1499,7 +1499,7 @@
<widget>
<class>GtkEntry</class>
- <name>entry8</name>
+ <name>entry-nickname</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -1571,7 +1571,7 @@
<widget>
<class>GtkEntry</class>
- <name>entry11</name>
+ <name>entry-fburl</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
diff --git a/addressbook/contact-editor/e-contact-editor.c b/addressbook/contact-editor/e-contact-editor.c
index 74f7e06345..2bb76cebe1 100644
--- a/addressbook/contact-editor/e-contact-editor.c
+++ b/addressbook/contact-editor/e-contact-editor.c
@@ -584,8 +584,11 @@ fill_in_info(EContactEditor *editor)
ECardList *email_list;
char *title;
char *org;
+ char *org_unit;
char *url;
char *role;
+ char *nickname;
+ char *fburl;
char *note;
const ECardDeliveryAddress *address;
const ECardPhone *phone;
@@ -603,8 +606,11 @@ fill_in_info(EContactEditor *editor)
"email", &email_list,
"url", &url,
"org", &org,
+ "org_unit", &org_unit,
"title", &title,
"role", &role,
+ "nickname", &nickname,
+ "fburl", &fburl,
"note", &note,
"birth_date", &bday,
NULL);
@@ -655,12 +661,30 @@ fill_in_info(EContactEditor *editor)
gtk_editable_insert_text(editable, org, strlen(org), &position);
position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-department"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (org_unit)
+ gtk_editable_insert_text(editable, org_unit, strlen(org_unit), &position);
+
+ position = 0;
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-jobtitle"));
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, "entry-nickname"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (nickname)
+ gtk_editable_insert_text(editable, nickname, strlen(nickname), &position);
+
+ position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-fburl"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (fburl)
+ gtk_editable_insert_text(editable, fburl, strlen(fburl), &position);
+
+ position = 0;
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-profession"));
gtk_editable_delete_text(editable, 0, -1);
if (role)
@@ -698,8 +722,11 @@ extract_info(EContactEditor *editor)
ECardList *email_list;
char *url;
char *org;
+ char *org_unit;
char *title;
char *role;
+ char *nickname;
+ char *fburl;
char *note;
const ECardDeliveryAddress *address;
const ECardPhone *phone;
@@ -805,6 +832,14 @@ extract_info(EContactEditor *editor)
NULL);
g_free(org);
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-department"));
+ org_unit = gtk_editable_get_chars(editable, 0, -1);
+ if (org_unit && *org_unit)
+ gtk_object_set(GTK_OBJECT(card),
+ "org_unit", org_unit,
+ NULL);
+ g_free(org_unit);
+
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-jobtitle"));
title = gtk_editable_get_chars(editable, 0, -1);
if (title && *title)
@@ -821,6 +856,22 @@ extract_info(EContactEditor *editor)
NULL);
g_free(role);
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-nickname"));
+ nickname = gtk_editable_get_chars(editable, 0, -1);
+ if (nickname && *nickname)
+ gtk_object_set(GTK_OBJECT(card),
+ "nickname", nickname,
+ NULL);
+ g_free(nickname);
+
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-fburl"));
+ fburl = gtk_editable_get_chars(editable, 0, -1);
+ if (fburl && *fburl)
+ gtk_object_set(GTK_OBJECT(card),
+ "fburl", fburl,
+ NULL);
+ g_free(fburl);
+
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "text-comments"));
note = gtk_editable_get_chars(editable, 0, -1);
if (note && *note)
diff --git a/addressbook/gui/contact-editor/contact-editor.glade b/addressbook/gui/contact-editor/contact-editor.glade
index 1a7cf84a6e..e97c6999dd 100644
--- a/addressbook/gui/contact-editor/contact-editor.glade
+++ b/addressbook/gui/contact-editor/contact-editor.glade
@@ -1499,7 +1499,7 @@
<widget>
<class>GtkEntry</class>
- <name>entry8</name>
+ <name>entry-nickname</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -1571,7 +1571,7 @@
<widget>
<class>GtkEntry</class>
- <name>entry11</name>
+ <name>entry-fburl</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 74f7e06345..2bb76cebe1 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -584,8 +584,11 @@ fill_in_info(EContactEditor *editor)
ECardList *email_list;
char *title;
char *org;
+ char *org_unit;
char *url;
char *role;
+ char *nickname;
+ char *fburl;
char *note;
const ECardDeliveryAddress *address;
const ECardPhone *phone;
@@ -603,8 +606,11 @@ fill_in_info(EContactEditor *editor)
"email", &email_list,
"url", &url,
"org", &org,
+ "org_unit", &org_unit,
"title", &title,
"role", &role,
+ "nickname", &nickname,
+ "fburl", &fburl,
"note", &note,
"birth_date", &bday,
NULL);
@@ -655,12 +661,30 @@ fill_in_info(EContactEditor *editor)
gtk_editable_insert_text(editable, org, strlen(org), &position);
position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-department"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (org_unit)
+ gtk_editable_insert_text(editable, org_unit, strlen(org_unit), &position);
+
+ position = 0;
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-jobtitle"));
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, "entry-nickname"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (nickname)
+ gtk_editable_insert_text(editable, nickname, strlen(nickname), &position);
+
+ position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-fburl"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (fburl)
+ gtk_editable_insert_text(editable, fburl, strlen(fburl), &position);
+
+ position = 0;
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-profession"));
gtk_editable_delete_text(editable, 0, -1);
if (role)
@@ -698,8 +722,11 @@ extract_info(EContactEditor *editor)
ECardList *email_list;
char *url;
char *org;
+ char *org_unit;
char *title;
char *role;
+ char *nickname;
+ char *fburl;
char *note;
const ECardDeliveryAddress *address;
const ECardPhone *phone;
@@ -805,6 +832,14 @@ extract_info(EContactEditor *editor)
NULL);
g_free(org);
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-department"));
+ org_unit = gtk_editable_get_chars(editable, 0, -1);
+ if (org_unit && *org_unit)
+ gtk_object_set(GTK_OBJECT(card),
+ "org_unit", org_unit,
+ NULL);
+ g_free(org_unit);
+
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-jobtitle"));
title = gtk_editable_get_chars(editable, 0, -1);
if (title && *title)
@@ -821,6 +856,22 @@ extract_info(EContactEditor *editor)
NULL);
g_free(role);
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-nickname"));
+ nickname = gtk_editable_get_chars(editable, 0, -1);
+ if (nickname && *nickname)
+ gtk_object_set(GTK_OBJECT(card),
+ "nickname", nickname,
+ NULL);
+ g_free(nickname);
+
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-fburl"));
+ fburl = gtk_editable_get_chars(editable, 0, -1);
+ if (fburl && *fburl)
+ gtk_object_set(GTK_OBJECT(card),
+ "fburl", fburl,
+ NULL);
+ g_free(fburl);
+
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "text-comments"));
note = gtk_editable_get_chars(editable, 0, -1);
if (note && *note)