diff options
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | osd.c | 16 | ||||
-rw-r--r-- | vdr.5 | 11 |
3 files changed, 22 insertions, 7 deletions
@@ -1145,3 +1145,5 @@ Video Disk Recorder Revision History performance under heavy system load. - New 'make' target 'install', which copies the manual pages and executables to their appropriate system locations. +- Automatic hotkey assignment is now suppressed if the first entry in + commands.conf starts with a digit in the range '1'...'9', followed by a blank. @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osd.c 1.22 2002/03/24 11:23:23 kls Exp $ + * $Id: osd.c 1.23 2002/03/29 16:34:03 kls Exp $ */ #include "osd.h" @@ -76,6 +76,7 @@ eOSState cOsdItem::ProcessKey(eKeys Key) cOsdMenu::cOsdMenu(const char *Title, int c0, int c1, int c2, int c3, int c4) { + digit = 0; hasHotkeys = false; visible = false; title = NULL; @@ -105,12 +106,15 @@ cOsdMenu::~cOsdMenu() const char *cOsdMenu::hk(const char *s) { static char buffer[32]; - if (digit < 9) { - snprintf(buffer, sizeof(buffer), " %d %s", ++digit, s); - return buffer; + if (s && hasHotkeys) { + if (digit == 0 && '1' <= *s && *s <= '9' && *(s + 1) == ' ') + digit = 10; // prevents automatic hotkeys - input already has them + if (digit < 9) { + snprintf(buffer, sizeof(buffer), " %d %s", ++digit, s); + s = buffer; + } } - else - return s; + return s; } void cOsdMenu::SetHasHotkeys(void) @@ -8,7 +8,7 @@ .\" License as specified in the file COPYING that comes with the .\" vdr distribution. .\" -.\" $Id: vdr.5 1.1 2002/03/29 14:05:31 kls Exp $ +.\" $Id: vdr.5 1.2 2002/03/29 16:45:36 kls Exp $ .\" .TH vdr 5 "29 Mar 2002" "1.0.0" "Video Disk Recorder Files" .SH NAME @@ -221,6 +221,13 @@ and \fBcommand\fR is the actual command string that will be executed when this option is selected. The delimiting ':' may be surrounded by any number of white space characters. +By default the menu entries in the "Commands" menu will be numbered '1'...'9' +to make them selectable by pressing the corresponding number key. If you want +to use your own numbering scheme (maybe to skip certain numbers), just precede +the \fBtitle\fRs with the numbers of your choice. \fBvdr\fR will suppress its +automatic numbering if the first entry in \fIcommands.conf\fR starts with a +digit in the range '1'...'9', followed by a blank. + In order to avoid error messages to the console, every command should have \fIstderr\fR redirected to \fIstdout\fR. Everything the command prints to \fIstdout\fR will be displayed in a result window, with \fBtitle\fR as its title. @@ -232,6 +239,8 @@ Check for new mail: /usr/local/bin/checkmail 2>&1 CPU status : /usr/local/bin/cpustatus 2>&1 .br Disk space : df -h | grep '/video' | awk '{ print 100 - $5 "% free"; }' +.br +Calendar : date;echo;cal Note that the commands 'checkmail' and 'cpustatus' are only \fBexamples\fR! Don't send emails to the author asking where to find these ;-) |