}
static ModestTnySendQueueStatus
-get_status_of_uid (const gchar *uid)
+get_status_of_uid (TnyHeader *header)
{
ModestCacheMgr *cache_mgr;
GHashTable *send_queue_cache;
GSList *send_queues = NULL, *node;
/* get_msg_status returns suspended by default, so we want to detect changes */
ModestTnySendQueueStatus status = MODEST_TNY_SEND_QUEUE_SUSPENDED;
+ ModestTnySendQueueStatus queue_status = MODEST_TNY_SEND_QUEUE_SUSPENDED;
+ gchar *msg_uid = NULL;
+ msg_uid = modest_tny_send_queue_get_msg_id (header);
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; node = g_slist_next (node)) {
- ModestTnySendQueueStatus queue_status = modest_tny_send_queue_get_msg_status (
- MODEST_TNY_SEND_QUEUE (node->data), uid);
- if (queue_status != MODEST_TNY_SEND_QUEUE_SUSPENDED)
+ ModestTnySendQueue *send_queue = MODEST_TNY_SEND_QUEUE (node->data);
+
+ queue_status = modest_tny_send_queue_get_msg_status (send_queue, msg_uid);
+ if (queue_status != MODEST_TNY_SEND_QUEUE_UNKNONW) {
status = queue_status;
- break;
+ break;
+ }
}
+
+ g_free(msg_uid);
g_slist_free (send_queues);
return status;
}
_modest_header_view_compact_header_cell_data (GtkTreeViewColumn *column, GtkCellRenderer *renderer,
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer user_data)
{
- TnyHeaderFlags flags;
+ TnyHeaderFlags flags, prior_flags;
gchar *address, *subject, *header;
time_t date;
ModestHeaderViewCompactHeaderMode header_mode;
-1);
/* flags */
+ prior_flags = flags & TNY_HEADER_FLAG_PRIORITY;
if (flags & TNY_HEADER_FLAG_ATTACHMENTS)
g_object_set (G_OBJECT (attach_cell), "pixbuf",
get_pixbuf_for_flag (TNY_HEADER_FLAG_ATTACHMENTS),
NULL, NULL);
if (flags & TNY_HEADER_FLAG_PRIORITY)
g_object_set (G_OBJECT (priority_cell), "pixbuf",
- get_pixbuf_for_flag (flags & TNY_HEADER_FLAG_PRIORITY),
+ get_pixbuf_for_flag (prior_flags),
+/* get_pixbuf_for_flag (flags & TNY_HEADER_FLAG_PRIORITY), */
NULL);
else
g_object_set (G_OBJECT (priority_cell), "pixbuf",
g_object_set (G_OBJECT (subject_cell), "markup", header, NULL);
g_free (header);
set_common_flags (subject_cell, flags);
+
+
+ /* fixme: we hardcode the color to #666666; instead we should use SecundaryTextColour from the
+ * theme (gtkrc file) */
- header = g_markup_printf_escaped ("<small>%s</small>", modest_text_utils_get_display_address (address));
+ header = g_markup_printf_escaped ("<span size='small' foreground='#666666'>%s</span>", modest_text_utils_get_display_address (address));
g_free (address);
- g_object_set (G_OBJECT (recipient_cell), "markup", header, NULL);
+ g_object_set (G_OBJECT (recipient_cell),
+ "markup", header,
+ NULL);
g_free (header);
set_common_flags (recipient_cell, flags);
ModestTnySendQueueStatus status = MODEST_TNY_SEND_QUEUE_WAITING;
const gchar *status_str = "";
if (msg_header != NULL) {
- status = get_status_of_uid (tny_header_get_message_id (msg_header));
+ status = get_status_of_uid (msg_header);
+ if (status == MODEST_TNY_SEND_QUEUE_SUSPENDED) {
+ tny_header_unset_flags (msg_header, TNY_HEADER_FLAG_PRIORITY);
+ tny_header_set_flags (msg_header, TNY_HEADER_FLAG_SUSPENDED_PRIORITY);
+ }
+/* if (prior_flags == TNY_HEADER_FLAG_SUSPENDED_PRIORITY) */
+/* status = MODEST_TNY_SEND_QUEUE_SUSPENDED; */
}
status_str = get_status_string (status);
- /* TODO: for now we set the status to waiting always, we need a way to
- * retrieve the current send status of a message */
- status_str = get_status_string (MODEST_TNY_SEND_QUEUE_WAITING);
- display_date = g_strdup_printf("<small>%s</small>", status_str);
- g_object_set (G_OBJECT (date_or_status_cell), "markup", display_date, NULL);
+ display_date = g_strdup_printf("<span size='small' foreground='#666666'>%s</span>", status_str);
+ g_object_set (G_OBJECT (date_or_status_cell),
+ "markup", display_date,
+ NULL);
g_free (display_date);
} else {
/* in some rare cases, mail might have no Date: field. it case,
else
tmp_date = g_strdup ("");
- display_date = g_strdup_printf ("<small>%s</small>", tmp_date);
- g_object_set (G_OBJECT (date_or_status_cell), "markup", display_date, NULL);
+ display_date = g_strdup_printf ("<span size='small' foreground='#666666'>%s</span>", tmp_date);
+ g_object_set (G_OBJECT (date_or_status_cell),
+ "markup", display_date,
+ NULL);
g_free (tmp_date);
g_free (display_date);
}
GtkTreeModel *tree_model, GtkTreeIter *iter,
gpointer user_data)
{
- TnyHeaderFlags flags;
+ TnyHeaderFlags flags, prior_flags;
//guint status;
gchar *status_str;
gtk_tree_model_get (tree_model, iter,
TNY_GTK_HEADER_LIST_MODEL_FLAGS_COLUMN, &flags,
- // TNY_GTK_HEADER_LIST_MODEL_MESSAGE_SIZE_COLUMN, &status,
-1);
- status_str = g_strdup(_("mcen_li_outbox_waiting"));
-
+ prior_flags = flags & TNY_HEADER_FLAG_PRIORITY;
+ if (prior_flags == TNY_HEADER_FLAG_SUSPENDED_PRIORITY)
+ status_str = g_strdup(_("mcen_li_outbox_suspended"));
+ else
+ status_str = g_strdup(_("mcen_li_outbox_waiting"));
+
g_object_set (G_OBJECT(renderer), "text", status_str, NULL);
set_common_flags (renderer, flags);