group, G_CALLBACK (modest_ui_dimming_rules_on_new_msg));
add_to_menu (self, HILDON_APP_MENU (priv->app_menu), _("mcen_me_inbox_sendandreceive"),
G_CALLBACK (modest_ui_actions_on_send_receive),
- group, G_CALLBACK (modest_ui_dimming_rules_on_send_receive));
+ group, G_CALLBACK (modest_ui_dimming_rules_on_send_receive_all));
add_to_menu (self, HILDON_APP_MENU (priv->app_menu), _("mcen_me_outbox_cancelsend"),
G_CALLBACK (modest_ui_actions_cancel_send),
group, G_CALLBACK (modest_ui_dimming_rules_on_cancel_sending_all));
#include <tny-simple-list.h>
#include <widgets/modest-recpt-editor.h>
#include <gtkhtml/gtkhtml.h>
+#include <modest-runtime.h>
#ifdef MODEST_TOOLKIT_HILDON2
#include <modest-header-window.h>
#endif
static gboolean _transfer_mode_enabled (ModestWindow *win);
static gboolean _selected_folder_has_subfolder_with_same_name (ModestWindow *win);
static void fill_list_of_caches (gpointer key, gpointer value, gpointer userdata);
+static gboolean _send_receive_in_progress (ModestWindow *win);
static DimmedState *
modest_account_mgr_free_account_names (account_names);
- /* TODO: should dim if send receive is in progress */
+ if (!dimmed) {
+ dimmed = _send_receive_in_progress (win);
+ }
return dimmed;
}
return (format != MODEST_MSG_EDIT_FORMAT_HTML);
}
+
+static gboolean
+_send_receive_in_progress (ModestWindow *win)
+{
+ ModestMailOperationQueue *queue;
+ GSList *op_list, *node;
+ gboolean found_send_receive;
+
+ queue = modest_runtime_get_mail_operation_queue ();
+ op_list = modest_mail_operation_queue_get_by_source (queue, G_OBJECT (win));
+
+ found_send_receive = FALSE;
+ for (node = op_list; node != NULL; node = g_slist_next (node)) {
+ ModestMailOperation *op;
+
+ op = (ModestMailOperation *) node->data;
+ if (modest_mail_operation_get_type_operation (op) == MODEST_MAIL_OPERATION_TYPE_SEND_AND_RECEIVE) {
+ found_send_receive = TRUE;
+ break;
+ }
+ }
+
+ g_slist_foreach (op_list, (GFunc) g_object_unref, NULL);
+ g_slist_free (op_list);
+
+ return found_send_receive;
+}