From: Jose Dapena Paz Date: Wed, 26 Nov 2008 10:40:51 +0000 (+0000) Subject: Use the new temporary contact dialog for adding addresses to abook X-Git-Tag: git_migration_finished~976 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=7397db62d4d525fcb3fc42a9f34ff65f74ad94bb Use the new temporary contact dialog for adding addresses to abook pmo-trunk-r6411 --- diff --git a/src/hildon2/modest-address-book.c b/src/hildon2/modest-address-book.c index 845f28e..bb26fc2 100644 --- a/src/hildon2/modest-address-book.c +++ b/src/hildon2/modest-address-book.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include "modest-hildon-includes.h" #include "modest-platform.h" @@ -135,36 +136,25 @@ open_addressbook_sync () void modest_address_book_add_address (const gchar *address) { - OssoABookAccount *account = NULL; GtkWidget *dialog = NULL; - gchar *email_address = NULL; + gchar *email_address; + EVCardAttribute *attribute; - contact_model = osso_abook_contact_model_new (); if (!open_addressbook ()) { - if (contact_model) { - g_object_unref (contact_model); - contact_model = NULL; - } return; } email_address = modest_text_utils_get_email_address (address); - account = osso_abook_account_get (EVC_EMAIL, NULL, email_address); - g_free (email_address); - if (account) - { - dialog = osso_abook_add_to_contacts_dialog_new (contact_model, account); - g_object_unref (account); - gtk_dialog_run (GTK_DIALOG (dialog)); + attribute = e_vcard_attribute_new (NULL, EVC_EMAIL); + e_vcard_attribute_add_value (attribute, email_address); + dialog = osso_abook_temporary_contact_dialog_new (NULL, book, attribute, NULL); + gtk_dialog_run (GTK_DIALOG (dialog)); - if (contact_model) { - g_object_unref (contact_model); - contact_model = NULL; - } + gtk_widget_destroy (dialog); - gtk_widget_destroy (dialog); - } + e_vcard_attribute_free (attribute); + g_free (email_address); }