* src/modest-tny-msg.c:
[modest] / src / modest-ui-dimming-rules.c
index ccb07eb..f435e9c 100644 (file)
@@ -273,7 +273,7 @@ _define_msg_view_window_dimming_state (ModestMsgViewWindow *window)
        all_has_attach = all_has_attach && (flags & TNY_HEADER_FLAG_ATTACHMENTS);
        state->all_has_attachments = all_has_attach;
        if (!state->any_has_attachments)
-               state->any_has_attachments = flags & TNY_HEADER_FLAG_ATTACHMENTS;
+               state->any_has_attachments = (flags & TNY_HEADER_FLAG_ATTACHMENTS)?1:0;
        
        /* sent in progress */
        msg_uid = modest_tny_send_queue_get_msg_id (header);
@@ -799,6 +799,9 @@ modest_ui_dimming_rules_on_details (ModestWindow *win, gpointer user_data)
                                        }
 
                                        g_object_unref (folder_store);
+                               } else {
+                                       dimmed = TRUE;
+                                       modest_dimming_rule_set_notification (rule, "");
                                }
                                if (!dimmed) {
                                        dimmed = _msg_download_in_progress (win);
@@ -1193,7 +1196,7 @@ modest_ui_dimming_rules_on_remove_attachments (ModestWindow *win, gpointer user_
 
        /* Check if the selected message in main window has attachments */
        if (!dimmed && MODEST_IS_MAIN_WINDOW (win)) {
-               dimmed = state->any_has_attachments;
+               dimmed = !(state->any_has_attachments);
                if (dimmed)
                        modest_dimming_rule_set_notification (rule, _("mail_ib_unable_to_purge_attachments"));
        }
@@ -1465,10 +1468,13 @@ modest_ui_dimming_rules_on_editor_paste (ModestWindow *win, gpointer user_data)
        }
 
        if (!dimmed) {
-               GtkClipboard *clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
+               dimmed = GTK_IS_TOGGLE_BUTTON (focused);
+       }
+
+       if (!dimmed) {
                ModestEmailClipboard *e_clipboard = modest_runtime_get_email_clipboard ();
                dimmed = modest_email_clipboard_cleared (e_clipboard) && 
-                       !gtk_clipboard_wait_is_text_available (clipboard);
+                       (modest_msg_edit_window_get_clipboard_text(MODEST_MSG_EDIT_WINDOW (win)) != NULL);
        }
        
        return dimmed;
@@ -2508,9 +2514,7 @@ _invalid_folder_for_purge (ModestWindow *win,
                        result = TRUE;
                        modest_dimming_rule_set_notification (rule, _("mail_ib_unable_to_purge_editable_msg"));
                } else {
-                       /* We're currently disabling purge in any local store */
-                       result = TRUE;
-                       modest_dimming_rule_set_notification (rule, _("mail_ib_unable_to_purge_attachments"));
+                       result = FALSE;
                }
        } else {
                const gchar *proto_str = tny_account_get_proto (TNY_ACCOUNT (account));