mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
fixed bug that datetime was not drawn correctly in menus
This commit is contained in:
parent
5f1ae51fe8
commit
97f3d372dc
2
HISTORY
2
HISTORY
@ -286,5 +286,5 @@ Version 0.4.1
|
|||||||
|
|
||||||
Version 0.4.2
|
Version 0.4.2
|
||||||
|
|
||||||
|
- fixed bug that datetime was not drawn correctly in menus
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ void cDisplayChannelView::DrawDate(void) {
|
|||||||
map < string, string > stringTokens;
|
map < string, string > stringTokens;
|
||||||
map < string, int > intTokens;
|
map < string, int > intTokens;
|
||||||
|
|
||||||
if (!SetDate(stringTokens, intTokens)) {
|
if (!SetDate(false, stringTokens, intTokens)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ void cDisplayChannelView::DrawTime(void) {
|
|||||||
map < string, string > stringTokens;
|
map < string, string > stringTokens;
|
||||||
map < string, int > intTokens;
|
map < string, int > intTokens;
|
||||||
|
|
||||||
if (!SetTime(stringTokens, intTokens)) {
|
if (!SetTime(false, stringTokens, intTokens)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ClearViewElement(veTime);
|
ClearViewElement(veTime);
|
||||||
|
@ -15,6 +15,7 @@ cDisplayMenuRootView::cDisplayMenuRootView(cTemplateView *rootView) : cView(root
|
|||||||
viewType = svUndefined;
|
viewType = svUndefined;
|
||||||
subView = NULL;
|
subView = NULL;
|
||||||
subViewAvailable = false;
|
subViewAvailable = false;
|
||||||
|
subViewInit = true;
|
||||||
pluginName = "";
|
pluginName = "";
|
||||||
pluginMenu = -1;
|
pluginMenu = -1;
|
||||||
pluginMenuType = mtUnknown;
|
pluginMenuType = mtUnknown;
|
||||||
@ -102,6 +103,7 @@ bool cDisplayMenuRootView::createOsd(void) {
|
|||||||
void cDisplayMenuRootView::SetMenu(eMenuCategory menuCat, bool menuInit) {
|
void cDisplayMenuRootView::SetMenu(eMenuCategory menuCat, bool menuInit) {
|
||||||
eSubView newViewType = svUndefined;
|
eSubView newViewType = svUndefined;
|
||||||
cat = menuCat;
|
cat = menuCat;
|
||||||
|
subViewInit = true;
|
||||||
bool isListView = true;
|
bool isListView = true;
|
||||||
if (menuCat != mcPlugin) {
|
if (menuCat != mcPlugin) {
|
||||||
pluginName = "";
|
pluginName = "";
|
||||||
@ -473,26 +475,31 @@ bool cDisplayMenuRootView::RenderDynamicElements(void) {
|
|||||||
return false;
|
return false;
|
||||||
bool updated = false;
|
bool updated = false;
|
||||||
bool implemented = false;
|
bool implemented = false;
|
||||||
if (view->DrawTime(implemented)) {
|
if (view->DrawTime(subViewInit, implemented)) {
|
||||||
defaultTimeDrawn = false;
|
defaultTimeDrawn = false;
|
||||||
updated = true;
|
updated = true;
|
||||||
} else if (!implemented && DrawTime()) {
|
} else if (!implemented && DrawTime(subViewInit)) {
|
||||||
defaultTimeDrawn = true;
|
defaultTimeDrawn = true;
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
implemented = false;
|
implemented = false;
|
||||||
if (view->DrawDateTime(implemented)) {
|
if (view->DrawDateTime(subViewInit, implemented)) {
|
||||||
defaultDateTimeDrawn = false;
|
defaultDateTimeDrawn = false;
|
||||||
} else if (!implemented) {
|
} else if (!implemented) {
|
||||||
DrawDateTime();
|
DrawDateTime(subViewInit);
|
||||||
defaultDateTimeDrawn = true;
|
defaultDateTimeDrawn = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (view->DrawDynamicViewElements()){
|
if (view->DrawDynamicViewElements()) {
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (subViewInit) {
|
||||||
|
subViewInit = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
subViewInit = false;
|
||||||
return updated;
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -517,7 +524,7 @@ void cDisplayMenuRootView::DrawHeader(void) {
|
|||||||
DrawViewElement(veHeader, &stringTokens, &intTokens);
|
DrawViewElement(veHeader, &stringTokens, &intTokens);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cDisplayMenuRootView::DrawDateTime(void) {
|
void cDisplayMenuRootView::DrawDateTime(bool forced) {
|
||||||
if (!ExecuteViewElement(veDateTime)) {
|
if (!ExecuteViewElement(veDateTime)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -525,7 +532,7 @@ void cDisplayMenuRootView::DrawDateTime(void) {
|
|||||||
map < string, string > stringTokens;
|
map < string, string > stringTokens;
|
||||||
map < string, int > intTokens;
|
map < string, int > intTokens;
|
||||||
|
|
||||||
if (!SetDate(stringTokens, intTokens)) {
|
if (!SetDate(forced, stringTokens, intTokens)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,7 +540,7 @@ void cDisplayMenuRootView::DrawDateTime(void) {
|
|||||||
DrawViewElement(veDateTime, &stringTokens, &intTokens);
|
DrawViewElement(veDateTime, &stringTokens, &intTokens);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cDisplayMenuRootView::DrawTime(void) {
|
bool cDisplayMenuRootView::DrawTime(bool forced) {
|
||||||
if (!ExecuteViewElement(veTime)) {
|
if (!ExecuteViewElement(veTime)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -541,7 +548,7 @@ bool cDisplayMenuRootView::DrawTime(void) {
|
|||||||
map < string, string > stringTokens;
|
map < string, string > stringTokens;
|
||||||
map < string, int > intTokens;
|
map < string, int > intTokens;
|
||||||
|
|
||||||
if (!SetTime(stringTokens, intTokens)) {
|
if (!SetTime(forced, stringTokens, intTokens)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ private:
|
|||||||
eSubView viewType;
|
eSubView viewType;
|
||||||
cTemplateView *subView;
|
cTemplateView *subView;
|
||||||
bool subViewAvailable;
|
bool subViewAvailable;
|
||||||
|
bool subViewInit;
|
||||||
string pluginName;
|
string pluginName;
|
||||||
int pluginMenu;
|
int pluginMenu;
|
||||||
ePluginMenuType pluginMenuType;
|
ePluginMenuType pluginMenuType;
|
||||||
@ -40,8 +41,8 @@ private:
|
|||||||
bool defaultSortmodeDrawn;
|
bool defaultSortmodeDrawn;
|
||||||
void DrawBackground(void);
|
void DrawBackground(void);
|
||||||
void DrawHeader(void);
|
void DrawHeader(void);
|
||||||
void DrawDateTime(void);
|
void DrawDateTime(bool forced);
|
||||||
bool DrawTime(void);
|
bool DrawTime(bool forced);
|
||||||
void DrawSortMode(void);
|
void DrawSortMode(void);
|
||||||
void DrawColorButtons(void);
|
void DrawColorButtons(void);
|
||||||
void DrawMessage(eMessageType type, const char *text);
|
void DrawMessage(eMessageType type, const char *text);
|
||||||
|
@ -46,7 +46,7 @@ bool cDisplayMenuView::DrawHeader(void) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cDisplayMenuView::DrawDateTime(bool &implemented) {
|
bool cDisplayMenuView::DrawDateTime(bool forced, bool &implemented) {
|
||||||
if (!ExecuteViewElement(veDateTime)) {
|
if (!ExecuteViewElement(veDateTime)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -54,7 +54,7 @@ bool cDisplayMenuView::DrawDateTime(bool &implemented) {
|
|||||||
map < string, string > stringTokens;
|
map < string, string > stringTokens;
|
||||||
map < string, int > intTokens;
|
map < string, int > intTokens;
|
||||||
|
|
||||||
if (!SetDate(stringTokens, intTokens)) {
|
if (!SetDate(forced, stringTokens, intTokens)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ bool cDisplayMenuView::DrawDateTime(bool &implemented) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cDisplayMenuView::DrawTime(bool &implemented) {
|
bool cDisplayMenuView::DrawTime(bool forced, bool &implemented) {
|
||||||
if (!ExecuteViewElement(veTime)) {
|
if (!ExecuteViewElement(veTime)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ bool cDisplayMenuView::DrawTime(bool &implemented) {
|
|||||||
map < string, string > stringTokens;
|
map < string, string > stringTokens;
|
||||||
map < string, int > intTokens;
|
map < string, int > intTokens;
|
||||||
|
|
||||||
if (!SetTime(stringTokens, intTokens)) {
|
if (!SetTime(forced, stringTokens, intTokens)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@ public:
|
|||||||
void SetButtonTexts(string *buttonTexts) { this->buttonTexts = buttonTexts; };
|
void SetButtonTexts(string *buttonTexts) { this->buttonTexts = buttonTexts; };
|
||||||
bool DrawBackground(void);
|
bool DrawBackground(void);
|
||||||
virtual bool DrawHeader(void);
|
virtual bool DrawHeader(void);
|
||||||
bool DrawDateTime(bool &implemented);
|
bool DrawDateTime(bool forced, bool &implemented);
|
||||||
bool DrawTime(bool &implemented);
|
bool DrawTime(bool forced, bool &implemented);
|
||||||
bool DrawColorButtons(void);
|
bool DrawColorButtons(void);
|
||||||
bool DrawMessage(eMessageType type, const char *text);
|
bool DrawMessage(eMessageType type, const char *text);
|
||||||
void DrawScrollbar(int numMax, int numDisplayed, int offset);
|
void DrawScrollbar(int numMax, int numDisplayed, int offset);
|
||||||
|
@ -52,7 +52,7 @@ void cDisplayReplayView::DrawDate(void) {
|
|||||||
map < string, string > stringTokens;
|
map < string, string > stringTokens;
|
||||||
map < string, int > intTokens;
|
map < string, int > intTokens;
|
||||||
|
|
||||||
if (!SetDate(stringTokens, intTokens)) {
|
if (!SetDate(false, stringTokens, intTokens)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ClearViewElement(veDateTime);
|
ClearViewElement(veDateTime);
|
||||||
@ -67,7 +67,7 @@ void cDisplayReplayView::DrawTime(void) {
|
|||||||
map < string, string > stringTokens;
|
map < string, string > stringTokens;
|
||||||
map < string, int > intTokens;
|
map < string, int > intTokens;
|
||||||
|
|
||||||
if (!SetTime(stringTokens, intTokens)) {
|
if (!SetTime(false, stringTokens, intTokens)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ClearViewElement(veTime);
|
ClearViewElement(veTime);
|
||||||
|
@ -59,13 +59,15 @@ bool cViewElementWeather::Render(void) {
|
|||||||
/********************************************************************************************************************/
|
/********************************************************************************************************************/
|
||||||
|
|
||||||
cViewElementDate::cViewElementDate(cTemplateViewElement *tmplViewElement) : cViewElement(tmplViewElement) {
|
cViewElementDate::cViewElementDate(cTemplateViewElement *tmplViewElement) : cViewElement(tmplViewElement) {
|
||||||
|
init = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cViewElementDate::Render(void) {
|
bool cViewElementDate::Render(void) {
|
||||||
ClearTokens();
|
ClearTokens();
|
||||||
if (!SetDate(stringTokens, intTokens)) {
|
if (!SetDate(init, stringTokens, intTokens)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
init = false;
|
||||||
ClearViewElement(veDateTime);
|
ClearViewElement(veDateTime);
|
||||||
DrawViewElement(veDateTime, &stringTokens, &intTokens);
|
DrawViewElement(veDateTime, &stringTokens, &intTokens);
|
||||||
return true;
|
return true;
|
||||||
@ -74,13 +76,15 @@ bool cViewElementDate::Render(void) {
|
|||||||
/********************************************************************************************************************/
|
/********************************************************************************************************************/
|
||||||
|
|
||||||
cViewElementTime::cViewElementTime(cTemplateViewElement *tmplViewElement) : cViewElement(tmplViewElement) {
|
cViewElementTime::cViewElementTime(cTemplateViewElement *tmplViewElement) : cViewElement(tmplViewElement) {
|
||||||
|
init = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cViewElementTime::Render(void) {
|
bool cViewElementTime::Render(void) {
|
||||||
ClearTokens();
|
ClearTokens();
|
||||||
if (!SetTime(stringTokens, intTokens)) {
|
if (!SetTime(init, stringTokens, intTokens)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
init = false;
|
||||||
ClearViewElement(veTime);
|
ClearViewElement(veTime);
|
||||||
DrawViewElement(veTime, &stringTokens, &intTokens);
|
DrawViewElement(veTime, &stringTokens, &intTokens);
|
||||||
return true;
|
return true;
|
||||||
|
@ -33,6 +33,7 @@ public:
|
|||||||
|
|
||||||
class cViewElementDate : public cViewElement, public cViewHelpers {
|
class cViewElementDate : public cViewElement, public cViewHelpers {
|
||||||
private:
|
private:
|
||||||
|
bool init;
|
||||||
public:
|
public:
|
||||||
cViewElementDate(cTemplateViewElement *tmplViewElement);
|
cViewElementDate(cTemplateViewElement *tmplViewElement);
|
||||||
virtual ~cViewElementDate() {};
|
virtual ~cViewElementDate() {};
|
||||||
@ -41,6 +42,7 @@ public:
|
|||||||
|
|
||||||
class cViewElementTime : public cViewElement, public cViewHelpers {
|
class cViewElementTime : public cViewElement, public cViewHelpers {
|
||||||
private:
|
private:
|
||||||
|
bool init;
|
||||||
public:
|
public:
|
||||||
cViewElementTime(cTemplateViewElement *tmplViewElement);
|
cViewElementTime(cTemplateViewElement *tmplViewElement);
|
||||||
virtual ~cViewElementTime() {};
|
virtual ~cViewElementTime() {};
|
||||||
|
@ -465,11 +465,11 @@ void cViewHelpers::SetPosterBanner(const cEvent *event, map < string, string > &
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cViewHelpers::SetTime(map < string, string > &stringTokens, map < string, int > &intTokens) {
|
bool cViewHelpers::SetTime(bool forced, map < string, string > &stringTokens, map < string, int > &intTokens) {
|
||||||
time_t t = time(0); // get time now
|
time_t t = time(0); // get time now
|
||||||
struct tm * now = localtime(&t);
|
struct tm * now = localtime(&t);
|
||||||
int sec = now->tm_sec;
|
int sec = now->tm_sec;
|
||||||
if (sec == lastSecond) {
|
if (!forced && sec == lastSecond) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int min = now->tm_min;
|
int min = now->tm_min;
|
||||||
@ -485,12 +485,13 @@ bool cViewHelpers::SetTime(map < string, string > &stringTokens, map < string, i
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cViewHelpers::SetDate(map < string, string > &stringTokens, map < string, int > &intTokens) {
|
bool cViewHelpers::SetDate(bool forced, map < string, string > &stringTokens, map < string, int > &intTokens) {
|
||||||
time_t t = time(0); // get time now
|
time_t t = time(0); // get time now
|
||||||
struct tm * now = localtime(&t);
|
struct tm * now = localtime(&t);
|
||||||
int min = now->tm_min;
|
int min = now->tm_min;
|
||||||
if (min == lastMinute)
|
if (!forced && min == lastMinute) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
lastMinute = min;
|
lastMinute = min;
|
||||||
|
|
||||||
intTokens.insert(pair<string, int>("year", now->tm_year + 1900));
|
intTokens.insert(pair<string, int>("year", now->tm_year + 1900));
|
||||||
|
@ -26,8 +26,8 @@ protected:
|
|||||||
bool CheckNewMails(void);
|
bool CheckNewMails(void);
|
||||||
void SetScraperTokens(const cEvent *event, const cRecording *recording, map < string, string > &stringTokens, map < string, int > &intTokens, map < string, vector< map< string, string > > > &loopTokens);
|
void SetScraperTokens(const cEvent *event, const cRecording *recording, map < string, string > &stringTokens, map < string, int > &intTokens, map < string, vector< map< string, string > > > &loopTokens);
|
||||||
void SetPosterBanner(const cEvent *event, map < string, string > &stringTokens, map < string, int > &intTokens);
|
void SetPosterBanner(const cEvent *event, map < string, string > &stringTokens, map < string, int > &intTokens);
|
||||||
bool SetTime(map < string, string > &stringTokens, map < string, int > &intTokens);
|
bool SetTime(bool forced, map < string, string > &stringTokens, map < string, int > &intTokens);
|
||||||
bool SetDate(map < string, string > &stringTokens, map < string, int > &intTokens);
|
bool SetDate(bool forced, map < string, string > &stringTokens, map < string, int > &intTokens);
|
||||||
bool SetCurrentWeatherTokens(map < string, string > &stringTokens, map < string, int > &intTokens);
|
bool SetCurrentWeatherTokens(map < string, string > &stringTokens, map < string, int > &intTokens);
|
||||||
void SetTimers(map<string,int> *intTokens, map<string,string> *stringTokens, vector<map<string,string> > *timers);
|
void SetTimers(map<string,int> *intTokens, map<string,string> *stringTokens, vector<map<string,string> > *timers);
|
||||||
void SetLastRecordings(map<string,int> *intTokens, map<string,string> *stringTokens, vector<map<string,string> > *lastRecordings);
|
void SetLastRecordings(map<string,int> *intTokens, map<string,string> *stringTokens, vector<map<string,string> > *lastRecordings);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user