Ticket #33222: patch-1.5.21-6.2.debian.sidebar.diff
File patch-1.5.21-6.2.debian.sidebar.diff, 36.5 KB (added by kchr@…, 12 years ago) |
---|
-
Makefile.am
This is the sidebar patch. When enabled, mutt will show a list of mailboxes with (new) message counts in a separate column on the left side of the screen. As this feature is still considered to be unstable, this patch is only applied in the "mutt-patched" package. * Configuration variables: sidebar_delim (string, default "|") This specifies the delimiter between the sidebar (if visible) and other screens. sidebar_visible (boolean, default no) This specifies whether or not to show sidebar (left-side list of folders). sidebar_width (integer, default 0) - The width of the sidebar. * Patch source: - http://www.lunar-linux.org/index.php?page=mutt-sidebar - http://lunar-linux.org/~tchan/mutt/patch-1.5.19.sidebar.20090522.txt * Changes made: - 2008-08-02 myon: Refreshed patch using quilt push -f to remove hunks we do not need (Makefile.in).
a b 32 32 rfc822.c rfc1524.c rfc2047.c rfc2231.c rfc3676.c \ 33 33 score.c send.c sendlib.c signal.c sort.c \ 34 34 status.c system.c thread.c charset.c history.c lib.c \ 35 sidebar.c \ 35 36 muttlib.c editmsg.c mbyte.c \ 36 37 url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c 37 38 -
OPS
a b 180 180 OP_MAIN_SHOW_LIMIT "show currently active limit pattern" 181 181 OP_MAIN_COLLAPSE_THREAD "collapse/uncollapse current thread" 182 182 OP_MAIN_COLLAPSE_ALL "collapse/uncollapse all threads" 183 OP_SIDEBAR_SCROLL_UP "scroll the mailbox pane up 1 page" 184 OP_SIDEBAR_SCROLL_DOWN "scroll the mailbox pane down 1 page" 185 OP_SIDEBAR_NEXT "go down to next mailbox" 186 OP_SIDEBAR_PREV "go to previous mailbox" 187 OP_SIDEBAR_OPEN "open hilighted mailbox" -
buffy.c
a b 340 340 return rc; 341 341 } 342 342 343 /* update message counts for the sidebar */ 344 void buffy_maildir_update (BUFFY* mailbox) 345 { 346 char path[_POSIX_PATH_MAX]; 347 DIR *dirp; 348 struct dirent *de; 349 char *p; 350 351 mailbox->msgcount = 0; 352 mailbox->msg_unread = 0; 353 mailbox->msg_flagged = 0; 354 355 snprintf (path, sizeof (path), "%s/new", mailbox->path); 356 357 if ((dirp = opendir (path)) == NULL) 358 { 359 mailbox->magic = 0; 360 return; 361 } 362 363 while ((de = readdir (dirp)) != NULL) 364 { 365 if (*de->d_name == '.') 366 continue; 367 368 if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) { 369 mailbox->new = 1; 370 mailbox->msgcount++; 371 mailbox->msg_unread++; 372 } 373 } 374 375 closedir (dirp); 376 snprintf (path, sizeof (path), "%s/cur", mailbox->path); 377 378 if ((dirp = opendir (path)) == NULL) 379 { 380 mailbox->magic = 0; 381 return; 382 } 383 384 while ((de = readdir (dirp)) != NULL) 385 { 386 if (*de->d_name == '.') 387 continue; 388 389 if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) { 390 mailbox->msgcount++; 391 if ((p = strstr (de->d_name, ":2,"))) { 392 if (!strchr (p + 3, 'T')) { 393 if (!strchr (p + 3, 'S')) 394 mailbox->msg_unread++; 395 if (strchr(p + 3, 'F')) 396 mailbox->msg_flagged++; 397 } 398 } 399 } 400 } 401 402 closedir (dirp); 403 } 404 343 405 /* returns 1 if mailbox has new mail */ 344 406 static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb) 345 407 { … … 371 433 return rc; 372 434 } 373 435 436 /* update message counts for the sidebar */ 437 void buffy_mbox_update (BUFFY* mailbox) 438 { 439 CONTEXT *ctx = NULL; 440 441 ctx = mx_open_mailbox(mailbox->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL); 442 if(ctx) 443 { 444 mailbox->msgcount = ctx->msgcount; 445 mailbox->msg_unread = ctx->unread; 446 mx_close_mailbox(ctx, 0); 447 } 448 } 449 374 450 int mutt_buffy_check (int force) 375 451 { 376 452 BUFFY *tmp; … … 444 520 { 445 521 case M_MBOX: 446 522 case M_MMDF: 523 buffy_mbox_update (tmp); 447 524 if (buffy_mbox_hasnew (tmp, &sb) > 0) 448 525 BuffyCount++; 449 526 break; 450 527 451 528 case M_MAILDIR: 529 buffy_maildir_update (tmp); 452 530 if (buffy_maildir_hasnew (tmp) > 0) 453 531 BuffyCount++; 454 532 break; 455 533 456 534 case M_MH: 535 mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged); 457 536 if ((tmp->new = mh_buffy (tmp->path)) > 0) 458 537 BuffyCount++; 459 538 break; -
buffy.h
a b 25 25 char path[_POSIX_PATH_MAX]; 26 26 off_t size; 27 27 struct buffy_t *next; 28 struct buffy_t *prev; 28 29 short new; /* mailbox has new mail */ 30 int msgcount; /* total number of messages */ 31 int msg_unread; /* number of unread messages */ 32 int msg_flagged; /* number of flagged messages */ 29 33 short notified; /* user has been notified */ 30 34 short magic; /* mailbox type */ 31 35 short newly_created; /* mbox or mmdf just popped into existence */ -
color.c
a b 93 93 { "bold", MT_COLOR_BOLD }, 94 94 { "underline", MT_COLOR_UNDERLINE }, 95 95 { "index", MT_COLOR_INDEX }, 96 { "sidebar_new", MT_COLOR_NEW }, 97 { "sidebar_flagged", MT_COLOR_FLAGGED }, 96 98 { NULL, 0 } 97 99 }; 98 100 -
compose.c
a b 72 72 73 73 #define HDR_XOFFSET 10 74 74 #define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */ 75 #define W (COLS - HDR_XOFFSET )75 #define W (COLS - HDR_XOFFSET - SidebarWidth) 76 76 77 77 static char *Prompts[] = 78 78 { … … 112 112 { 113 113 int off = 0; 114 114 115 mvaddstr (HDR_CRYPT, 0, "Security: ");115 mvaddstr (HDR_CRYPT, SidebarWidth, "Security: "); 116 116 117 117 if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0) 118 118 { … … 144 144 } 145 145 146 146 clrtoeol (); 147 move (HDR_CRYPTINFO, 0);147 move (HDR_CRYPTINFO, SidebarWidth); 148 148 clrtoeol (); 149 149 150 150 if ((WithCrypto & APPLICATION_PGP) … … 161 161 && (msg->security & ENCRYPT) 162 162 && SmimeCryptAlg 163 163 && *SmimeCryptAlg) { 164 mvprintw (HDR_CRYPTINFO, 40, "%s%s", _("Encrypt with: "),164 mvprintw (HDR_CRYPTINFO, SidebarWidth + 40, "%s%s", _("Encrypt with: "), 165 165 NONULL(SmimeCryptAlg)); 166 166 off = 20; 167 167 } … … 175 175 int c; 176 176 char *t; 177 177 178 mvaddstr (HDR_MIX, 0, " Mix: ");178 mvaddstr (HDR_MIX, SidebarWidth, " Mix: "); 179 179 180 180 if (!chain) 181 181 { … … 190 190 if (t && t[0] == '0' && t[1] == '\0') 191 191 t = "<random>"; 192 192 193 if (c + mutt_strlen (t) + 2 >= COLS )193 if (c + mutt_strlen (t) + 2 >= COLS - SidebarWidth) 194 194 break; 195 195 196 196 addstr (NONULL(t)); … … 242 242 243 243 buf[0] = 0; 244 244 rfc822_write_address (buf, sizeof (buf), addr, 1); 245 mvprintw (line, 0, TITLE_FMT, Prompts[line - 1]);245 mvprintw (line, SidebarWidth, TITLE_FMT, Prompts[line - 1]); 246 246 mutt_paddstr (W, buf); 247 247 } 248 248 … … 252 252 draw_envelope_addr (HDR_TO, msg->env->to); 253 253 draw_envelope_addr (HDR_CC, msg->env->cc); 254 254 draw_envelope_addr (HDR_BCC, msg->env->bcc); 255 mvprintw (HDR_SUBJECT, 0, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);255 mvprintw (HDR_SUBJECT, SidebarWidth, TITLE_FMT, Prompts[HDR_SUBJECT - 1]); 256 256 mutt_paddstr (W, NONULL (msg->env->subject)); 257 257 draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to); 258 mvprintw (HDR_FCC, 0, TITLE_FMT, Prompts[HDR_FCC - 1]);258 mvprintw (HDR_FCC, SidebarWidth, TITLE_FMT, Prompts[HDR_FCC - 1]); 259 259 mutt_paddstr (W, fcc); 260 260 261 261 if (WithCrypto) … … 266 266 #endif 267 267 268 268 SETCOLOR (MT_COLOR_STATUS); 269 mvaddstr (HDR_ATTACH - 1, 0, _("-- Attachments"));269 mvaddstr (HDR_ATTACH - 1, SidebarWidth, _("-- Attachments")); 270 270 BKGDSET (MT_COLOR_STATUS); 271 271 clrtoeol (); 272 272 … … 304 304 /* redraw the expanded list so the user can see the result */ 305 305 buf[0] = 0; 306 306 rfc822_write_address (buf, sizeof (buf), *addr, 1); 307 move (line, HDR_XOFFSET );307 move (line, HDR_XOFFSET+SidebarWidth); 308 308 mutt_paddstr (W, buf); 309 309 310 310 return 0; … … 549 549 if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0) 550 550 { 551 551 mutt_str_replace (&msg->env->subject, buf); 552 move (HDR_SUBJECT, HDR_XOFFSET );552 move (HDR_SUBJECT, HDR_XOFFSET + SidebarWidth); 553 553 clrtoeol (); 554 554 if (msg->env->subject) 555 555 mutt_paddstr (W, msg->env->subject); … … 566 566 { 567 567 strfcpy (fcc, buf, fcclen); 568 568 mutt_pretty_mailbox (fcc, fcclen); 569 move (HDR_FCC, HDR_XOFFSET );569 move (HDR_FCC, HDR_XOFFSET + SidebarWidth); 570 570 mutt_paddstr (W, fcc); 571 571 fccSet = 1; 572 572 } -
curs_main.c
a b 26 26 #include "mailbox.h" 27 27 #include "mapping.h" 28 28 #include "sort.h" 29 #include "buffy.h" 29 30 #include "mx.h" 31 #include "sidebar.h" 30 32 31 33 #ifdef USE_POP 32 34 #include "pop.h" … … 532 534 menu->redraw |= REDRAW_STATUS; 533 535 if (do_buffy_notify) 534 536 { 535 if (mutt_buffy_notify () && option (OPTBEEPNEW)) 536 beep (); 537 if (mutt_buffy_notify ()) 538 { 539 menu->redraw |= REDRAW_FULL; 540 if (option (OPTBEEPNEW)) 541 beep (); 542 } 537 543 } 538 544 else 539 545 do_buffy_notify = 1; … … 545 551 if (menu->redraw & REDRAW_FULL) 546 552 { 547 553 menu_redraw_full (menu); 554 draw_sidebar(menu->menu); 548 555 mutt_show_error (); 549 556 } 550 557 … … 567 574 568 575 if (menu->redraw & REDRAW_STATUS) 569 576 { 577 DrawFullLine = 1; 570 578 menu_status_line (buf, sizeof (buf), menu, NONULL (Status)); 579 DrawFullLine = 0; 571 580 CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES-2); 572 581 SETCOLOR (MT_COLOR_STATUS); 573 582 BKGDSET (MT_COLOR_STATUS); 583 set_buffystats(Context); 574 584 mutt_paddstr (COLS, buf); 575 585 SETCOLOR (MT_COLOR_NORMAL); 576 586 BKGDSET (MT_COLOR_NORMAL); … … 591 601 menu->oldcurrent = -1; 592 602 593 603 if (option (OPTARROWCURSOR)) 594 move (menu->current - menu->top + menu->offset, 2);604 move (menu->current - menu->top + menu->offset, SidebarWidth + 2); 595 605 else if (option (OPTBRAILLEFRIENDLY)) 596 606 move (menu->current - menu->top + menu->offset, 0); 597 607 else … … 1089 1099 menu->redraw = REDRAW_FULL; 1090 1100 break; 1091 1101 1102 case OP_SIDEBAR_OPEN: 1092 1103 case OP_MAIN_CHANGE_FOLDER: 1093 1104 case OP_MAIN_NEXT_UNREAD_MAILBOX: 1094 1105 … … 1120 1131 { 1121 1132 mutt_buffy (buf, sizeof (buf)); 1122 1133 1123 if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1) 1134 if ( op == OP_SIDEBAR_OPEN ) { 1135 if(!CurBuffy) 1136 break; 1137 strncpy( buf, CurBuffy->path, sizeof(buf) ); 1138 } else if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1) 1124 1139 { 1125 1140 if (menu->menu == MENU_PAGER) 1126 1141 { … … 1138 1153 } 1139 1154 1140 1155 mutt_expand_path (buf, sizeof (buf)); 1156 set_curbuffy(buf); 1141 1157 if (mx_get_magic (buf) <= 0) 1142 1158 { 1143 1159 mutt_error (_("%s is not a mailbox."), buf); … … 2241 2257 mutt_what_key(); 2242 2258 break; 2243 2259 2260 case OP_SIDEBAR_SCROLL_UP: 2261 case OP_SIDEBAR_SCROLL_DOWN: 2262 case OP_SIDEBAR_NEXT: 2263 case OP_SIDEBAR_PREV: 2264 scroll_sidebar(op, menu->menu); 2265 break; 2244 2266 default: 2245 2267 if (menu->menu == MENU_MAIN) 2246 2268 km_error_key (MENU_MAIN); -
flags.c
a b 22 22 23 23 #include "mutt.h" 24 24 #include "mutt_curses.h" 25 #include "mutt_menu.h" 25 26 #include "sort.h" 26 27 #include "mx.h" 28 #include "sidebar.h" 27 29 28 30 void _mutt_set_flag (CONTEXT *ctx, HEADER *h, int flag, int bf, int upd_ctx) 29 31 { … … 290 292 */ 291 293 if (h->searched && (changed != h->changed || deleted != ctx->deleted || tagged != ctx->tagged || flagged != ctx->flagged)) 292 294 h->searched = 0; 295 draw_sidebar(0); 293 296 } 294 297 295 298 void mutt_tag_set_flag (int flag, int bf) -
functions.h
a b 170 170 { "decrypt-save", OP_DECRYPT_SAVE, NULL }, 171 171 172 172 173 { "sidebar-scroll-up", OP_SIDEBAR_SCROLL_UP, NULL }, 174 { "sidebar-scroll-down", OP_SIDEBAR_SCROLL_DOWN, NULL }, 175 { "sidebar-next", OP_SIDEBAR_NEXT, NULL }, 176 { "sidebar-prev", OP_SIDEBAR_PREV, NULL }, 177 { "sidebar-open", OP_SIDEBAR_OPEN, NULL }, 173 178 { NULL, 0, NULL } 174 179 }; 175 180 … … 274 279 275 280 { "what-key", OP_WHAT_KEY, NULL }, 276 281 282 { "sidebar-scroll-up", OP_SIDEBAR_SCROLL_UP, NULL }, 283 { "sidebar-scroll-down", OP_SIDEBAR_SCROLL_DOWN, NULL }, 284 { "sidebar-next", OP_SIDEBAR_NEXT, NULL }, 285 { "sidebar-prev", OP_SIDEBAR_PREV, NULL }, 286 { "sidebar-open", OP_SIDEBAR_OPEN, NULL }, 277 287 { NULL, 0, NULL } 278 288 }; 279 289 -
globals.h
a b 117 117 WHERE char *SendCharset; 118 118 WHERE char *Sendmail; 119 119 WHERE char *Shell; 120 WHERE char *SidebarDelim; 120 121 WHERE char *Signature; 121 122 WHERE char *SimpleSearch; 122 123 #if USE_SMTP … … 210 211 WHERE short ScoreThresholdRead; 211 212 WHERE short ScoreThresholdFlag; 212 213 214 WHERE struct buffy_t *CurBuffy INITVAL(0); 215 WHERE short DrawFullLine INITVAL(0); 216 WHERE short SidebarWidth; 213 217 #ifdef USE_IMAP 214 218 WHERE short ImapKeepalive; 215 219 WHERE short ImapPipelineDepth; -
imap/command.c
a b 1011 1011 opened */ 1012 1012 status->uidnext = oldun; 1013 1013 1014 /* Added to make the sidebar show the correct numbers */ 1015 if (status->messages) 1016 { 1017 inc->msgcount = status->messages; 1018 inc->msg_unread = status->unseen; 1019 } 1020 1014 1021 FREE (&value); 1015 1022 return; 1016 1023 } -
imap/imap.c
a b 1527 1527 1528 1528 imap_munge_mbox_name (munged, sizeof (munged), name); 1529 1529 snprintf (command, sizeof (command), 1530 "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT )", munged);1530 "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT MESSAGES)", munged); 1531 1531 1532 1532 if (imap_exec (idata, command, IMAP_CMD_QUEUE) < 0) 1533 1533 { -
init.h
a b 1965 1965 ** not used. 1966 1966 ** (PGP only) 1967 1967 */ 1968 {"sidebar_delim", DT_STR, R_BOTH, UL &SidebarDelim, "|"}, 1969 /* 1970 ** .pp 1971 ** This specifies the delimiter between the sidebar (if visible) and 1972 ** other screens. 1973 */ 1974 { "sidebar_visible", DT_BOOL, R_BOTH, OPTSIDEBAR, 0 }, 1975 /* 1976 ** .pp 1977 ** This specifies whether or not to show sidebar (left-side list of folders). 1978 */ 1979 { "sidebar_width", DT_NUM, R_BOTH, UL &SidebarWidth, 0 }, 1980 /* 1981 ** .pp 1982 ** The width of the sidebar. 1983 */ 1968 1984 { "pgp_use_gpg_agent", DT_BOOL, R_NONE, OPTUSEGPGAGENT, 0}, 1969 1985 /* 1970 1986 ** .pp -
mailbox.h
a b 27 27 #define M_NEWFOLDER (1<<4) /* create a new folder - same as M_APPEND, but uses 28 28 * safe_fopen() for mbox-style folders. 29 29 */ 30 #define M_PEEK (1<<5) /* revert atime back after taking a look (if applicable) */ 30 31 31 32 /* mx_open_new_message() */ 32 33 #define M_ADD_FROM 1 /* add a From_ line */ -
mbox.c
a b 104 104 mutt_perror (ctx->path); 105 105 return (-1); 106 106 } 107 ctx->atime = sb.st_atime; 107 108 ctx->mtime = sb.st_mtime; 108 109 ctx->size = sb.st_size; 109 110 … … 255 256 256 257 ctx->size = sb.st_size; 257 258 ctx->mtime = sb.st_mtime; 259 ctx->atime = sb.st_atime; 258 260 259 261 #ifdef NFS_ATTRIBUTE_HACK 260 262 if (sb.st_mtime > sb.st_atime) -
menu.c
a b 24 24 #include "mutt_curses.h" 25 25 #include "mutt_menu.h" 26 26 #include "mbyte.h" 27 #include "sidebar.h" 27 28 28 29 #include <string.h> 29 30 #include <stdlib.h> … … 156 157 { 157 158 char *scratch = safe_strdup (s); 158 159 int shift = option (OPTARROWCURSOR) ? 3 : 0; 159 int cols = COLS - shift ;160 int cols = COLS - shift - SidebarWidth; 160 161 161 162 mutt_format_string (s, n, cols, cols, FMT_LEFT, ' ', scratch, mutt_strlen (scratch), 1); 162 163 s[n - 1] = 0; … … 207 208 char buf[LONG_STRING]; 208 209 int i; 209 210 211 draw_sidebar(1); 210 212 for (i = menu->top; i < menu->top + menu->pagelen; i++) 211 213 { 212 214 if (i < menu->max) … … 217 219 if (option (OPTARROWCURSOR)) 218 220 { 219 221 attrset (menu->color (i)); 220 CLEARLINE (i - menu->top + menu->offset);222 CLEARLINE_WIN (i - menu->top + menu->offset); 221 223 222 224 if (i == menu->current) 223 225 { … … 246 248 BKGDSET (MT_COLOR_INDICATOR); 247 249 } 248 250 249 CLEARLINE (i - menu->top + menu->offset);251 CLEARLINE_WIN (i - menu->top + menu->offset); 250 252 print_enriched_string (menu->color(i), (unsigned char *) buf, i != menu->current); 251 253 SETCOLOR (MT_COLOR_NORMAL); 252 254 BKGDSET (MT_COLOR_NORMAL); 253 255 } 254 256 } 255 257 else 256 CLEARLINE (i - menu->top + menu->offset);258 CLEARLINE_WIN (i - menu->top + menu->offset); 257 259 } 258 260 menu->redraw = 0; 259 261 } … … 268 270 return; 269 271 } 270 272 271 move (menu->oldcurrent + menu->offset - menu->top, 0);273 move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth); 272 274 SETCOLOR (MT_COLOR_NORMAL); 273 275 BKGDSET (MT_COLOR_NORMAL); 274 276 … … 283 285 clrtoeol (); 284 286 menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent); 285 287 menu_pad_string (buf, sizeof (buf)); 286 move (menu->oldcurrent + menu->offset - menu->top, 3);288 move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth + 3); 287 289 print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1); 288 290 SETCOLOR (MT_COLOR_NORMAL); 289 291 } 290 292 291 293 /* now draw it in the new location */ 292 move (menu->current + menu->offset - menu->top, 0);294 move (menu->current + menu->offset - menu->top, SidebarWidth); 293 295 attrset (menu->color (menu->current)); 294 296 ADDCOLOR (MT_COLOR_INDICATOR); 295 297 addstr ("->"); … … 310 312 attrset (menu->color (menu->current)); 311 313 ADDCOLOR (MT_COLOR_INDICATOR); 312 314 BKGDSET (MT_COLOR_INDICATOR); 313 CLEARLINE (menu->current - menu->top + menu->offset);315 CLEARLINE_WIN (menu->current - menu->top + menu->offset); 314 316 print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0); 315 317 SETCOLOR (MT_COLOR_NORMAL); 316 318 BKGDSET (MT_COLOR_NORMAL); … … 322 324 { 323 325 char buf[LONG_STRING]; 324 326 325 move (menu->current + menu->offset - menu->top, 0);327 move (menu->current + menu->offset - menu->top, SidebarWidth); 326 328 menu_make_entry (buf, sizeof (buf), menu, menu->current); 327 329 menu_pad_string (buf, sizeof (buf)); 328 330 … … 884 886 885 887 886 888 if (option (OPTARROWCURSOR)) 887 move (menu->current - menu->top + menu->offset, 2);889 move (menu->current - menu->top + menu->offset, SidebarWidth + 2); 888 890 else if (option (OPTBRAILLEFRIENDLY)) 889 891 move (menu->current - menu->top + menu->offset, 0); 890 892 else -
mh.c
a b 235 235 236 236 if (mh_read_sequences (&mhs, path) < 0) 237 237 return 0; 238 238 239 for (i = 0; !r && i <= mhs.max; i++) 239 if (mhs_check (&mhs, i) & MH_SEQ_UNSEEN) 240 if (mhs_check (&mhs, i) & MH_SEQ_UNSEEN) { 240 241 r = 1; 242 } 241 243 mhs_free_sequences (&mhs); 242 244 return r; 243 245 } 244 246 247 void mh_buffy_update (const char *path, int *msgcount, int *msg_unread, int *msg_flagged) 248 { 249 int i; 250 struct mh_sequences mhs; 251 memset (&mhs, 0, sizeof (mhs)); 252 253 if (mh_read_sequences (&mhs, path) < 0) 254 return; 255 256 msgcount = 0; 257 msg_unread = 0; 258 msg_flagged = 0; 259 for (i = 0; i <= mhs.max; i++) 260 msgcount++; 261 if (mhs_check (&mhs, i) & MH_SEQ_UNSEEN) { 262 msg_unread++; 263 } 264 if (mhs_check (&mhs, i) & MH_SEQ_FLAGGED) 265 msg_flagged++; 266 mhs_free_sequences (&mhs); 267 } 268 245 269 static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt) 246 270 { 247 271 int fd; -
mutt.h
a b 431 431 OPTSAVEEMPTY, 432 432 OPTSAVENAME, 433 433 OPTSCORE, 434 OPTSIDEBAR, 434 435 OPTSIGDASHES, 435 436 OPTSIGONTOP, 436 437 OPTSORTRE, … … 874 875 { 875 876 char *path; 876 877 FILE *fp; 878 time_t atime; 877 879 time_t mtime; 878 880 off_t size; 879 881 off_t vsize; … … 914 916 unsigned int quiet : 1; /* inhibit status messages? */ 915 917 unsigned int collapsed : 1; /* are all threads collapsed? */ 916 918 unsigned int closing : 1; /* mailbox is being closed */ 919 unsigned int peekonly : 1; /* just taking a glance, revert atime */ 917 920 918 921 /* driver hooks */ 919 922 void *data; /* driver specific data */ -
mutt_curses.h
a b 64 64 #undef lines 65 65 #endif /* lines */ 66 66 67 #define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol() 67 68 #define CLEARLINE(x) move(x,0), clrtoeol() 68 69 #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x) 69 70 #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0) … … 126 127 MT_COLOR_BOLD, 127 128 MT_COLOR_UNDERLINE, 128 129 MT_COLOR_INDEX, 130 MT_COLOR_NEW, 131 MT_COLOR_FLAGGED, 129 132 MT_COLOR_MAX 130 133 }; 131 134 -
muttlib.c
a b 1286 1286 pl = pw = 1; 1287 1287 1288 1288 /* see if there's room to add content, else ignore */ 1289 if ( DrawFullLine ) 1290 { 1289 1291 if ((col < COLS && wlen < destlen) || soft) 1290 1292 { 1291 1293 int pad; … … 1329 1331 col += wid; 1330 1332 src += pl; 1331 1333 } 1334 } 1335 else 1336 { 1337 if ((col < COLS-SidebarWidth && wlen < destlen) || soft) 1338 { 1339 int pad; 1340 1341 /* get contents after padding */ 1342 mutt_FormatString (buf, sizeof (buf), 0, src + pl, callback, data, flags); 1343 len = mutt_strlen (buf); 1344 wid = mutt_strwidth (buf); 1345 1346 /* try to consume as many columns as we can, if we don't have 1347 * memory for that, use as much memory as possible */ 1348 pad = (COLS - SidebarWidth - col - wid) / pw; 1349 if (pad > 0 && wlen + (pad * pl) + len > destlen) 1350 pad = ((signed)(destlen - wlen - len)) / pl; 1351 if (pad > 0) 1352 { 1353 while (pad--) 1354 { 1355 memcpy (wptr, src, pl); 1356 wptr += pl; 1357 wlen += pl; 1358 col += pw; 1359 } 1360 } 1361 else if (soft && pad < 0) 1362 { 1363 /* \0-terminate dest for length computation in mutt_wstr_trunc() */ 1364 *wptr = 0; 1365 /* make sure right part is at most as wide as display */ 1366 len = mutt_wstr_trunc (buf, destlen, COLS, &wid); 1367 /* truncate left so that right part fits completely in */ 1368 wlen = mutt_wstr_trunc (dest, destlen - len, col + pad, &col); 1369 wptr = dest + wlen; 1370 } 1371 if (len + wlen > destlen) 1372 len = mutt_wstr_trunc (buf, destlen - wlen, COLS - SidebarWidth - col, NULL); 1373 memcpy (wptr, buf, len); 1374 wptr += len; 1375 wlen += len; 1376 col += wid; 1377 src += pl; 1378 } 1379 } 1332 1380 break; /* skip rest of input */ 1333 1381 } 1334 1382 else if (ch == '|') -
mx.c
a b 595 595 * M_APPEND open mailbox for appending 596 596 * M_READONLY open mailbox in read-only mode 597 597 * M_QUIET only print error messages 598 * M_PEEK revert atime where applicable 598 599 * ctx if non-null, context struct to use 599 600 */ 600 601 CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT *pctx) … … 617 618 ctx->quiet = 1; 618 619 if (flags & M_READONLY) 619 620 ctx->readonly = 1; 621 if (flags & M_PEEK) 622 ctx->peekonly = 1; 620 623 621 624 if (flags & (M_APPEND|M_NEWFOLDER)) 622 625 { … … 721 724 void mx_fastclose_mailbox (CONTEXT *ctx) 722 725 { 723 726 int i; 727 #ifndef BUFFY_SIZE 728 struct utimbuf ut; 729 #endif 724 730 725 731 if(!ctx) 726 732 return; 733 #ifndef BUFFY_SIZE 734 /* fix up the times so buffy won't get confused */ 735 if (ctx->peekonly && ctx->path && ctx->mtime > ctx->atime) 736 { 737 ut.actime = ctx->atime; 738 ut.modtime = ctx->mtime; 739 utime (ctx->path, &ut); 740 } 741 #endif 727 742 728 743 /* never announce that a mailbox we've just left has new mail. #3290 729 744 * XXX: really belongs in mx_close_mailbox, but this is a nice hook point */ -
mx.h
a b 61 61 int mh_sync_mailbox (CONTEXT *, int *); 62 62 int mh_check_mailbox (CONTEXT *, int *); 63 63 int mh_buffy (const char *); 64 void mh_buffy_update (const char *, int *, int *, int *); 64 65 int mh_check_empty (const char *); 65 66 66 67 int maildir_read_dir (CONTEXT *); -
pager.c
a b 29 29 #include "pager.h" 30 30 #include "attach.h" 31 31 #include "mbyte.h" 32 #include "sidebar.h" 32 33 33 34 #include "mutt_crypt.h" 34 35 … … 1095 1096 wchar_t wc; 1096 1097 mbstate_t mbstate; 1097 1098 int wrap_cols = mutt_term_width ((flags & M_PAGER_NOWRAP) ? 0 : Wrap); 1099 wrap_cols -= SidebarWidth; 1098 1100 1099 1101 if (check_attachment_marker ((char *)buf) == 0) 1100 1102 wrap_cols = COLS; … … 1745 1747 if ((redraw & REDRAW_BODY) || topline != oldtopline) 1746 1748 { 1747 1749 do { 1748 move (bodyoffset, 0);1750 move (bodyoffset, SidebarWidth); 1749 1751 curline = oldtopline = topline; 1750 1752 lines = 0; 1751 1753 force_redraw = 0; … … 1758 1760 &QuoteList, &q_level, &force_redraw, &SearchRE) > 0) 1759 1761 lines++; 1760 1762 curline++; 1763 move(lines + bodyoffset, SidebarWidth); 1761 1764 } 1762 1765 last_offset = lineInfo[curline].offset; 1763 1766 } while (force_redraw); … … 1771 1774 addch ('~'); 1772 1775 addch ('\n'); 1773 1776 lines++; 1777 move(lines + bodyoffset, SidebarWidth); 1774 1778 } 1775 1779 /* We are going to update the pager status bar, so it isn't 1776 1780 * necessary to reset to normal color now. */ … … 1794 1798 /* print out the pager status bar */ 1795 1799 SETCOLOR (MT_COLOR_STATUS); 1796 1800 BKGDSET (MT_COLOR_STATUS); 1797 CLEARLINE (statusoffset);1801 CLEARLINE_WIN (statusoffset); 1798 1802 1799 1803 if (IsHeader (extra) || IsMsgAttach (extra)) 1800 1804 { 1801 size_t l1 = COLS* MB_LEN_MAX;1805 size_t l1 = (COLS-SidebarWidth) * MB_LEN_MAX; 1802 1806 size_t l2 = sizeof (buffer); 1803 1807 hfi.hdr = (IsHeader (extra)) ? extra->hdr : extra->bdy->hdr; 1804 1808 mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT); 1805 mutt_paddstr (COLS , buffer);1809 mutt_paddstr (COLS-SidebarWidth, buffer); 1806 1810 } 1807 1811 else 1808 1812 { 1809 1813 char bn[STRING]; 1810 1814 snprintf (bn, sizeof (bn), "%s (%s)", banner, pager_progress_str); 1811 mutt_paddstr (COLS , bn);1815 mutt_paddstr (COLS-SidebarWidth, bn); 1812 1816 } 1813 1817 BKGDSET (MT_COLOR_NORMAL); 1814 1818 SETCOLOR (MT_COLOR_NORMAL); … … 1826 1830 /* redraw the pager_index indicator, because the 1827 1831 * flags for this message might have changed. */ 1828 1832 menu_redraw_current (index); 1833 draw_sidebar(MENU_PAGER); 1829 1834 1830 1835 /* print out the index status bar */ 1831 1836 menu_status_line (buffer, sizeof (buffer), index, NONULL(Status)); 1832 1837 1833 move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), 0);1838 move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), SidebarWidth); 1834 1839 SETCOLOR (MT_COLOR_STATUS); 1835 1840 BKGDSET (MT_COLOR_STATUS); 1836 mutt_paddstr (COLS , buffer);1841 mutt_paddstr (COLS-SidebarWidth, buffer); 1837 1842 SETCOLOR (MT_COLOR_NORMAL); 1838 1843 BKGDSET (MT_COLOR_NORMAL); 1839 1844 } 1840 1845 1846 /* if we're not using the index, update every time */ 1847 if ( index == 0 ) 1848 draw_sidebar(MENU_PAGER); 1849 1841 1850 redraw = 0; 1842 1851 1843 1852 if (option(OPTBRAILLEFRIENDLY)) { … … 2769 2778 mutt_what_key (); 2770 2779 break; 2771 2780 2781 case OP_SIDEBAR_SCROLL_UP: 2782 case OP_SIDEBAR_SCROLL_DOWN: 2783 case OP_SIDEBAR_NEXT: 2784 case OP_SIDEBAR_PREV: 2785 scroll_sidebar(ch, MENU_PAGER); 2786 break; 2787 2772 2788 default: 2773 2789 ch = -1; 2774 2790 break; -
new file sidebar.c
- + 1 /* 2 * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu> 3 * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. 18 */ 19 20 21 #if HAVE_CONFIG_H 22 # include "config.h" 23 #endif 24 25 #include "mutt.h" 26 #include "mutt_menu.h" 27 #include "mutt_curses.h" 28 #include "sidebar.h" 29 #include "buffy.h" 30 #include <libgen.h> 31 #include "keymap.h" 32 #include <stdbool.h> 33 34 /*BUFFY *CurBuffy = 0;*/ 35 static BUFFY *TopBuffy = 0; 36 static BUFFY *BottomBuffy = 0; 37 static int known_lines = 0; 38 39 static int quick_log10(int n) 40 { 41 char string[32]; 42 sprintf(string, "%d", n); 43 return strlen(string); 44 } 45 46 void calc_boundaries (int menu) 47 { 48 BUFFY *tmp = Incoming; 49 50 if ( known_lines != LINES ) { 51 TopBuffy = BottomBuffy = 0; 52 known_lines = LINES; 53 } 54 for ( ; tmp->next != 0; tmp = tmp->next ) 55 tmp->next->prev = tmp; 56 57 if ( TopBuffy == 0 && BottomBuffy == 0 ) 58 TopBuffy = Incoming; 59 if ( BottomBuffy == 0 ) { 60 int count = LINES - 2 - (menu != MENU_PAGER || option(OPTSTATUSONTOP)); 61 BottomBuffy = TopBuffy; 62 while ( --count && BottomBuffy->next ) 63 BottomBuffy = BottomBuffy->next; 64 } 65 else if ( TopBuffy == CurBuffy->next ) { 66 int count = LINES - 2 - (menu != MENU_PAGER); 67 BottomBuffy = CurBuffy; 68 tmp = BottomBuffy; 69 while ( --count && tmp->prev) 70 tmp = tmp->prev; 71 TopBuffy = tmp; 72 } 73 else if ( BottomBuffy == CurBuffy->prev ) { 74 int count = LINES - 2 - (menu != MENU_PAGER); 75 TopBuffy = CurBuffy; 76 tmp = TopBuffy; 77 while ( --count && tmp->next ) 78 tmp = tmp->next; 79 BottomBuffy = tmp; 80 } 81 } 82 83 char *make_sidebar_entry(char *box, int size, int new, int flagged) 84 { 85 static char *entry = 0; 86 char *c; 87 int i = 0; 88 int delim_len = strlen(SidebarDelim); 89 90 c = realloc(entry, SidebarWidth - delim_len + 2); 91 if ( c ) entry = c; 92 entry[SidebarWidth - delim_len + 1] = 0; 93 for (; i < SidebarWidth - delim_len + 1; entry[i++] = ' ' ); 94 i = strlen(box); 95 strncpy( entry, box, i < (SidebarWidth - delim_len + 1) ? i : (SidebarWidth - delim_len + 1) ); 96 97 if (size == -1) 98 sprintf(entry + SidebarWidth - delim_len - 3, "?"); 99 else if ( new ) { 100 if (flagged > 0) { 101 sprintf( 102 entry + SidebarWidth - delim_len - 5 - quick_log10(size) - quick_log10(new) - quick_log10(flagged), 103 "% d(%d)[%d]", size, new, flagged); 104 } else { 105 sprintf( 106 entry + SidebarWidth - delim_len - 3 - quick_log10(size) - quick_log10(new), 107 "% d(%d)", size, new); 108 } 109 } else if (flagged > 0) { 110 sprintf( entry + SidebarWidth - delim_len - 3 - quick_log10(size) - quick_log10(flagged), "% d[%d]", size, flagged); 111 } else { 112 sprintf( entry + SidebarWidth - delim_len - 1 - quick_log10(size), "% d", size); 113 } 114 return entry; 115 } 116 117 void set_curbuffy(char buf[LONG_STRING]) 118 { 119 BUFFY* tmp = CurBuffy = Incoming; 120 121 if (!Incoming) 122 return; 123 124 while(1) { 125 if(!strcmp(tmp->path, buf)) { 126 CurBuffy = tmp; 127 break; 128 } 129 130 if(tmp->next) 131 tmp = tmp->next; 132 else 133 break; 134 } 135 } 136 137 int draw_sidebar(int menu) { 138 139 int lines = option(OPTHELP) ? 1 : 0; 140 lines += option(OPTSTATUSONTOP) ? 1 : 0; 141 142 BUFFY *tmp; 143 #ifndef USE_SLANG_CURSES 144 attr_t attrs; 145 #endif 146 short delim_len = strlen(SidebarDelim); 147 short color_pair; 148 149 static bool initialized = false; 150 static int prev_show_value; 151 static short saveSidebarWidth; 152 153 /* initialize first time */ 154 if(!initialized) { 155 prev_show_value = option(OPTSIDEBAR); 156 saveSidebarWidth = SidebarWidth; 157 if(!option(OPTSIDEBAR)) SidebarWidth = 0; 158 initialized = true; 159 } 160 161 /* save or restore the value SidebarWidth */ 162 if(prev_show_value != option(OPTSIDEBAR)) { 163 if(prev_show_value && !option(OPTSIDEBAR)) { 164 saveSidebarWidth = SidebarWidth; 165 SidebarWidth = 0; 166 } else if(!prev_show_value && option(OPTSIDEBAR)) { 167 SidebarWidth = saveSidebarWidth; 168 } 169 prev_show_value = option(OPTSIDEBAR); 170 } 171 172 173 // if ( SidebarWidth == 0 ) return 0; 174 if (SidebarWidth > 0 && option (OPTSIDEBAR) 175 && delim_len >= SidebarWidth) { 176 unset_option (OPTSIDEBAR); 177 /* saveSidebarWidth = SidebarWidth; */ 178 if (saveSidebarWidth > delim_len) { 179 SidebarWidth = saveSidebarWidth; 180 mutt_error (_("Value for sidebar_delim is too long. Disabling sidebar.")); 181 sleep (2); 182 } else { 183 SidebarWidth = 0; 184 mutt_error (_("Value for sidebar_delim is too long. Disabling sidebar. Please set your sidebar_width to a sane value.")); 185 sleep (4); /* the advise to set a sane value should be seen long enough */ 186 } 187 saveSidebarWidth = 0; 188 return (0); 189 } 190 191 if ( SidebarWidth == 0 || !option(OPTSIDEBAR)) { 192 if (SidebarWidth > 0) { 193 saveSidebarWidth = SidebarWidth; 194 SidebarWidth = 0; 195 } 196 unset_option(OPTSIDEBAR); 197 return 0; 198 } 199 200 /* get attributes for divider */ 201 SETCOLOR(MT_COLOR_STATUS); 202 #ifndef USE_SLANG_CURSES 203 attr_get(&attrs, &color_pair, 0); 204 #else 205 color_pair = attr_get(); 206 #endif 207 SETCOLOR(MT_COLOR_NORMAL); 208 209 /* draw the divider */ 210 211 for ( ; lines < LINES-1-(menu != MENU_PAGER || option(OPTSTATUSONTOP)); lines++ ) { 212 move(lines, SidebarWidth - delim_len); 213 addstr(NONULL(SidebarDelim)); 214 #ifndef USE_SLANG_CURSES 215 mvchgat(lines, SidebarWidth - delim_len, delim_len, 0, color_pair, NULL); 216 #endif 217 } 218 219 if ( Incoming == 0 ) return 0; 220 lines = option(OPTHELP) ? 1 : 0; /* go back to the top */ 221 lines += option(OPTSTATUSONTOP) ? 1 : 0; 222 223 if ( known_lines != LINES || TopBuffy == 0 || BottomBuffy == 0 ) 224 calc_boundaries(menu); 225 if ( CurBuffy == 0 ) CurBuffy = Incoming; 226 227 tmp = TopBuffy; 228 229 SETCOLOR(MT_COLOR_NORMAL); 230 231 for ( ; tmp && lines < LINES-1 - (menu != MENU_PAGER || option(OPTSTATUSONTOP)); tmp = tmp->next ) { 232 if ( tmp == CurBuffy ) 233 SETCOLOR(MT_COLOR_INDICATOR); 234 else if ( tmp->msg_unread > 0 ) 235 SETCOLOR(MT_COLOR_NEW); 236 else if ( tmp->msg_flagged > 0 ) 237 SETCOLOR(MT_COLOR_FLAGGED); 238 else 239 SETCOLOR(MT_COLOR_NORMAL); 240 241 move( lines, 0 ); 242 if ( Context && !strcmp( tmp->path, Context->path ) ) { 243 tmp->msg_unread = Context->unread; 244 tmp->msgcount = Context->msgcount; 245 tmp->msg_flagged = Context->flagged; 246 } 247 // check whether Maildir is a prefix of the current folder's path 248 short maildir_is_prefix = 0; 249 if ( (strlen(tmp->path) > strlen(Maildir)) && 250 (strncmp(Maildir, tmp->path, strlen(Maildir)) == 0) ) 251 maildir_is_prefix = 1; 252 // calculate depth of current folder and generate its display name with indented spaces 253 int sidebar_folder_depth = 0; 254 char *sidebar_folder_name; 255 sidebar_folder_name = basename(tmp->path); 256 if ( maildir_is_prefix ) { 257 char *tmp_folder_name; 258 int i; 259 tmp_folder_name = tmp->path + strlen(Maildir); 260 for (i = 0; i < strlen(tmp->path) - strlen(Maildir); i++) { 261 if (tmp_folder_name[i] == '/') sidebar_folder_depth++; 262 } 263 if (sidebar_folder_depth > 0) { 264 sidebar_folder_name = malloc(strlen(basename(tmp->path)) + sidebar_folder_depth + 1); 265 for (i=0; i < sidebar_folder_depth; i++) 266 sidebar_folder_name[i]=' '; 267 sidebar_folder_name[i]=0; 268 strncat(sidebar_folder_name, basename(tmp->path), strlen(basename(tmp->path)) + sidebar_folder_depth); 269 } 270 } 271 printw( "%.*s", SidebarWidth - delim_len + 1, 272 make_sidebar_entry(sidebar_folder_name, tmp->msgcount, 273 tmp->msg_unread, tmp->msg_flagged)); 274 if (sidebar_folder_depth > 0) 275 free(sidebar_folder_name); 276 lines++; 277 } 278 SETCOLOR(MT_COLOR_NORMAL); 279 for ( ; lines < LINES-1 - (menu != MENU_PAGER || option(OPTSTATUSONTOP)); lines++ ) { 280 int i = 0; 281 move( lines, 0 ); 282 for ( ; i < SidebarWidth - delim_len; i++ ) 283 addch(' '); 284 } 285 return 0; 286 } 287 288 289 void set_buffystats(CONTEXT* Context) 290 { 291 BUFFY *tmp = Incoming; 292 while(tmp) { 293 if(Context && !strcmp(tmp->path, Context->path)) { 294 tmp->msg_unread = Context->unread; 295 tmp->msgcount = Context->msgcount; 296 break; 297 } 298 tmp = tmp->next; 299 } 300 } 301 302 void scroll_sidebar(int op, int menu) 303 { 304 if(!SidebarWidth) return; 305 if(!CurBuffy) return; 306 307 switch (op) { 308 case OP_SIDEBAR_NEXT: 309 if ( CurBuffy->next == NULL ) return; 310 CurBuffy = CurBuffy->next; 311 break; 312 case OP_SIDEBAR_PREV: 313 if ( CurBuffy->prev == NULL ) return; 314 CurBuffy = CurBuffy->prev; 315 break; 316 case OP_SIDEBAR_SCROLL_UP: 317 CurBuffy = TopBuffy; 318 if ( CurBuffy != Incoming ) { 319 calc_boundaries(menu); 320 CurBuffy = CurBuffy->prev; 321 } 322 break; 323 case OP_SIDEBAR_SCROLL_DOWN: 324 CurBuffy = BottomBuffy; 325 if ( CurBuffy->next ) { 326 calc_boundaries(menu); 327 CurBuffy = CurBuffy->next; 328 } 329 break; 330 default: 331 return; 332 } 333 calc_boundaries(menu); 334 draw_sidebar(menu); 335 } 336 -
new file sidebar.h
- + 1 /* 2 * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu> 3 * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. 18 */ 19 20 #ifndef SIDEBAR_H 21 #define SIDEBAR_H 22 23 struct MBOX_LIST { 24 char *path; 25 int msgcount; 26 int new; 27 } MBLIST; 28 29 /* parameter is whether or not to go to the status line */ 30 /* used for omitting the last | that covers up the status bar in the index */ 31 int draw_sidebar(int); 32 void scroll_sidebar(int, int); 33 void set_curbuffy(char*); 34 void set_buffystats(CONTEXT*); 35 36 #endif /* SIDEBAR_H */