From 177d079544c613add80ad1c6ec076afadc49dd82 Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Wed, 5 May 2004 02:40:00 +0000 Subject: Use defaults from Anna. (im_service_default): Ditto. (email_default): 2004-05-04 Hans Petter Jansson * gui/contact-editor/e-contact-editor.c (phones_default): Use defaults from Anna. (im_service_default): Ditto. (email_default): Ditto. (im_location): Renamed to common_location, as it's used by both IM and e-mail. (init_email_record_location): im_location -> common_location (init_im_record_location): Ditto. (email_index_to_location): Ditto. (im_index_to_location): Ditto. (get_email_location): Ditto. (get_im_location): Ditto. (fill_in_email_record): Consult defaults. (fill_in_im_record): Ditto. svn path=/trunk/; revision=25796 --- addressbook/ChangeLog | 17 ++++++++++++ addressbook/gui/contact-editor/e-contact-editor.c | 34 +++++++++++++---------- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index e604b7f703..c9b95e642a 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,20 @@ +2004-05-04 Hans Petter Jansson + + * gui/contact-editor/e-contact-editor.c (phones_default): Use defaults + from Anna. + (im_service_default): Ditto. + (email_default): Ditto. + (im_location): Renamed to common_location, as it's used by both IM + and e-mail. + (init_email_record_location): im_location -> common_location + (init_im_record_location): Ditto. + (email_index_to_location): Ditto. + (im_index_to_location): Ditto. + (get_email_location): Ditto. + (get_im_location): Ditto. + (fill_in_email_record): Consult defaults. + (fill_in_im_record): Ditto. + 2004-05-04 Hans Petter Jansson * gui/contact-editor/e-contact-editor.c (set_entry_activate_signals): diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index f3082c3ab3..b5f85fe1fc 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -160,7 +160,7 @@ phones [] = { }; /* Defaults from the table above */ -gint phones_default [] = { 1, 6, 2, 9 }; +gint phones_default [] = { 1, 6, 9, 2 }; static EContactField addresses[] = { E_CONTACT_ADDRESS_WORK, @@ -188,17 +188,23 @@ im_service [] = { E_CONTACT_IM_GROUPWISE, N_ ("GroupWise") } }; +/* Defaults from the table above */ +gint im_service_default [] = { 0, 2, 3 }; + static struct { gchar *name; gchar *pretty_name; } -im_location [] = +common_location [] = { { "WORK", N_ ("Work") }, { "HOME", N_ ("Home") }, { "OTHER", N_ ("Other") } }; +/* Default from the table above */ +gint email_default [] = { 0, 1, 2, 2 }; + #define nonempty(x) ((x) && *(x)) GType @@ -318,10 +324,10 @@ init_email_record_location (EContactEditor *editor, gint record) location_menu = gtk_menu_new (); - for (i = 0; i < G_N_ELEMENTS (im_location); i++) { + for (i = 0; i < G_N_ELEMENTS (common_location); i++) { GtkWidget *item; - item = gtk_menu_item_new_with_label (im_location [i].pretty_name); + item = gtk_menu_item_new_with_label (common_location [i].pretty_name); gtk_menu_shell_append (GTK_MENU_SHELL (location_menu), item); } @@ -354,7 +360,7 @@ fill_in_email_record (EContactEditor *editor, gint record, const gchar *address, g_free (widget_name); gtk_option_menu_set_history (GTK_OPTION_MENU (location_option_menu), - location >= 0 ? location : 0); + location >= 0 ? location : email_default [record - 1]); set_entry_text (editor, GTK_ENTRY (email_entry), address ? address : ""); } @@ -380,13 +386,13 @@ extract_email_record (EContactEditor *editor, gint record, gchar **address, gint static const gchar * email_index_to_location (gint index) { - return im_location [index].name; + return common_location [index].name; } static const gchar * im_index_to_location (gint index) { - return im_location [index].name; + return common_location [index].name; } static void @@ -401,8 +407,8 @@ get_email_location (EVCardAttribute *attr) { gint i; - for (i = 0; i < G_N_ELEMENTS (im_location); i++) { - if (e_vcard_attribute_has_type (attr, im_location [i].name)) + for (i = 0; i < G_N_ELEMENTS (common_location); i++) { + if (e_vcard_attribute_has_type (attr, common_location [i].name)) return i; } @@ -414,8 +420,8 @@ get_im_location (EVCardAttribute *attr) { gint i; - for (i = 0; i < G_N_ELEMENTS (im_location); i++) { - if (e_vcard_attribute_has_type (attr, im_location [i].name)) + for (i = 0; i < G_N_ELEMENTS (common_location); i++) { + if (e_vcard_attribute_has_type (attr, common_location [i].name)) return i; } @@ -869,10 +875,10 @@ init_im_record_location (EContactEditor *editor, gint record) location_menu = gtk_menu_new (); - for (i = 0; i < G_N_ELEMENTS (im_location); i++) { + for (i = 0; i < G_N_ELEMENTS (common_location); i++) { GtkWidget *item; - item = gtk_menu_item_new_with_label (im_location [i].pretty_name); + item = gtk_menu_item_new_with_label (common_location [i].pretty_name); gtk_menu_shell_append (GTK_MENU_SHELL (location_menu), item); } @@ -941,7 +947,7 @@ fill_in_im_record (EContactEditor *editor, gint record, gint service, const gcha gtk_option_menu_set_history (GTK_OPTION_MENU (location_option_menu), location >= 0 ? location : 0); gtk_option_menu_set_history (GTK_OPTION_MENU (service_option_menu), - service >= 0 ? service : 0); + service >= 0 ? service : im_service_default [record - 1]); set_entry_text (editor, GTK_ENTRY (name_entry), name ? name : ""); } -- cgit