expose vdrstatus to displaymenu

This commit is contained in:
Peter Bieringer 2021-05-05 17:39:20 +02:00
parent 0159d536d0
commit 3aae0169b4
4 changed files with 33 additions and 4 deletions

View File

@ -62,6 +62,7 @@ enum class eVeDisplayMenu {
header, header,
datetime, datetime,
time, time,
vdrstatus,
sortmode, sortmode,
colorbuttons, colorbuttons,
message, message,

View File

@ -108,6 +108,7 @@ void cViewMenu::SetViewElements(void) {
viewElementNames.insert(pair<string, int>("header", (int)eVeDisplayMenu::header)); viewElementNames.insert(pair<string, int>("header", (int)eVeDisplayMenu::header));
viewElementNames.insert(pair<string, int>("datetime", (int)eVeDisplayMenu::datetime)); viewElementNames.insert(pair<string, int>("datetime", (int)eVeDisplayMenu::datetime));
viewElementNames.insert(pair<string, int>("time", (int)eVeDisplayMenu::time)); viewElementNames.insert(pair<string, int>("time", (int)eVeDisplayMenu::time));
viewElementNames.insert(pair<string, int>("vdrstatus", (int)eVeDisplayMenu::vdrstatus));
viewElementNames.insert(pair<string, int>("colorbuttons", (int)eVeDisplayMenu::colorbuttons)); viewElementNames.insert(pair<string, int>("colorbuttons", (int)eVeDisplayMenu::colorbuttons));
viewElementNames.insert(pair<string, int>("message", (int)eVeDisplayMenu::message)); viewElementNames.insert(pair<string, int>("message", (int)eVeDisplayMenu::message));
viewElementNames.insert(pair<string, int>("scrollbar", (int)eVeDisplayMenu::scrollbar)); viewElementNames.insert(pair<string, int>("scrollbar", (int)eVeDisplayMenu::scrollbar));
@ -629,6 +630,7 @@ cSubView::cSubView(const char *name) {
header = NULL; header = NULL;
datetime = NULL; datetime = NULL;
time = NULL; time = NULL;
vdrstatus = NULL;
message = NULL; message = NULL;
sortmode = NULL; sortmode = NULL;
colorbuttons = NULL; colorbuttons = NULL;
@ -693,6 +695,10 @@ void cSubView::SetViewElement(eVeDisplayMenu ve, cViewElement *viewElement) {
if (!time) if (!time)
time = dynamic_cast<cVeTime*>(viewElement); time = dynamic_cast<cVeTime*>(viewElement);
break; break;
case eVeDisplayMenu::vdrstatus:
if (!vdrstatus)
vdrstatus = dynamic_cast<cVeDmVdrstatus*>(viewElement);
break;
case eVeDisplayMenu::message: case eVeDisplayMenu::message:
if (!message) if (!message)
message = dynamic_cast<cVeMessage*>(viewElement); message = dynamic_cast<cVeMessage*>(viewElement);
@ -735,6 +741,10 @@ void cSubView::SetViewElementHorizontal(eVeDisplayMenu ve, cViewElement *viewEle
if (!time) if (!time)
time = dynamic_cast<cVeTime*>(viewElement); time = dynamic_cast<cVeTime*>(viewElement);
break; break;
case eVeDisplayMenu::vdrstatus:
if (!vdrstatus)
vdrstatus = dynamic_cast<cVeDmVdrstatus*>(viewElement);
break;
case eVeDisplayMenu::message: case eVeDisplayMenu::message:
if (!message) if (!message)
message = dynamic_cast<cVeMessage*>(viewElement); message = dynamic_cast<cVeMessage*>(viewElement);
@ -866,6 +876,7 @@ void cSubView::Clear(void) {
if (background) background->Hide(); if (background) background->Hide();
if (datetime) datetime->Hide(); if (datetime) datetime->Hide();
if (time) time->Hide(); if (time) time->Hide();
if (vdrstatus) vdrstatus->Hide();
if (header) header->Hide(); if (header) header->Hide();
if (colorbuttons) colorbuttons->Hide(); if (colorbuttons) colorbuttons->Hide();
if (scrollbar) scrollbar->Hide(); if (scrollbar) scrollbar->Hide();
@ -902,6 +913,11 @@ void cSubView::DrawDynamicVEs(void) {
time->Render(); time->Render();
} }
} }
if (vdrstatus) {
vdrstatus->Show();
if (vdrstatus->Parse())
vdrstatus->Render();
}
} }
void cSubView::DrawList(void) { void cSubView::DrawList(void) {
@ -949,6 +965,11 @@ void cSubView::SetViewElementObjects(void) {
else if (viewElements[(int)eVeDisplayMenu::time]) else if (viewElements[(int)eVeDisplayMenu::time])
time = dynamic_cast<cVeTime*>(viewElements[(int)eVeDisplayMenu::time]); time = dynamic_cast<cVeTime*>(viewElements[(int)eVeDisplayMenu::time]);
if (orientation == eOrientation::horizontal && viewElementsHorizontal[(int)eVeDisplayMenu::vdrstatus])
vdrstatus = dynamic_cast<cVeDmVdrstatus*>(viewElementsHorizontal[(int)eVeDisplayMenu::vdrstatus]);
else if (viewElements[(int)eVeDisplayMenu::message])
vdrstatus = dynamic_cast<cVeDmVdrstatus*>(viewElements[(int)eVeDisplayMenu::vdrstatus]);
if (orientation == eOrientation::horizontal && viewElementsHorizontal[(int)eVeDisplayMenu::message]) if (orientation == eOrientation::horizontal && viewElementsHorizontal[(int)eVeDisplayMenu::message])
message = dynamic_cast<cVeMessage*>(viewElementsHorizontal[(int)eVeDisplayMenu::message]); message = dynamic_cast<cVeMessage*>(viewElementsHorizontal[(int)eVeDisplayMenu::message]);
else if (viewElements[(int)eVeDisplayMenu::message]) else if (viewElements[(int)eVeDisplayMenu::message])
@ -986,6 +1007,7 @@ void cSubView::SetViewElements(void) {
viewElementNames.insert(pair<string, int>("background", (int)eVeDisplayMenu::background)); viewElementNames.insert(pair<string, int>("background", (int)eVeDisplayMenu::background));
viewElementNames.insert(pair<string, int>("header", (int)eVeDisplayMenu::header)); viewElementNames.insert(pair<string, int>("header", (int)eVeDisplayMenu::header));
viewElementNames.insert(pair<string, int>("datetime", (int)eVeDisplayMenu::datetime)); viewElementNames.insert(pair<string, int>("datetime", (int)eVeDisplayMenu::datetime));
viewElementNames.insert(pair<string, int>("vdrstatus", (int)eVeDisplayMenu::vdrstatus));
viewElementNames.insert(pair<string, int>("time", (int)eVeDisplayMenu::time)); viewElementNames.insert(pair<string, int>("time", (int)eVeDisplayMenu::time));
viewElementNames.insert(pair<string, int>("colorbuttons", (int)eVeDisplayMenu::colorbuttons)); viewElementNames.insert(pair<string, int>("colorbuttons", (int)eVeDisplayMenu::colorbuttons));
viewElementNames.insert(pair<string, int>("message", (int)eVeDisplayMenu::message)); viewElementNames.insert(pair<string, int>("message", (int)eVeDisplayMenu::message));
@ -1059,7 +1081,7 @@ cViewMenuMain::cViewMenuMain(const char *name) : cSubView(name) {
load = NULL; load = NULL;
memory = NULL; memory = NULL;
vdrstats = NULL; vdrstats = NULL;
vdrstatus = NULL; // vdrstatus = NULL;
temperatures = NULL; temperatures = NULL;
currentSchedule = NULL; currentSchedule = NULL;
lastRecordings = NULL; lastRecordings = NULL;
@ -1625,6 +1647,11 @@ void cViewMenuDetail::DrawDynamicVEs(void) {
if (time->Parse()) if (time->Parse())
time->Render(); time->Render();
} }
if (vdrstatus) {
vdrstatus->Show();
if (vdrstatus->Parse())
vdrstatus->Render();
}
} }
void cViewMenuDetail::DrawDetailedView(void) { void cViewMenuDetail::DrawDetailedView(void) {

View File

@ -120,6 +120,7 @@ protected:
cVeDmHeader *header; cVeDmHeader *header;
cVeDateTime *datetime; cVeDateTime *datetime;
cVeTime *time; cVeTime *time;
cVeDmVdrstatus *vdrstatus;
cVeMessage *message; cVeMessage *message;
cVeDmSortmode *sortmode; cVeDmSortmode *sortmode;
cVeDmColorbuttons *colorbuttons; cVeDmColorbuttons *colorbuttons;
@ -188,7 +189,7 @@ private:
cVeDmSystemload *load; cVeDmSystemload *load;
cVeDmSystemmemory *memory; cVeDmSystemmemory *memory;
cVeDmVdrstatistics *vdrstats; cVeDmVdrstatistics *vdrstats;
cVeDmVdrstatus *vdrstatus; // cVeDmVdrstatus *vdrstatus;
cVeDmTemperatures *temperatures; cVeDmTemperatures *temperatures;
cVeDmCurrentschedule *currentSchedule; cVeDmCurrentschedule *currentSchedule;
cVeDmLastrecordings *lastRecordings; cVeDmLastrecordings *lastRecordings;

View File

@ -2,7 +2,7 @@
<!ENTITY % functions SYSTEM "functions.dtd"> <!ENTITY % functions SYSTEM "functions.dtd">
<!ELEMENT displaymenu (background,header,datetime,time*,message,sortmode*,colorbuttons,scrollbar*, <!ELEMENT displaymenu (background,header,datetime,time*,vdrstatus*,message,sortmode*,colorbuttons,scrollbar*,
menudefault,menumain*,menusetup*,menuschedules*, menudefault,menumain*,menusetup*,menuschedules*,
menutimers*,menuchannels*,menurecordings*, menutimers*,menuchannels*,menurecordings*,
menudetailedepg,menudetailedrecording, menudetailedepg,menudetailedrecording,
@ -330,7 +330,7 @@
> >
<!ELEMENT menumain (background | header | datetime | time | colorbuttons | scrollbar | sortmode | timers | <!ELEMENT menumain (background | header | datetime | time | colorbuttons | scrollbar | sortmode | timers |
discusage | devices | systemload | systemmemory | vdrstatistics | vdrstatus | temperatures | currentschedule | discusage | devices | systemload | systemmemory | vdrstatistics | vdrstatus* | temperatures | currentschedule |
currentweather | lastrecordings | customtokens | menuitems)*> currentweather | lastrecordings | customtokens | menuitems)*>
<!ATTLIST menumain <!ATTLIST menumain
x CDATA #REQUIRED x CDATA #REQUIRED