fixed display of header in schedules menu

This commit is contained in:
louis 2016-02-17 18:08:38 +01:00
parent c22ba065c4
commit 21732b1777
3 changed files with 12 additions and 8 deletions

View File

@ -889,15 +889,15 @@ void cSubView::DrawStaticVEs(void) {
background->Show(); background->Show();
background->Render(); background->Render();
} }
}
void cSubView::DrawDynamicVEs(void) {
if (header) { if (header) {
header->Show(); header->Show();
header->Set(menuCat); header->Set(menuCat);
if (header->Parse()) if (header->Parse())
header->Render(); header->Render();
} }
}
void cSubView::DrawDynamicVEs(void) {
if (datetime) { if (datetime) {
datetime->Show(); datetime->Show();
if (datetime->Parse()) if (datetime->Parse())

View File

@ -11,6 +11,7 @@
* cVeDmHeader * cVeDmHeader
******************************************************************/ ******************************************************************/
cVeDmHeader::cVeDmHeader(void) { cVeDmHeader::cVeDmHeader(void) {
changed = false;
title = NULL; title = NULL;
channelName = NULL; channelName = NULL;
channelNumber = 0; channelNumber = 0;
@ -48,12 +49,11 @@ void cVeDmHeader::SetTokenContainer(void) {
} }
void cVeDmHeader::SetTitle(const char *title) { void cVeDmHeader::SetTitle(const char *title) {
if (this->title && !strcmp(this->title, title))
return;
free(this->title);
this->title = strdup(title); this->title = strdup(title);
free(channelName); changed = true;
channelName = NULL;
channelNumber = 0;
free(channelId);
channelId = NULL;
} }
void cVeDmHeader::SetChannel(const cChannel *channel) { void cVeDmHeader::SetChannel(const cChannel *channel) {
@ -65,6 +65,8 @@ void cVeDmHeader::SetChannel(const cChannel *channel) {
} }
void cVeDmHeader::Set(eMenuCategory menuCat) { void cVeDmHeader::Set(eMenuCategory menuCat) {
if (!changed)
return;
tokenContainer->Clear(); tokenContainer->Clear();
tokenContainer->AddStringToken((int)eDMHeaderST::title, title); tokenContainer->AddStringToken((int)eDMHeaderST::title, title);
tokenContainer->AddStringToken((int)eDMHeaderST::vdrversion, VDRVERSION); tokenContainer->AddStringToken((int)eDMHeaderST::vdrversion, VDRVERSION);
@ -101,6 +103,7 @@ void cVeDmHeader::Set(eMenuCategory menuCat) {
tokenContainer->AddIntToken((int)eDMHeaderIT::channelnumber, channelNumber); tokenContainer->AddIntToken((int)eDMHeaderIT::channelnumber, channelNumber);
tokenContainer->AddIntToken((int)eDMHeaderIT::channellogoexists, imgCache->LogoExists(channelId)); tokenContainer->AddIntToken((int)eDMHeaderIT::channellogoexists, imgCache->LogoExists(channelId));
} }
changed = false;
SetDirty(); SetDirty();
} }

View File

@ -9,6 +9,7 @@
******************************************************************/ ******************************************************************/
class cVeDmHeader : public cViewElement { class cVeDmHeader : public cViewElement {
private: private:
bool changed;
char *title; char *title;
char *channelName; char *channelName;
int channelNumber; int channelNumber;