aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/contact-editor/e-contact-editor.c
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/contact-editor/e-contact-editor.c
parent9aa111c5c129c90ede69ae644280004529f63839 (diff)
downloadgsoc2013-evolution-23c29cbcf654883e1243f51adb4bfe3556477cff.tar.gz
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/contact-editor/e-contact-editor.c')
-rw-r--r--addressbook/contact-editor/e-contact-editor.c72
1 files changed, 72 insertions, 0 deletions
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);
}
}
+
+
+
+
+
+
+
+
+