From 23c29cbcf654883e1243f51adb4bfe3556477cff Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sun, 16 Apr 2000 11:36:03 +0000 Subject: Added orginization and role fields. 2000-04-16 Christopher James Lahey * 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 --- ChangeLog | 19 +++ addressbook/backend/ebook/e-card.c | 73 +++++++-- addressbook/backend/ebook/e-card.h | 3 + addressbook/backend/ebook/test-card.c | 14 ++ addressbook/backend/pas/pas-backend-file.c | 3 + addressbook/contact-editor/contact-editor.glade | 174 ++++++++++----------- .../contact-editor/e-contact-editor-strings.h | 2 +- addressbook/contact-editor/e-contact-editor.c | 72 +++++++++ .../gui/contact-editor/contact-editor.glade | 174 ++++++++++----------- .../gui/contact-editor/e-contact-editor-strings.h | 2 +- addressbook/gui/contact-editor/e-contact-editor.c | 72 +++++++++ addressbook/gui/minicard/e-minicard-view.c | 1 + addressbook/gui/minicard/e-minicard.c | 10 ++ addressbook/gui/widgets/e-minicard-view.c | 1 + addressbook/gui/widgets/e-minicard.c | 10 ++ 15 files changed, 445 insertions(+), 185 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b991cf0fd..6ae65b9524 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2000-04-16 Christopher James Lahey + + * 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. + 2000-04-15 Matt Loper * addressbook/gui/component/addressbook.c 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) { @@ -483,6 +499,19 @@ parse_url(ECard *card, VObject *vobj) assign_string(vobj, &(card->url)); } +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) { @@ -491,6 +520,14 @@ parse_title(ECard *card, VObject *vobj) assign_string(vobj, &(card->title)); } +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) { @@ -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 @@ Contact-editor contact-editor + + src + pixmaps + C + True + True True False False @@ -725,7 +731,7 @@ GtkEntry GtkCombo:entry - entry14 + entry-fileas True True True @@ -809,7 +815,6 @@ GtkButton button-email1 - True Placeholder @@ -842,7 +847,6 @@ GtkButton button-address1 - True Placeholder @@ -875,7 +879,6 @@ GtkButton button-phone4 - True Placeholder @@ -908,7 +911,6 @@ GtkButton button-phone2 - True Placeholder @@ -941,7 +943,6 @@ GtkButton button-phone1 - True Placeholder @@ -1057,7 +1058,6 @@ GtkButton button-phone3 - True Placeholder @@ -1427,7 +1427,7 @@ GtkEntry - entry5 + entry-department True True True @@ -1451,7 +1451,7 @@ GtkEntry - entry6 + entry-office True True True @@ -1475,7 +1475,7 @@ GtkEntry - entry7 + entry-profession True True True @@ -1595,7 +1595,7 @@ GnomeDateEdit - dateedit2 + dateedit-anniversary False False False @@ -1619,7 +1619,7 @@ GnomeDateEdit - dateedit1 + dateedit-birthday False False False @@ -1929,6 +1929,48 @@ True + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area2 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button28 + True + True + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button29 + True + True + GNOME_STOCK_BUTTON_APPLY + + + + GtkButton + button30 + True + True + GNOME_STOCK_BUTTON_CANCEL + + + GtkTable table2 @@ -2060,11 +2102,39 @@ + + + + + GnomeDialog + dialog-add-phone + False + New phone type + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + vbox2 + False + 8 + + 4 + True + True + GtkHButtonBox GnomeDialog:action_area - dialog-action_area2 + hbuttonbox1 GTK_BUTTONBOX_END 8 85 @@ -2080,56 +2150,21 @@ GtkButton - button28 - True - True - GNOME_STOCK_BUTTON_OK - - - - GtkButton - button29 + button43 True True - GNOME_STOCK_BUTTON_APPLY + + GNOME_STOCK_PIXMAP_ADD GtkButton - button30 + button44 True True GNOME_STOCK_BUTTON_CANCEL - - - - - GnomeDialog - dialog-add-phone - False - New phone type - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - False - False - False - False - - - GtkVBox - GnomeDialog:vbox - vbox2 - False - 8 - - 4 - True - True - GtkFrame @@ -2164,41 +2199,6 @@ - - - GtkHButtonBox - GnomeDialog:action_area - hbuttonbox1 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkButton - button43 - True - True - - GNOME_STOCK_PIXMAP_ADD - - - - GtkButton - button44 - True - True - GNOME_STOCK_BUTTON_CANCEL - - 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", ¬e, + "birth_date", &bday, NULL); position = 0; @@ -642,17 +648,41 @@ fill_in_info(EContactEditor *editor) if (url) 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 @@ Contact-editor contact-editor + + src + pixmaps + C + True + True True False False @@ -725,7 +731,7 @@ GtkEntry GtkCombo:entry - entry14 + entry-fileas True True True @@ -809,7 +815,6 @@ GtkButton button-email1 - True Placeholder @@ -842,7 +847,6 @@ GtkButton button-address1 - True Placeholder @@ -875,7 +879,6 @@ GtkButton button-phone4 - True Placeholder @@ -908,7 +911,6 @@ GtkButton button-phone2 - True Placeholder @@ -941,7 +943,6 @@ GtkButton button-phone1 - True Placeholder @@ -1057,7 +1058,6 @@ GtkButton button-phone3 - True Placeholder @@ -1427,7 +1427,7 @@ GtkEntry - entry5 + entry-department True True True @@ -1451,7 +1451,7 @@ GtkEntry - entry6 + entry-office True True True @@ -1475,7 +1475,7 @@ GtkEntry - entry7 + entry-profession True True True @@ -1595,7 +1595,7 @@ GnomeDateEdit - dateedit2 + dateedit-anniversary False False False @@ -1619,7 +1619,7 @@ GnomeDateEdit - dateedit1 + dateedit-birthday False False False @@ -1929,6 +1929,48 @@ True + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area2 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button28 + True + True + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button29 + True + True + GNOME_STOCK_BUTTON_APPLY + + + + GtkButton + button30 + True + True + GNOME_STOCK_BUTTON_CANCEL + + + GtkTable table2 @@ -2060,11 +2102,39 @@ + + + + + GnomeDialog + dialog-add-phone + False + New phone type + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + vbox2 + False + 8 + + 4 + True + True + GtkHButtonBox GnomeDialog:action_area - dialog-action_area2 + hbuttonbox1 GTK_BUTTONBOX_END 8 85 @@ -2080,56 +2150,21 @@ GtkButton - button28 - True - True - GNOME_STOCK_BUTTON_OK - - - - GtkButton - button29 + button43 True True - GNOME_STOCK_BUTTON_APPLY + + GNOME_STOCK_PIXMAP_ADD GtkButton - button30 + button44 True True GNOME_STOCK_BUTTON_CANCEL - - - - - GnomeDialog - dialog-add-phone - False - New phone type - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - False - False - False - False - False - - - GtkVBox - GnomeDialog:vbox - vbox2 - False - 8 - - 4 - True - True - GtkFrame @@ -2164,41 +2199,6 @@ - - - GtkHButtonBox - GnomeDialog:action_area - hbuttonbox1 - GTK_BUTTONBOX_END - 8 - 85 - 27 - 7 - 0 - - 0 - False - True - GTK_PACK_END - - - - GtkButton - button43 - True - True - - GNOME_STOCK_PIXMAP_ADD - - - - GtkButton - button44 - True - True - GNOME_STOCK_BUTTON_CANCEL - - 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", ¬e, + "birth_date", &bday, NULL); position = 0; @@ -642,17 +648,41 @@ fill_in_info(EContactEditor *editor) if (url) 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 #include +#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 #include +#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); -- cgit v1.2.3