aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-05-31 05:43:40 +0800
committerDan Winship <danw@src.gnome.org>2000-05-31 05:43:40 +0800
commitc7381e8f1494734aeb9f1a406e6dadbac1f23d62 (patch)
treeffdf2fb6bbd356cf316b64ab03940c0c9ce1465d
parentf0ec699349a7a516f712b2fc24cd5e72a63d1f0b (diff)
downloadgsoc2013-evolution-c7381e8f1494734aeb9f1a406e6dadbac1f23d62.tar.gz
gsoc2013-evolution-c7381e8f1494734aeb9f1a406e6dadbac1f23d62.tar.zst
gsoc2013-evolution-c7381e8f1494734aeb9f1a406e6dadbac1f23d62.zip
call e_table_model_row_changed, not e_table_model_changed so we do less
* message-list.c (message_changed): call e_table_model_row_changed, not e_table_model_changed so we do less work, and don't lose the current selection. (select_msg): Set up a timer to mark the displayed message as "seen" if it's selected for longer than 1.5 seconds (a number pulled out of Matt's butt). (ml_value_at): Use the MESSAGE_STATUS column for read/unread as well as deleted. svn path=/trunk/; revision=3293
-rw-r--r--mail/ChangeLog11
-rw-r--r--mail/message-list.c32
2 files changed, 40 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index e03ad42e69..6435cd4861 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,14 @@
+2000-05-30 Dan Winship <danw@helixcode.com>
+
+ * message-list.c (message_changed): call
+ e_table_model_row_changed, not e_table_model_changed so we do less
+ work, and don't lose the current selection.
+ (select_msg): Set up a timer to mark the displayed message as
+ "seen" if it's selected for longer than 1.5 seconds (a number
+ pulled out of Matt's butt).
+ (ml_value_at): Use the MESSAGE_STATUS column for read/unread as
+ well as deleted.
+
2000-05-30 Christopher James Lahey <clahey@helixcode.com>
* message-list.c, message-list.h: Added bold for unread messages.
diff --git a/mail/message-list.c b/mail/message-list.c
index 8c29995cfe..89b5fb7cd4 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -81,9 +81,27 @@ static CamelMessageInfo *get_message_info(MessageList *message_list, gint row)
}
static void
-message_changed(CamelMimeMessage *m, enum _MessageChangeType type, MessageList *message_list)
+message_changed (CamelMimeMessage *m, enum _MessageChangeType type,
+ MessageList *message_list)
{
- e_table_model_changed (message_list->table_model);
+ guint row = GPOINTER_TO_UINT (gtk_object_get_data (GTK_OBJECT (m),
+ "row"));
+
+ e_table_model_row_changed (message_list->table_model, row);
+}
+
+static gint
+mark_msg_seen (gpointer data)
+{
+ CamelMimeMessage *msg = data;
+ guint32 flags;
+
+ g_return_if_fail (CAMEL_IS_MIME_MESSAGE (msg));
+
+ flags = camel_mime_message_get_flags (msg);
+ camel_mime_message_set_flags (msg, CAMEL_MESSAGE_SEEN,
+ CAMEL_MESSAGE_SEEN);
+ return FALSE;
}
/* select a message and display it */
@@ -93,6 +111,7 @@ select_msg (MessageList *message_list, gint row)
CamelException ex;
CamelMimeMessage *message = NULL;
CamelMessageInfo *msg_info;
+ static guint timeout;
camel_exception_init (&ex);
@@ -109,10 +128,15 @@ select_msg (MessageList *message_list, gint row)
}
if (message) {
- gtk_signal_connect((GtkObject *)message, "message_changed",
+ if (timeout)
+ gtk_timeout_remove (timeout);
+ gtk_object_set_data (GTK_OBJECT (message), "row",
+ GUINT_TO_POINTER (row));
+ gtk_signal_connect(GTK_OBJECT (message), "message_changed",
message_changed, message_list);
mail_display_set_message (message_list->parent_folder_browser->mail_display,
CAMEL_MEDIUM (message));
+ timeout = gtk_timeout_add (1500, mark_msg_seen, message);
gtk_object_unref (GTK_OBJECT (message));
}
}
@@ -186,6 +210,8 @@ ml_value_at (ETableModel *etm, int col, int row, void *data)
case COL_MESSAGE_STATUS:
if (msg_info->flags & CAMEL_MESSAGE_DELETED)
retval = GINT_TO_POINTER (2);
+ else if (msg_info->flags & CAMEL_MESSAGE_SEEN)
+ retval = GINT_TO_POINTER (0);
else
retval = GINT_TO_POINTER (1);
break;