#include "modest-tny-msg.h"
#include "modest-tny-mime-part.h"
#include "modest-text-utils.h"
-#include <modest-address-book.h>
+#include "modest-address-book.h"
#include <widgets/modest-attachments-view.h>
#include <modest-runtime.h>
#include <tny-simple-list.h>
/* Check dimmed rule */
if (MODEST_IS_MSG_VIEW_WINDOW(win)) {
+#ifndef MODEST_TOOLKIT_HILDON2
dimmed = _msg_download_in_progress (win);
if (dimmed)
- modest_dimming_rule_set_notification (rule, "");
+ modest_dimming_rule_set_notification (rule, "");
+#endif
} else if (MODEST_IS_MAIN_WINDOW(win)) {
dimmed = !modest_account_mgr_has_accounts(modest_runtime_get_account_mgr(),
TRUE);
!gtk_widget_is_focus (header_view) &&
!gtk_widget_is_focus (folder_view)) {
dimmed = TRUE;
- modest_dimming_rule_set_notification (rule, dgettext("hildon-common-strings", "ckct_ib_nothing_to_delete"));
+ modest_dimming_rule_set_notification (rule, _CS("ckct_ib_nothing_to_delete"));
}
#ifdef MODEST_TOOLKIT_HILDON2
dimmed = _clipboard_is_empty (win);
if (dimmed)
modest_dimming_rule_set_notification (rule,
- dgettext("hildon-common-strings",
- "ecoc_ib_edwin_nothing_to_paste"));
+ _CS("ecoc_ib_edwin_nothing_to_paste"));
if (!dimmed) {
dimmed = _selected_folder_is_any_of_type (win, types, 3);
if (dimmed)
modest_dimming_rule_set_notification (rule,
- dgettext("hildon-common-strings",
- "ckct_ib_unable_to_paste_here"));
+ _CS("ckct_ib_unable_to_paste_here"));
}
if (!dimmed) {
dimmed = !_folder_view_has_focus (win);
if (dimmed)
modest_dimming_rule_set_notification (rule,
- dgettext("hildon-common-strings",
- "ckct_ib_unable_to_paste_here"));
+ _CS("ckct_ib_unable_to_paste_here"));
}
if (!dimmed) {
dimmed = _selected_folder_not_writeable (MODEST_MAIN_WINDOW(win), TRUE);
if (dimmed)
modest_dimming_rule_set_notification (rule,
- dgettext("hildon-common-strings",
- "ckct_ib_unable_to_paste_here"));
+ _CS("ckct_ib_unable_to_paste_here"));
}
if (!dimmed) {
dimmed = _selected_folder_is_same_as_source (win);
modest_dimming_rule_set_notification (rule, _("FIXME:no attachment selected"));
}
+#ifndef MODEST_TOOLKIT_HILDON2
/* Messages as attachments could not be removed */
if (!dimmed && MODEST_IS_MSG_VIEW_WINDOW (win)) {
TnyList *attachments;
g_object_unref (attachments);
}
}
+#endif
if (!dimmed) {
{
ModestDimmingRule *rule = NULL;
gboolean dimmed = FALSE;
-
+ ModestAccountMgr *mgr;
+ const gchar* account_name;
+
g_return_val_if_fail (MODEST_IS_DIMMING_RULE (user_data), FALSE);
rule = MODEST_DIMMING_RULE (user_data);
-
- /* Check dimmed rule */
- dimmed = !modest_account_mgr_has_accounts(modest_runtime_get_account_mgr(),
- TRUE);
+ mgr = modest_runtime_get_account_mgr();
+
+ /* Check dimmed rule */
+ account_name = modest_window_get_active_account (win);
+ dimmed = modest_account_mgr_account_is_busy (mgr, account_name);
+
if (dimmed)
modest_dimming_rule_set_notification (rule, _("mcen_nc_no_email_acnts_defined"));
{
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 */
GSList *account_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr (), TRUE);
- if (g_slist_length (account_names) <= 1)
+ 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);
if (!dimmed) {
msg = modest_msg_view_window_get_message (MODEST_MSG_VIEW_WINDOW (win));
/* Message is loaded asynchronously, so this could happen */
- if (!msg)
- return TRUE;
+ if (!msg) {
+#ifdef MODEST_TOOLKIT_HILDON2
+ TnyHeader *header;
- recipients = modest_tny_msg_get_all_recipients_list (msg);
+ header = modest_msg_view_window_get_header (MODEST_MSG_VIEW_WINDOW (win));
+ if (!header)
+ return TRUE;
+
+ recipients = modest_tny_msg_header_get_all_recipients_list (header);
+ g_object_unref (header);
+#else
+ return TRUE;
+#endif
+ } else {
+ recipients = modest_tny_msg_get_all_recipients_list (msg);
+ g_object_unref (msg);
+ }
has_recipients_to_add = FALSE;
for (node = recipients; node != NULL; node = g_slist_next (node)) {
g_slist_foreach (recipients, (GFunc) g_free, NULL);
g_slist_free (recipients);
- g_object_unref (msg);
return !has_recipients_to_add;
}