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 --- .../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 +++++++++ 3 files changed, 160 insertions(+), 88 deletions(-) (limited to 'addressbook/gui/contact-editor') 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); } } + + + + + + + + + -- cgit v1.2.3