]> mj.ucw.cz Git - checkmail.git/commitdiff
0.3
authorMartin Mares <mj@ucw.cz>
Wed, 25 May 2005 16:47:08 +0000 (16:47 +0000)
committerMartin Mares <mj@ucw.cz>
Wed, 25 May 2005 16:47:08 +0000 (16:47 +0000)
ChangeLog
Makefile
README
cm.c

index 11a22ae94da6458eb2db1d6a74b8987835a318d3..c577a418e0ce844eac508401d953d1c8e9fb0f37 100644 (file)
--- 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  <mj@ucw.cz>
 
        * Replaced the `-h' switch by a general interface for setting options.
index 8a671c32d697e1ae80f85676a02157a35c4ddf81..2d3c5b1fb8aad1112218bc5c74c23c56955bea1f 100644 (file)
--- 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 86acc1fa306d929f0a66571a4fa6582adc1ac1a3..a4d49e7d11dde96dbedbb447f79e2cedd2ff459f 100644 (file)
--- 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 7494d0c4d29e17f867e1256c1b3341c693753ae7..53635efec1e1065e747275c0bec44d56771bbbf4 100644 (file)
--- 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')
                {