aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-03-15 04:14:08 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-03-15 04:14:08 +0800
commit1911f19678bf2dbfa0fb1a8f316293c12c060872 (patch)
treed7be626e314be2ed93a43ec9177a6e06a1397970 /mail
parent4ed704581dd70d9fca3388c95cb6a834c592204b (diff)
downloadgsoc2013-evolution-1911f19678bf2dbfa0fb1a8f316293c12c060872.tar.gz
gsoc2013-evolution-1911f19678bf2dbfa0fb1a8f316293c12c060872.tar.zst
gsoc2013-evolution-1911f19678bf2dbfa0fb1a8f316293c12c060872.zip
Implemented.
2002-03-14 Jeffrey Stedfast <fejj@ximian.com> * mail-callbacks.c (next_thread): Implemented. * message-list.c (message_list_select_next_thread): New function to select the next thread. svn path=/trunk/; revision=16165
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/folder-browser-ui.c2
-rw-r--r--mail/mail-callbacks.c11
-rw-r--r--mail/mail-callbacks.h1
-rw-r--r--mail/message-list.c36
-rw-r--r--mail/message-list.h2
6 files changed, 57 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index df6925db21..9c9ee5e007 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2002-03-14 Jeffrey Stedfast <fejj@ximian.com>
+
+ * mail-callbacks.c (next_thread): Implemented.
+
+ * message-list.c (message_list_select_next_thread): New function
+ to select the next thread.
+
2002-03-13 Jeffrey Stedfast <fejj@ximian.com>
* folder-browser-window.c (folder_browser_window_new): Set a
diff --git a/mail/folder-browser-ui.c b/mail/folder-browser-ui.c
index 9fcc902c3f..36e8cea6f2 100644
--- a/mail/folder-browser-ui.c
+++ b/mail/folder-browser-ui.c
@@ -39,7 +39,7 @@ static BonoboUIVerb message_verbs [] = {
BONOBO_UI_UNSAFE_VERB ("MailNext", next_msg),
BONOBO_UI_UNSAFE_VERB ("MailNextFlagged", next_flagged_msg),
BONOBO_UI_UNSAFE_VERB ("MailNextUnread", next_unread_msg),
-/* BONOBO_UI_UNSAFE_VERB ("MailNextThread", next_thread),*/
+ BONOBO_UI_UNSAFE_VERB ("MailNextThread", next_thread),
BONOBO_UI_UNSAFE_VERB ("MailPrevious", previous_msg),
BONOBO_UI_UNSAFE_VERB ("MailPreviousFlagged", previous_flagged_msg),
BONOBO_UI_UNSAFE_VERB ("MailPreviousUnread", previous_unread_msg),
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 37f4d352bc..f95a3457cc 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -2523,6 +2523,17 @@ next_flagged_msg (GtkWidget *button, gpointer user_data)
}
void
+next_thread (GtkWidget *button, gpointer user_data)
+{
+ FolderBrowser *fb = FOLDER_BROWSER (user_data);
+
+ if (FOLDER_BROWSER_IS_DESTROYED (fb))
+ return;
+
+ message_list_select_next_thread (fb->message_list);
+}
+
+void
previous_msg (GtkWidget *button, gpointer user_data)
{
FolderBrowser *fb = FOLDER_BROWSER (user_data);
diff --git a/mail/mail-callbacks.h b/mail/mail-callbacks.h
index 16f0219b1e..103788c584 100644
--- a/mail/mail-callbacks.h
+++ b/mail/mail-callbacks.h
@@ -78,6 +78,7 @@ void view_source (GtkWidget *widget, gpointer user_data);
void next_msg (GtkWidget *widget, gpointer user_data);
void next_unread_msg (GtkWidget *widget, gpointer user_data);
void next_flagged_msg (GtkWidget *widget, gpointer user_data);
+void next_thread (GtkWidget *widget, gpointer user_data);
void previous_msg (GtkWidget *widget, gpointer user_data);
void previous_unread_msg (GtkWidget *widget, gpointer user_data);
void previous_flagged_msg (GtkWidget *widget, gpointer user_data);
diff --git a/mail/message-list.c b/mail/message-list.c
index e9dd90fa9a..79f24f14a8 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -376,7 +376,7 @@ search_func (ETreeModel *model, ETreePath path, struct search_func_data *data)
return FALSE;
info = get_message_info (data->message_list, path);
-
+
if (info && (info->flags & data->mask) == data->flags) {
gtk_signal_emit (GTK_OBJECT (data->message_list), message_list_signals[MESSAGE_SELECTED],
camel_message_info_uid (info));
@@ -463,6 +463,40 @@ message_list_select_uid (MessageList *message_list, const char *uid)
}
}
+
+void
+message_list_select_next_thread (MessageList *message_list)
+{
+ ETreePath node, last;
+
+ if (!message_list->cursor_uid)
+ return;
+
+ /* get the thread parent node */
+ last = node = g_hash_table_lookup (message_list->uid_nodemap, message_list->cursor_uid);
+ while (!e_tree_model_node_is_root (message_list->model, node)) {
+ last = node;
+ node = e_tree_model_node_get_parent (message_list->model, node);
+ }
+
+ /* get the next toplevel node */
+ node = e_tree_model_node_get_next (message_list->model, last);
+
+ if (node) {
+ CamelMessageInfo *info;
+
+ info = get_message_info (message_list, node);
+ e_tree_set_cursor (message_list->tree, node);
+
+ g_free (message_list->cursor_uid);
+ message_list->cursor_uid = g_strdup (camel_message_info_uid (info));
+
+ gtk_signal_emit (GTK_OBJECT (message_list), message_list_signals[MESSAGE_SELECTED],
+ camel_message_info_uid (info));
+ }
+}
+
+
/*
* SimpleTableModel::col_count
*/
diff --git a/mail/message-list.h b/mail/message-list.h
index d6965b5c71..bf5eb92308 100644
--- a/mail/message-list.h
+++ b/mail/message-list.h
@@ -125,6 +125,8 @@ gboolean message_list_select (MessageList *message_list,
void message_list_select_uid (MessageList *message_list,
const char *uid);
+void message_list_select_next_thread (MessageList *messageList);
+
/* info */
unsigned int message_list_length(MessageList *ml);
unsigned int message_list_hidden(MessageList *ml);