ModestDimmingRule *rule = NULL;
gboolean dimmed = FALSE;
- g_return_val_if_fail (MODEST_IS_MSG_VIEW_WINDOW(win), FALSE);
+ g_return_val_if_fail (MODEST_IS_WINDOW(win), FALSE);
g_return_val_if_fail (MODEST_IS_DIMMING_RULE (user_data), FALSE);
rule = MODEST_DIMMING_RULE (user_data);
/* Check dimmed rule */
- if (!dimmed) {
- dimmed = _msg_download_in_progress (MODEST_MSG_VIEW_WINDOW(win));
- if (dimmed)
- modest_dimming_rule_set_notification (rule, "");
+ if (MODEST_IS_MSG_VIEW_WINDOW(win)) {
+ if (!dimmed) {
+ dimmed = _msg_download_in_progress (MODEST_MSG_VIEW_WINDOW(win));
+ if (dimmed)
+ modest_dimming_rule_set_notification (rule, "");
+ }
+ } else if (MODEST_IS_MAIN_WINDOW(win)) {
+ if (!dimmed) {
+ dimmed = !modest_account_mgr_has_accounts(modest_runtime_get_account_mgr(),
+ TRUE);
+ if (dimmed)
+ modest_dimming_rule_set_notification (rule, _("mcen_nc_no_email_acnts_defined"));
+ }
}
return dimmed;
dimmed = FALSE;
} else {
const gchar *proto_str = tny_account_get_proto (TNY_ACCOUNT (parent_folder));
- /* If it's POP then dim */
- dimmed = (modest_protocol_info_get_transport_store_protocol (proto_str) ==
- MODEST_PROTOCOL_STORE_POP) ? TRUE : FALSE;
- if (dimmed)
- modest_dimming_rule_set_notification (rule, _("mail_in_ui_folder_create_error"));
+ if (proto_str != NULL) {
+ /* If it's POP then dim */
+ dimmed = (modest_protocol_info_get_transport_store_protocol (proto_str) ==
+ MODEST_PROTOCOL_STORE_POP) ? TRUE : FALSE;
+ if (dimmed)
+ modest_dimming_rule_set_notification (rule, _("mail_in_ui_folder_create_error"));
+ }
}
} else {
/* TODO: the specs say that only one level of subfolder is allowed, is this true ? */
if (dimmed)
modest_dimming_rule_set_notification (rule, _("mcen_ib_unable_to_copy_samefolder"));
}
-
+
return dimmed;
}