{
case M_MBOX:
case M_MMDF:
- if (sidebar_should_refresh()) {
+ if (sb_should_refresh()) {
buffy_mbox_update (tmp, &sb);
- sidebar_updated();
+ sb_set_update_time();
}
if (buffy_mbox_hasnew (tmp, &sb) > 0)
BuffyCount++;
break;
case M_MAILDIR:
- if (sidebar_should_refresh()) {
+ if (sb_should_refresh()) {
buffy_maildir_update (tmp);
- sidebar_updated();
+ sb_set_update_time();
}
if (buffy_maildir_hasnew (tmp) > 0)
BuffyCount++;
break;
case M_MH:
- if (sidebar_should_refresh()) {
+ if (sb_should_refresh()) {
mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged, &tmp->sb_last_checked);
- sidebar_updated();
+ sb_set_update_time();
}
mh_buffy(tmp);
if (tmp->new)
static void draw_envelope (HEADER *msg, char *fcc)
{
- draw_sidebar();
+ sb_draw();
draw_envelope_addr (HDR_FROM, msg->env->from);
draw_envelope_addr (HDR_TO, msg->env->to);
draw_envelope_addr (HDR_CC, msg->env->cc);
if (menu->redraw & REDRAW_FULL)
{
menu_redraw_full (menu);
- draw_sidebar();
+ sb_draw();
mutt_show_error ();
} else if (menu->redraw & REDRAW_SIDEBAR) {
- draw_sidebar();
+ sb_draw();
menu->redraw &= ~REDRAW_SIDEBAR;
}
SidebarWidth = sw; /* Restore the sidebar width */
move (option (OPTSTATUSONTOP) ? 0 : LINES-2, 0);
SETCOLOR (MT_COLOR_STATUS);
- set_buffystats (Context);
+ sb_set_buffystats (Context);
mutt_paddstr (COLS, buf);
NORMAL_COLOR;
menu->redraw &= ~REDRAW_STATUS;
}
mutt_expand_path (buf, sizeof (buf));
- set_curbuffy (buf);
+ sb_set_open_buffy (buf);
if (mx_get_magic (buf) <= 0)
{
mutt_error (_("%s is not a mailbox."), buf);
case OP_SIDEBAR_PREV:
case OP_SIDEBAR_NEXT_NEW:
case OP_SIDEBAR_PREV_NEW:
- scroll_sidebar (op);
+ sb_change_mailbox (op);
break;
default:
if (menu->menu == MENU_MAIN)
*/
if (h->searched && (changed != h->changed || deleted != ctx->deleted || tagged != ctx->tagged || flagged != ctx->flagged))
h->searched = 0;
- draw_sidebar();
+ sb_draw();
}
void mutt_tag_set_flag (int flag, int bf)
if((Context = mx_open_mailbox (folder, ((flags & M_RO) || option (OPTREADONLY)) ? M_READONLY : 0, NULL))
|| !explicit_folder)
{
- set_curbuffy (folder);
+ sb_set_open_buffy (folder);
mutt_index_menu ();
if (Context)
FREE (&Context);
int do_color;
int attr;
- draw_sidebar();
+ sb_draw();
for (i = menu->top; i < menu->top + menu->pagelen; i++)
{
if (i < menu->max)
for (i = 0; i < ctx->msgcount; i++)
mutt_free_header (&ctx->hdrs[i]);
ctx->msgcount -= ctx->deleted;
- set_buffystats (ctx);
+ sb_set_buffystats (ctx);
FREE (&ctx->hdrs);
FREE (&ctx->v2r);
FREE (&ctx->path);
/* redraw the pager_index indicator, because the
* flags for this message might have changed. */
menu_redraw_current (index);
- draw_sidebar();
+ sb_draw();
/* print out the index status bar */
menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
/* if we're not using the index, update every time */
if (index == 0)
- draw_sidebar();
+ sb_draw();
redraw = 0;
case OP_SIDEBAR_PREV_NEW:
case OP_SIDEBAR_SCROLL_DOWN:
case OP_SIDEBAR_SCROLL_UP:
- scroll_sidebar (ch);
+ sb_change_mailbox (ch);
break;
default:
}
static const char *
-sidebar_format_str (char *dest, size_t destlen, size_t col, char op, const char *src,
+cb_format_str (char *dest, size_t destlen, size_t col, char op, const char *src,
const char *prefix, const char *ifstring, const char *elsestring,
unsigned long data, format_flag flags)
{
}
if (optional)
- mutt_FormatString (dest, destlen, col, ifstring, sidebar_format_str, (unsigned long) sbe, flags);
+ mutt_FormatString (dest, destlen, col, ifstring, cb_format_str, (unsigned long) sbe, flags);
else if (flags & M_FORMAT_OPTIONAL)
- mutt_FormatString (dest, destlen, col, elsestring, sidebar_format_str, (unsigned long) sbe, flags);
+ mutt_FormatString (dest, destlen, col, elsestring, cb_format_str, (unsigned long) sbe, flags);
/* We return the format string, unchanged */
return src;
/* Temporarily lie about the screen width */
int oc = COLS;
COLS = width + SidebarWidth;
- mutt_FormatString (buf, buflen, 0, NONULL(SidebarFormat), sidebar_format_str, (unsigned long) &sbe, 0);
+ mutt_FormatString (buf, buflen, 0, NONULL(SidebarFormat), cb_format_str, (unsigned long) &sbe, 0);
COLS = oc;
/* Force string to be exactly the right width */
void
-draw_sidebar (void)
+sb_draw (void)
{
#ifndef USE_SLANG_CURSES
attr_t attrs;
}
int
-sidebar_should_refresh (void)
+sb_should_refresh (void)
{
if (option (OPTSIDEBAR) && (SidebarRefresh > 0)) {
if ((time (NULL) - SidebarLastRefresh) >= SidebarRefresh) {
}
void
-scroll_sidebar (int op)
+sb_change_mailbox (int op)
{
BUFFY *b;
if ((SidebarWidth == 0) || !CurBuffy)
return;
}
calc_boundaries();
- draw_sidebar();
+ sb_draw();
}
void
-set_buffystats (const CONTEXT *ctx)
+sb_set_buffystats (const CONTEXT *ctx)
{
/* Even if the sidebar's hidden,
* we should take note of the new data. */
}
void
-set_curbuffy (char *path)
+sb_set_open_buffy (char *path)
{
BUFFY *b = CurBuffy = Incoming;
}
void
-sidebar_updated (void)
+sb_set_update_time (void)
{
SidebarLastRefresh = time (NULL);
}
typedef struct _context CONTEXT;
-void draw_sidebar (void);
-void scroll_sidebar (int op);
-void set_buffystats (const CONTEXT *ctx);
-void set_curbuffy (char *path);
-int sidebar_should_refresh (void);
-void sidebar_updated (void);
+void sb_change_mailbox (int op);
+void sb_draw (void);
+void sb_set_buffystats (const CONTEXT *ctx);
+void sb_set_open_buffy (char *path);
+void sb_set_update_time (void);
+int sb_should_refresh (void);
#endif /* SIDEBAR_H */