X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-msg-view-window.c;h=abd650cde1238737187788b28d109c4d755ef169;hp=48699f1c6e33f425591294af2f101779c9a19784;hb=f2e1c16627aa9ad6aa8f58d8711151fefc930640;hpb=e1a1d369c7494dbd0cceabb6de6e1141de897317 diff --git a/src/widgets/modest-msg-view-window.c b/src/widgets/modest-msg-view-window.c index 48699f1..abd650c 100644 --- a/src/widgets/modest-msg-view-window.c +++ b/src/widgets/modest-msg-view-window.c @@ -3650,7 +3650,6 @@ modest_msg_view_window_add_to_contacts (ModestMsgViewWindow *self) priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (self); GSList *recipients = NULL; TnyMsg *msg = NULL; - gboolean contacts_to_add = FALSE; msg = tny_msg_view_get_msg (TNY_MSG_VIEW (priv->msg_view)); if (msg == NULL) { @@ -3666,56 +3665,11 @@ modest_msg_view_window_add_to_contacts (ModestMsgViewWindow *self) g_object_unref (msg); } - if (recipients != NULL) { - /****** HILDON2:START - * shows dialog with addresses not present in addressbook. User can choose one to - * add it to addressbook. - * */ - GtkWidget *picker_dialog; - GtkWidget *selector; - GSList *node; - gchar *selected = NULL; - - selector = hildon_touch_selector_new_text (); - g_object_ref (selector); - - for (node = recipients; node != NULL; node = g_slist_next (node)) { - if (!modest_address_book_has_address ((const gchar *) node->data)) { - hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector), - (const gchar *) node->data); - contacts_to_add = TRUE; - } - } - - if (contacts_to_add) { - gint picker_result; - - picker_dialog = hildon_picker_dialog_new (GTK_WINDOW (self)); - gtk_window_set_title (GTK_WINDOW (picker_dialog), _("mcen_me_viewer_addtocontacts")); - - hildon_picker_dialog_set_selector (HILDON_PICKER_DIALOG (picker_dialog), - HILDON_TOUCH_SELECTOR (selector)); - - picker_result = gtk_dialog_run (GTK_DIALOG (picker_dialog)); - - if (picker_result == GTK_RESPONSE_OK) { - selected = hildon_touch_selector_get_current_text (HILDON_TOUCH_SELECTOR (selector)); - } - gtk_widget_destroy (picker_dialog); - - if (selected) - modest_address_book_add_address (selected, (GtkWindow *) self); - g_free (selected); - - } else { - - g_object_unref (selector); - - } - /****** HILDON2:END */ + if (recipients) { + /* Offer the user to add recipients to the address book */ + modest_address_book_add_address_list_with_selector (recipients, (GtkWindow *) self); + g_slist_foreach (recipients, (GFunc) g_free, NULL); g_slist_free (recipients); } - - if (recipients) {g_slist_foreach (recipients, (GFunc) g_free, NULL); g_slist_free (recipients);} } static gboolean