* Fixes NB#81047, the colon after "folders" is now getting the proper "dimmed" color
[modest] / src / maemo / modest-msg-view-window.c
index 16ed9cb..c758c0d 100644 (file)
@@ -1628,10 +1628,6 @@ message_reader_performer (gboolean canceled,
        modest_mail_operation_get_msg (mail_op, info->header, view_msg_cb, info->row_reference);
        g_object_unref (mail_op);
 
-       /* Update dimming rules */
-       modest_ui_actions_check_toolbar_dimming_rules (MODEST_WINDOW (parent_window));
-       modest_ui_actions_check_menu_dimming_rules (MODEST_WINDOW (parent_window));
-
  frees:
        /* Frees. The row_reference will be freed by the view_msg_cb callback */
        g_object_unref (info->header);
@@ -2247,6 +2243,14 @@ on_mail_operation_finished (ModestMailOperation *mail_op,
                if (observers_empty (self)) {
                        set_toolbar_mode (self, TOOLBAR_MODE_NORMAL);
                }
+
+               /* Update dimming rules. We have to do this right here
+                  and not in view_msg_cb because at that point the
+                  transfer mode is still enabled so the dimming rule
+                  won't let the user delete the message that has been
+                  readed for example */
+               modest_ui_actions_check_toolbar_dimming_rules (MODEST_WINDOW (self));
+               modest_ui_actions_check_menu_dimming_rules (MODEST_WINDOW (self));
        }
 }
 
@@ -2558,7 +2562,6 @@ modest_msg_view_window_save_attachments (ModestMsgViewWindow *window, TnyList *m
        GList *files_to_save = NULL;
        GtkWidget *save_dialog = NULL;
        gchar *folder = NULL;
-       gboolean canceled = FALSE;
        const gchar *filename = NULL;
        gchar *save_multiple_str = NULL;
 
@@ -2580,11 +2583,14 @@ modest_msg_view_window_save_attachments (ModestMsgViewWindow *window, TnyList *m
                iter = tny_list_create_iterator (mime_parts);
                TnyMimePart *mime_part = (TnyMimePart *) tny_iterator_get_current (iter);
                g_object_unref (iter);
-               if (!modest_tny_mime_part_is_msg (mime_part) && tny_mime_part_is_attachment (mime_part)) {
+               if (!modest_tny_mime_part_is_msg (mime_part) && 
+                   modest_tny_mime_part_is_attachment_for_modest (mime_part)) {
                        filename = tny_mime_part_get_filename (mime_part);
                } else {
+                       /* TODO: show any error? */
                        g_warning ("Tried to save a non-file attachment");
-                       canceled = TRUE;
+                       g_object_unref (mime_parts);
+                       return;
                }
                g_object_unref (mime_part);
        } else {
@@ -2608,6 +2614,7 @@ modest_msg_view_window_save_attachments (ModestMsgViewWindow *window, TnyList *m
        /* if multiple, set multiple string */
        if (save_multiple_str) {
                g_object_set (G_OBJECT (save_dialog), "save-multiple", save_multiple_str, NULL);
+               gtk_window_set_title (GTK_WINDOW (save_dialog), _FM("sfil_ti_save_objects_files"));
        }
                
        /* show dialog */
@@ -2624,7 +2631,7 @@ modest_msg_view_window_save_attachments (ModestMsgViewWindow *window, TnyList *m
                        while (!tny_iterator_is_done (iter)) {
                                TnyMimePart *mime_part = (TnyMimePart *) tny_iterator_get_current (iter);
 
-                               if ((tny_mime_part_is_attachment (mime_part)) && 
+                               if ((modest_tny_mime_part_is_attachment_for_modest (mime_part)) && 
                                    (tny_mime_part_get_filename (mime_part) != NULL)) {
                                        SaveMimePartPair *pair;