aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-04-16 19:36:03 +0800
committerChris Lahey <clahey@src.gnome.org>2000-04-16 19:36:03 +0800
commit23c29cbcf654883e1243f51adb4bfe3556477cff (patch)
tree6f2435672bfe00d39a675e1bd02f72bd9c30be7c /addressbook
parent9aa111c5c129c90ede69ae644280004529f63839 (diff)
downloadgsoc2013-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')
-rw-r--r--addressbook/backend/ebook/e-card.c73
-rw-r--r--addressbook/backend/ebook/e-card.h3
-rw-r--r--addressbook/backend/ebook/test-card.c14
-rw-r--r--addressbook/backend/pas/pas-backend-file.c3
-rw-r--r--addressbook/contact-editor/contact-editor.glade174
-rw-r--r--addressbook/contact-editor/e-contact-editor-strings.h2
-rw-r--r--addressbook/contact-editor/e-contact-editor.c72
-rw-r--r--addressbook/gui/contact-editor/contact-editor.glade174
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor-strings.h2
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c72
-rw-r--r--addressbook/gui/minicard/e-minicard-view.c1
-rw-r--r--addressbook/gui/minicard/e-minicard.c10
-rw-r--r--addressbook/gui/widgets/e-minicard-view.c1
-rw-r--r--addressbook/gui/widgets/e-minicard.c10
14 files changed, 426 insertions, 185 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 },
diff --git a/addressbook/contact-editor/contact-editor.glade b/addressbook/contact-editor/contact-editor.glade
index 24f98decac..1a7cf84a6e 100644
--- a/addressbook/contact-editor/contact-editor.glade
+++ b/addressbook/contact-editor/contact-editor.glade
@@ -4,6 +4,12 @@
<project>
<name>Contact-editor</name>
<program_name>contact-editor</program_name>
+ <directory></directory>
+ <source_directory>src</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
<use_widget_names>True</use_widget_names>
<output_main_file>False</output_main_file>
<output_support_files>False</output_support_files>
@@ -725,7 +731,7 @@
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
- <name>entry14</name>
+ <name>entry-fileas</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -809,7 +815,6 @@
<widget>
<class>GtkButton</class>
<name>button-email1</name>
- <can_focus>True</can_focus>
<widget>
<class>Placeholder</class>
@@ -842,7 +847,6 @@
<widget>
<class>GtkButton</class>
<name>button-address1</name>
- <can_focus>True</can_focus>
<widget>
<class>Placeholder</class>
@@ -875,7 +879,6 @@
<widget>
<class>GtkButton</class>
<name>button-phone4</name>
- <can_focus>True</can_focus>
<widget>
<class>Placeholder</class>
@@ -908,7 +911,6 @@
<widget>
<class>GtkButton</class>
<name>button-phone2</name>
- <can_focus>True</can_focus>
<widget>
<class>Placeholder</class>
@@ -941,7 +943,6 @@
<widget>
<class>GtkButton</class>
<name>button-phone1</name>
- <can_focus>True</can_focus>
<widget>
<class>Placeholder</class>
@@ -1057,7 +1058,6 @@
<widget>
<class>GtkButton</class>
<name>button-phone3</name>
- <can_focus>True</can_focus>
<widget>
<class>Placeholder</class>
@@ -1427,7 +1427,7 @@
<widget>
<class>GtkEntry</class>
- <name>entry5</name>
+ <name>entry-department</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -1451,7 +1451,7 @@
<widget>
<class>GtkEntry</class>
- <name>entry6</name>
+ <name>entry-office</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -1475,7 +1475,7 @@
<widget>
<class>GtkEntry</class>
- <name>entry7</name>
+ <name>entry-profession</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -1595,7 +1595,7 @@
<widget>
<class>GnomeDateEdit</class>
- <name>dateedit2</name>
+ <name>dateedit-anniversary</name>
<show_time>False</show_time>
<use_24_format>False</use_24_format>
<week_start_monday>False</week_start_monday>
@@ -1619,7 +1619,7 @@
<widget>
<class>GnomeDateEdit</class>
- <name>dateedit1</name>
+ <name>dateedit-birthday</name>
<show_time>False</show_time>
<use_24_format>False</use_24_format>
<week_start_monday>False</week_start_monday>
@@ -1930,6 +1930,48 @@
</child>
<widget>
+ <class>GtkHButtonBox</class>
+ <child_name>GnomeDialog:action_area</child_name>
+ <name>dialog-action_area2</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>8</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button28</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button29</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_APPLY</stock_button>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button30</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+ </widget>
+ </widget>
+
+ <widget>
<class>GtkTable</class>
<name>table2</name>
<rows>2</rows>
@@ -2060,11 +2102,39 @@
</widget>
</widget>
</widget>
+ </widget>
+</widget>
+
+<widget>
+ <class>GnomeDialog</class>
+ <name>dialog-add-phone</name>
+ <visible>False</visible>
+ <title>New phone type</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>False</allow_grow>
+ <auto_shrink>False</auto_shrink>
+ <auto_close>False</auto_close>
+ <hide_on_close>False</hide_on_close>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDialog:vbox</child_name>
+ <name>vbox2</name>
+ <homogeneous>False</homogeneous>
+ <spacing>8</spacing>
+ <child>
+ <padding>4</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
- <name>dialog-action_area2</name>
+ <name>hbuttonbox1</name>
<layout_style>GTK_BUTTONBOX_END</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
@@ -2080,56 +2150,21 @@
<widget>
<class>GtkButton</class>
- <name>button28</name>
- <can_default>True</can_default>
- <can_focus>True</can_focus>
- <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button29</name>
+ <name>button43</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
- <stock_button>GNOME_STOCK_BUTTON_APPLY</stock_button>
+ <label>Add</label>
+ <stock_pixmap>GNOME_STOCK_PIXMAP_ADD</stock_pixmap>
</widget>
<widget>
<class>GtkButton</class>
- <name>button30</name>
+ <name>button44</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
</widget>
- </widget>
-</widget>
-
-<widget>
- <class>GnomeDialog</class>
- <name>dialog-add-phone</name>
- <visible>False</visible>
- <title>New phone type</title>
- <type>GTK_WINDOW_TOPLEVEL</type>
- <position>GTK_WIN_POS_NONE</position>
- <modal>False</modal>
- <allow_shrink>False</allow_shrink>
- <allow_grow>False</allow_grow>
- <auto_shrink>False</auto_shrink>
- <auto_close>False</auto_close>
- <hide_on_close>False</hide_on_close>
-
- <widget>
- <class>GtkVBox</class>
- <child_name>GnomeDialog:vbox</child_name>
- <name>vbox2</name>
- <homogeneous>False</homogeneous>
- <spacing>8</spacing>
- <child>
- <padding>4</padding>
- <expand>True</expand>
- <fill>True</fill>
- </child>
<widget>
<class>GtkFrame</class>
@@ -2164,41 +2199,6 @@
</widget>
</widget>
</widget>
-
- <widget>
- <class>GtkHButtonBox</class>
- <child_name>GnomeDialog:action_area</child_name>
- <name>hbuttonbox1</name>
- <layout_style>GTK_BUTTONBOX_END</layout_style>
- <spacing>8</spacing>
- <child_min_width>85</child_min_width>
- <child_min_height>27</child_min_height>
- <child_ipad_x>7</child_ipad_x>
- <child_ipad_y>0</child_ipad_y>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>True</fill>
- <pack>GTK_PACK_END</pack>
- </child>
-
- <widget>
- <class>GtkButton</class>
- <name>button43</name>
- <can_default>True</can_default>
- <can_focus>True</can_focus>
- <label>Add</label>
- <stock_pixmap>GNOME_STOCK_PIXMAP_ADD</stock_pixmap>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button44</name>
- <can_default>True</can_default>
- <can_focus>True</can_focus>
- <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
- </widget>
- </widget>
</widget>
</widget>
diff --git a/addressbook/contact-editor/e-contact-editor-strings.h b/addressbook/contact-editor/e-contact-editor-strings.h
index 131dd6fdf4..b0795c166b 100644
--- a/addressbook/contact-editor/e-contact-editor-strings.h
+++ b/addressbook/contact-editor/e-contact-editor-strings.h
@@ -44,5 +44,5 @@ gchar *s = N_("Add");
gchar *s = N_("Delete");
gchar *s = N_("Phone Types");
gchar *s = N_("New phone type");
-gchar *s = N_("New phone type");
gchar *s = N_("Add");
+gchar *s = N_("New phone type");
diff --git a/addressbook/contact-editor/e-contact-editor.c b/addressbook/contact-editor/e-contact-editor.c
index 5461fe3993..74f7e06345 100644
--- a/addressbook/contact-editor/e-contact-editor.c
+++ b/addressbook/contact-editor/e-contact-editor.c
@@ -583,10 +583,13 @@ fill_in_info(EContactEditor *editor)
ECardList *phone_list;
ECardList *email_list;
char *title;
+ char *org;
char *url;
+ char *role;
char *note;
const ECardDeliveryAddress *address;
const ECardPhone *phone;
+ const ECardDate *bday;
GtkEditable *editable;
int position = 0;
const char *email;
@@ -599,8 +602,11 @@ fill_in_info(EContactEditor *editor)
"phone", &phone_list,
"email", &email_list,
"url", &url,
+ "org", &org,
"title", &title,
+ "role", &role,
"note", &note,
+ "birth_date", &bday,
NULL);
position = 0;
@@ -643,16 +649,40 @@ fill_in_info(EContactEditor *editor)
gtk_editable_insert_text(editable, url, strlen(url), &position);
position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-company"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (org)
+ gtk_editable_insert_text(editable, org, strlen(org), &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-profession"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (role)
+ gtk_editable_insert_text(editable, role, strlen(role), &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);
+
+ if (bday) {
+ struct tm time_struct = {0,0,0,0,0,0,0,0,0};
+ time_t time_val;
+ GnomeDateEdit *dateedit;
+ time_struct.tm_mday = bday->day;
+ time_struct.tm_mon = bday->month;
+ time_struct.tm_year = bday->year;
+ time_val = mktime(&time_struct);
+ dateedit = GNOME_DATE_EDIT(glade_xml_get_widget(editor->gui, "dateedit-birthday"));
+ gnome_date_edit_set_time(dateedit, time_val);
+ }
}
}
@@ -667,15 +697,21 @@ extract_info(EContactEditor *editor)
ECardList *phone_list;
ECardList *email_list;
char *url;
+ char *org;
char *title;
+ char *role;
char *note;
const ECardDeliveryAddress *address;
const ECardPhone *phone;
ECardDeliveryAddress *address_copy;
ECardPhone *phone_copy;
char *email;
+ ECardDate *bday;
GtkEditable *editable;
+ GnomeDateEdit *dateedit;
int position = 0;
+ struct tm time_struct;
+ time_t time_val;
ECardIterator *iterator;
@@ -761,6 +797,14 @@ extract_info(EContactEditor *editor)
NULL);
g_free(url);
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-company"));
+ org = gtk_editable_get_chars(editable, 0, -1);
+ if (org && *org)
+ gtk_object_set(GTK_OBJECT(card),
+ "org", org,
+ NULL);
+ g_free(org);
+
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-jobtitle"));
title = gtk_editable_get_chars(editable, 0, -1);
if (title && *title)
@@ -769,6 +813,14 @@ extract_info(EContactEditor *editor)
NULL);
g_free(title);
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-profession"));
+ role = gtk_editable_get_chars(editable, 0, -1);
+ if (role && *role)
+ gtk_object_set(GTK_OBJECT(card),
+ "role", role,
+ NULL);
+ g_free(role);
+
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "text-comments"));
note = gtk_editable_get_chars(editable, 0, -1);
if (note && *note)
@@ -777,5 +829,25 @@ extract_info(EContactEditor *editor)
NULL);
g_free(note);
+ dateedit = GNOME_DATE_EDIT(glade_xml_get_widget(editor->gui, "dateedit-birthday"));
+ time_val = gnome_date_edit_get_date(dateedit);
+ gmtime_r(&time_val,
+ &time_struct);
+ bday = g_new(ECardDate, 1);
+ bday->day = time_struct.tm_mday;
+ bday->month = time_struct.tm_mon;
+ bday->year = time_struct.tm_year;
+ gtk_object_set(GTK_OBJECT(card),
+ "birth_date", bday,
+ NULL);
}
}
+
+
+
+
+
+
+
+
+
diff --git a/addressbook/gui/contact-editor/contact-editor.glade b/addressbook/gui/contact-editor/contact-editor.glade
index 24f98decac..1a7cf84a6e 100644
--- a/addressbook/gui/contact-editor/contact-editor.glade
+++ b/addressbook/gui/contact-editor/contact-editor.glade
@@ -4,6 +4,12 @@
<project>
<name>Contact-editor</name>
<program_name>contact-editor</program_name>
+ <directory></directory>
+ <source_directory>src</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
<use_widget_names>True</use_widget_names>
<output_main_file>False</output_main_file>
<output_support_files>False</output_support_files>
@@ -725,7 +731,7 @@
<widget>
<class>GtkEntry</class>
<child_name>GtkCombo:entry</child_name>
- <name>entry14</name>
+ <name>entry-fileas</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -809,7 +815,6 @@
<widget>
<class>GtkButton</class>
<name>button-email1</name>
- <can_focus>True</can_focus>
<widget>
<class>Placeholder</class>
@@ -842,7 +847,6 @@
<widget>
<class>GtkButton</class>
<name>button-address1</name>
- <can_focus>True</can_focus>
<widget>
<class>Placeholder</class>
@@ -875,7 +879,6 @@
<widget>
<class>GtkButton</class>
<name>button-phone4</name>
- <can_focus>True</can_focus>
<widget>
<class>Placeholder</class>
@@ -908,7 +911,6 @@
<widget>
<class>GtkButton</class>
<name>button-phone2</name>
- <can_focus>True</can_focus>
<widget>
<class>Placeholder</class>
@@ -941,7 +943,6 @@
<widget>
<class>GtkButton</class>
<name>button-phone1</name>
- <can_focus>True</can_focus>
<widget>
<class>Placeholder</class>
@@ -1057,7 +1058,6 @@
<widget>
<class>GtkButton</class>
<name>button-phone3</name>
- <can_focus>True</can_focus>
<widget>
<class>Placeholder</class>
@@ -1427,7 +1427,7 @@
<widget>
<class>GtkEntry</class>
- <name>entry5</name>
+ <name>entry-department</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -1451,7 +1451,7 @@
<widget>
<class>GtkEntry</class>
- <name>entry6</name>
+ <name>entry-office</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -1475,7 +1475,7 @@
<widget>
<class>GtkEntry</class>
- <name>entry7</name>
+ <name>entry-profession</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
@@ -1595,7 +1595,7 @@
<widget>
<class>GnomeDateEdit</class>
- <name>dateedit2</name>
+ <name>dateedit-anniversary</name>
<show_time>False</show_time>
<use_24_format>False</use_24_format>
<week_start_monday>False</week_start_monday>
@@ -1619,7 +1619,7 @@
<widget>
<class>GnomeDateEdit</class>
- <name>dateedit1</name>
+ <name>dateedit-birthday</name>
<show_time>False</show_time>
<use_24_format>False</use_24_format>
<week_start_monday>False</week_start_monday>
@@ -1930,6 +1930,48 @@
</child>
<widget>
+ <class>GtkHButtonBox</class>
+ <child_name>GnomeDialog:action_area</child_name>
+ <name>dialog-action_area2</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>8</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button28</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button29</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_APPLY</stock_button>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button30</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+ </widget>
+ </widget>
+
+ <widget>
<class>GtkTable</class>
<name>table2</name>
<rows>2</rows>
@@ -2060,11 +2102,39 @@
</widget>
</widget>
</widget>
+ </widget>
+</widget>
+
+<widget>
+ <class>GnomeDialog</class>
+ <name>dialog-add-phone</name>
+ <visible>False</visible>
+ <title>New phone type</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>False</allow_grow>
+ <auto_shrink>False</auto_shrink>
+ <auto_close>False</auto_close>
+ <hide_on_close>False</hide_on_close>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>GnomeDialog:vbox</child_name>
+ <name>vbox2</name>
+ <homogeneous>False</homogeneous>
+ <spacing>8</spacing>
+ <child>
+ <padding>4</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
<widget>
<class>GtkHButtonBox</class>
<child_name>GnomeDialog:action_area</child_name>
- <name>dialog-action_area2</name>
+ <name>hbuttonbox1</name>
<layout_style>GTK_BUTTONBOX_END</layout_style>
<spacing>8</spacing>
<child_min_width>85</child_min_width>
@@ -2080,56 +2150,21 @@
<widget>
<class>GtkButton</class>
- <name>button28</name>
- <can_default>True</can_default>
- <can_focus>True</can_focus>
- <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button29</name>
+ <name>button43</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
- <stock_button>GNOME_STOCK_BUTTON_APPLY</stock_button>
+ <label>Add</label>
+ <stock_pixmap>GNOME_STOCK_PIXMAP_ADD</stock_pixmap>
</widget>
<widget>
<class>GtkButton</class>
- <name>button30</name>
+ <name>button44</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
</widget>
- </widget>
-</widget>
-
-<widget>
- <class>GnomeDialog</class>
- <name>dialog-add-phone</name>
- <visible>False</visible>
- <title>New phone type</title>
- <type>GTK_WINDOW_TOPLEVEL</type>
- <position>GTK_WIN_POS_NONE</position>
- <modal>False</modal>
- <allow_shrink>False</allow_shrink>
- <allow_grow>False</allow_grow>
- <auto_shrink>False</auto_shrink>
- <auto_close>False</auto_close>
- <hide_on_close>False</hide_on_close>
-
- <widget>
- <class>GtkVBox</class>
- <child_name>GnomeDialog:vbox</child_name>
- <name>vbox2</name>
- <homogeneous>False</homogeneous>
- <spacing>8</spacing>
- <child>
- <padding>4</padding>
- <expand>True</expand>
- <fill>True</fill>
- </child>
<widget>
<class>GtkFrame</class>
@@ -2164,41 +2199,6 @@
</widget>
</widget>
</widget>
-
- <widget>
- <class>GtkHButtonBox</class>
- <child_name>GnomeDialog:action_area</child_name>
- <name>hbuttonbox1</name>
- <layout_style>GTK_BUTTONBOX_END</layout_style>
- <spacing>8</spacing>
- <child_min_width>85</child_min_width>
- <child_min_height>27</child_min_height>
- <child_ipad_x>7</child_ipad_x>
- <child_ipad_y>0</child_ipad_y>
- <child>
- <padding>0</padding>
- <expand>False</expand>
- <fill>True</fill>
- <pack>GTK_PACK_END</pack>
- </child>
-
- <widget>
- <class>GtkButton</class>
- <name>button43</name>
- <can_default>True</can_default>
- <can_focus>True</can_focus>
- <label>Add</label>
- <stock_pixmap>GNOME_STOCK_PIXMAP_ADD</stock_pixmap>
- </widget>
-
- <widget>
- <class>GtkButton</class>
- <name>button44</name>
- <can_default>True</can_default>
- <can_focus>True</can_focus>
- <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
- </widget>
- </widget>
</widget>
</widget>
diff --git a/addressbook/gui/contact-editor/e-contact-editor-strings.h b/addressbook/gui/contact-editor/e-contact-editor-strings.h
index 131dd6fdf4..b0795c166b 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-strings.h
+++ b/addressbook/gui/contact-editor/e-contact-editor-strings.h
@@ -44,5 +44,5 @@ gchar *s = N_("Add");
gchar *s = N_("Delete");
gchar *s = N_("Phone Types");
gchar *s = N_("New phone type");
-gchar *s = N_("New phone type");
gchar *s = N_("Add");
+gchar *s = N_("New phone type");
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 5461fe3993..74f7e06345 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -583,10 +583,13 @@ fill_in_info(EContactEditor *editor)
ECardList *phone_list;
ECardList *email_list;
char *title;
+ char *org;
char *url;
+ char *role;
char *note;
const ECardDeliveryAddress *address;
const ECardPhone *phone;
+ const ECardDate *bday;
GtkEditable *editable;
int position = 0;
const char *email;
@@ -599,8 +602,11 @@ fill_in_info(EContactEditor *editor)
"phone", &phone_list,
"email", &email_list,
"url", &url,
+ "org", &org,
"title", &title,
+ "role", &role,
"note", &note,
+ "birth_date", &bday,
NULL);
position = 0;
@@ -643,16 +649,40 @@ fill_in_info(EContactEditor *editor)
gtk_editable_insert_text(editable, url, strlen(url), &position);
position = 0;
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-company"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (org)
+ gtk_editable_insert_text(editable, org, strlen(org), &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-profession"));
+ gtk_editable_delete_text(editable, 0, -1);
+ if (role)
+ gtk_editable_insert_text(editable, role, strlen(role), &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);
+
+ if (bday) {
+ struct tm time_struct = {0,0,0,0,0,0,0,0,0};
+ time_t time_val;
+ GnomeDateEdit *dateedit;
+ time_struct.tm_mday = bday->day;
+ time_struct.tm_mon = bday->month;
+ time_struct.tm_year = bday->year;
+ time_val = mktime(&time_struct);
+ dateedit = GNOME_DATE_EDIT(glade_xml_get_widget(editor->gui, "dateedit-birthday"));
+ gnome_date_edit_set_time(dateedit, time_val);
+ }
}
}
@@ -667,15 +697,21 @@ extract_info(EContactEditor *editor)
ECardList *phone_list;
ECardList *email_list;
char *url;
+ char *org;
char *title;
+ char *role;
char *note;
const ECardDeliveryAddress *address;
const ECardPhone *phone;
ECardDeliveryAddress *address_copy;
ECardPhone *phone_copy;
char *email;
+ ECardDate *bday;
GtkEditable *editable;
+ GnomeDateEdit *dateedit;
int position = 0;
+ struct tm time_struct;
+ time_t time_val;
ECardIterator *iterator;
@@ -761,6 +797,14 @@ extract_info(EContactEditor *editor)
NULL);
g_free(url);
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-company"));
+ org = gtk_editable_get_chars(editable, 0, -1);
+ if (org && *org)
+ gtk_object_set(GTK_OBJECT(card),
+ "org", org,
+ NULL);
+ g_free(org);
+
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-jobtitle"));
title = gtk_editable_get_chars(editable, 0, -1);
if (title && *title)
@@ -769,6 +813,14 @@ extract_info(EContactEditor *editor)
NULL);
g_free(title);
+ editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "entry-profession"));
+ role = gtk_editable_get_chars(editable, 0, -1);
+ if (role && *role)
+ gtk_object_set(GTK_OBJECT(card),
+ "role", role,
+ NULL);
+ g_free(role);
+
editable = GTK_EDITABLE(glade_xml_get_widget(editor->gui, "text-comments"));
note = gtk_editable_get_chars(editable, 0, -1);
if (note && *note)
@@ -777,5 +829,25 @@ extract_info(EContactEditor *editor)
NULL);
g_free(note);
+ dateedit = GNOME_DATE_EDIT(glade_xml_get_widget(editor->gui, "dateedit-birthday"));
+ time_val = gnome_date_edit_get_date(dateedit);
+ gmtime_r(&time_val,
+ &time_struct);
+ bday = g_new(ECardDate, 1);
+ bday->day = time_struct.tm_mday;
+ bday->month = time_struct.tm_mon;
+ bday->year = time_struct.tm_year;
+ gtk_object_set(GTK_OBJECT(card),
+ "birth_date", bday,
+ NULL);
}
}
+
+
+
+
+
+
+
+
+
diff --git a/addressbook/gui/minicard/e-minicard-view.c b/addressbook/gui/minicard/e-minicard-view.c
index 06c308ada8..080693b354 100644
--- a/addressbook/gui/minicard/e-minicard-view.c
+++ b/addressbook/gui/minicard/e-minicard-view.c
@@ -22,6 +22,7 @@
#include <config.h>
#include <gnome.h>
+#include "e-canvas.h"
#include "e-minicard-view.h"
#include "e-minicard.h"
static void e_minicard_view_init (EMinicardView *reflow);
diff --git a/addressbook/gui/minicard/e-minicard.c b/addressbook/gui/minicard/e-minicard.c
index 455b34c8b5..0b6cbd428a 100644
--- a/addressbook/gui/minicard/e-minicard.c
+++ b/addressbook/gui/minicard/e-minicard.c
@@ -448,7 +448,9 @@ remodel( EMinicard *e_minicard )
if (e_minicard->card) {
char *fname;
char *url;
+ char *org;
char *title;
+ char *role;
ECardList *address_list;
ECardList *phone_list;
ECardList *email_list;
@@ -469,7 +471,9 @@ remodel( EMinicard *e_minicard )
"phone", &phone_list,
"email", &email_list,
"url", &url,
+ "org", &org,
"title", &title,
+ "role", &role,
NULL);
if (fname) {
@@ -484,9 +488,15 @@ remodel( EMinicard *e_minicard )
"text", "",
NULL);
+ if (org)
+ add_field(e_minicard, "Company:", org);
+
if (title)
add_field(e_minicard, "Title:", title);
+ if (role)
+ add_field(e_minicard, "Profession:", role);
+
if (address_list) {
for (iterator = e_card_list_get_iterator(address_list); e_card_iterator_is_valid(iterator); e_card_iterator_next(iterator)) {
const ECardDeliveryAddress *address = e_card_iterator_get(iterator);
diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c
index 06c308ada8..080693b354 100644
--- a/addressbook/gui/widgets/e-minicard-view.c
+++ b/addressbook/gui/widgets/e-minicard-view.c
@@ -22,6 +22,7 @@
#include <config.h>
#include <gnome.h>
+#include "e-canvas.h"
#include "e-minicard-view.h"
#include "e-minicard.h"
static void e_minicard_view_init (EMinicardView *reflow);
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index 455b34c8b5..0b6cbd428a 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -448,7 +448,9 @@ remodel( EMinicard *e_minicard )
if (e_minicard->card) {
char *fname;
char *url;
+ char *org;
char *title;
+ char *role;
ECardList *address_list;
ECardList *phone_list;
ECardList *email_list;
@@ -469,7 +471,9 @@ remodel( EMinicard *e_minicard )
"phone", &phone_list,
"email", &email_list,
"url", &url,
+ "org", &org,
"title", &title,
+ "role", &role,
NULL);
if (fname) {
@@ -484,9 +488,15 @@ remodel( EMinicard *e_minicard )
"text", "",
NULL);
+ if (org)
+ add_field(e_minicard, "Company:", org);
+
if (title)
add_field(e_minicard, "Title:", title);
+ if (role)
+ add_field(e_minicard, "Profession:", role);
+
if (address_list) {
for (iterator = e_card_list_get_iterator(address_list); e_card_iterator_is_valid(iterator); e_card_iterator_next(iterator)) {
const ECardDeliveryAddress *address = e_card_iterator_get(iterator);