From: Martin Mares Date: Wed, 25 May 2005 16:47:08 +0000 (+0000) Subject: 0.3 X-Git-Tag: v1.4~39 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=3e1dd85d6091f1ee683a9feba91525d502deaeb5;p=checkmail.git 0.3 --- diff --git a/ChangeLog b/ChangeLog index 11a22ae..c577a41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,12 @@ * cm.c (add_snippet): Don't forget to terminate the string. Gets rid of occassional garbage at the end of mail snippets. + * Ctrl-L now refreshes the screen. + + * `B' disables (and `b' enables) all beeping. + + * Released as 0.3. + 2005-05-23 Martin Mares * Replaced the `-h' switch by a general interface for setting options. diff --git a/Makefile b/Makefile index 8a671c3..2d3c5b1 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ CFLAGS=-O2 -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -Winline $(DEBUG) -std=gnu99 -DVERSION=$(VERSION) -DYEAR=$(YEAR) LDFLAGS=-lncurses -VERSION=0.2 +VERSION=0.3 YEAR=2005 all: cm diff --git a/README b/README index 86acc1f..a4d49e7 100644 --- a/README +++ b/README @@ -26,8 +26,10 @@ Keys: ` TAB in reverse direction Ctrl-R forces full reload of the list (otherwise, it gets updated incrementally) + Ctrl-L redraw screen 0...9 sets minimum priority of mailboxes to show (0=show all) + b, B enable/disable beeping Examples: diff --git a/cm.c b/cm.c index 7494d0c..53635ef 100644 --- a/cm.c +++ b/cm.c @@ -23,6 +23,7 @@ static int check_interval = 30; static int force_refresh; +static int allow_bells = 1; static int minimum_priority; static time_t last_scan_time; static char *run_cmd = "mutt -f %s"; @@ -624,7 +625,7 @@ rethink_display(void) redraw_all(); refresh(); } - if (beeeep) + if (beeeep && allow_bells) beep(); } @@ -678,17 +679,23 @@ term_cleanup(void) } static void -scan_and_redraw(void) +print_status(char *status) { move(LINES-1, 0); - printw("Busy..."); - refresh(); - scan(); - move(LINES-1, 0); + if (status) + printw("%s", status); clrtoeol(); refresh(); } +static void +scan_and_redraw(void) +{ + print_status("Busy..."); + scan(); + print_status(NULL); +} + static void move_cursor(int i) { @@ -904,9 +911,22 @@ main(int argc, char **argv) scan_and_redraw(); } break; + case 'l' & 0x1f: + clearok(stdscr, TRUE); + redraw_all(); + refresh(); + break; case 'r' & 0x1f: force_refresh = 1; break; + case 'b': + allow_bells = 1; + print_status("Bells and whistles are now enabled. Toot!"); + break; + case 'B': + allow_bells = 0; + print_status("Bells and whistles are now disabled. Pssst!"); + break; default: if (ch >= '0' && ch <= '9') {