The new virtual function cStatus::OsdItem2() can be used to get the information whether a menu item is selectable

This commit is contained in:
Klaus Schmidinger 2025-01-16 09:42:11 +01:00
parent e595eed57d
commit 0749a34342
6 changed files with 20 additions and 11 deletions

View File

@ -2590,6 +2590,7 @@ Markus Ehrnsperger <markus.ehrnsperger@googlemail.com>
for suggesting a fix for expiring of one-time VPS timers in case there is more than for suggesting a fix for expiring of one-time VPS timers in case there is more than
one event with the same VPS time one event with the same VPS time
for fixing handling margins for timers that are not VPS controlled and not spawned for fixing handling margins for timers that are not VPS controlled and not spawned
for implementing cStatus::OsdItem2() with the information whether the item is selectable
Werner Färber <w.faerber@gmx.de> Werner Färber <w.faerber@gmx.de>
for reporting a bug in handling the cPluginManager::Active() result when pressing for reporting a bug in handling the cPluginManager::Active() result when pressing

View File

@ -10034,7 +10034,7 @@ Video Disk Recorder Revision History
(suggested by Stefan Hofmann). (suggested by Stefan Hofmann).
- Added vdrrootdir and incdir to vdr.pc (thanks to Stefan Hofmann). - Added vdrrootdir and incdir to vdr.pc (thanks to Stefan Hofmann).
2025-01-15: 2025-01-16:
- Removed all DEPRECATED_* code. - Removed all DEPRECATED_* code.
- Fixed error checking in case the fps value can't be determined by the frame parser. - Fixed error checking in case the fps value can't be determined by the frame parser.
@ -10056,3 +10056,8 @@ Video Disk Recorder Revision History
- Added parameter checks to strn0cpy() (thanks to Stefan Hofmann). Same for Utf8Strn0Cpy(). - Added parameter checks to strn0cpy() (thanks to Stefan Hofmann). Same for Utf8Strn0Cpy().
- The info files of recordings are now only re-read if they have been modified (thanks - The info files of recordings are now only re-read if they have been modified (thanks
to Stefan Hofmann). to Stefan Hofmann).
- The new virtual function cStatus::OsdItem2() can be used to get the information whether
a menu item is selectable (thanks to Markus Ehrnsperger). Plugins that implemented
cStatus::OsdItem() will still work as before, because the default implementation of
cStatus::OsdItem2() calls cStatus::OsdItem().
APIVERSNUM is now 30006.

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: config.h 5.24 2024/10/12 13:32:46 kls Exp $ * $Id: config.h 5.25 2025/01/16 09:42:11 kls Exp $
*/ */
#ifndef __CONFIG_H #ifndef __CONFIG_H
@ -27,8 +27,8 @@
// The plugin API's version number: // The plugin API's version number:
#define APIVERSION "5" #define APIVERSION "6"
#define APIVERSNUM 30005 #define APIVERSNUM 30006
// When loading plugins, VDR searches files by their APIVERSION, which // When loading plugins, VDR searches files by their APIVERSION, which
// is different from VDRVERSION. APIVERSION is a plain number, incremented // is different from VDRVERSION. APIVERSION is a plain number, incremented

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: osdbase.c 5.1 2024/01/19 12:10:47 kls Exp $ * $Id: osdbase.c 5.2 2025/01/16 09:42:11 kls Exp $
*/ */
#include "osdbase.h" #include "osdbase.h"
@ -248,7 +248,7 @@ void cOsdMenu::Display(void)
if (count > 0) { if (count > 0) {
int ni = 0; int ni = 0;
for (cOsdItem *item = First(); item; item = Next(item)) { for (cOsdItem *item = First(); item; item = Next(item)) {
cStatus::MsgOsdItem(item->Text(), ni++); cStatus::MsgOsdItem(item->Text(), ni++, item->Selectable());
if (current < 0 && item->Selectable()) if (current < 0 && item->Selectable())
current = item->Index(); current = item->Index();
} }

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 4.1 2018/01/29 13:36:53 kls Exp $ * $Id: status.c 5.1 2025/01/16 09:42:11 kls Exp $
*/ */
#include "status.h" #include "status.h"
@ -107,10 +107,10 @@ 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) void cStatus::MsgOsdItem(const char *Text, int Index, bool Selectable)
{ {
for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
sm->OsdItem(Text, Index); sm->OsdItem2(Text, Index, Selectable);
} }
void cStatus::MsgOsdCurrentItem(const char *Text) void cStatus::MsgOsdCurrentItem(const char *Text)

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 4.4 2018/01/29 13:42:17 kls Exp $ * $Id: status.h 5.1 2025/01/16 09:42:11 kls Exp $
*/ */
#ifndef __STATUS_H #ifndef __STATUS_H
@ -87,6 +87,9 @@ protected:
// 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) {} virtual void OsdItem(const char *Text, int Index) {}
// The OSD displays the given single line Text as menu item at Index. // The OSD displays the given single line Text as menu item at Index.
virtual void OsdItem2(const char *Text, int Index, bool Selectable) { OsdItem(Text, Index); }
// The OSD displays the given single line Text as menu item at Index.
// Selectable is true if this item can be selected.
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) {}
@ -117,7 +120,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 MsgOsdItem(const char *Text, int Index, bool Selectable = true);
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);