mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
The new virtual function cStatus::OsdCurrentItem2() can be used to get the index of the current menu item
This commit is contained in:
parent
80d8851e62
commit
ef4ebeb7ee
@ -2593,6 +2593,7 @@ Markus Ehrnsperger <markus.ehrnsperger@googlemail.com>
|
|||||||
for implementing cStatus::OsdItem2() with the information whether the item is selectable
|
for implementing cStatus::OsdItem2() with the information whether the item is selectable
|
||||||
for reporting an improper call of cStatus::OsdCurrentItem() before cStatus::OsdItem2()
|
for reporting an improper call of cStatus::OsdCurrentItem() before cStatus::OsdItem2()
|
||||||
for fixing unnecessary calls to DisplayCurrent() for editable menu items
|
for fixing unnecessary calls to DisplayCurrent() for editable menu items
|
||||||
|
for implementing cStatus::OsdCurrentItem2() with the index of the current item
|
||||||
|
|
||||||
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
|
||||||
|
4
HISTORY
4
HISTORY
@ -10068,3 +10068,7 @@ Video Disk Recorder Revision History
|
|||||||
- Fixed an unnecessary redisplay of the menu when pressing a hotkey.
|
- Fixed an unnecessary redisplay of the menu when pressing a hotkey.
|
||||||
- Fixed unnecessary calls to DisplayCurrent() for editable menu items (thanks to Markus
|
- Fixed unnecessary calls to DisplayCurrent() for editable menu items (thanks to Markus
|
||||||
Ehrnsperger).
|
Ehrnsperger).
|
||||||
|
- The new virtual function cStatus::OsdCurrentItem2() can be used to get the index of the
|
||||||
|
current menu item (thanks to Markus Ehrnsperger). Plugins that implemented
|
||||||
|
cStatus::OsdCurrentItem() will still work as before, because the default implementation
|
||||||
|
of cStatus::OsdCurrentItem2() calls cStatus::OsdCurrentItem().
|
||||||
|
@ -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.4 2025/01/29 10:35:25 kls Exp $
|
* $Id: osdbase.c 5.5 2025/01/29 11:15:26 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "osdbase.h"
|
#include "osdbase.h"
|
||||||
@ -268,7 +268,7 @@ void cOsdMenu::Display(void)
|
|||||||
bool CurrentSelectable = (i == current) && item->Selectable();
|
bool CurrentSelectable = (i == current) && item->Selectable();
|
||||||
item->SetMenuItem(displayMenu, i - first, CurrentSelectable, item->Selectable());
|
item->SetMenuItem(displayMenu, i - first, CurrentSelectable, item->Selectable());
|
||||||
if (CurrentSelectable)
|
if (CurrentSelectable)
|
||||||
cStatus::MsgOsdCurrentItem(item->Text());
|
cStatus::MsgOsdCurrentItem(item->Text(), i);
|
||||||
if (++n == displayMenuItems)
|
if (++n == displayMenuItems)
|
||||||
break;
|
break;
|
||||||
i++;
|
i++;
|
||||||
@ -300,7 +300,7 @@ void cOsdMenu::DisplayCurrent(bool Current)
|
|||||||
if (item) {
|
if (item) {
|
||||||
item->SetMenuItem(displayMenu, current - first, Current && item->Selectable(), item->Selectable());
|
item->SetMenuItem(displayMenu, current - first, Current && item->Selectable(), item->Selectable());
|
||||||
if (Current && item->Selectable())
|
if (Current && item->Selectable())
|
||||||
cStatus::MsgOsdCurrentItem(item->Text());
|
cStatus::MsgOsdCurrentItem(item->Text(), current);
|
||||||
if (!Current)
|
if (!Current)
|
||||||
item->SetFresh(true); // leaving the current item resets 'fresh'
|
item->SetFresh(true); // leaving the current item resets 'fresh'
|
||||||
if (cMenuEditItem *MenuEditItem = dynamic_cast<cMenuEditItem *>(item)) {
|
if (cMenuEditItem *MenuEditItem = dynamic_cast<cMenuEditItem *>(item)) {
|
||||||
@ -321,7 +321,7 @@ void cOsdMenu::DisplayItem(cOsdItem *Item)
|
|||||||
bool Current = Index == current;
|
bool Current = Index == current;
|
||||||
Item->SetMenuItem(displayMenu, Offset, Current && Item->Selectable(), Item->Selectable());
|
Item->SetMenuItem(displayMenu, Offset, Current && Item->Selectable(), Item->Selectable());
|
||||||
if (Current && Item->Selectable())
|
if (Current && Item->Selectable())
|
||||||
cStatus::MsgOsdCurrentItem(Item->Text());
|
cStatus::MsgOsdCurrentItem(Item->Text(), Index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
6
status.c
6
status.c
@ -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 5.1 2025/01/16 09:42:11 kls Exp $
|
* $Id: status.c 5.2 2025/01/29 11:15:26 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "status.h"
|
#include "status.h"
|
||||||
@ -113,10 +113,10 @@ void cStatus::MsgOsdItem(const char *Text, int Index, bool Selectable)
|
|||||||
sm->OsdItem2(Text, Index, Selectable);
|
sm->OsdItem2(Text, Index, Selectable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cStatus::MsgOsdCurrentItem(const char *Text)
|
void cStatus::MsgOsdCurrentItem(const char *Text, int Index)
|
||||||
{
|
{
|
||||||
for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
|
for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
|
||||||
sm->OsdCurrentItem(Text);
|
sm->OsdCurrentItem2(Text, Index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cStatus::MsgOsdTextItem(const char *Text, bool Scroll)
|
void cStatus::MsgOsdTextItem(const char *Text, bool Scroll)
|
||||||
|
7
status.h
7
status.h
@ -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 5.1 2025/01/16 09:42:11 kls Exp $
|
* $Id: status.h 5.2 2025/01/29 11:15:26 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __STATUS_H
|
#ifndef __STATUS_H
|
||||||
@ -92,6 +92,9 @@ protected:
|
|||||||
// Selectable is true if this item can be selected.
|
// 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 OsdCurrentItem2(const char *Text, int Index) { OsdCurrentItem(Text); }
|
||||||
|
// The OSD displays the given single line Text as the current menu item.
|
||||||
|
// Index is the one that was given in OsdItem[2]() for this item.
|
||||||
virtual void OsdTextItem(const char *Text, bool Scroll) {}
|
virtual void OsdTextItem(const char *Text, bool Scroll) {}
|
||||||
// The OSD displays the given multi line text. If Text points to an
|
// The OSD displays the given multi line text. If Text points to an
|
||||||
// actual string, that text shall be displayed and Scroll has no
|
// actual string, that text shall be displayed and Scroll has no
|
||||||
@ -121,7 +124,7 @@ public:
|
|||||||
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, bool Selectable = true);
|
static void MsgOsdItem(const char *Text, int Index, bool Selectable = true);
|
||||||
static void MsgOsdCurrentItem(const char *Text);
|
static void MsgOsdCurrentItem(const char *Text, int Index = -1);
|
||||||
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);
|
||||||
static void MsgOsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle);
|
static void MsgOsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user