diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-11-01 14:27:43 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-11-01 14:27:43 +0100 |
commit | 6304820a0eafabf050e27cf5924934367b6954ab (patch) | |
tree | 2618017ceb8bda905d605eaf4428d4db0ba6fda3 /interface.c | |
parent | 5abadbf1a8e48c7ed205cfc0b8521112e75a4b1b (diff) | |
download | vdr-6304820a0eafabf050e27cf5924934367b6954ab.tar.gz vdr-6304820a0eafabf050e27cf5924934367b6954ab.tar.bz2 |
Now displaying the name of the remote control for which the keys are being learned inside the menu1.3.15
Diffstat (limited to 'interface.c')
-rw-r--r-- | interface.c | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/interface.c b/interface.c index 06ba331a..33737433 100644 --- a/interface.c +++ b/interface.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: interface.c 1.67 2004/05/02 10:57:06 kls Exp $ + * $Id: interface.c 1.68 2004/11/01 14:23:28 kls Exp $ */ #include "interface.h" @@ -76,23 +76,23 @@ bool cInterface::Confirm(const char *s, int Seconds, bool WaitForTimeout) bool cInterface::QueryKeys(cRemote *Remote, cSkinDisplayMenu *DisplayMenu) { - DisplayMenu->SetItem(tr("Phase 1: Detecting RC code type"), 1, false, false); - DisplayMenu->SetItem(tr("Press any key on the RC unit"), 3, false, false); + DisplayMenu->SetItem(tr("Phase 1: Detecting RC code type"), 2, false, false); + DisplayMenu->SetItem(tr("Press any key on the RC unit"), 4, false, false); DisplayMenu->Flush(); if (Remote->Initialize()) { - DisplayMenu->SetItem(tr("RC code detected!"), 3, false, false); - DisplayMenu->SetItem(tr("Do not press any key..."), 4, false, false); + DisplayMenu->SetItem(tr("RC code detected!"), 4, false, false); + DisplayMenu->SetItem(tr("Do not press any key..."), 5, false, false); DisplayMenu->Flush(); sleep(3); - DisplayMenu->SetItem("", 3, false, false); DisplayMenu->SetItem("", 4, false, false); + DisplayMenu->SetItem("", 5, false, false); - DisplayMenu->SetItem(tr("Phase 2: Learning specific key codes"), 1, false, false); + DisplayMenu->SetItem(tr("Phase 2: Learning specific key codes"), 2, false, false); eKeys NewKey = kUp; while (NewKey != kNone) { char *Prompt; asprintf(&Prompt, tr("Press key for '%s'"), tr(cKey::ToString(NewKey))); - DisplayMenu->SetItem(Prompt, 3, false, false); + DisplayMenu->SetItem(Prompt, 4, false, false); free(Prompt); cRemote::Clear(); DisplayMenu->Flush(); @@ -107,11 +107,11 @@ bool cInterface::QueryKeys(cRemote *Remote, cSkinDisplayMenu *DisplayMenu) Keys.Del(last); } break; - case kDown: DisplayMenu->SetItem(tr("Press 'Up' to confirm"), 3, false, false); - DisplayMenu->SetItem(tr("Press 'Down' to continue"), 4, false, false); - DisplayMenu->SetItem("", 5, false, false); + case kDown: DisplayMenu->SetItem(tr("Press 'Up' to confirm"), 4, false, false); + DisplayMenu->SetItem(tr("Press 'Down' to continue"), 5, false, false); DisplayMenu->SetItem("", 6, false, false); DisplayMenu->SetItem("", 7, false, false); + DisplayMenu->SetItem("", 8, false, false); DisplayMenu->Flush(); for (;;) { Key = cRemote::Get(100); @@ -120,7 +120,7 @@ bool cInterface::QueryKeys(cRemote *Remote, cSkinDisplayMenu *DisplayMenu) return true; } else if (Key == kDown) { - DisplayMenu->SetItem("", 4, false, false); + DisplayMenu->SetItem("", 5, false, false); k = kNone; // breaks the outer for() loop break; } @@ -139,17 +139,17 @@ bool cInterface::QueryKeys(cRemote *Remote, cSkinDisplayMenu *DisplayMenu) } } if (NewKey > kUp) - DisplayMenu->SetItem(tr("(press 'Up' to go back)"), 5, false, false); + DisplayMenu->SetItem(tr("(press 'Up' to go back)"), 6, false, false); else - DisplayMenu->SetItem("", 5, false, false); + DisplayMenu->SetItem("", 6, false, false); if (NewKey > kDown) - DisplayMenu->SetItem(tr("(press 'Down' to end key definition)"), 6, false, false); + DisplayMenu->SetItem(tr("(press 'Down' to end key definition)"), 7, false, false); else - DisplayMenu->SetItem("", 6, false, false); + DisplayMenu->SetItem("", 7, false, false); if (NewKey > kMenu) - DisplayMenu->SetItem(tr("(press 'Menu' to skip this key)"), 7, false, false); + DisplayMenu->SetItem(tr("(press 'Menu' to skip this key)"), 8, false, false); else - DisplayMenu->SetItem("", 7, false, false); + DisplayMenu->SetItem("", 8, false, false); } return true; } @@ -168,9 +168,10 @@ void cInterface::LearnKeys(void) if (!known) { cSkinDisplayMenu *DisplayMenu = Skins.Current()->DisplayMenu(); char Headline[256]; - snprintf(Headline, sizeof(Headline), tr("Learning Remote Control Keys (%s)"), Remote->Name()); + snprintf(Headline, sizeof(Headline), tr("Learning Remote Control Keys")); cRemote::Clear(); DisplayMenu->SetTitle(Headline); + DisplayMenu->SetItem(Remote->Name(), 0, false, false); cRemote::SetLearning(Remote); bool rc = QueryKeys(Remote, DisplayMenu); cRemote::SetLearning(NULL); @@ -179,8 +180,9 @@ void cInterface::LearnKeys(void) delete DisplayMenu; continue; } - DisplayMenu->SetItem(tr("Phase 3: Saving key codes"), 1, false, false); - DisplayMenu->SetItem(tr("Press 'Up' to save, 'Down' to cancel"), 3, false, false); + DisplayMenu->SetItem(Remote->Name(), 0, false, false); + DisplayMenu->SetItem(tr("Phase 3: Saving key codes"), 2, false, false); + DisplayMenu->SetItem(tr("Press 'Up' to save, 'Down' to cancel"), 4, false, false); for (;;) { eKeys key = GetKey(); if (key == kUp) { |