[evolution/express2: 1/51] Compress new contact dialog (first page) a little; more to come.



commit ced5bef58a54e80ea522ca05d50a7831c7baff12
Author: Michael Meeks <michael meeks novell com>
Date:   Wed Mar 17 21:49:15 2010 +0000

    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(-)
---
diff --git a/addressbook/gui/contact-editor/contact-editor.ui b/addressbook/gui/contact-editor/contact-editor.ui
index 964ce43..a603c13 100644
--- a/addressbook/gui/contact-editor/contact-editor.ui
+++ b/addressbook/gui/contact-editor/contact-editor.ui
@@ -424,7 +424,7 @@
                         <property name="label_yalign">0.5</property>
                         <property name="shadow_type">GTK_SHADOW_NONE</property>
                         <child>
-                          <object class="GtkTable" id="table85">
+                          <object class="GtkTable" id="email-table">
                             <property name="border_width">12</property>
                             <property name="visible">True</property>
                             <property name="n_rows">3</property>
@@ -1080,7 +1080,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkEntry" id="entry-im-name-2">
+                              <object class="GtkEntry" id="entry-im-name-3">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="editable">True</property>
@@ -1099,7 +1099,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkEntry" id="entry-im-name-3">
+                              <object class="GtkEntry" id="entry-im-name-2">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="editable">True</property>
@@ -1152,7 +1152,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkComboBox" id="combobox-im-service-2">
+                              <object class="GtkComboBox" id="combobox-im-service-3">
                                 <property name="visible">True</property>
                                 <property name="add_tearoffs">False</property>
                                 <property name="focus_on_click">True</property>
@@ -1167,7 +1167,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkComboBox" id="combobox-im-service-3">
+                              <object class="GtkComboBox" id="combobox-im-service-2">
                                 <property name="visible">True</property>
                                 <property name="add_tearoffs">False</property>
                                 <property name="focus_on_click">True</property>
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 2807b9e..7019e91 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 5079f1a..b41324c 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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]