summaryrefslogtreecommitdiff
path: root/osdbase.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2012-03-02 15:49:57 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2012-03-02 15:49:57 +0100
commitc5eb60f07a560d9baed751edbb5b5c0246c8e903 (patch)
tree419f655ba1aa9dd9ccb20cd91a9f6658d4bfde40 /osdbase.c
parente7b0f909ff42983c9f22b9db0e4ad6686942ea8b (diff)
downloadvdr-c5eb60f07a560d9baed751edbb5b5c0246c8e903.tar.gz
vdr-c5eb60f07a560d9baed751edbb5b5c0246c8e903.tar.bz2
Fixed handling OSD color button texts in case a menu item has texts of its own
Diffstat (limited to 'osdbase.c')
-rw-r--r--osdbase.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/osdbase.c b/osdbase.c
index b0df4de3..0a4dc32f 100644
--- a/osdbase.c
+++ b/osdbase.c
@@ -4,13 +4,14 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osdbase.c 2.3 2010/12/12 13:41:28 kls Exp $
+ * $Id: osdbase.c 2.4 2012/03/02 15:49:57 kls Exp $
*/
#include "osdbase.h"
#include <string.h>
#include "device.h"
#include "i18n.h"
+#include "menuitems.h"
#include "remote.h"
#include "status.h"
@@ -85,6 +86,7 @@ cOsdMenu::cOsdMenu(const char *Title, int c0, int c1, int c2, int c3, int c4)
current = marked = -1;
subMenu = NULL;
helpRed = helpGreen = helpYellow = helpBlue = NULL;
+ helpDisplayed = false;
status = NULL;
if (!displayMenuCount++)
SetDisplayMenu();
@@ -154,6 +156,15 @@ void cOsdMenu::SetTitle(const char *Title)
title = strdup(Title);
}
+void cOsdMenu::DisplayHelp(bool Force)
+{
+ if (!helpDisplayed || Force) {
+ displayMenu->SetButtons(helpRed, helpGreen, helpYellow, helpBlue);
+ cStatus::MsgOsdHelpKeys(helpRed, helpGreen, helpYellow, helpBlue);
+ helpDisplayed = true;
+ }
+}
+
void cOsdMenu::SetHelp(const char *Red, const char *Green, const char *Yellow, const char *Blue)
{
// strings are NOT copied - must be constants!!!
@@ -161,8 +172,7 @@ void cOsdMenu::SetHelp(const char *Red, const char *Green, const char *Yellow, c
helpGreen = Green;
helpYellow = Yellow;
helpBlue = Blue;
- displayMenu->SetButtons(helpRed, helpGreen, helpYellow, helpBlue);
- cStatus::MsgOsdHelpKeys(helpRed, helpGreen, helpYellow, helpBlue);
+ DisplayHelp(true);
}
void cOsdMenu::Del(int Index)
@@ -205,8 +215,7 @@ void cOsdMenu::Display(void)
displayMenu->SetTabs(cols[0], cols[1], cols[2], cols[3], cols[4]);//XXX
displayMenu->SetTitle(title);
cStatus::MsgOsdTitle(title);
- displayMenu->SetButtons(helpRed, helpGreen, helpYellow, helpBlue);
- cStatus::MsgOsdHelpKeys(helpRed, helpGreen, helpYellow, helpBlue);
+ DisplayHelp(true);
int count = Count();
if (count > 0) {
int ni = 0;
@@ -263,6 +272,12 @@ void cOsdMenu::DisplayCurrent(bool Current)
cStatus::MsgOsdCurrentItem(item->Text());
if (!Current)
item->SetFresh(true); // leaving the current item resets 'fresh'
+ if (cMenuEditItem *MenuEditItem = dynamic_cast<cMenuEditItem *>(item)) {
+ if (!MenuEditItem->DisplayHelp())
+ DisplayHelp();
+ else
+ helpDisplayed = false;
+ }
}
}