summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-10-03 12:27:15 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-10-03 12:27:15 +0200
commitb724e950d8eeb410c882d1915a33335eb6408943 (patch)
tree8723437ca7d00ec6adbbc045da95ae74286d0c68 /menu.c
parentadf99fb3e88a6e6c076eb85080dd6e7785e1bb9d (diff)
downloadvdr-b724e950d8eeb410c882d1915a33335eb6408943.tar.gz
vdr-b724e950d8eeb410c882d1915a33335eb6408943.tar.bz2
Improved the CAM enquiry menu
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/menu.c b/menu.c
index df61061b..53251f25 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.372 2005/10/03 10:41:26 kls Exp $
+ * $Id: menu.c 1.373 2005/10/03 12:24:34 kls Exp $
*/
#include "menu.h"
@@ -1368,17 +1368,18 @@ eOSState cMenuCam::ProcessKey(eKeys Key)
// --- cMenuCamEnquiry -------------------------------------------------------
-//XXX this is just quick and dirty - make this a separate display object
cMenuCamEnquiry::cMenuCamEnquiry(cCiEnquiry *CiEnquiry)
-:cOsdMenu("", 10)
+:cOsdMenu("", 1)
{
ciEnquiry = CiEnquiry;
int Length = ciEnquiry->ExpectedLength();
input = MALLOC(char, Length + 1);
*input = 0;
replied = false;
- SetTitle(ciEnquiry->Text() ? ciEnquiry->Text() : "CAM");
- Add(new cMenuEditNumItem("Input", input, Length, ciEnquiry->Blind()));
+ SetTitle("CAM");
+ Add(new cOsdItem(ciEnquiry->Text(), osUnknown, false));
+ Add(new cOsdItem("", osUnknown, false));
+ Add(new cMenuEditNumItem("", input, Length, ciEnquiry->Blind()));
Display();
}
@@ -1392,7 +1393,12 @@ cMenuCamEnquiry::~cMenuCamEnquiry()
eOSState cMenuCamEnquiry::Reply(void)
{
- //XXX check length???
+ if (ciEnquiry->ExpectedLength() < 0xFF && int(strlen(input)) != ciEnquiry->ExpectedLength()) {
+ char buffer[64];
+ snprintf(buffer, sizeof(buffer), tr("Please enter %d digits!"), ciEnquiry->ExpectedLength());
+ Skins.Message(mtError, buffer);
+ return osContinue;
+ }
ciEnquiry->Reply(input);
replied = true;
return osEnd;