* src/modest-mail-operation.[ch]:
authorJose Dapena Paz <jdapena@igalia.com>
Mon, 28 Apr 2008 08:41:57 +0000 (08:41 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Mon, 28 Apr 2008 08:41:57 +0000 (08:41 +0000)
        * Now modest_mail_operation_get_msg gets a boolean parameter to
          enable/disable progress bar status feedback.
* src/modest-ui-actions.c:
        * On opening a message for removing attachments, don't show
  progress bar (fixes NB#83892).
        * Adapt to modest_mail_operation_get_msg to new API.
* src/maemo/modest-msg-view-window.c:
        * Adapt to modest_mail_operation_get_msg to new API.

pmo-trunk-r4485

src/maemo/modest-msg-view-window.c
src/modest-mail-operation.c
src/modest-mail-operation.h
src/modest-ui-actions.c

index 9e3bcc8..bbd215d 100644 (file)
@@ -1646,7 +1646,7 @@ message_reader_performer (gboolean canceled,
                                                                 NULL, NULL);
                                
        modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_op);
-       modest_mail_operation_get_msg (mail_op, info->header, view_msg_cb, info->row_reference);
+       modest_mail_operation_get_msg (mail_op, info->header, TRUE, view_msg_cb, info->row_reference);
        g_object_unref (mail_op);
 
        /* Update dimming rules */
index 3f0f98a..ffa5c29 100644 (file)
@@ -2200,6 +2200,7 @@ modest_mail_operation_rename_folder (ModestMailOperation *self,
 void 
 modest_mail_operation_get_msg (ModestMailOperation *self,
                               TnyHeader *header,
+                              gboolean progress_feedback,
                               GetMsgAsyncUserCallback user_callback,
                               gpointer user_data)
 {
@@ -2221,10 +2222,14 @@ modest_mail_operation_get_msg (ModestMailOperation *self,
        priv->account = modest_tny_folder_get_account (TNY_FOLDER(folder));
        
        /* Check for cached messages */
-       if (tny_header_get_flags (header) & TNY_HEADER_FLAG_CACHED)
-               priv->op_type = MODEST_MAIL_OPERATION_TYPE_OPEN;
-       else 
-               priv->op_type = MODEST_MAIL_OPERATION_TYPE_RECEIVE;
+       if (progress_feedback) {
+               if (tny_header_get_flags (header) & TNY_HEADER_FLAG_CACHED)
+                       priv->op_type = MODEST_MAIL_OPERATION_TYPE_OPEN;
+               else 
+                       priv->op_type = MODEST_MAIL_OPERATION_TYPE_RECEIVE;
+       } else {
+               priv->op_type = MODEST_MAIL_OPERATION_TYPE_UNKNOWN;
+       }
        
        /* Create the helper */
        helper = g_slice_new0 (GetMsgInfo);
index 1e44cf5..7c43ac0 100644 (file)
@@ -592,6 +592,7 @@ void          modest_mail_operation_remove_msgs     (ModestMailOperation *self,
  * modest_mail_operation_get_msg:
  * @self: a #ModestMailOperation
  * @header_list: the #TnyHeader of the message to get
+ * @progress_feedback: a #gboolean. If %TRUE, we'll get progress bar feedback.
  * @user_callback: a #GetMsgAsyncUserCallback function to call after tinymail callback execution.
  * @user_data: generic user data which will be passed to @user_callback function.
  * 
@@ -600,7 +601,8 @@ void          modest_mail_operation_remove_msgs     (ModestMailOperation *self,
  * #ModestMailOperation should be added to #ModestMailOperationQueue
  **/
 void          modest_mail_operation_get_msg     (ModestMailOperation *self,
-                                                TnyHeader *header, 
+                                                TnyHeader *header,
+                                                gboolean progress_feedback,
                                                 GetMsgAsyncUserCallback user_callback,
                                                 gpointer user_data);
 /**
index 9e8cd82..a5eb995 100644 (file)
@@ -1702,6 +1702,7 @@ reply_forward (ReplyForwardAction action, ModestWindow *win)
                                
                                modest_mail_operation_get_msg (mail_op,
                                                               header,
+                                                              TRUE,
                                                               reply_forward_cb,
                                                               rf_helper);
                                /* Clean */
@@ -4863,7 +4864,7 @@ modest_ui_actions_on_main_window_remove_attachments (GtkAction *action,
                                                                         modest_ui_actions_disk_operations_error_handler,
                                                                         NULL, NULL);
                modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_op);
-               modest_mail_operation_get_msg (mail_op, header, open_msg_for_purge_cb, win);
+               modest_mail_operation_get_msg (mail_op, header, FALSE, open_msg_for_purge_cb, win);
                
                g_object_unref (mail_op);
        }