From 9e6feeb9fb6bf39d4809850f0833bed8a8a8387b Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Fri, 28 May 2004 22:55:12 +0000 Subject: Add back office, spouse, web log fields. Allow for 8 phone numbers, of 2004-05-28 Hans Petter Jansson * gui/contact-editor/contact-editor.glade: Add back office, spouse, web log fields. Allow for 8 phone numbers, of which 4 can be hidden. * gui/contact-editor/e-contact-editor.c (phones_default): Add more defaults. (im_service_default): Add more defaults. (expand_phone): Implement. (fill_in_phone_record): Expand if we have any records past 4. (init_im_record_location) (fill_in_im_record) (extract_im_record) (sensitize_im_record): Remove location. (simple_field_map): Add spouse, office, web log. (expand_phone_toggle): Implement. (e_contact_editor_init): Hook up expander button. svn path=/trunk/; revision=26128 --- addressbook/ChangeLog | 18 + .../gui/contact-editor/contact-editor.glade | 889 +++++++++++++-------- addressbook/gui/contact-editor/e-contact-editor.c | 74 +- 3 files changed, 650 insertions(+), 331 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 411d5a0034..6727dfd5a8 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,21 @@ +2004-05-28 Hans Petter Jansson + + * gui/contact-editor/contact-editor.glade: Add back office, spouse, + web log fields. Allow for 8 phone numbers, of which 4 can be hidden. + + * gui/contact-editor/e-contact-editor.c (phones_default): Add more + defaults. + (im_service_default): Add more defaults. + (expand_phone): Implement. + (fill_in_phone_record): Expand if we have any records past 4. + (init_im_record_location) + (fill_in_im_record) + (extract_im_record) + (sensitize_im_record): Remove location. + (simple_field_map): Add spouse, office, web log. + (expand_phone_toggle): Implement. + (e_contact_editor_init): Hook up expander button. + 2004-05-28 Christophe Fergeau * gui/component/addressbook-config.c: added missing #ifdef HAVE_LDAP diff --git a/addressbook/gui/contact-editor/contact-editor.glade b/addressbook/gui/contact-editor/contact-editor.glade index 59d3c0cea5..a1a136a03b 100644 --- a/addressbook/gui/contact-editor/contact-editor.glade +++ b/addressbook/gui/contact-editor/contact-editor.glade @@ -385,7 +385,7 @@ True False - 12 + 10 @@ -694,29 +694,27 @@ - + True - 0 - 0.5 - GTK_SHADOW_NONE + False + 0 - + True - True - GTK_POLICY_NEVER - GTK_POLICY_NEVER + 0 + 0.5 GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - + + 12 True - GTK_SHADOW_NONE + False + 6 - 11 True 2 4 @@ -964,28 +962,333 @@ + + 0 + False + True + + + + + + 2 + 4 + False + 6 + 6 + + + + True + True + 0 + + + + + + + True + Work + True + + + + + + + True + Personal + True + + + + + + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + True + 0 + + + + + + + True + Work + True + + + + + + + True + Personal + True + + + + + + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 0 + 1 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 1 + 2 + + + + + + + True + True + 0 + + + + + + + True + Work + True + + + + + + + True + Personal + True + + + + + + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + True + 0 + + + + + + + True + Work + True + + + + + + + True + Personal + True + + + + + + + + 2 + 3 + 1 + 2 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 3 + 4 + 0 + 1 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 3 + 4 + 1 + 2 + + + + + + 0 + False + True + - - - - - True - <b>Telephone</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 + + + True + False + 4 + + + + True + <b>Telephone</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + 20 + 20 + True + True + GTK_RELIEF_NONE + + + + True + GTK_ARROW_RIGHT + GTK_SHADOW_NONE + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + label_item + + - label_item + 0 + False + True @@ -1007,7 +1310,7 @@ 12 True - 3 + 2 4 False 6 @@ -1190,10 +1493,10 @@ - 0 - 1 - 2 - 3 + 2 + 3 + 0 + 1 fill @@ -1211,281 +1514,80 @@ * False - - 1 - 2 - 2 - 3 - - - - - - - True - True - 0 - - - - - - - True - Home - True - - - - - - - True - Work - True - - - - - - - True - Other - True - - - - - - - True - item7 - True - - - - - - - True - item8 - True - - - - - - 3 4 0 1 - fill - - - - - - - True - Location: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 2 - 3 - 0 - 1 - fill - - - - - - - True - Location: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 2 - 3 - 1 - 2 - fill - - - - - - - True - True - 0 - - - - - - - True - Home - True - - - - - - - True - Work - True - - - - - - - True - Other - True - - - - - - - True - item7 - True - - - - - - - True - item8 - True - - - - - - - - 3 - 4 - 1 - 2 - fill - - - - - - - True - Location: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 2 - 3 - 2 - 3 - fill - + True - True - 0 - - - - - - - True - Home - True - - - - - - - True - Work - True - - - + True + 0 + + + - + True - Other + AIM True - + - + True - item7 + Novell Groupwise True - + - + True - item8 + MSN Messenger True - + + + 2 + 3 + 1 + 2 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + 3 4 - 2 - 3 - fill + 1 + 2 @@ -1526,7 +1628,7 @@ - False + True True @@ -1568,7 +1670,7 @@ 12 True - 4 + 5 2 False 6 @@ -1615,8 +1717,8 @@ 0 1 - 1 - 2 + 2 + 3 fill @@ -1639,8 +1741,8 @@ 0 1 - 2 - 3 + 3 + 4 fill @@ -1649,7 +1751,7 @@ True - Webcam: + Video Chat: False False GTK_JUSTIFY_LEFT @@ -1663,8 +1765,8 @@ 0 1 - 3 - 4 + 4 + 5 fill @@ -1698,8 +1800,8 @@ 1 2 - 1 - 2 + 2 + 3 fill @@ -1715,8 +1817,8 @@ 1 2 - 2 - 3 + 3 + 4 fill @@ -1732,8 +1834,50 @@ 1 2 - 3 - 4 + 4 + 5 + fill + + + + + + True + Web Log: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + e_contact_editor_create_web + 0 + 0 + Tue, 13 Apr 2004 22:04:21 GMT + + + 1 + 2 + 1 + 2 + fill fill @@ -2092,38 +2236,15 @@ 12 True - 2 + 3 4 False 6 6 - - - True - Birthday: - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - 1 - 0 - 1 - fill - - - - + 38 True True GTK_POLICY_AUTOMATIC @@ -2152,8 +2273,8 @@ 1 4 - 1 - 2 + 2 + 3 @@ -2171,13 +2292,127 @@ 0 0 + + 0 + 1 + 2 + 3 + fill + fill + + + + + + True + Office: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Spouse: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + 0 1 1 2 fill - fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 0 + 1 + + + + + + + True + True + True + True + 0 + + True + * + False + + + 1 + 2 + 1 + 2 + + + + + + + True + Birthday: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 2 + 3 + 0 + 1 + fill + @@ -2198,38 +2433,38 @@ 2 3 - 0 - 1 + 1 + 2 fill - + True e_contact_editor_create_date 0 0 - Tue, 13 Apr 2004 23:55:46 GMT + Tue, 13 Apr 2004 23:56:03 GMT - 1 - 2 - 0 - 1 + 3 + 4 + 1 + 2 fill fill - + True e_contact_editor_create_date 0 0 - Tue, 13 Apr 2004 23:56:03 GMT + Tue, 13 Apr 2004 23:55:46 GMT 3 diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 2d058eca04..b0207439bb 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -72,8 +72,8 @@ #include "e-contact-editor-marshal.h" #define EMAIL_SLOTS 4 -#define PHONE_SLOTS 4 -#define IM_SLOTS 3 +#define PHONE_SLOTS 8 +#define IM_SLOTS 4 #define ADDRESS_SLOTS 3 #define EVOLUTION_UI_SLOT_PARAM "X-EVOLUTION-UI-SLOT" @@ -155,7 +155,7 @@ phones [] = { }; /* Defaults from the table above */ -gint phones_default [] = { 1, 6, 9, 2 }; +gint phones_default [] = { 1, 6, 9, 2, 7, 12, 10, 10 }; static EContactField addresses [] = { E_CONTACT_ADDRESS_WORK, @@ -184,7 +184,7 @@ im_service [] = }; /* Defaults from the table above */ -gint im_service_default [] = { 0, 2, 3 }; +gint im_service_default [] = { 0, 2, 4, 5 }; static struct { gchar *name; @@ -1023,6 +1023,24 @@ set_attributes_named (EVCard *vcard, const gchar *attr_name, GList *attr_list) } } +static void +expand_phone (EContactEditor *editor, gboolean expanded) +{ + GtkWidget *phone_ext_table; + GtkWidget *phone_ext_arrow; + + phone_ext_table = glade_xml_get_widget (editor->gui, "table-phone-extended"); + phone_ext_arrow = glade_xml_get_widget (editor->gui, "arrow-phone-expand"); + + if (expanded) { + gtk_arrow_set (GTK_ARROW (phone_ext_arrow), GTK_ARROW_DOWN, GTK_SHADOW_NONE); + gtk_widget_show (phone_ext_table); + } else { + gtk_arrow_set (GTK_ARROW (phone_ext_arrow), GTK_ARROW_RIGHT, GTK_SHADOW_NONE); + gtk_widget_hide (phone_ext_table); + } +} + static void fill_in_phone_record (EContactEditor *editor, gint record, const gchar *phone, gint phone_type) { @@ -1042,6 +1060,9 @@ fill_in_phone_record (EContactEditor *editor, gint record, const gchar *phone, g phone_type >= 0 ? phone_type : phones_default [record - 1]); set_entry_text (editor, GTK_ENTRY (phone_entry), phone ? phone : ""); + + if (phone && *phone && record >= 5) + expand_phone (editor, TRUE); } static void @@ -1197,6 +1218,8 @@ init_phone (EContactEditor *editor) { gint i; + expand_phone (editor, FALSE); + for (i = 1; i <= PHONE_SLOTS; i++) init_phone_record_type (editor, i); } @@ -1275,6 +1298,7 @@ init_im_record_location (EContactEditor *editor, gint record) name_entry = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); +#ifdef ENABLE_IM_LOCATION widget_name = g_strdup_printf ("optionmenu-im-location-%d", record); location_option_menu = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); @@ -1292,6 +1316,8 @@ init_im_record_location (EContactEditor *editor, gint record) gtk_option_menu_set_menu (GTK_OPTION_MENU (location_option_menu), location_menu); g_signal_connect (location_option_menu, "changed", G_CALLBACK (object_changed), editor); +#endif + g_signal_connect (name_entry, "changed", G_CALLBACK (object_changed), editor); g_signal_connect_swapped (name_entry, "activate", G_CALLBACK (entry_activated), editor); } @@ -1338,7 +1364,9 @@ static void fill_in_im_record (EContactEditor *editor, gint record, gint service, const gchar *name, gint location) { GtkWidget *service_option_menu; +#ifdef ENABLE_IM_LOCATION GtkWidget *location_option_menu; +#endif GtkWidget *name_entry; gchar *widget_name; @@ -1346,16 +1374,20 @@ fill_in_im_record (EContactEditor *editor, gint record, gint service, const gcha service_option_menu = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); +#ifdef ENABLE_IM_LOCATION widget_name = g_strdup_printf ("optionmenu-im-location-%d", record); location_option_menu = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); +#endif widget_name = g_strdup_printf ("entry-im-name-%d", record); name_entry = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); +#ifdef ENABLE_IM_LOCATION set_option_menu_history (editor, GTK_OPTION_MENU (location_option_menu), location >= 0 ? location : 0); +#endif set_option_menu_history (editor, GTK_OPTION_MENU (service_option_menu), service >= 0 ? service : im_service_default [record - 1]); set_entry_text (editor, GTK_ENTRY (name_entry), name ? name : ""); @@ -1402,7 +1434,9 @@ static void extract_im_record (EContactEditor *editor, gint record, gint *service, gchar **name, gint *location) { GtkWidget *service_option_menu; +#ifdef ENABLE_IM_LOCATION GtkWidget *location_option_menu; +#endif GtkWidget *name_entry; gchar *widget_name; @@ -1410,9 +1444,11 @@ extract_im_record (EContactEditor *editor, gint record, gint *service, gchar **n service_option_menu = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); +#ifdef ENABLE_IM_LOCATION widget_name = g_strdup_printf ("optionmenu-im-location-%d", record); location_option_menu = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); +#endif widget_name = g_strdup_printf ("entry-im-name-%d", record); name_entry = glade_xml_get_widget (editor->gui, widget_name); @@ -1420,7 +1456,11 @@ extract_im_record (EContactEditor *editor, gint record, gint *service, gchar **n *name = g_strdup (gtk_entry_get_text (GTK_ENTRY (name_entry))); *service = gtk_option_menu_get_history (GTK_OPTION_MENU (service_option_menu)); +#ifdef ENABLE_IM_LOCATION *location = gtk_option_menu_get_history (GTK_OPTION_MENU (location_option_menu)); +#else + *location = -1; +#endif } static void @@ -1492,7 +1532,9 @@ static void sensitize_im_record (EContactEditor *editor, gint record, gboolean enabled) { GtkWidget *service_option_menu; +#ifdef ENABLE_IM_LOCATION GtkWidget *location_option_menu; +#endif GtkWidget *name_entry; gchar *widget_name; @@ -1500,16 +1542,20 @@ sensitize_im_record (EContactEditor *editor, gint record, gboolean enabled) service_option_menu = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); +#ifdef ENABLE_IM_LOCATION widget_name = g_strdup_printf ("optionmenu-im-location-%d", record); location_option_menu = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); +#endif widget_name = g_strdup_printf ("entry-im-name-%d", record); name_entry = glade_xml_get_widget (editor->gui, widget_name); g_free (widget_name); gtk_widget_set_sensitive (service_option_menu, enabled); +#ifdef ENABLE_IM_LOCATION gtk_widget_set_sensitive (location_option_menu, enabled); +#endif gtk_widget_set_sensitive (name_entry, enabled); } @@ -1826,6 +1872,12 @@ static FieldMapping simple_field_map [] = { { "dateedit-anniversary", E_CONTACT_ANNIVERSARY, TRUE, TRUE }, { "label-anniversary", E_CONTACT_ANNIVERSARY, FALSE, FALSE }, + { "entry-spouse", E_CONTACT_SPOUSE, TRUE, TRUE }, + { "label-spouse", E_CONTACT_SPOUSE, FALSE, FALSE }, + + { "entry-office", E_CONTACT_OFFICE, TRUE, TRUE }, + { "label-office", E_CONTACT_OFFICE, FALSE, FALSE }, + { "text-comments", E_CONTACT_NOTE, TRUE, TRUE }, { "label-comments", E_CONTACT_NOTE, FALSE, FALSE }, @@ -1835,6 +1887,9 @@ static FieldMapping simple_field_map [] = { { "entry-categories", E_CONTACT_CATEGORIES, TRUE, TRUE }, { "button-categories", E_CONTACT_CATEGORIES, FALSE, TRUE }, + { "entry-weblog", E_CONTACT_BLOG_URL, TRUE, TRUE }, + { "label-weblog", E_CONTACT_BLOG_URL, FALSE, FALSE }, + { "entry-caluri", E_CONTACT_CALENDAR_URI, TRUE, TRUE }, { "label-caluri", E_CONTACT_CALENDAR_URI, FALSE, FALSE }, @@ -2769,6 +2824,15 @@ setup_tab_order(GladeXML *gui) } } +static void +expand_phone_toggle (EContactEditor *ce) +{ + GtkWidget *phone_ext_table; + + phone_ext_table = glade_xml_get_widget (ce->gui, "table-phone-extended"); + expand_phone (ce, GTK_WIDGET_VISIBLE (phone_ext_table) ? FALSE : TRUE); +} + static void e_contact_editor_init (EContactEditor *e_contact_editor) { @@ -2816,6 +2880,8 @@ e_contact_editor_init (EContactEditor *e_contact_editor) g_signal_connect (widget, "clicked", G_CALLBACK (file_cancel_cb), e_contact_editor); widget = glade_xml_get_widget (e_contact_editor->gui, "button-help"); g_signal_connect (widget, "clicked", G_CALLBACK (show_help_cb), e_contact_editor); + widget = glade_xml_get_widget (e_contact_editor->gui, "button-phone-expand"); + g_signal_connect_swapped (widget, "clicked", G_CALLBACK (expand_phone_toggle), e_contact_editor); widget = glade_xml_get_widget (e_contact_editor->gui, "entry-fullname"); if (widget) -- cgit v1.2.3