diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-02-22 08:13:56 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-02-22 08:13:56 +0800 |
commit | 17815d8669be4a9e57a3a0eba4c54db122ed1188 (patch) | |
tree | 559be630ae148bbdb451d512f37b19ba70303c74 /mail/message-list.c | |
parent | 4f122d673cbe7cd1e11a951c5dd9f6d5e23431b7 (diff) | |
download | gsoc2013-evolution-17815d8669be4a9e57a3a0eba4c54db122ed1188.tar.gz gsoc2013-evolution-17815d8669be4a9e57a3a0eba4c54db122ed1188.tar.zst gsoc2013-evolution-17815d8669be4a9e57a3a0eba4c54db122ed1188.zip |
Connect to our own message_list_built signal. Focus the list and select
2002-02-21 Jeffrey Stedfast <fejj@ximian.com>
* message-list.c (on_message_list_built): Connect to our own
message_list_built signal. Focus the list and select the first
unread message (or frst message depending). Fixes bug #3900.
svn path=/trunk/; revision=15784
Diffstat (limited to 'mail/message-list.c')
-rw-r--r-- | mail/message-list.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/mail/message-list.c b/mail/message-list.c index 030791faa8..de11443503 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -109,6 +109,7 @@ typedef struct _EMailAddress EMailAddress; static ETreeScrolledClass *message_list_parent_class; static void on_cursor_activated_cmd (ETree *tree, int row, ETreePath path, gpointer user_data); +static void on_message_list_built (MessageList *message_list, gpointer user_data); static gint on_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, MessageList *list); static char *filter_date (time_t date); static char *filter_size (int size); @@ -1274,6 +1275,9 @@ message_list_construct (MessageList *message_list) gtk_signal_connect (GTK_OBJECT (message_list->tree), "click", GTK_SIGNAL_FUNC (on_click), message_list); + + gtk_signal_connect (GTK_OBJECT (message_list), "message_list_built", + GTK_SIGNAL_FUNC (on_message_list_built), message_list); } GtkWidget * @@ -1460,7 +1464,6 @@ build_tree (MessageList *ml, CamelFolderThread *thread, CamelFolderChangeInfo *c diff -= start.tv_sec * 1000 + start.tv_usec/1000; printf("Building tree took %ld.%03ld seconds\n", diff / 1000, diff % 1000); #endif - } /* this is about 20% faster than build_subtree_diff, @@ -2043,6 +2046,31 @@ on_cursor_activated_cmd (ETree *tree, int row, ETreePath path, gpointer user_dat } } +static void +on_message_list_built (MessageList *message_list, gpointer user_data) +{ + GtkWidget *widget = GTK_WIDGET (message_list); + + if (!GTK_WIDGET_VISIBLE (widget)) + return; + + if (!GTK_WIDGET_HAS_FOCUS (widget)) + gtk_widget_grab_focus (widget); + + if (!e_tree_get_cursor (message_list->tree)) { + CamelMessageInfo *info; + ETreePath node; + + node = e_tree_node_at_row (message_list->tree, 0); + e_tree_set_cursor (message_list->tree, node); + + info = e_tree_memory_node_get_data (E_TREE_MEMORY (message_list->model), node); + if (info && info->flags & CAMEL_MESSAGE_SEEN) + message_list_select (message_list, MESSAGE_LIST_SELECT_NEXT, + 0, CAMEL_MESSAGE_SEEN, FALSE); + } +} + static gint on_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, MessageList *list) { |