-_sending_in_progress (ModestWindow *win)
-{
- GHashTable *send_queue_cache = NULL;
- ModestCacheMgr *cache_mgr = NULL;
- ModestTnySendQueue *send_queue = NULL;
- GSList *send_queues = NULL, *node = NULL;
- gboolean result = FALSE;
-
- g_return_val_if_fail (MODEST_IS_MAIN_WINDOW (win), FALSE);
-
- /* Get send queue */
- cache_mgr = modest_runtime_get_cache_mgr ();
- send_queue_cache = modest_cache_mgr_get_cache (cache_mgr,
- MODEST_CACHE_MGR_CACHE_TYPE_SEND_QUEUE);
-
- g_hash_table_foreach (send_queue_cache, (GHFunc) fill_list_of_caches, &send_queues);
-
- for (node = send_queues; node != NULL && !result; node = g_slist_next (node)) {
- send_queue = MODEST_TNY_SEND_QUEUE (node->data);
-
- /* Check if send operation is in progress */
- result = modest_tny_send_queue_sending_in_progress (send_queue);
- }
-
- return result;
-}
-
-static gboolean
-_invalid_account_for_purge (ModestWindow *win,
- ModestDimmingRule *rule)
-{
- const gchar *account_name;
- ModestTnyAccountStore *account_store;
- TnyAccount *store_account = NULL;
- gboolean result = FALSE;
- const gchar *protocol_name;
-
- account_name = modest_window_get_active_account (win);
- if (account_name == NULL)
- goto frees;
-
- account_store = modest_runtime_get_account_store ();
- store_account = modest_tny_account_store_get_server_account (account_store, account_name, TNY_ACCOUNT_TYPE_STORE);
- if (store_account == NULL)
- goto frees;
-
- protocol_name = tny_account_get_proto (store_account);
- if (modest_protocol_info_get_transport_store_protocol (protocol_name) == MODEST_PROTOCOL_STORE_POP) {
- gint n_selected = 0;
- result = TRUE;
-
- if (MODEST_IS_MSG_VIEW_WINDOW (win)) {
- TnyList *attachments;
- attachments = modest_msg_view_window_get_attachments (MODEST_MSG_VIEW_WINDOW(win));
- n_selected = tny_list_get_length (attachments);
- g_object_unref (attachments);
- }
-
- modest_dimming_rule_set_notification (rule,
- ngettext ("mail_ib_unable_to_pure_attach_pop_mail_singular",
- "mail_ib_unable_to_pure_attach_pop_mail_plural",
- n_selected));
-
- }
-frees:
- if (store_account)
- g_object_unref (store_account);
- return result;
-}
-
-static gboolean