modest_dimming_rule_set_notification (rule, _("mcen_ib_message_already_deleted"));
}
- /* Commented out, because deletion should be possible even when
- * the message window has no header view model, which will be the
- * case when it is not the selected message in the header view.
+ /* The delete button should be dimmed when viewing an attachment,
+ * but should be enabled when viewing a message from the list,
+ * or when viewing a search result.
*/
-
if (!dimmed) {
- dimmed = !modest_msg_view_window_has_headers_model (MODEST_MSG_VIEW_WINDOW(win));
- if (dimmed) {
- modest_dimming_rule_set_notification (rule, _CS("ckct_ib_unable_to_delete"));
+ if (!modest_msg_view_window_is_search_result (MODEST_MSG_VIEW_WINDOW(win))) {
+ dimmed = !modest_msg_view_window_has_headers_model (MODEST_MSG_VIEW_WINDOW(win));
+ if (dimmed) {
+ modest_dimming_rule_set_notification (rule, _CS("ckct_ib_unable_to_delete"));
+ }
}
}
}
if (dimmed)
modest_dimming_rule_set_notification (rule, _("mail_ib_notavailable_downloading"));
}
+
if (!dimmed) {
- if (MODEST_IS_MSG_VIEW_WINDOW (win))
- dimmed = !modest_msg_view_window_has_headers_model (MODEST_MSG_VIEW_WINDOW (win));
+ 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,
+ * or when viewing a search result.
+ */
+ if (!modest_msg_view_window_is_search_result (MODEST_MSG_VIEW_WINDOW(win))) {
+ dimmed = !modest_msg_view_window_has_headers_model (MODEST_MSG_VIEW_WINDOW (win));
+ }
+ }
+
if (dimmed)
modest_dimming_rule_set_notification (rule, _("mcen_ib_unable_to_move_mail_attachment"));
}
/* Check window specific dimming rules */
if (MODEST_IS_MAIN_WINDOW (win)) {
- if (!dimmed) {
- dimmed = _selected_folder_is_empty (MODEST_MAIN_WINDOW(win));
- if (dimmed)
- modest_dimming_rule_set_notification (rule, "");
- }
- if (!dimmed) {
- dimmed = _selected_msg_sent_in_progress (win);
- if (dimmed)
+ /* Get focused widget */
+ GtkWidget *focused = gtk_window_get_focus (GTK_WINDOW (win));
+
+ if (MODEST_IS_HEADER_VIEW (focused)) {
+ if (!dimmed) {
+ dimmed = _selected_folder_is_empty (MODEST_MAIN_WINDOW(win));
+ if (dimmed)
+ modest_dimming_rule_set_notification (rule, "");
+ }
+ if (!dimmed) {
+ dimmed = _selected_msg_sent_in_progress (win);
+ if (dimmed)
modest_dimming_rule_set_notification (rule, _("mcen_ib_unable_to_cut_mess"));
+ }
}
}
-
+
return dimmed;
}
/* Check window specific dimming rules */
if (MODEST_IS_MAIN_WINDOW (win)) {
- if (!dimmed) {
- dimmed = _selected_folder_is_empty (MODEST_MAIN_WINDOW(win));
- if (dimmed)
- modest_dimming_rule_set_notification (rule, "");
- }
- if (!dimmed) {
- dimmed = _selected_msg_sent_in_progress (win);
- if (dimmed)
- modest_dimming_rule_set_notification (rule, _("mcen_ib_unable_to_cut_mess"));
+ /* Get focused widget */
+ GtkWidget *focused = gtk_window_get_focus (GTK_WINDOW (win));
+
+ if (MODEST_IS_HEADER_VIEW (focused)) {
+ if (!dimmed) {
+ dimmed = _selected_folder_is_empty (MODEST_MAIN_WINDOW(win));
+ if (dimmed)
+ modest_dimming_rule_set_notification (rule, "");
+ }
+ if (!dimmed) {
+ dimmed = _selected_msg_sent_in_progress (win);
+ if (dimmed)
+ modest_dimming_rule_set_notification (rule, _("mcen_ib_unable_to_cut_mess"));
+ }
}
}