diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2003-10-05 09:51:02 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2003-10-05 09:51:02 +0200 |
commit | f163e785fb345c9e2589110724da1cc762af3cf9 (patch) | |
tree | 31380b1593fadfc638f1f287cc8518a675d66291 /interface.c | |
parent | e4c3316bd2e1715eeba3685495f3e876ddeaac42 (diff) | |
download | vdr-f163e785fb345c9e2589110724da1cc762af3cf9.tar.gz vdr-f163e785fb345c9e2589110724da1cc762af3cf9.tar.bz2 |
Fixed handling rc key learning in case cRemote::Initialize() returns 'false'
Diffstat (limited to 'interface.c')
-rw-r--r-- | interface.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/interface.c b/interface.c index 6431f911..cff07744 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.64 2003/04/27 12:08:52 kls Exp $ + * $Id: interface.c 1.65 2003/10/05 09:48:13 kls Exp $ */ #include "interface.h" @@ -329,7 +329,7 @@ void cInterface::Help(const char *Red, const char *Green, const char *Yellow, co cStatus::MsgOsdHelpKeys(Red, Green, Yellow, Blue); } -void cInterface::QueryKeys(cRemote *Remote) +bool cInterface::QueryKeys(cRemote *Remote) { WriteText(1, 3, tr("Phase 1: Detecting RC code type")); WriteText(1, 5, tr("Press any key on the RC unit")); @@ -372,7 +372,7 @@ void cInterface::QueryKeys(cRemote *Remote) Key = cRemote::Get(100); if (Key == kUp) { Clear(); - return; + return true; } else if (Key == kDown) { ClearEol(0, 6); @@ -406,7 +406,9 @@ void cInterface::QueryKeys(cRemote *Remote) else ClearEol(0, 9); } + return true; } + return false; } void cInterface::LearnKeys(void) @@ -426,9 +428,13 @@ void cInterface::LearnKeys(void) cRemote::Clear(); WriteText(1, 1, Headline); cRemote::SetLearning(Remote); - QueryKeys(Remote); + bool rc = QueryKeys(Remote); cRemote::SetLearning(NULL); Clear(); + if (!rc) { + Close(); + return; + } WriteText(1, 1, Headline); WriteText(1, 3, tr("Phase 3: Saving key codes")); WriteText(1, 5, tr("Press 'Up' to save, 'Down' to cancel")); |