fixed bug that detached viewelements were not cleared correctly

This commit is contained in:
louis 2015-05-14 06:45:03 +02:00
parent 57999a442f
commit f33354ba5a
5 changed files with 19 additions and 2 deletions

View File

@ -316,3 +316,7 @@ Version 0.4.5
- added {numtimers} Token to lastrecordings viewelement
- fixed time display bug in displaymenurecordings
- added token {watched} to displaymenurecordings
- fixed bug that scrapercontent in displaychannel was not
updated if detached
- fixed bug that detached viewelements were not cleared
correctly

View File

@ -354,15 +354,17 @@ void cDisplayChannelView::DrawScraperContent(const cEvent *event) {
}
if (DetachViewElement(veScraperContent)) {
cViewElement *viewElement = GetViewElement(veScraperContent);
cViewElementScraperContent *viewElement = dynamic_cast<cViewElementScraperContent*>(GetViewElement(veScraperContent));
if (!viewElement) {
viewElement = new cViewElementScraperContent(event, ctPosterBanner, tmplView->GetViewElement(veScraperContent));
AddViewElement(veScraperContent, viewElement);
viewElement->Start();
} else {
if (!viewElement->Starting())
if (!viewElement->Starting()) {
viewElement->SetEvent(event);
viewElement->Render();
}
}
} else {
map < string, string > stringTokens;
map < string, int > intTokens;

View File

@ -27,6 +27,7 @@ private:
public:
cViewElementScraperContent(const cEvent *event, ScraperContentType type, cTemplateViewElement *tmplViewElement);
virtual ~cViewElementScraperContent() {};
void SetEvent(const cEvent *event) { this->event = event; };
bool Render(void);
};

View File

@ -183,6 +183,11 @@ void cView::DrawViewElement(eViewElement ve, map <string,string> *stringTokens,
}
void cView::ClearViewElement(eViewElement ve) {
cViewElement *detachedVE = GetViewElement(ve);
if (detachedVE) {
detachedVE->Clear();
return;
}
cTemplateViewElement *viewElement = NULL;
int currentAnimCat = ve;
if (tmplViewElement) {
@ -1103,6 +1108,10 @@ bool cViewElement::Render(void) {
return true;
}
void cViewElement::Clear(void) {
ClearViewElement(ve);
}
void cViewElement::Action(void) {
DoSleep(delay);
if (!Running())

View File

@ -95,6 +95,7 @@ public:
virtual ~cViewElement();
void SetCallback(eViewElement ve, bool (cViewHelpers::*SetTokens)(bool, stringmap&, intmap&)) { this->ve = ve; this->SetTokens = SetTokens; };
virtual bool Render(void);
void Clear(void);
bool Starting(void) { return Running(); };
};