From ed0295fd125834f672109cf6f968b21b224069ad Mon Sep 17 00:00:00 2001 From: Jason Leach Date: Sat, 4 Aug 2001 18:33:50 +0000 Subject: Add a @wraparound argument, so the 'n' and 'p' keypresses (or anything 2001-08-04 Jason Leach * message-list.c (message_list_select): Add a @wraparound argument, so the 'n' and 'p' keypresses (or anything else that wants to) can wrap around to find the next unread. * folder-browser.c (on_key_press): Tell it to wrap around here. * mail-callbacks.c (delete_msg): Don't wrap around here (or the other callbacks in this file). svn path=/trunk/; revision=11651 --- mail/message-list.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'mail/message-list.c') diff --git a/mail/message-list.c b/mail/message-list.c index e1abf688d7..8c9accb3aa 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -365,9 +365,12 @@ get_message_info (MessageList *message_list, ETreePath node) * unchanged. **/ void -message_list_select (MessageList *message_list, int base_row, +message_list_select (MessageList *message_list, + int base_row, MessageListSelectDirection direction, - guint32 flags, guint32 mask) + guint32 flags, + guint32 mask, + gboolean wraparound) { CamelMessageInfo *info; int vrow, last; @@ -405,8 +408,10 @@ message_list_select (MessageList *message_list, int base_row, /* We don't know whether to use < or > due to "direction" */ while (vrow != last) { - ETreePath node = e_tree_node_at_row(et, vrow); + ETreePath node = e_tree_node_at_row (et, vrow); + info = get_message_info (message_list, node); + if (info && (info->flags & mask) == flags) { e_tree_set_cursor (et, node); @@ -416,6 +421,15 @@ message_list_select (MessageList *message_list, int base_row, } vrow += direction; } + + if (wraparound) { + if (direction > 0) + message_list_select (message_list, 0, + direction, flags, mask, FALSE); + else + message_list_select (message_list, e_tree_row_count (et) - 1, + direction, flags, mask, FALSE); + } } -- cgit v1.2.3