X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmaemo%2Fmodest-address-book.c;h=183034ad51c4e075f7c8446ce6b2774a8b1f820b;hp=3e76c390195fc12e24d962e08a2ce55c9b9d8973;hb=84c2681caafc791433135f704227111272e45203;hpb=1cbda05a7cfb2067ce37b79f27674b5f005025a5 diff --git a/src/maemo/modest-address-book.c b/src/maemo/modest-address-book.c index 3e76c39..183034a 100644 --- a/src/maemo/modest-address-book.c +++ b/src/maemo/modest-address-book.c @@ -36,9 +36,7 @@ #include #include #include -#include -#include -#include +#include "modest-hildon-includes.h" #include #include #include @@ -141,9 +139,13 @@ modest_address_book_select_addresses (ModestRecptEditor *recpt_editor) GtkWidget *contact_dialog; GSList *email_addrs_per_contact = NULL; gchar *econtact_id; + gboolean focus_recpt_editor = FALSE; + GtkWidget *toplevel; g_return_if_fail (MODEST_IS_RECPT_EDITOR (recpt_editor)); + toplevel = gtk_widget_get_toplevel (GTK_WIDGET (recpt_editor)); + contact_model = osso_abook_contact_model_new (); if (!open_addressbook ()) { if (contact_model) { @@ -181,6 +183,7 @@ modest_address_book_select_addresses (ModestRecptEditor *recpt_editor) g_slist_foreach (email_addrs_per_contact, (GFunc) g_free, NULL); g_slist_free (email_addrs_per_contact); email_addrs_per_contact = NULL; + focus_recpt_editor = TRUE; } } g_list_free (contacts_list); @@ -198,6 +201,9 @@ modest_address_book_select_addresses (ModestRecptEditor *recpt_editor) gtk_widget_destroy (contact_dialog); + if (focus_recpt_editor) + modest_recpt_editor_grab_focus (MODEST_RECPT_EDITOR (recpt_editor)); + } /** @@ -307,7 +313,11 @@ commit_contact(EContact * contact) if (!contact || !book) return; +#ifdef MODEST_HILDON_VERSION_0 osso_abook_contact_commit(contact, FALSE, book); +#else + osso_abook_contact_commit(contact, FALSE, book, NULL); +#endif /* MODEST_HILDON_VERSION_0 */ } /** @@ -510,6 +520,8 @@ select_email_addrs_for_contact(GList * email_addr_list) gtk_list_store_set(list_store, &iter, 0, email_addr, -1); g_free(email_addr); } + gtk_tree_model_get_iter_first (GTK_TREE_MODEL (list_store), &iter); + gtk_tree_selection_select_iter (selection, &iter); gtk_widget_show_all(select_email_addr_dlg); result = gtk_dialog_run(GTK_DIALOG(select_email_addr_dlg));