summaryrefslogtreecommitdiff
path: root/menuitems.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 /menuitems.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 'menuitems.c')
-rw-r--r--menuitems.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/menuitems.c b/menuitems.c
index e7797d6e..dc3ea715 100644
--- a/menuitems.c
+++ b/menuitems.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menuitems.c 2.10 2011/08/12 13:19:40 kls Exp $
+ * $Id: menuitems.c 2.11 2012/03/02 15:49:57 kls Exp $
*/
#include "menuitems.h"
@@ -26,6 +26,7 @@ const char *FileNameChars = trNOOP("FileNameChars$ abcdefghijklmnopqrstuvwxyz012
cMenuEditItem::cMenuEditItem(const char *Name)
{
name = strdup(Name ? Name : "???");
+ SetHelp(NULL);
}
cMenuEditItem::~cMenuEditItem()
@@ -40,6 +41,27 @@ void cMenuEditItem::SetValue(const char *Value)
cStatus::MsgOsdCurrentItem(buffer);
}
+void cMenuEditItem::SetHelp(const char *Red, const char *Green, const char *Yellow, const char *Blue)
+{
+ // strings are NOT copied - must be constants!!!
+ helpRed = Red;
+ helpGreen = Green;
+ helpYellow = Yellow;
+ helpBlue = Blue;
+ helpDisplayed = false;
+}
+
+bool cMenuEditItem::DisplayHelp(void)
+{
+ bool HasHelp = helpRed || helpGreen || helpYellow || helpBlue;
+ if (HasHelp && !helpDisplayed) {
+ cSkinDisplay::Current()->SetButtons(helpRed, helpGreen, helpYellow, helpBlue);
+ cStatus::MsgOsdHelpKeys(helpRed, helpGreen, helpYellow, helpBlue);
+ helpDisplayed = true;
+ }
+ return HasHelp;
+}
+
// --- cMenuEditIntItem ------------------------------------------------------
cMenuEditIntItem::cMenuEditIntItem(const char *Name, int *Value, int Min, int Max, const char *MinString, const char *MaxString)
@@ -382,9 +404,9 @@ void cMenuEditStrItem::LeaveEditMode(bool SaveValue)
void cMenuEditStrItem::SetHelpKeys(void)
{
if (InEditMode())
- cSkinDisplay::Current()->SetButtons(tr("Button$ABC/abc"), insert ? tr("Button$Overwrite") : tr("Button$Insert"), tr("Button$Delete"));
+ SetHelp(tr("Button$ABC/abc"), insert ? tr("Button$Overwrite") : tr("Button$Insert"), tr("Button$Delete"));
else
- cSkinDisplay::Current()->SetButtons(NULL);
+ SetHelp(NULL);
}
uint *cMenuEditStrItem::IsAllowed(uint c)