Changes specific to mutt-ng:
+2005-02-27
+ * integrated patch to highlight the next mailbox which includes new mail in
+ sidebar
+
2005-02-24:
* Integrated another sidebar fix and a build fix from Rocco Rutte.
* Implemented feature request that the number of flagged messages is shown in the sidebar
OP_SIDEBAR_SCROLL_UP "scroll the mailbox pane up 1 page"
OP_SIDEBAR_SCROLL_DOWN "scroll the mailbox pane down 1 page"
OP_SIDEBAR_NEXT "go down to next mailbox"
+OP_SIDEBAR_NEXT_NEW "go down to next mailbox with new mail"
OP_SIDEBAR_PREV "go to previous mailbox"
+OP_SIDEBAR_PREV_NEW "go to previous mailbox with new mail"
OP_SIDEBAR_OPEN "open hilighted mailbox"
case OP_SIDEBAR_SCROLL_DOWN:
case OP_SIDEBAR_NEXT:
case OP_SIDEBAR_PREV:
+ case OP_SIDEBAR_NEXT_NEW:
+ case OP_SIDEBAR_PREV_NEW:
scroll_sidebar(op, menu->menu);
break;
default:
sidebar-scroll-up Scrolls the mailbox list up 1 page
sidebar-scroll-down Scrolls the mailbox list down 1 page
sidebar-next Hilights the next mailbox
+sidebar-next-new Hilights the next mailbox with new mail
sidebar-previous Hilights the previous mailbox
sidebar-open Opens the currently hilighted mailbox
</tscreen></verb>
{ "sidebar-scroll-down", OP_SIDEBAR_SCROLL_DOWN, NULL },
{ "sidebar-next", OP_SIDEBAR_NEXT, NULL },
{ "sidebar-prev", OP_SIDEBAR_PREV, NULL },
+ { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW, NULL},
+ { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW, NULL},
{ "sidebar-open", OP_SIDEBAR_OPEN, NULL },
{ NULL, 0, NULL }
};
{ "sidebar-scroll-down", OP_SIDEBAR_SCROLL_DOWN, NULL },
{ "sidebar-next", OP_SIDEBAR_NEXT, NULL },
{ "sidebar-prev", OP_SIDEBAR_PREV, NULL },
+ { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW, NULL},
+ { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW, NULL},
{ "sidebar-open", OP_SIDEBAR_OPEN, NULL },
{ NULL, 0, NULL }
};
case OP_SIDEBAR_SCROLL_UP:
case OP_SIDEBAR_SCROLL_DOWN:
case OP_SIDEBAR_NEXT:
+ case OP_SIDEBAR_NEXT_NEW:
case OP_SIDEBAR_PREV:
+ case OP_SIDEBAR_PREV_NEW:
scroll_sidebar(ch, MENU_PAGER);
break;
default:
return 0;
}
+BUFFY * exist_next_new()
+{
+ BUFFY *tmp = CurBuffy;
+ if(tmp == NULL) return NULL;
+ while (tmp->next != NULL)
+ {
+ tmp = tmp->next;
+ if(tmp->msg_unread) return tmp;
+ }
+ return NULL;
+}
+
+BUFFY * exist_prev_new()
+{
+ BUFFY *tmp = CurBuffy;
+ if(tmp == NULL) return NULL;
+ while (tmp->prev != NULL)
+ {
+ tmp = tmp->prev;
+ if(tmp->msg_unread) return tmp;
+ }
+ return NULL;
+}
+
+
void scroll_sidebar(int op, int menu)
{
if(!SidebarWidth) return;
if(!CurBuffy) return;
+ BUFFY *tmp;
switch (op) {
case OP_SIDEBAR_NEXT:
if ( CurBuffy->next == NULL ) return;
CurBuffy = CurBuffy->next;
break;
+ case OP_SIDEBAR_NEXT_NEW:
+ if ( (tmp = exist_next_new()) == NULL)
+ {
+ if (CurBuffy->next == NULL) return;
+ CurBuffy = CurBuffy->next;
+ }
+ else CurBuffy = tmp;
+ break;
case OP_SIDEBAR_PREV:
- if ( CurBuffy == Incoming ) return;
+ if ( CurBuffy->prev == NULL ) return;
+ CurBuffy = CurBuffy->prev;
+ break;
+ case OP_SIDEBAR_PREV_NEW:
+ if ( (tmp = exist_prev_new()) == NULL)
{
- BUFFY *tmp = Incoming;
- while ( tmp->next && strcmp(tmp->next->path, CurBuffy->path) ) tmp = tmp->next;
- CurBuffy = tmp;
+ if(CurBuffy->prev == NULL) return;
+ CurBuffy = CurBuffy->prev;
}
+ else CurBuffy = tmp;
break;
+
case OP_SIDEBAR_SCROLL_UP:
CurBuffy = TopBuffy;
if ( CurBuffy != Incoming ) {