summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-03-29 16:45:36 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2002-03-29 16:45:36 +0100
commit9bfb79e15ede5040ac42396df1135e36b12e4e77 (patch)
treec7f1cd80574b62392fe90b9e11cc8c73381fb177
parentb83ff7ab5dd4bce5b02bc90198d23e0bd63538c8 (diff)
downloadvdr-9bfb79e15ede5040ac42396df1135e36b12e4e77.tar.gz
vdr-9bfb79e15ede5040ac42396df1135e36b12e4e77.tar.bz2
Suppressing automatic hotkey assignment if entry starts with digit and blank
-rw-r--r--HISTORY2
-rw-r--r--osd.c16
-rw-r--r--vdr.511
3 files changed, 22 insertions, 7 deletions
diff --git a/HISTORY b/HISTORY
index 66af8496..2f66c529 100644
--- a/HISTORY
+++ b/HISTORY
@@ -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.
diff --git a/osd.c b/osd.c
index 0b445780..56ba9b5c 100644
--- a/osd.c
+++ b/osd.c
@@ -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)
diff --git a/vdr.5 b/vdr.5
index 6a2dfad8..03b0ac8c 100644
--- a/vdr.5
+++ b/vdr.5
@@ -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 ;-)