From b724e950d8eeb410c882d1915a33335eb6408943 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 3 Oct 2005 12:27:15 +0200 Subject: [PATCH] Improved the CAM enquiry menu --- i18n.c | 23 ++++++++++++++++++++++- menu.c | 18 ++++++++++++------ 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/i18n.c b/i18n.c index 55ec647a..33f49e14 100644 --- a/i18n.c +++ b/i18n.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: i18n.c 1.212 2005/10/02 14:36:11 kls Exp $ + * $Id: i18n.c 1.213 2005/10/03 12:27:15 kls Exp $ * * Translations provided by: * @@ -2378,6 +2378,27 @@ const tI18nPhrase Phrases[] = { "CAM mooduli taaskäivitus tehtud", "CAM er blevet nulstillet", }, + { "Please enter %d digits!", + "Bitte geben Sie %d Ziffern ein!", + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + "",//TODO + }, { "No audio available!", "Kein Audio verfügbar!", "Zvok ni dosegljiv", 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;