From 098f74dc564443ca659479717cf2f9d16c192bdf Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 17 Mar 2010 21:49:15 +0000 Subject: Compress new contact dialog (first page) a little; more to come. --- addressbook/gui/contact-editor/contact-editor.ui | 10 +++++----- addressbook/gui/contact-editor/e-contact-editor.c | 23 +++++++++++++++++++++++ addressbook/gui/contact-editor/e-contact-editor.h | 3 +++ 3 files changed, 31 insertions(+), 5 deletions(-) (limited to 'addressbook/gui') diff --git a/addressbook/gui/contact-editor/contact-editor.ui b/addressbook/gui/contact-editor/contact-editor.ui index 964ce434c2..a603c13cc7 100644 --- a/addressbook/gui/contact-editor/contact-editor.ui +++ b/addressbook/gui/contact-editor/contact-editor.ui @@ -424,7 +424,7 @@ 0.5 GTK_SHADOW_NONE - + 12 True 3 @@ -1080,7 +1080,7 @@ - + True True True @@ -1099,7 +1099,7 @@ - + True True True @@ -1152,7 +1152,7 @@ - + True False True @@ -1167,7 +1167,7 @@ - + True False True diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 2807b9e149..7019e91dcd 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -748,6 +748,23 @@ init_email (EContactEditor *editor) for (i = 1; i <= EMAIL_SLOTS; i++) init_email_record_location (editor, i); + + if (editor->compress_ui) { + GtkTable *table; + GtkWidget *check; + + gtk_widget_hide (e_builder_get_widget (editor->builder, "entry-email-4")); + gtk_widget_hide (e_builder_get_widget (editor->builder, "combobox-email-4")); + + table = GTK_TABLE (e_builder_get_widget (editor->builder, "email-table")); + check = e_builder_get_widget (editor->builder, "checkbutton-htmlmail"); + if (check != NULL && table != NULL) { + g_object_ref (G_OBJECT (check)); + gtk_container_remove (GTK_CONTAINER (check->parent), check); + gtk_table_attach_defaults (table, check, 2, 4, 1, 2); + g_object_unref (G_OBJECT (check)); + } + } } static void @@ -1458,6 +1475,11 @@ init_im_record_service (EContactEditor *editor, gint record) service_combo_box = e_builder_get_widget (editor->builder, widget_name); g_free (widget_name); + if (editor->compress_ui && record > 2) { + gtk_widget_hide (name_entry); + gtk_widget_hide (service_combo_box); + } + init_item_sensitiveable_combo_box (GTK_COMBO_BOX (service_combo_box)); store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (service_combo_box))); @@ -3402,6 +3424,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) e_contact_editor->target_editable = TRUE; e_contact_editor->fullname_dialog = NULL; e_contact_editor->categories_dialog = NULL; + e_contact_editor->compress_ui = e_shell_get_express_mode (e_shell_get_default ()); e_contact_editor->load_source_id = 0; e_contact_editor->load_book = NULL; diff --git a/addressbook/gui/contact-editor/e-contact-editor.h b/addressbook/gui/contact-editor/e-contact-editor.h index 5079f1a0ee..b41324c270 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.h +++ b/addressbook/gui/contact-editor/e-contact-editor.h @@ -84,6 +84,9 @@ struct _EContactEditor /* Whether an image is changed */ guint image_changed : 1; + /* Whether to try to reduce space used */ + guint compress_ui : 1; + EList *writable_fields; EList *required_fields; -- cgit