}
/* New mail operation */
- mail_op = modest_mail_operation_new_with_error_handling (op_type,
- G_OBJECT(window),
+ mail_op = modest_mail_operation_new_with_error_handling (G_OBJECT(window),
modest_ui_actions_get_msgs_full_error_handler,
NULL);
}
ModestMailOperation*
-modest_mail_operation_new (ModestMailOperationTypeOperation op_type,
- GObject *source)
+modest_mail_operation_new (GObject *source)
{
ModestMailOperation *obj;
ModestMailOperationPrivate *priv;
obj = MODEST_MAIL_OPERATION(g_object_new(MODEST_TYPE_MAIL_OPERATION, NULL));
priv = MODEST_MAIL_OPERATION_GET_PRIVATE(obj);
- priv->op_type = op_type;
if (source != NULL)
priv->source = g_object_ref(source);
}
ModestMailOperation*
-modest_mail_operation_new_with_error_handling (ModestMailOperationTypeOperation op_type,
- GObject *source,
+modest_mail_operation_new_with_error_handling (GObject *source,
ErrorCheckingUserCallback error_handler,
gpointer user_data)
{
ModestMailOperation *obj;
ModestMailOperationPrivate *priv;
- obj = modest_mail_operation_new (op_type, source);
+ obj = modest_mail_operation_new (source);
priv = MODEST_MAIL_OPERATION_GET_PRIVATE(obj);
g_return_val_if_fail (error_handler != NULL, obj);
g_return_if_fail (TNY_IS_TRANSPORT_ACCOUNT (transport_account));
priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self);
+ priv->op_type = MODEST_MAIL_OPERATION_TYPE_SEND;
/* Check parametters */
if (to == NULL) {
SaveToDraftsInfo *info = (SaveToDraftsInfo *) userdata;
priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self);
+
if (!msg) {
priv->status = MODEST_MAIL_OPERATION_STATUS_FAILED;
g_set_error (&(priv->error), MODEST_MAIL_OPERATION_ERROR,
/* Get account and set it into mail_operation */
priv->account = g_object_ref (transport_account);
+ priv->op_type = MODEST_MAIL_OPERATION_TYPE_INFO;
info = g_slice_new0 (SaveToDraftsInfo);
info->transport_account = g_object_ref (transport_account);
priv->total = 0;
priv->done = 0;
priv->status = MODEST_MAIL_OPERATION_STATUS_IN_PROGRESS;
+ priv->op_type = MODEST_MAIL_OPERATION_TYPE_RECEIVE;
/* Get the store account */
store_account = (TnyStoreAccount *)
g_return_val_if_fail (name, NULL);
priv = MODEST_MAIL_OPERATION_GET_PRIVATE (self);
+ priv->op_type = MODEST_MAIL_OPERATION_TYPE_INFO;
/* Check for already existing folder */
if (modest_tny_folder_has_subfolder_with_name (parent, name)) {
/* Get the account */
account = modest_tny_folder_get_account (folder);
priv->account = g_object_ref(account);
+ priv->op_type = MODEST_MAIL_OPERATION_TYPE_DELETE;
/* Delete folder or move to trash */
if (remove_to_trash) {
error_msg = _("mail_in_ui_folder_move_target_error");
/* Get account and set it into mail_operation */
+ priv->op_type = MODEST_MAIL_OPERATION_TYPE_RECEIVE;
priv->account = modest_tny_folder_get_account (TNY_FOLDER(folder));
priv->status = MODEST_MAIL_OPERATION_STATUS_IN_PROGRESS;
/* Get account and set it into mail_operation */
priv->account = modest_tny_folder_get_account (TNY_FOLDER(folder));
+ priv->op_type = MODEST_MAIL_OPERATION_TYPE_INFO;
/* Check folder rules */
rules = modest_tny_folder_get_rules (TNY_FOLDER (folder));
folder = tny_header_get_folder (header);
priv->status = MODEST_MAIL_OPERATION_STATUS_IN_PROGRESS;
+ priv->op_type = MODEST_MAIL_OPERATION_TYPE_RECEIVE;
/* Get message from folder */
if (folder) {
/* Init mail operation */
priv = MODEST_MAIL_OPERATION_GET_PRIVATE (self);
priv->status = MODEST_MAIL_OPERATION_STATUS_IN_PROGRESS;
+ priv->op_type = MODEST_MAIL_OPERATION_TYPE_RECEIVE;
priv->done = 0;
priv->total = tny_list_get_length(header_list);
/* Get account and set it into mail_operation */
priv->account = modest_tny_folder_get_account (TNY_FOLDER(folder));
-
+ priv->op_type = MODEST_MAIL_OPERATION_TYPE_DELETE;
priv->status = MODEST_MAIL_OPERATION_STATUS_IN_PROGRESS;
/* remove message from folder */
/* Get account and set it into mail_operation */
priv->account = modest_tny_folder_get_account (TNY_FOLDER(folder));
-
+ priv->op_type = MODEST_MAIL_OPERATION_TYPE_DELETE;
priv->status = MODEST_MAIL_OPERATION_STATUS_IN_PROGRESS;
/* remove message from folder */
priv->total = 1;
priv->done = 0;
priv->status = MODEST_MAIL_OPERATION_STATUS_IN_PROGRESS;
+ priv->op_type = MODEST_MAIL_OPERATION_TYPE_RECEIVE;
/* Apply folder rules */
rules = modest_tny_folder_get_rules (TNY_FOLDER (folder));
/* Get account and set it into mail_operation */
priv->account = modest_tny_folder_get_account (folder);
+ priv->op_type = MODEST_MAIL_OPERATION_TYPE_RECEIVE;
/* Create the helper */
helper = g_slice_new0 (RefreshAsyncHelper);
priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self);
/* Ensure that all the fields are filled correctly */
-/* g_return_if_fail (priv->account != NULL); */
-/* g_return_if_fail (priv->op_type != MODEST_MAIL_OPERATION_TYPE_UNKNOWN); */
- g_assert (priv->account != NULL);
- g_assert (priv->op_type != MODEST_MAIL_OPERATION_TYPE_UNKNOWN);
+ g_return_if_fail (priv->account != NULL);
+ g_return_if_fail (priv->op_type != MODEST_MAIL_OPERATION_TYPE_UNKNOWN);
/* Notify the observers about the mail operation. We do not
wrapp this emission because we assume that this function is
/**
* modest_mail_operation_new:
- * @id: a #ModestMailOperationId identification of operation type.
* @source: a #GObject which creates this new operation.
*
* Creates a new instance of class #ModestMailOperation, using parameters
* to initialize its private structure. @source parameter may be NULL.
**/
-ModestMailOperation* modest_mail_operation_new (ModestMailOperationTypeOperation type,
- GObject *source);
+ModestMailOperation* modest_mail_operation_new (GObject *source);
/**
* modest_mail_operation_new_with_error_handling:
* @error_handler can not be NULL, but it will be returned an mail operation
* object without error handling capability.
**/
-ModestMailOperation* modest_mail_operation_new_with_error_handling (ModestMailOperationTypeOperation op_type,
- GObject *source,
+ModestMailOperation* modest_mail_operation_new_with_error_handling (GObject *source,
ErrorCheckingUserCallback error_handler,
gpointer user_data);
/**
void modest_do_message_delete (TnyHeader *header, ModestWindow *win)
{
ModestMailOperation *mail_op = NULL;
- mail_op = modest_mail_operation_new (MODEST_MAIL_OPERATION_TYPE_DELETE,
- win ? G_OBJECT(win) : NULL);
+ mail_op = modest_mail_operation_new (win ? G_OBJECT(win) : NULL);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
mail_op);
void modest_do_messages_delete (TnyList *headers, ModestWindow *win)
{
ModestMailOperation *mail_op = NULL;
- mail_op = modest_mail_operation_new (MODEST_MAIL_OPERATION_TYPE_DELETE,
- win ? G_OBJECT(win) : NULL);
+ mail_op = modest_mail_operation_new (win ? G_OBJECT(win) : NULL);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
mail_op);
/* Open each message */
if (tny_list_get_length (not_opened_headers) > 0) {
- mail_op = modest_mail_operation_new_with_error_handling (MODEST_MAIL_OPERATION_TYPE_RECEIVE,
- G_OBJECT (win),
+ mail_op = modest_mail_operation_new_with_error_handling (G_OBJECT (win),
modest_ui_actions_get_msgs_full_error_handler,
NULL);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_op);
/* Retrieve messages */
if (do_retrieve) {
mail_op = modest_mail_operation_new_with_error_handling (
- MODEST_MAIL_OPERATION_TYPE_RECEIVE,
G_OBJECT(win),
modest_ui_actions_get_msgs_full_error_handler,
NULL);
/* Set send/receive operation in progress */
modest_main_window_notify_send_receive_initied (MODEST_MAIN_WINDOW(win));
- mail_op = modest_mail_operation_new_with_error_handling (MODEST_MAIL_OPERATION_TYPE_RECEIVE,
- G_OBJECT (win),
+ mail_op = modest_mail_operation_new_with_error_handling (G_OBJECT (win),
modest_ui_actions_send_receive_error_handler,
NULL);
from = modest_account_mgr_get_from_string (account_mgr, account_name);
/* Create the mail operation */
- mail_operation = modest_mail_operation_new (MODEST_MAIL_OPERATION_TYPE_INFO, G_OBJECT(edit_window));
+ mail_operation = modest_mail_operation_new (G_OBJECT(edit_window));
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_operation);
modest_mail_operation_save_to_drafts (mail_operation,
gchar *from = modest_account_mgr_get_from_string (account_mgr, account_name);
/* Create the mail operation */
- ModestMailOperation *mail_operation = modest_mail_operation_new (MODEST_MAIL_OPERATION_TYPE_SEND, G_OBJECT(edit_window));
+ ModestMailOperation *mail_operation = modest_mail_operation_new (G_OBJECT(edit_window));
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_operation);
modest_mail_operation_send_new_mail (mail_operation,
ModestMailOperation *mail_op;
TnyFolder *new_folder = NULL;
- mail_op = modest_mail_operation_new_with_error_handling (MODEST_MAIL_OPERATION_TYPE_INFO,
- G_OBJECT(parent_window),
+ mail_op = modest_mail_operation_new_with_error_handling (G_OBJECT(parent_window),
modest_ui_actions_new_folder_error_handler,
parent_window);
GtkTreeSelection *sel = NULL;
mail_op =
- modest_mail_operation_new_with_error_handling (MODEST_MAIL_OPERATION_TYPE_INFO,
- G_OBJECT(main_window),
+ modest_mail_operation_new_with_error_handling (G_OBJECT(main_window),
modest_ui_actions_rename_folder_error_handler,
main_window);
/* Create the mail operation */
mail_op =
- modest_mail_operation_new_with_error_handling (MODEST_MAIL_OPERATION_TYPE_DELETE,
- G_OBJECT(main_window),
+ modest_mail_operation_new_with_error_handling (G_OBJECT(main_window),
modest_ui_actions_delete_folder_error_handler,
NULL);
helper->banner = modest_platform_animation_banner (GTK_WIDGET (window), NULL,
_CS("ckct_nw_pasting"));
modest_email_clipboard_get_data (e_clipboard, &src_folder, &data, &delete);
- mail_op = modest_mail_operation_new (MODEST_MAIL_OPERATION_TYPE_RECEIVE,
- G_OBJECT (window));
+ mail_op = modest_mail_operation_new (G_OBJECT (window));
if (helper->banner != NULL) {
g_object_ref (G_OBJECT (helper->banner));
gtk_window_set_modal (GTK_WINDOW (helper->banner), FALSE);
modest_email_clipboard_get_data (clipboard, &src_folder, &data, &delete);
/* Create a new mail operation */
- mail_op = modest_mail_operation_new (MODEST_MAIL_OPERATION_TYPE_RECEIVE, G_OBJECT(window));
+ mail_op = modest_mail_operation_new (G_OBJECT(window));
/* Get destination folder */
folder_store = modest_folder_view_get_selected (MODEST_FOLDER_VIEW (focused_widget));
} else {
ModestMailOperation *mail_op = NULL;
modest_window_mgr_register_header (modest_runtime_get_window_mgr (), header);
- mail_op = modest_mail_operation_new_with_error_handling (MODEST_MAIL_OPERATION_TYPE_RECEIVE,
- G_OBJECT (win),
+ mail_op = modest_mail_operation_new_with_error_handling (G_OBJECT (win),
modest_ui_actions_get_msgs_full_error_handler,
NULL);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_op);
}
ModestMailOperation *mail_op =
- modest_mail_operation_new_with_error_handling (MODEST_MAIL_OPERATION_TYPE_RECEIVE,
- G_OBJECT(win),
+ modest_mail_operation_new_with_error_handling (G_OBJECT(win),
modest_ui_actions_move_folder_error_handler,
NULL);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
gtk_tree_selection_unselect_all (sel);
mail_op =
- modest_mail_operation_new_with_error_handling (MODEST_MAIL_OPERATION_TYPE_RECEIVE,
- G_OBJECT(win),
+ modest_mail_operation_new_with_error_handling (G_OBJECT(win),
modest_ui_actions_move_folder_error_handler,
src_folder);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
return;
/* Create mail operation */
- mail_op = modest_mail_operation_new_with_error_handling (MODEST_MAIL_OPERATION_TYPE_RECEIVE,
- G_OBJECT (window),
+ mail_op = modest_mail_operation_new_with_error_handling (G_OBJECT (window),
modest_ui_actions_get_msgs_full_error_handler,
NULL);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_op);
goto cleanup;
/* Transfer messages */
- mail_op = modest_mail_operation_new_with_error_handling (MODEST_MAIL_OPERATION_TYPE_RECEIVE,
- NULL,
+ mail_op = modest_mail_operation_new_with_error_handling (NULL,
modest_ui_actions_move_folder_error_handler,
NULL);
/* Do the mail operation */
mail_op =
- modest_mail_operation_new_with_error_handling (MODEST_MAIL_OPERATION_TYPE_RECEIVE,
- G_OBJECT (modest_window_mgr_get_main_window (mgr)),
+ modest_mail_operation_new_with_error_handling (G_OBJECT (modest_window_mgr_get_main_window (mgr)),
modest_ui_actions_move_folder_error_handler,
folder);
info->user_data = user_data;
/* Create the mail operation (source will be the parent widget) */
- mail_op = modest_mail_operation_new (MODEST_MAIL_OPERATION_TYPE_RECEIVE, source);
+ mail_op = modest_mail_operation_new (source);
modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
mail_op);