aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-02-22 08:13:56 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-02-22 08:13:56 +0800
commit17815d8669be4a9e57a3a0eba4c54db122ed1188 (patch)
tree559be630ae148bbdb451d512f37b19ba70303c74
parent4f122d673cbe7cd1e11a951c5dd9f6d5e23431b7 (diff)
downloadgsoc2013-evolution-17815d8669be4a9e57a3a0eba4c54db122ed1188.tar
gsoc2013-evolution-17815d8669be4a9e57a3a0eba4c54db122ed1188.tar.gz
gsoc2013-evolution-17815d8669be4a9e57a3a0eba4c54db122ed1188.tar.bz2
gsoc2013-evolution-17815d8669be4a9e57a3a0eba4c54db122ed1188.tar.lz
gsoc2013-evolution-17815d8669be4a9e57a3a0eba4c54db122ed1188.tar.xz
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
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/message-list.c30
2 files changed, 35 insertions, 3 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 29bb0aee94..853e1f266a 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,9 +1,14 @@
+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.
+
2002-02-20 Anna Marie Dirks <anna@ximian.com>
* message-tag-editor.c (message_tag_editor_init): Gave the editor
window a title and an icon.
-
2002-02-20 Anna Marie Dirks <anna@ximian.com>
* message-tags.glade: Changed the policy for table2 so that it
@@ -11,7 +16,6 @@
as much growing room as possible. (And besides, there's no reason for
table2 to expand/fill; its child widgets can't change size.
-
2002-02-19 Jeffrey Stedfast <fejj@ximian.com>
* mail-callbacks.c (confirm_goto_next_folder): Prompt the user to
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)
{