Added cStatus::OsdItem() to provide the entire list of menu items to a plugin

This commit is contained in:
Klaus Schmidinger 2003-05-03 14:55:17 +02:00
parent 2cd7928fc6
commit f1e5b591bd
5 changed files with 22 additions and 3 deletions

View File

@ -627,3 +627,6 @@ Olivier Jacques <jacquesolivier@hotmail.com>)
Kai Moeller <moeller.ki@gmx.de> Kai Moeller <moeller.ki@gmx.de>
for reporting a double call to MainMenuAction() of a plugin if invoked via a hotkey for reporting a double call to MainMenuAction() of a plugin if invoked via a hotkey
Carsten Siebholz <c.siebholz@t-online.de>
for adding cStatus::OsdItem() to provide the entire list of menu items to a plugin

View File

@ -2104,3 +2104,5 @@ Video Disk Recorder Revision History
If all devices are busy and none of them can provide the current channel, the If all devices are busy and none of them can provide the current channel, the
message "Channel not available!" will be displayed. message "Channel not available!" will be displayed.
- Removed the (no longer necessary) 'panic' stuff from cThread. - Removed the (no longer necessary) 'panic' stuff from cThread.
- Added cStatus::OsdItem() to provide the entire list of menu items to a plugin
(thanks to Carsten Siebholz).

7
osd.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: osd.c 1.41 2003/05/02 10:46:13 kls Exp $ * $Id: osd.c 1.42 2003/05/03 14:46:38 kls Exp $
*/ */
#include "osd.h" #include "osd.h"
@ -423,6 +423,11 @@ void cOsdMenu::Display(void)
Interface->Help(helpRed, helpGreen, helpYellow, helpBlue); Interface->Help(helpRed, helpGreen, helpYellow, helpBlue);
int count = Count(); int count = Count();
if (count > 0) { if (count > 0) {
for (int i = 0; i < count; i++) {
cOsdItem *item = Get(i);
if (item)
cStatus::MsgOsdItem(item->Text(), i);
}
if (current < 0) if (current < 0)
current = 0; // just for safety - there HAS to be a current item! current = 0; // just for safety - there HAS to be a current item!
int n = 0; int n = 0;

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: status.c 1.4 2002/07/13 10:49:34 kls Exp $ * $Id: status.c 1.5 2003/05/03 14:47:44 kls Exp $
*/ */
#include "status.h" #include "status.h"
@ -71,6 +71,12 @@ void cStatus::MsgOsdHelpKeys(const char *Red, const char *Green, const char *Yel
sm->OsdHelpKeys(Red, Green, Yellow, Blue); sm->OsdHelpKeys(Red, Green, Yellow, Blue);
} }
void cStatus::MsgOsdItem(const char *Text, int Index)
{
for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
sm->OsdItem(Text, Index);
}
void cStatus::MsgOsdCurrentItem(const char *Text) void cStatus::MsgOsdCurrentItem(const char *Text)
{ {
for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))

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: status.h 1.5 2002/07/14 10:54:39 kls Exp $ * $Id: status.h 1.6 2003/05/03 14:43:18 kls Exp $
*/ */
#ifndef __STATUS_H #ifndef __STATUS_H
@ -45,6 +45,8 @@ protected:
// If Message is NULL, the status line has been cleared. // If Message is NULL, the status line has been cleared.
virtual void OsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue) {} virtual void OsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue) {}
// The help keys have been set to the given values (may be NULL). // The help keys have been set to the given values (may be NULL).
virtual void OsdItem(const char *Text, int Index) {}
// The OSD displays the given single line Text as menu item at Index.
virtual void OsdCurrentItem(const char *Text) {} virtual void OsdCurrentItem(const char *Text) {}
// The OSD displays the given single line Text as the current menu item. // The OSD displays the given single line Text as the current menu item.
virtual void OsdTextItem(const char *Text, bool Scroll) {} virtual void OsdTextItem(const char *Text, bool Scroll) {}
@ -69,6 +71,7 @@ public:
static void MsgOsdTitle(const char *Title); static void MsgOsdTitle(const char *Title);
static void MsgOsdStatusMessage(const char *Message); static void MsgOsdStatusMessage(const char *Message);
static void MsgOsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue); static void MsgOsdHelpKeys(const char *Red, const char *Green, const char *Yellow, const char *Blue);
static void MsgOsdItem(const char *Text, int Index);
static void MsgOsdCurrentItem(const char *Text); static void MsgOsdCurrentItem(const char *Text);
static void MsgOsdTextItem(const char *Text, bool Scroll = false); static void MsgOsdTextItem(const char *Text, bool Scroll = false);
static void MsgOsdChannel(const char *Text); static void MsgOsdChannel(const char *Text);