aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2004-05-05 10:40:00 +0800
committerHans Petter <hansp@src.gnome.org>2004-05-05 10:40:00 +0800
commit177d079544c613add80ad1c6ec076afadc49dd82 (patch)
treeb6f825a4a9cd370a4c833b16e874e19298cfdb67
parentdfdd6db76ebcbecb316b6244eeccadb0ed91849a (diff)
downloadgsoc2013-evolution-177d079544c613add80ad1c6ec076afadc49dd82.tar.gz
gsoc2013-evolution-177d079544c613add80ad1c6ec076afadc49dd82.tar.zst
gsoc2013-evolution-177d079544c613add80ad1c6ec076afadc49dd82.zip
Use defaults from Anna. (im_service_default): Ditto. (email_default):
2004-05-04 Hans Petter Jansson <hpj@ximian.com> * 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
-rw-r--r--addressbook/ChangeLog17
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c34
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,5 +1,22 @@
2004-05-04 Hans Petter Jansson <hpj@ximian.com>
+ * 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 <hpj@ximian.com>
+
* gui/contact-editor/e-contact-editor.c (set_entry_activate_signals):
Remove blog, add home page.
(set_entry_changed_signals): Ditto.
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 : "");
}