Migrated hildon2 to text-utils dgettext macros
[modest] / src / hildon2 / modest-address-book.c
index 537186b..c1360bc 100644 (file)
@@ -203,7 +203,7 @@ modest_address_book_select_addresses (ModestRecptEditor *recpt_editor)
 #else /* MODEST_ABOOK_API < 4 */
        /* TODO: figure out how to make the contact chooser modal */
        contact_chooser = osso_abook_contact_chooser_new_with_capabilities (NULL,
-                                                                           _("mcen_me_editor_selectrecipients"),
+                                                                           _AB("addr_ti_dia_select_contacts"),
                                                                            OSSO_ABOOK_CAPS_EMAIL, 
                                                                            OSSO_ABOOK_CONTACT_ORDER_NAME);
        /* Enable multiselection */
@@ -365,17 +365,20 @@ commit_contact(EContact * contact, gboolean is_new)
 {
        g_return_if_fail (contact);
        g_return_if_fail (book);
-       
+
        if (!contact || !book)
                return;
-       
+
 #if MODEST_ABOOK_API < 4
        osso_abook_contact_commit(contact, is_new, book);
 #else
        if (OSSO_ABOOK_IS_CONTACT (contact)) {
-               osso_abook_contact_commit(contact, is_new, book, NULL);
+               osso_abook_contact_commit(OSSO_ABOOK_CONTACT(contact), is_new, book, NULL);
        } else {
-               e_book_commit_contact (book, contact, NULL);
+               if (is_new)
+                       e_book_add_contact (book, contact, NULL);
+               else
+                       e_book_commit_contact (book, contact, NULL);
        }
 #endif /* MODEST_ABOOK_API < 2 */
 }
@@ -504,7 +507,7 @@ run_add_email_addr_to_contact_dlg(const gchar * contact_name)
                                if ((invalid_char_offset != NULL)&&(*invalid_char_offset != '\0')) {
                                        gchar *char_in_string = g_strdup_printf ("%c", *invalid_char_offset);
                                        gchar *message = g_strdup_printf(
-                                               dgettext("hildon-common-strings", "ckdg_ib_illegal_characters_entered"), 
+                                               _CS("ckdg_ib_illegal_characters_entered"), 
                                                char_in_string);
                                        hildon_banner_show_information (
                                                add_email_addr_to_contact_dlg, NULL, message );
@@ -750,9 +753,9 @@ modest_address_book_check_names (ModestRecptEditor *recpt_editor, gboolean updat
                if (!modest_text_utils_validate_recipient (address, &invalid_char_position)) {
                        if ((invalid_char_position != NULL) && (*invalid_char_position != '\0')) {
                                gchar *char_in_string = g_strdup_printf("%c", *invalid_char_position);
-                               gchar *message = g_strdup_printf(
-                                       dgettext("hildon-common-strings", "ckdg_ib_illegal_characters_entered"), 
-                                       char_in_string);
+                               gchar *message = 
+                                       g_strdup_printf(_CS("ckdg_ib_illegal_characters_entered"), 
+                                                       char_in_string);
                                g_free (char_in_string);
                                hildon_banner_show_information (NULL, NULL, message );
                                g_free (message);                               
@@ -896,10 +899,9 @@ select_contacts_for_name_dialog (const gchar *name)
 
                /* TODO: figure out how to make the contact chooser modal */
                contact_dialog = osso_abook_contact_chooser_new_with_capabilities (NULL,
-                                                                                  _("mcen_me_editor_selectrecipients"),
-                                                                                  OSSO_ABOOK_CAPS_EMAIL, 
+                                                                                  _AB("addr_ti_dia_select_contacts"),
+                                                                                  OSSO_ABOOK_CAPS_EMAIL,
                                                                                   OSSO_ABOOK_CONTACT_ORDER_NAME);
-
                osso_abook_contact_chooser_set_model (OSSO_ABOOK_CONTACT_CHOOSER (contact_dialog),
                                                      contact_model);