From 268501ccd5a36de584715c22c14dbf020249be4f Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Thu, 4 Dec 2008 22:28:50 +0000 Subject: [PATCH] Use new contact chooser instead of contact selector pmo-trunk-r6674 --- src/hildon2/modest-address-book.c | 23 +++++++++++++++++++---- src/hildon2/modest-hildon-includes.h | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/hildon2/modest-address-book.c b/src/hildon2/modest-address-book.c index f793576..c67ef6e 100644 --- a/src/hildon2/modest-address-book.c +++ b/src/hildon2/modest-address-book.c @@ -871,13 +871,10 @@ select_contacts_for_name_dialog (const gchar *name) e_book_query_unref (full_name_book_query); if (book_view) { - GtkWidget *contact_view = NULL; GtkWidget *contact_dialog = NULL; #if MODEST_ABOOK_API < 4 + GtkWidget *contact_view = NULL; osso_abook_tree_model_set_book_view (OSSO_ABOOK_TREE_MODEL (contact_model), book_view); -#else /* MODEST_ABOOK_API < 4 */ - osso_abook_list_store_set_book_view (OSSO_ABOOK_LIST_STORE (contact_model), book_view); -#endif /* MODEST_ABOOK_API < 4 */ e_book_view_start (book_view); contact_view = osso_abook_contact_selector_new_basic (contact_model); @@ -890,6 +887,24 @@ select_contacts_for_name_dialog (const gchar *name) e_book_view_stop (book_view); g_object_unref (book_view); gtk_widget_destroy (contact_dialog); +#else /* MODEST_ABOOK_API < 4 */ + osso_abook_list_store_set_book_view (OSSO_ABOOK_LIST_STORE (contact_model), book_view); + e_book_view_start (book_view); + + /* TODO: figure out how to make the contact chooser modal */ + contact_dialog = osso_abook_contact_chooser_new_with_capabilities (NULL, + _("mcen_ti_select_recipients"), + OSSO_ABOOK_CAPS_EMAIL, + OSSO_ABOOK_CONTACT_ORDER_NAME); + osso_abook_contact_chooser_set_model (OSSO_ABOOK_CONTACT_CHOOSER (contact_dialog), + contact_model); + + if (gtk_dialog_run (GTK_DIALOG (contact_dialog)) == GTK_RESPONSE_OK) + result = osso_abook_contact_chooser_get_selection (OSSO_ABOOK_CONTACT_CHOOSER (contact_dialog)); + e_book_view_stop (book_view); + g_object_unref (book_view); + gtk_widget_destroy (contact_dialog); +#endif /* MODEST_ABOOK_API < 4 */ } return result; diff --git a/src/hildon2/modest-hildon-includes.h b/src/hildon2/modest-hildon-includes.h index 11503cd..93d52b6 100644 --- a/src/hildon2/modest-hildon-includes.h +++ b/src/hildon2/modest-hildon-includes.h @@ -18,7 +18,7 @@ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -k * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- 1.7.9.5