summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-10-02 13:54:34 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-10-02 13:54:34 +0200
commit8365632b3f201f1b903dd88d80593435ba9545a1 (patch)
tree07705e4d45b3024171506840219a38679262c6b7
parent283a6f83f90a10175ffa6b5acbb895298223b48d (diff)
downloadvdr-8365632b3f201f1b903dd88d80593435ba9545a1.tar.gz
vdr-8365632b3f201f1b903dd88d80593435ba9545a1.tar.bz2
The CAM menu is now completely closed when pressing the Menu key while inside a sub menu
-rw-r--r--HISTORY4
-rw-r--r--ci.c16
-rw-r--r--ci.h3
-rw-r--r--menu.c15
4 files changed, 31 insertions, 7 deletions
diff --git a/HISTORY b/HISTORY
index 712fd1b6..d2afbd92 100644
--- a/HISTORY
+++ b/HISTORY
@@ -45,7 +45,7 @@ Video Disk Recorder Revision History
a prepended '@' character.
- If an instant recording is currently active, the "Main" menu now contains
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.
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
@@ -3874,3 +3874,5 @@ Video Disk Recorder Revision History
- The CAM menu now automatically updates itself in case of a progress display (as
used, for instance, when updating the firmware via satellite).
- 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.
diff --git a/ci.c b/ci.c
index 2621932a..5218bdeb 100644
--- a/ci.c
+++ b/ci.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* 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"
@@ -1032,6 +1032,7 @@ public:
cCiEnquiry *Enquiry(bool Clear = false);
bool SendMenuAnswer(uint8_t Selection);
bool SendAnswer(const char *Text);
+ bool SendCloseMMI(void);
};
cCiMMI::cCiMMI(int SessionId, cCiTransportConnection *Tc)
@@ -1204,6 +1205,14 @@ bool cCiMMI::SendAnswer(const char *Text)
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(cCiMMI *MMI, bool Selectable)
@@ -1253,6 +1262,11 @@ bool cCiMenu::Cancel(void)
return Select(-1);
}
+bool cCiMenu::Abort(void)
+{
+ return mmi->SendCloseMMI();
+}
+
// --- cCiEnquiry ------------------------------------------------------------
cCiEnquiry::cCiEnquiry(cCiMMI *MMI)
diff --git a/ci.h b/ci.h
index 483a83ec..34b422fa 100644
--- a/ci.h
+++ b/ci.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* 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
@@ -40,6 +40,7 @@ public:
bool Selectable(void) { return selectable; }
bool Select(int Index);
bool Cancel(void);
+ bool Abort(void);
bool HasUpdate(void);
};
diff --git a/menu.c b/menu.c
index 8d8ecb96..7f32283c 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.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"
@@ -1314,7 +1314,7 @@ cMenuCam::cMenuCam(cCiMenu *CiMenu)
cMenuCam::~cMenuCam()
{
if (!selected)
- ciMenu->Cancel();
+ ciMenu->Abort();
delete ciMenu;
}
@@ -1323,8 +1323,10 @@ eOSState cMenuCam::Select(void)
if (ciMenu->Selectable()) {
ciMenu->Select(Current() - offset);
dsyslog("CAM: select %d", Current() - offset);
- selected = true;
}
+ else
+ ciMenu->Cancel();
+ selected = true;
return osEnd;
}
@@ -1338,8 +1340,13 @@ eOSState cMenuCam::ProcessKey(eKeys Key)
default: break;
}
}
+ else if (state == osBack) {
+ ciMenu->Cancel();
+ selected = true;
+ return osEnd;
+ }
if (ciMenu->HasUpdate()) {
- selected = true; // just to not call ciMenu->Cancel()
+ selected = true;
return osEnd;
}
return state;