aboutsummaryrefslogtreecommitdiffstats
path: root/mail
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
parente444178d117e6f6b9afc3ffb507acbf641edad1f (diff)
downloadgsoc2013-evolution-ed0295fd125834f672109cf6f968b21b224069ad.tar.gz
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')
-rw-r--r--mail/ChangeLog11
-rw-r--r--mail/folder-browser.c4
-rw-r--r--mail/message-list.c20
-rw-r--r--mail/message-list.h4
4 files changed, 33 insertions, 6 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 8ec376f443..1fd39504a2 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,14 @@
+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).
+
2001-08-03 Jason Leach <jleach@ximian.com>
* mail-folder-cache.c (update_idle): Updates for EvolutionStorage
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index ff398c4f87..05acbb3268 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -1536,14 +1536,14 @@ on_key_press (GtkWidget *widget, GdkEventKey *key, gpointer data)
case 'N':
message_list_select (fb->message_list, row,
MESSAGE_LIST_SELECT_NEXT,
- 0, CAMEL_MESSAGE_SEEN);
+ 0, CAMEL_MESSAGE_SEEN, TRUE);
return TRUE;
case 'p':
case 'P':
message_list_select (fb->message_list, row,
MESSAGE_LIST_SELECT_PREVIOUS,
- 0, CAMEL_MESSAGE_SEEN);
+ 0, CAMEL_MESSAGE_SEEN, TRUE);
return TRUE;
case GDK_Menu:
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);
+ }
}
diff --git a/mail/message-list.h b/mail/message-list.h
index 6482a09210..26a6512d0d 100644
--- a/mail/message-list.h
+++ b/mail/message-list.h
@@ -113,7 +113,9 @@ void message_list_foreach (MessageList *message_list,
void message_list_select (MessageList *message_list,
int base_row,
MessageListSelectDirection direction,
- guint32 flags, guint32 mask);
+ guint32 flags,
+ guint32 mask,
+ gboolean wraparound);
void message_list_select_uid (MessageList *message_list,
const char *uid);