The CAM menu is now completely closed when pressing the Menu key while inside a sub menu

This commit is contained in:
Klaus Schmidinger 2005-10-02 13:54:34 +02:00
parent 283a6f83f9
commit 8365632b3f
4 changed files with 31 additions and 7 deletions

View File

@ -45,7 +45,7 @@ Video Disk Recorder Revision History
a prepended '@' character. a prepended '@' character.
- If an instant recording is currently active, the "Main" menu now contains - If an instant recording is currently active, the "Main" menu now contains
an option to stop that recording. an option to stop that recording.
- Timers are now only processed when the Menu is not active. So after editing - Timers are now only processed when the menu is not active. So after editing
a timer the effect will take place only after the menu has been closed. a timer the effect will take place only after the menu has been closed.
In order to avoid missing a timer event by inadvertently leaving the menu In order to avoid missing a timer event by inadvertently leaving the menu
open, the menu will be closed automatically after about two minutes of open, the menu will be closed automatically after about two minutes of
@ -3874,3 +3874,5 @@ Video Disk Recorder Revision History
- The CAM menu now automatically updates itself in case of a progress display (as - The CAM menu now automatically updates itself in case of a progress display (as
used, for instance, when updating the firmware via satellite). used, for instance, when updating the firmware via satellite).
- Now skipping some funny characters sent by some CAMs at the beginning of strings. - Now skipping some funny characters sent by some CAMs at the beginning of strings.
- The CAM menu is now completely closed when pressing the Menu key while inside
a sub menu.

16
ci.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: ci.c 1.30 2005/10/02 13:10:28 kls Exp $ * $Id: ci.c 1.31 2005/10/02 13:20:41 kls Exp $
*/ */
#include "ci.h" #include "ci.h"
@ -1032,6 +1032,7 @@ public:
cCiEnquiry *Enquiry(bool Clear = false); cCiEnquiry *Enquiry(bool Clear = false);
bool SendMenuAnswer(uint8_t Selection); bool SendMenuAnswer(uint8_t Selection);
bool SendAnswer(const char *Text); bool SendAnswer(const char *Text);
bool SendCloseMMI(void);
}; };
cCiMMI::cCiMMI(int SessionId, cCiTransportConnection *Tc) cCiMMI::cCiMMI(int SessionId, cCiTransportConnection *Tc)
@ -1204,6 +1205,14 @@ bool cCiMMI::SendAnswer(const char *Text)
return true; return true;
} }
bool cCiMMI::SendCloseMMI(void)
{
dbgprotocol("%d: ==> Close MMI\n", SessionId());
SendData(AOT_CLOSE_MMI, 0);
//XXX return value of all SendData() calls???
return true;
}
// --- cCiMenu --------------------------------------------------------------- // --- cCiMenu ---------------------------------------------------------------
cCiMenu::cCiMenu(cCiMMI *MMI, bool Selectable) cCiMenu::cCiMenu(cCiMMI *MMI, bool Selectable)
@ -1253,6 +1262,11 @@ bool cCiMenu::Cancel(void)
return Select(-1); return Select(-1);
} }
bool cCiMenu::Abort(void)
{
return mmi->SendCloseMMI();
}
// --- cCiEnquiry ------------------------------------------------------------ // --- cCiEnquiry ------------------------------------------------------------
cCiEnquiry::cCiEnquiry(cCiMMI *MMI) cCiEnquiry::cCiEnquiry(cCiMMI *MMI)

3
ci.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: ci.h 1.15 2005/10/02 12:51:22 kls Exp $ * $Id: ci.h 1.16 2005/10/02 13:20:41 kls Exp $
*/ */
#ifndef __CI_H #ifndef __CI_H
@ -40,6 +40,7 @@ public:
bool Selectable(void) { return selectable; } bool Selectable(void) { return selectable; }
bool Select(int Index); bool Select(int Index);
bool Cancel(void); bool Cancel(void);
bool Abort(void);
bool HasUpdate(void); bool HasUpdate(void);
}; };

15
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.c 1.367 2005/10/02 12:56:19 kls Exp $ * $Id: menu.c 1.368 2005/10/02 13:20:41 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -1314,7 +1314,7 @@ cMenuCam::cMenuCam(cCiMenu *CiMenu)
cMenuCam::~cMenuCam() cMenuCam::~cMenuCam()
{ {
if (!selected) if (!selected)
ciMenu->Cancel(); ciMenu->Abort();
delete ciMenu; delete ciMenu;
} }
@ -1323,8 +1323,10 @@ eOSState cMenuCam::Select(void)
if (ciMenu->Selectable()) { if (ciMenu->Selectable()) {
ciMenu->Select(Current() - offset); ciMenu->Select(Current() - offset);
dsyslog("CAM: select %d", Current() - offset); dsyslog("CAM: select %d", Current() - offset);
selected = true;
} }
else
ciMenu->Cancel();
selected = true;
return osEnd; return osEnd;
} }
@ -1338,8 +1340,13 @@ eOSState cMenuCam::ProcessKey(eKeys Key)
default: break; default: break;
} }
} }
else if (state == osBack) {
ciMenu->Cancel();
selected = true;
return osEnd;
}
if (ciMenu->HasUpdate()) { if (ciMenu->HasUpdate()) {
selected = true; // just to not call ciMenu->Cancel() selected = true;
return osEnd; return osEnd;
} }
return state; return state;