[evolution/gtk-builder] Changes about addressbook



commit 0b7bc987d9a8d2f138c52deee7bc96fd822841f6
Author: Milan Crha <mcrha redhat com>
Date:   Mon Nov 2 15:52:15 2009 +0100

    Changes about addressbook

 addressbook/gui/contact-editor/contact-editor.ui   |  111 ++++++++++----------
 addressbook/gui/contact-editor/e-contact-editor.c  |   91 +++-------------
 .../gui/contact-list-editor/contact-list-editor.ui |    9 +-
 .../contact-list-editor/e-contact-list-editor.c    |  107 ++++++++++---------
 .../eab-contact-commit-duplicate-detected.ui       |   24 +---
 .../gui/merging/eab-contact-duplicate-detected.ui  |   20 +---
 addressbook/gui/merging/eab-contact-merging.c      |   13 ---
 addressbook/gui/widgets/eab-gui-util.c             |   23 ----
 addressbook/gui/widgets/eab-gui-util.h             |    2 -
 shell/main.c                                       |    1 -
 widgets/misc/e-dateedit.c                          |   41 +++++++-
 widgets/misc/e-image-chooser.c                     |   53 +++++++++
 widgets/misc/e-import-assistant.c                  |    1 -
 13 files changed, 231 insertions(+), 265 deletions(-)
---
diff --git a/addressbook/gui/contact-editor/contact-editor.ui b/addressbook/gui/contact-editor/contact-editor.ui
index e9c30f1..2ca8346 100644
--- a/addressbook/gui/contact-editor/contact-editor.ui
+++ b/addressbook/gui/contact-editor/contact-editor.ui
@@ -162,17 +162,10 @@
                         <property name="can_focus">True</property>
                         <property name="relief">GTK_RELIEF_NORMAL</property>
                         <property name="focus_on_click">True</property>
-                        <accessibility>
-			
-		      </accessibility>
                         <child>
-                          <object class="Custom" id="image-chooser">
+                          <object class="EImageChooser" type-func="e_image_chooser_get_type" id="image-chooser">
                             <property name="visible">True</property>
-                            <property name="creation_function">eab_create_image_chooser_widget</property>
-                            <property name="string1">stock_person</property>
-                            <property name="int1">0</property>
-                            <property name="int2">0</property>
-                            <property name="last_modification_time">Tue, 13 Apr 2004 20:51:33 GMT</property>
+                            <property name="icon-name">stock_person</property>
                           </object>
                         </child>
                         <child internal-child="accessible">
@@ -363,12 +356,8 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="Custom" id="source-combo-box-source">
+                          <object class="ESourceComboBox" type-func="e_source_combo_box_get_type" id="source-combo-box-source">
                             <property name="visible">True</property>
-                            <property name="creation_function">e_contact_editor_create_source_combo_box</property>
-                            <property name="int1">0</property>
-                            <property name="int2">0</property>
-                            <property name="last_modification_time">Tue, 13 Apr 2004 20:47:50 GMT</property>
                           </object>
                           <packing>
                             <property name="left_attach">3</property>
@@ -1280,7 +1269,7 @@
                 </child>
               </object>
               <packing>
-                <property name="tab_expand">True</property>
+                <property name="tab_expand">False</property>
                 <property name="tab_fill">True</property>
               </packing>
             </child>
@@ -1437,13 +1426,13 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="Custom" id="entry-homepage">
+                          <object class="EUrlEntry" type-func="e_url_entry_get_type" id="entry-homepage">
                             <property name="visible">True</property>
-                            <property name="creation_function">e_contact_editor_create_web</property>
-                            <property name="string1">Home Page:</property>
-                            <property name="int1">0</property>
-                            <property name="int2">0</property>
-                            <property name="last_modification_time">Tue, 13 Apr 2004 22:04:21 GMT</property>
+                            <child internal-child="accessible">
+                              <object class="AtkObject" id="a11y-entry-homepage">
+                                <property name="AtkObject::accessible_name" translatable="yes">Home Page:</property>
+                              </object>
+                            </child>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
@@ -1454,13 +1443,13 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="Custom" id="entry-caluri">
+                          <object class="EUrlEntry" type-func="e_url_entry_get_type" id="entry-caluri">
                             <property name="visible">True</property>
-                            <property name="creation_function">e_contact_editor_create_web</property>
-                            <property name="string1">Calendar:</property>
-                            <property name="int1">0</property>
-                            <property name="int2">0</property>
-                            <property name="last_modification_time">Tue, 13 Apr 2004 22:04:51 GMT</property>
+                            <child internal-child="accessible">
+                              <object class="AtkObject" id="a11y-entry-caluri">
+                                <property name="AtkObject::accessible_name" translatable="yes">Calendar:</property>
+                              </object>
+                            </child>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
@@ -1471,13 +1460,13 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="Custom" id="entry-fburl">
+                          <object class="EUrlEntry" type-func="e_url_entry_get_type" id="entry-fburl">
                             <property name="visible">True</property>
-                            <property name="creation_function">e_contact_editor_create_web</property>
-                            <property name="string1">Free/Busy:</property>
-                            <property name="int1">0</property>
-                            <property name="int2">0</property>
-                            <property name="last_modification_time">Tue, 13 Apr 2004 22:05:05 GMT</property>
+                            <child internal-child="accessible">
+                              <object class="AtkObject" id="a11y-entry-fburl">
+                                <property name="AtkObject::accessible_name" translatable="yes">Free/Busy:</property>
+                              </object>
+                            </child>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
@@ -1488,13 +1477,13 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="Custom" id="entry-videourl">
+                          <object class="EUrlEntry" type-func="e_url_entry_get_type" id="entry-videourl">
                             <property name="visible">True</property>
-                            <property name="creation_function">e_contact_editor_create_web</property>
-                            <property name="string1">Video Chat:</property>
-                            <property name="int1">0</property>
-                            <property name="int2">0</property>
-                            <property name="last_modification_time">Tue, 13 Apr 2004 22:05:30 GMT</property>
+                            <child internal-child="accessible">
+                              <object class="AtkObject" id="a11y-entry-videourl">
+                                <property name="AtkObject::accessible_name" translatable="yes">Video Chat:</property>
+                              </object>
+                            </child>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
@@ -1533,13 +1522,13 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="Custom" id="entry-weblog">
+                          <object class="EUrlEntry" type-func="e_url_entry_get_type" id="entry-weblog">
                             <property name="visible">True</property>
-                            <property name="creation_function">e_contact_editor_create_web</property>
-                            <property name="string1">Web Log:</property>
-                            <property name="int1">0</property>
-                            <property name="int2">0</property>
-                            <property name="last_modification_time">Tue, 13 Apr 2004 22:04:21 GMT</property>
+                            <child internal-child="accessible">
+                              <object class="AtkObject" id="a11y-entry-weblog">
+                                <property name="AtkObject::accessible_name" translatable="yes">Web Log:</property>
+                              </object>
+                            </child>
                           </object>
                           <packing>
                             <property name="left_attach">1</property>
@@ -2101,13 +2090,17 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="Custom" id="dateedit-anniversary">
+                          <object class="EDateEdit" type-func="e_date_edit_get_type" id="dateedit-anniversary">
                             <property name="visible">True</property>
-                            <property name="creation_function">e_contact_editor_create_date</property>
-                            <property name="string1">Anniversary</property>
-                            <property name="int1">0</property>
-                            <property name="int2">0</property>
-                            <property name="last_modification_time">Tue, 13 Apr 2004 23:56:03 GMT</property>
+                            <property name="allow-no-date-set">True</property>
+                            <property name="show-time">False</property>
+                            <property name="set-none">True</property>
+			    <property name="twodigit-year-can-future">False</property>
+                            <child internal-child="accessible">
+                              <object class="AtkObject" id="a11y-dateedit-anniversary">
+                                <property name="AtkObject::accessible_name" translatable="yes">Anniversary</property>
+                              </object>
+                            </child>
                           </object>
                           <packing>
                             <property name="left_attach">3</property>
@@ -2119,13 +2112,17 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="Custom" id="dateedit-birthday">
+                          <object class="EDateEdit" type-func="e_date_edit_get_type" id="dateedit-birthday">
                             <property name="visible">True</property>
-                            <property name="creation_function">e_contact_editor_create_date</property>
-                            <property name="string1">Birthday</property>
-                            <property name="int1">0</property>
-                            <property name="int2">0</property>
-                            <property name="last_modification_time">Tue, 13 Apr 2004 23:55:46 GMT</property>
+                            <property name="allow-no-date-set">True</property>
+                            <property name="show-time">False</property>
+                            <property name="set-none">True</property>
+			    <property name="twodigit-year-can-future">False</property>
+                            <child internal-child="accessible">
+                              <object class="AtkObject" id="a11y-dateedit-birthday">
+                                <property name="AtkObject::accessible_name" translatable="yes">Birthday</property>
+                              </object>
+                            </child>
                           </object>
                           <packing>
                             <property name="left_attach">3</property>
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index a32f178..96a8096 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -3370,6 +3370,21 @@ expand_phone_toggle (EContactEditor *ce)
 }
 
 static void
+setup_e_source_list (GtkWidget *widget)
+{
+	ESourceList *source_list;
+	GConfClient *gconf_client;
+
+	g_return_if_fail (widget != NULL);
+
+	gconf_client = gconf_client_get_default ();
+	source_list = e_source_list_new_for_gconf (gconf_client, "/apps/evolution/addressbook/sources");
+	g_object_set (G_OBJECT (widget), "source-list", source_list, NULL);
+	g_object_unref (source_list);
+	g_object_unref (gconf_client);
+}
+
+static void
 e_contact_editor_init (EContactEditor *e_contact_editor)
 {
 	GtkBuilder *builder;
@@ -3416,6 +3431,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor)
 	widget = e_builder_get_widget(e_contact_editor->builder, "button-categories");
 	g_signal_connect (widget, "clicked", G_CALLBACK (categories_clicked), e_contact_editor);
 	widget = e_builder_get_widget (e_contact_editor->builder, "source-combo-box-source");
+	setup_e_source_list (widget);
 	g_signal_connect (widget, "changed", G_CALLBACK (source_changed), e_contact_editor);
 	label = e_builder_get_widget (e_contact_editor->builder, "where-label");
 	gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget);
@@ -3814,78 +3830,3 @@ e_contact_editor_show (EABEditor *editor)
 	EContactEditor *ce = E_CONTACT_EDITOR (editor);
 	gtk_widget_show (ce->app);
 }
-
-/* Is this declaration here so that libglade can reach this? */
-GtkWidget *
-e_contact_editor_create_date(gchar *name,
-			     gchar *string1, gchar *string2,
-			     gint int1, gint int2);
-
-GtkWidget *
-e_contact_editor_create_date(gchar *name,
-			     gchar *string1, gchar *string2,
-			     gint int1, gint int2)
-{
-	GtkWidget *widget = e_date_edit_new ();
-	AtkObject *a11y;
-
-	e_date_edit_set_allow_no_date_set (E_DATE_EDIT (widget),
-					   TRUE);
-	e_date_edit_set_show_time (E_DATE_EDIT (widget), FALSE);
-	e_date_edit_set_time (E_DATE_EDIT (widget), -1);
-	e_date_edit_set_twodigit_year_can_future (E_DATE_EDIT (widget), FALSE);
-
-	a11y = gtk_widget_get_accessible (e_date_edit_get_entry (E_DATE_EDIT(widget)));
-	if (a11y != NULL) {
-		atk_object_set_name (a11y, string1);
-	}
-
-	gtk_widget_show (widget);
-	return widget;
-}
-
-GtkWidget *
-e_contact_editor_create_web(gchar *name,
-			    gchar *string1, gchar *string2,
-			    gint int1, gint int2);
-
-GtkWidget *
-e_contact_editor_create_web(gchar *name,
-			    gchar *string1, gchar *string2,
-			    gint int1, gint int2)
-{
-	GtkWidget *widget = e_url_entry_new ();
-	AtkObject *a11y = gtk_widget_get_accessible (e_url_entry_get_entry ((EUrlEntry *)widget));
-
-	if (a11y != NULL) {
-		atk_object_set_name (a11y, string1);
-	}
-
-	gtk_widget_show (widget);
-	return widget;
-}
-
-GtkWidget *
-e_contact_editor_create_source_combo_box (gchar *name,
-					  gchar *string1, gchar *string2,
-					  gint int1, gint int2);
-
-GtkWidget *
-e_contact_editor_create_source_combo_box (gchar *name,
-					  gchar *string1, gchar *string2,
-					  gint int1, gint int2)
-{
-	GtkWidget   *combo_box;
-	GConfClient *gconf_client;
-	ESourceList *source_list;
-
-	gconf_client = gconf_client_get_default ();
-	source_list = e_source_list_new_for_gconf (gconf_client, "/apps/evolution/addressbook/sources");
-
-	combo_box = e_source_combo_box_new (source_list);
-	g_object_unref (source_list);
-	g_object_unref (gconf_client);
-
-	gtk_widget_show (combo_box);
-	return combo_box;
-}
diff --git a/addressbook/gui/contact-list-editor/contact-list-editor.ui b/addressbook/gui/contact-list-editor/contact-list-editor.ui
index 5b318b4..a4b95d2 100644
--- a/addressbook/gui/contact-list-editor/contact-list-editor.ui
+++ b/addressbook/gui/contact-list-editor/contact-list-editor.ui
@@ -84,8 +84,8 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="Custom" id="source-combo-box">
-                    <property name="creation_function">contact_list_editor_create_source_combo_box</property>
+                  <object class="ESourceComboBox" type-func="e_source_combo_box_get_type" id="source-combo-box">
+                    <property name="visible">True</property>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
@@ -150,8 +150,8 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="Custom" id="email-entry">
-                            <property name="creation_function">contact_list_editor_create_name_selector</property>
+                          <object class="ENameSelectorEntry" type-func="e_name_selector_entry_get_type" id="email-entry">
+                            <property name="visible">True</property>
                           </object>
                           <packing>
                             <property name="top_attach">1</property>
@@ -251,7 +251,6 @@
                                 <property name="tooltip_markup">Insert email addresses from Address Book</property>
                                 <property name="tooltip_text">Insert email addresses from Address Book</property>
                                 <property name="label" translatable="yes" context="yes">_Select...</property>
-                                <property name="response_id">0</property>
                                 <signal name="clicked" handler="contact_list_editor_select_button_clicked_cb"/>
                               </object>
                               <packing>
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
index 63e9915..8e92d28 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -61,7 +61,7 @@
 #define CONTACT_LIST_EDITOR_WIDGET_DIALOG(editor) \
 	CONTACT_LIST_EDITOR_WIDGET ((editor), "dialog")
 #define CONTACT_LIST_EDITOR_WIDGET_EMAIL_ENTRY(editor) \
-	CONTACT_LIST_EDITOR_WIDGET ((editor), "email-entry")
+	E_CONTACT_LIST_EDITOR_GET_PRIVATE (editor)->email_entry
 #define CONTACT_LIST_EDITOR_WIDGET_LIST_NAME_ENTRY(editor) \
 	CONTACT_LIST_EDITOR_WIDGET ((editor), "list-name-entry")
 #define CONTACT_LIST_EDITOR_WIDGET_MEMBERS_VBOX(editor) \
@@ -101,6 +101,7 @@ struct _EContactListEditorPrivate {
 	GtkBuilder *builder;
 	GtkTreeModel *model;
 	ENameSelector *name_selector;
+	ENameSelectorEntry *email_entry; /* it's kept here, because the builder has an old widget, which was changed with this one */
 
 	/* Whether we are editing a new contact or an existing one. */
 	guint is_new_list : 1;
@@ -864,49 +865,7 @@ contact_list_editor_tree_view_key_press_event_cb (GtkWidget *widget,
 	return FALSE;
 }
 
-/*********************** Glade Custom Widget Factories ***********************/
-
-GtkWidget *
-contact_list_editor_create_source_combo_box (gchar *name,
-                                             gchar *string1,
-                                             gchar *string2,
-                                             gint int1,
-                                             gint int2);
-
-GtkWidget *
-contact_list_editor_create_source_combo_box (gchar *name,
-                                             gchar *string1,
-                                             gchar *string2,
-                                             gint int1,
-                                             gint int2)
-{
-	const gchar *key = "/apps/evolution/addressbook/sources";
-
-	GtkWidget *combo_box;
-	GConfClient *client;
-	ESourceList *source_list;
-
-	client = gconf_client_get_default ();
-	source_list = e_source_list_new_for_gconf (client, key);
-	combo_box = e_source_combo_box_new (source_list);
-	g_object_unref (source_list);
-	g_object_unref (client);
-
-	g_signal_connect (
-		combo_box, "changed", G_CALLBACK (
-		contact_list_editor_source_menu_changed_cb), NULL);
-
-	gtk_widget_show (combo_box);
-
-	return combo_box;
-}
-
-GtkWidget *
-contact_list_editor_create_name_selector (gchar *name,
-                                          gchar *string1,
-                                          gchar *string2,
-                                          gint int1,
-                                          gint int2);
+/*********************** GtkBuilder Custom Widgets Functions ***********************/
 
 static gpointer
 contact_editor_fudge_new (EBook *book,
@@ -938,15 +897,36 @@ contact_list_editor_fudge_new (EBook *book,
 		shell, book, contact, is_new, editable);
 }
 
-GtkWidget *
-contact_list_editor_create_name_selector (gchar *name,
-                                          gchar *string1,
-                                          gchar *string2,
-                                          gint int1,
-                                          gint int2)
+static void
+setup_custom_widgets (EContactListEditor *editor)
 {
+	const gchar *key = "/apps/evolution/addressbook/sources";
+	GtkWidget *combo_box;
+	GConfClient *client;
+	ESourceList *source_list;
 	ENameSelectorEntry *name_selector_entry;
 	ENameSelector *name_selector;
+	GtkWidget *old, *parent;
+	EContactListEditorPrivate *priv;
+	guint ba = 0, la = 0, ra = 0, ta = 0, xo = 0, xp = 0, yo = 0, yp = 0;
+
+	g_return_if_fail (editor != NULL);
+
+	priv = E_CONTACT_LIST_EDITOR_GET_PRIVATE (editor);
+
+	combo_box = WIDGET (SOURCE_MENU);
+	client = gconf_client_get_default ();
+	source_list = e_source_list_new_for_gconf (client, key);
+	g_object_set (G_OBJECT (combo_box), "source-list", source_list, NULL);
+	g_object_unref (source_list);
+	g_object_unref (client);
+
+	g_signal_connect (
+		combo_box, "changed", G_CALLBACK (
+		contact_list_editor_source_menu_changed_cb), NULL);
+
+	old = CONTACT_LIST_EDITOR_WIDGET (editor, "email-entry");
+	g_return_if_fail (old != NULL);
 
 	name_selector = e_name_selector_new ();
 
@@ -957,11 +937,32 @@ contact_list_editor_create_name_selector (gchar *name,
 	name_selector_entry = e_name_selector_peek_section_entry (
 		name_selector, "Members");
 
+	gtk_widget_set_name (GTK_WIDGET (name_selector_entry), gtk_widget_get_name (old));
+	parent = gtk_widget_get_parent (old);
+
+	gtk_container_child_get (GTK_CONTAINER (parent), old,
+		"bottom-attach", &ba,
+		"left-attach", &la,
+		"right-attach", &ra,
+		"top-attach", &ta,
+		"x-options", &xo,
+		"x-padding", &xp,
+		"y-options", &yo,
+		"y-padding", &yp,
+		NULL);
+
+	/* only hide it... */
+	gtk_widget_hide (old);
+
+	/* ... and place the new name selector to the exact place as is the old one in UI file */
+	gtk_widget_show (GTK_WIDGET (name_selector_entry));
+	gtk_table_attach (GTK_TABLE (parent), GTK_WIDGET (name_selector_entry), la, ra, ta, ba, xo, yo, xp, yp);
+	priv->email_entry = name_selector_entry;
+
 	e_name_selector_entry_set_contact_editor_func (
 		name_selector_entry, contact_editor_fudge_new);
 	e_name_selector_entry_set_contact_list_editor_func (
 		name_selector_entry, contact_list_editor_fudge_new);
-	gtk_widget_show (GTK_WIDGET (name_selector_entry));
 
 	g_signal_connect (
 		name_selector_entry, "activate", G_CALLBACK (
@@ -975,8 +976,6 @@ contact_list_editor_create_name_selector (gchar *name,
 	g_signal_connect (
 		name_selector_entry, "updated", G_CALLBACK (
 		contact_list_editor_email_entry_updated_cb), NULL);
-
-	return GTK_WIDGET (name_selector_entry);
 }
 
 /***************************** GObject Callbacks *****************************/
@@ -1351,6 +1350,8 @@ contact_list_editor_init (EContactListEditor *editor)
 
 	gtk_widget_show_all (WIDGET (DIALOG));
 
+	setup_custom_widgets (editor);
+
 	editor->priv = priv;
 }
 
diff --git a/addressbook/gui/merging/eab-contact-commit-duplicate-detected.ui b/addressbook/gui/merging/eab-contact-commit-duplicate-detected.ui
index 0f69069..c12a39e 100644
--- a/addressbook/gui/merging/eab-contact-commit-duplicate-detected.ui
+++ b/addressbook/gui/merging/eab-contact-commit-duplicate-detected.ui
@@ -58,12 +58,8 @@
             <property name="row_spacing">6</property>
             <property name="column_spacing">6</property>
             <child>
-              <object class="Custom" id="custom-old-contact">
+              <object class="EABContactDisplay" type-func="eab_contact_display_get_type" id="custom-old-contact">
                 <property name="visible">True</property>
-                <property name="creation_function">_eab_contact_merging_create_contact_display</property>
-                <property name="int1">0</property>
-                <property name="int2">0</property>
-                <property name="last_modification_time">Sun, 05 Oct 2003 03:54:20 GMT</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
@@ -140,12 +136,8 @@
               </packing>
             </child>
             <child>
-              <object class="Custom" id="custom-new-contact">
+              <object class="EABContactDisplay" type-func="eab_contact_display_get_type" id="custom-new-contact">
                 <property name="visible">True</property>
-                <property name="creation_function">_eab_contact_merging_create_contact_display</property>
-                <property name="int1">0</property>
-                <property name="int2">0</property>
-                <property name="last_modification_time">Sun, 05 Oct 2003 03:53:42 GMT</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
@@ -162,14 +154,10 @@
                 <property name="xscale">1</property>
                 <property name="yscale">0</property>
                 <child>
-                  <object class="Custom" id="custom2">
-                    <property name="visible">True</property>
-                    <property name="creation_function">e_create_image_widget</property>
-                    <property name="string1">stock_person</property>
-                    <property name="int1">0</property>
-                    <property name="int2">0</property>
-                    <property name="last_modification_time">Fri, 08 Jun 2001 00:18:39 GMT</property>
-                  </object>
+                   <object class="GtkImage" id="custom2">
+                     <property name="visible">True</property>
+                     <property name="icon-name">stock_person</property>
+                   </object>
                 </child>
               </object>
               <packing>
diff --git a/addressbook/gui/merging/eab-contact-duplicate-detected.ui b/addressbook/gui/merging/eab-contact-duplicate-detected.ui
index 6e8010c..00ae19f 100644
--- a/addressbook/gui/merging/eab-contact-duplicate-detected.ui
+++ b/addressbook/gui/merging/eab-contact-duplicate-detected.ui
@@ -87,12 +87,8 @@
                     <property name="row_spacing">6</property>
                     <property name="column_spacing">12</property>
                     <child>
-                      <object class="Custom" id="custom-old-contact">
+                      <object class="EABContactDisplay" type-func="eab_contact_display_get_type" id="custom-old-contact">
                         <property name="visible">True</property>
-                        <property name="creation_function">_eab_contact_merging_create_contact_display</property>
-                        <property name="int1">0</property>
-                        <property name="int2">0</property>
-                        <property name="last_modification_time">Sun, 05 Oct 2003 03:55:10 GMT</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -170,12 +166,8 @@ in this folder.  Would you like to add it anyway?</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="Custom" id="custom-new-contact">
+                      <object class="EABContactDisplay" type-func="eab_contact_display_get_type" id="custom-new-contact">
                         <property name="visible">True</property>
-                        <property name="creation_function">_eab_contact_merging_create_contact_display</property>
-                        <property name="int1">0</property>
-                        <property name="int2">0</property>
-                        <property name="last_modification_time">Sun, 05 Oct 2003 03:54:50 GMT</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -196,13 +188,9 @@ in this folder.  Would you like to add it anyway?</property>
                         <property name="left_padding">0</property>
                         <property name="right_padding">0</property>
                         <child>
-                          <object class="Custom" id="custom2">
+                          <object class="GtkImage" id="custom2">
                             <property name="visible">True</property>
-                            <property name="creation_function">e_create_image_widget</property>
-                            <property name="string1">stock_person</property>
-                            <property name="int1">0</property>
-                            <property name="int2">0</property>
-                            <property name="last_modification_time">Fri, 08 Jun 2001 00:18:39 GMT</property>
+                            <property name="icon-name">stock_person</property>
                           </object>
                         </child>
                       </object>
diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c
index 77d9009..a4659c7 100644
--- a/addressbook/gui/merging/eab-contact-merging.c
+++ b/addressbook/gui/merging/eab-contact-merging.c
@@ -596,16 +596,3 @@ eab_merging_book_find_contact (EBook                 *book,
 
 	return TRUE;
 }
-
-GtkWidget *
-_eab_contact_merging_create_contact_display(gchar *name,
-					    gchar *string1, gchar *string2,
-					    gint int1, gint int2);
-
-GtkWidget *
-_eab_contact_merging_create_contact_display(gchar *name,
-					    gchar *string1, gchar *string2,
-					    gint int1, gint int2)
-{
-	return eab_contact_display_new();
-}
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index 0aa6385..1c2b358 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -633,29 +633,6 @@ eab_transfer_contacts (EBook *source, GList *contacts /* adopted */, gboolean de
 	addressbook_load (dest, got_book_cb, process);
 }
 
-GtkWidget *
-eab_create_image_chooser_widget(gchar *name,
-				gchar *string1, gchar *string2,
-				gint int1, gint int2)
-{
-	gchar *filename;
-	GtkWidget *w = NULL;
-
-	w = e_image_chooser_new ();
-	gtk_widget_show_all (w);
-
-	if (string1) {
-		filename = e_icon_factory_get_icon_filename (string1, GTK_ICON_SIZE_DIALOG);
-
-		if (filename && *filename)
-			e_image_chooser_set_from_file (E_IMAGE_CHOOSER (w), filename);
-
-		g_free (filename);
-	}
-
-	return w;
-}
-
 /* To parse something like...
 =?UTF-8?Q?=E0=A4=95=E0=A4=95=E0=A4=AC=E0=A5=82=E0=A5=8B=E0=A5=87?=\t\n=?UTF-8?Q?=E0=A4=B0?=\t\n<aa aa ccom>
 and return the decoded representation of name & email parts.
diff --git a/addressbook/gui/widgets/eab-gui-util.h b/addressbook/gui/widgets/eab-gui-util.h
index 7422eab..ed3f650 100644
--- a/addressbook/gui/widgets/eab-gui-util.h
+++ b/addressbook/gui/widgets/eab-gui-util.h
@@ -51,8 +51,6 @@ void                eab_contact_list_save         (gchar *title,
 						   GList *list,
 						   GtkWindow *parent_window);
 
-GtkWidget *eab_create_image_chooser_widget (gchar *name, gchar *string1, gchar *string2, gint int1, gint int2);
-
 ESource            *eab_select_source             (const gchar *title, const gchar *message,
 						   const gchar *select_uid, GtkWindow *parent);
 
diff --git a/shell/main.c b/shell/main.c
index 6d6588a..5e158e4 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -37,7 +37,6 @@
 #include <windows.h>
 #endif
 
-#include <glade/glade.h>
 #include <dbus/dbus-glib.h>
 #include <gconf/gconf-client.h>
 
diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c
index d712e98..268931a 100644
--- a/widgets/misc/e-dateedit.c
+++ b/widgets/misc/e-dateedit.c
@@ -124,7 +124,9 @@ enum {
 	PROP_SHOW_TIME,
 	PROP_SHOW_WEEK_NUMBERS,
 	PROP_USE_24_HOUR_FORMAT,
-	PROP_WEEK_START_DAY
+	PROP_WEEK_START_DAY,
+	PROP_TWODIGIT_YEAR_CAN_FUTURE,
+	PROP_SET_NONE
 };
 
 enum {
@@ -248,6 +250,17 @@ date_edit_set_property (GObject *object,
 				E_DATE_EDIT (object),
 				g_value_get_int (value));
 			return;
+
+		case PROP_TWODIGIT_YEAR_CAN_FUTURE:
+			e_date_edit_set_twodigit_year_can_future (
+				E_DATE_EDIT (object),
+				g_value_get_boolean (value));
+			return;
+
+		case PROP_SET_NONE:
+			if (g_value_get_boolean (value))
+				e_date_edit_set_time (E_DATE_EDIT (object), -1);
+			return;
 	}
 
 	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -295,6 +308,12 @@ date_edit_get_property (GObject *object,
 				value, e_date_edit_get_week_start_day (
 				E_DATE_EDIT (object)));
 			return;
+
+		case PROP_TWODIGIT_YEAR_CAN_FUTURE:
+			g_value_set_boolean (
+				value, e_date_edit_get_twodigit_year_can_future (
+				E_DATE_EDIT (object)));
+			return;
 	}
 
 	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -398,6 +417,26 @@ date_edit_class_init (EDateEditClass *class)
 			0,
 			G_PARAM_READWRITE));
 
+	g_object_class_install_property (
+		object_class,
+		PROP_TWODIGIT_YEAR_CAN_FUTURE,
+		g_param_spec_boolean (
+			"twodigit-year-can-future",
+			"Two-digit year can be treated as future",
+			NULL,
+			TRUE,
+			G_PARAM_READWRITE));
+
+	g_object_class_install_property (
+		object_class,
+		PROP_SET_NONE,
+		g_param_spec_boolean (
+			"set-none",
+			"Sets None as selected date",
+			NULL,
+			TRUE,
+			G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
+
 	signals[CHANGED] = g_signal_new (
 		"changed",
 		G_OBJECT_CLASS_TYPE (object_class),
diff --git a/widgets/misc/e-image-chooser.c b/widgets/misc/e-image-chooser.c
index 32a3f2a..6783759 100644
--- a/widgets/misc/e-image-chooser.c
+++ b/widgets/misc/e-image-chooser.c
@@ -28,6 +28,7 @@
 
 #include "e-image-chooser.h"
 #include "e-util/e-util.h"
+#include "e-util/e-icon-factory.h"
 
 #define E_IMAGE_CHOOSER_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -48,6 +49,11 @@ enum {
 	LAST_SIGNAL
 };
 
+enum {
+	PROP_0,
+	PROP_ICON_NAME
+};
+
 static gpointer parent_class;
 static guint signals[LAST_SIGNAL];
 
@@ -268,6 +274,41 @@ image_drag_data_received_cb (GtkWidget *widget,
 exit:
 	gtk_drag_finish (context, handled, FALSE, time);
 }
+static void
+image_chooser_set_property (GObject *object,
+                         guint property_id,
+                         const GValue *value,
+                         GParamSpec *pspec)
+{
+	switch (property_id) {
+		case PROP_ICON_NAME: {
+			const gchar *icon_name;
+			gchar *filename;
+
+			icon_name = g_value_get_string (value);
+			if (icon_name) {
+				filename = e_icon_factory_get_icon_filename (icon_name, GTK_ICON_SIZE_DIALOG);
+
+				if (filename && *filename)
+					e_image_chooser_set_from_file (E_IMAGE_CHOOSER (object), filename);
+
+				g_free (filename);
+			}
+			return;
+		}
+	}
+
+	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+image_chooser_get_property (GObject *object,
+                         guint property_id,
+                         GValue *value,
+                         GParamSpec *pspec)
+{
+	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
 
 static void
 image_chooser_dispose (GObject *object)
@@ -312,6 +353,8 @@ e_image_chooser_class_init (EImageChooserClass *class)
 	g_type_class_add_private (class, sizeof (EImageChooserPrivate));
 
 	object_class = G_OBJECT_CLASS (class);
+	object_class->set_property = image_chooser_set_property;
+	object_class->get_property = image_chooser_get_property;
 	object_class->dispose = image_chooser_dispose;
 	object_class->finalize = image_chooser_finalize;
 
@@ -323,6 +366,16 @@ e_image_chooser_class_init (EImageChooserClass *class)
 		NULL, NULL,
 		g_cclosure_marshal_VOID__VOID,
 		G_TYPE_NONE, 0);
+
+	g_object_class_install_property (
+		object_class,
+		PROP_ICON_NAME,
+		g_param_spec_string (
+			"icon-name",
+			"File name of the icon to load",
+			NULL,
+			FALSE,
+			G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
 }
 
 static void
diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c
index cec3325..5ab7ca6 100644
--- a/widgets/misc/e-import-assistant.c
+++ b/widgets/misc/e-import-assistant.c
@@ -27,7 +27,6 @@
 #include <string.h>
 
 #include <glib/gi18n.h>
-#include <glade/glade.h>
 #include <gdk/gdkkeysyms.h>
 
 #include "e-util/e-error.h"



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