Fixes NB#76204
[modest] / src / modest-ui-dimming-rules.c
index 030c387..788e90a 100644 (file)
@@ -1002,6 +1002,11 @@ modest_ui_dimming_rules_on_view_window_move_to (ModestWindow *win, gpointer user
        }
        
        if (!dimmed) {
+               dimmed = _selected_msg_sent_in_progress (win);
+               if (dimmed)
+                       modest_dimming_rule_set_notification (rule, _("mcen_ib_unable_to_move_mail_attachment"));
+       }
+       if (!dimmed) {
                if (MODEST_IS_MSG_VIEW_WINDOW (win)) {
                        /* The move_to button should be dimmed when viewing an attachment,
                         * but should be enabled when viewing a message from the list, 
@@ -1728,6 +1733,29 @@ modest_ui_dimming_rules_on_send_receive (ModestWindow *win, gpointer user_data)
        return dimmed;
 }
 
+gboolean 
+modest_ui_dimming_rules_on_send_receive_all (ModestWindow *win, gpointer user_data)
+{
+       ModestDimmingRule *rule = NULL;
+       gboolean dimmed = FALSE;
+       
+       g_return_val_if_fail (MODEST_IS_DIMMING_RULE (user_data), FALSE);
+       rule = MODEST_DIMMING_RULE (user_data);
+       /* Check dimmed rule */ 
+       if (!dimmed) {
+               GSList *account_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr (), TRUE);
+               if (g_slist_length (account_names) <= 1)
+                       dimmed = TRUE;
+               if (dimmed)
+                       modest_dimming_rule_set_notification (rule, _("mcen_nc_no_email_acnts_defined"));
+               
+               modest_account_mgr_free_account_names (account_names);
+       }
+
+       return dimmed;
+}
+
 gboolean
 modest_ui_dimming_rules_on_add_to_contacts (ModestWindow *win, gpointer user_data)
 {
@@ -2370,8 +2398,10 @@ _purged_attach_selected (ModestWindow *win, gboolean all, ModestDimmingRule *rul
        else
                result = (purged > 0);
 
+       /* This string no longer exists, refer to NB#75415 for more info
        if (result && (rule != NULL))
                modest_dimming_rule_set_notification (rule, _("mail_ib_attachment_already_purged"));
+       */
 
        return result;
 }