aboutsummaryrefslogtreecommitdiffstats
path: root/mail/message-list.c
diff options
context:
space:
mode:
authorJason Leach <jleach@ximian.com>2001-08-05 02:33:50 +0800
committerJacob Leach <jleach@src.gnome.org>2001-08-05 02:33:50 +0800
commited0295fd125834f672109cf6f968b21b224069ad (patch)
treef6b97d01f34cfe0a83e4c5408f412f223fa30ee8 /mail/message-list.c
parente444178d117e6f6b9afc3ffb507acbf641edad1f (diff)
downloadgsoc2013-evolution-ed0295fd125834f672109cf6f968b21b224069ad.tar
gsoc2013-evolution-ed0295fd125834f672109cf6f968b21b224069ad.tar.gz
gsoc2013-evolution-ed0295fd125834f672109cf6f968b21b224069ad.tar.bz2
gsoc2013-evolution-ed0295fd125834f672109cf6f968b21b224069ad.tar.lz
gsoc2013-evolution-ed0295fd125834f672109cf6f968b21b224069ad.tar.xz
gsoc2013-evolution-ed0295fd125834f672109cf6f968b21b224069ad.tar.zst
gsoc2013-evolution-ed0295fd125834f672109cf6f968b21b224069ad.zip
Add a @wraparound argument, so the 'n' and 'p' keypresses (or anything
2001-08-04 Jason Leach <jleach@ximian.com> * 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
Diffstat (limited to 'mail/message-list.c')
-rw-r--r--mail/message-list.c20
1 files changed, 17 insertions, 3 deletions
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);
+ }
}