not_opened_headers = TNY_LIST (user_data);
status = tny_account_get_connection_status (account);
- if (err || canceled ||
- (modest_tny_folder_store_is_remote (TNY_FOLDER_STORE (account)) &&
- status != TNY_CONNECTION_STATUS_CONNECTED)) {
+ if (err || canceled) {
/* TODO: Show an error ? */
goto clean;
}
g_object_unref (source);
}
+gboolean
+retrieve_all_messages_cb (GObject *source,
+ guint num_msgs,
+ guint retrieve_limit)
+{
+ GtkWindow *window;
+ gchar *msg;
+ gint response;
+
+ window = GTK_WINDOW (source);
+ msg = g_strdup_printf (_("mail_nc_msg_count_limit_exceeded"),
+ num_msgs, retrieve_limit);
+
+ /* Ask the user if they want to retrieve all the messages */
+ response =
+ modest_platform_run_confirmation_dialog_with_buttons (window, msg,
+ _("mcen_bd_get_all"),
+ _("mcen_bd_newest_only"));
+ /* Free and return */
+ g_free (msg);
+ return (response == GTK_RESPONSE_ACCEPT) ? TRUE : FALSE;
+}
+
typedef struct {
TnyAccount *account;
ModestWindow *win;
modest_main_window_notify_send_receive_initied (MODEST_MAIN_WINDOW (info->win));
}
- mail_op = modest_mail_operation_new_with_error_handling (G_OBJECT (info->win),
+ mail_op = modest_mail_operation_new_with_error_handling ((info->win) ? G_OBJECT (info->win) : NULL,
modest_ui_actions_send_receive_error_handler,
NULL, NULL);
/* Send & receive. */
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_op);
modest_mail_operation_update_account (mail_op, info->account_name, (info->win) ? FALSE : TRUE,
+ (info->win) ? retrieve_all_messages_cb : NULL,
new_messages_arrived, info->win);
g_object_unref (G_OBJECT (mail_op));