vdr-plugin-skindesigner/views/displaymenuview.c

670 lines
23 KiB
C
Raw Normal View History

2014-09-27 09:25:14 +02:00
#define __STL_CONFIG_H
#include <vdr/menu.h>
#include <vdr/videodir.h>
#include "displaymenuview.h"
#include "displayviewelements.h"
2014-09-27 09:25:14 +02:00
#include "../config.h"
#include "../libcore/helpers.h"
#include "../services/scraper2vdr.h"
2014-09-27 09:25:14 +02:00
cDisplayMenuView::cDisplayMenuView(cTemplateView *tmplView, bool menuInit) : cView(tmplView) {
2015-05-10 12:55:23 +02:00
if (!menuInit)
2014-09-27 09:25:14 +02:00
SetFadeTime(0);
fadeOut = false;
2014-09-27 09:25:14 +02:00
cat = mcUndefined;
sortMode = msmUnknown;
sortModeLast = msmUnknown;
buttonTexts = NULL;
2014-09-27 09:25:14 +02:00
}
cDisplayMenuView::~cDisplayMenuView() {
}
bool cDisplayMenuView::DrawBackground(void) {
if (!ExecuteViewElement(veBackground)) {
2014-09-27 09:25:14 +02:00
return false;
}
2015-01-06 06:07:48 +01:00
map < string, string > stringTokens;
map < string, int > intTokens;
DrawViewElement(veBackground, &stringTokens, &intTokens);
2014-09-27 09:25:14 +02:00
return true;
}
bool cDisplayMenuView::DrawHeader(void) {
if (!ExecuteViewElement(veHeader)) {
2014-09-27 09:25:14 +02:00
return false;
}
2015-05-10 12:55:23 +02:00
if (DetachViewElement(veHeader)) {
cViewElement *viewElement = GetViewElement(veHeader);
if (!viewElement) {
viewElement = new cViewElementMenuHeader(tmplView->GetViewElement(veHeader), cat, menuTitle);
AddViewElement(veHeader, viewElement);
viewElement->Start();
} else {
if (!viewElement->Starting())
viewElement->Render();
}
} else {
map < string, string > stringTokens;
map < string, int > intTokens;
SetMenuHeader(cat, menuTitle, stringTokens, intTokens);
ClearViewElement(veHeader);
DrawViewElement(veHeader, &stringTokens, &intTokens);
}
2014-09-27 09:25:14 +02:00
return true;
}
bool cDisplayMenuView::DrawDateTime(bool forced, bool &implemented) {
if (!ExecuteViewElement(veDateTime)) {
2014-09-27 09:25:14 +02:00
return false;
}
implemented = true;
2015-05-10 12:55:23 +02:00
if (DetachViewElement(veDateTime)) {
cViewElement *viewElement = GetViewElement(veDateTime);
if (!viewElement) {
viewElement = new cViewElement(tmplView->GetViewElement(veDateTime), this);
viewElement->SetCallback(veDateTime, &cDisplayMenuView::SetDate);
AddViewElement(veDateTime, viewElement);
viewElement->Start();
} else {
if (!viewElement->Starting())
if (!viewElement->Render())
return false;
}
} else {
map < string, string > stringTokens;
map < string, int > intTokens;
if (!SetDate(forced, stringTokens, intTokens)) {
return false;
}
2014-09-27 09:25:14 +02:00
2015-05-10 12:55:23 +02:00
ClearViewElement(veDateTime);
DrawViewElement(veDateTime, &stringTokens, &intTokens);
}
2014-09-27 09:25:14 +02:00
return true;
}
bool cDisplayMenuView::DrawTime(bool forced, bool &implemented) {
if (!ExecuteViewElement(veTime)) {
2015-01-06 06:07:48 +01:00
return false;
}
implemented = true;
2015-01-06 06:07:48 +01:00
2015-05-10 12:55:23 +02:00
if (DetachViewElement(veTime)) {
cViewElement *viewElement = GetViewElement(veTime);
if (!viewElement) {
viewElement = new cViewElement(tmplView->GetViewElement(veTime), this);
viewElement->SetCallback(veTime, &cDisplayMenuView::SetTime);
AddViewElement(veTime, viewElement);
viewElement->Start();
} else {
if (!viewElement->Starting())
if (!viewElement->Render())
return false;
}
} else {
2015-01-06 06:07:48 +01:00
2015-05-10 12:55:23 +02:00
map < string, string > stringTokens;
map < string, int > intTokens;
2015-01-06 06:07:48 +01:00
2015-05-10 12:55:23 +02:00
if (!SetTime(forced, stringTokens, intTokens)) {
return false;
}
ClearViewElement(veTime);
DrawViewElement(veTime, &stringTokens, &intTokens);
}
2015-01-06 06:07:48 +01:00
return true;
}
2014-09-27 09:25:14 +02:00
bool cDisplayMenuView::DrawColorButtons(void) {
if (!ExecuteViewElement(veButtons)) {
2014-09-27 09:25:14 +02:00
return false;
}
map < string, string > stringTokens;
map < string, int > intTokens;
stringTokens.insert(pair<string,string>("red", buttonTexts ? buttonTexts[0] : ""));
stringTokens.insert(pair<string,string>("green", buttonTexts ? buttonTexts[1]: ""));
stringTokens.insert(pair<string,string>("yellow", buttonTexts ? buttonTexts[2]: ""));
stringTokens.insert(pair<string,string>("blue", buttonTexts ? buttonTexts[3] : ""));
2014-09-27 09:25:14 +02:00
int colorKeys[4] = { Setup.ColorKey0, Setup.ColorKey1, Setup.ColorKey2, Setup.ColorKey3 };
for (int button = 1; button < 5; button++) {
string red = *cString::sprintf("red%d", button);
string green = *cString::sprintf("green%d", button);
string yellow = *cString::sprintf("yellow%d", button);
string blue = *cString::sprintf("blue%d", button);
bool isRed = false;
bool isGreen = false;
bool isYellow = false;
bool isBlue = false;
switch (colorKeys[button-1]) {
case 0:
isRed = true;
break;
case 1:
isGreen = true;
break;
case 2:
isYellow = true;
break;
case 3:
isBlue = true;
break;
default:
break;
}
intTokens.insert(pair<string, int>(red, isRed));
intTokens.insert(pair<string, int>(green, isGreen));
intTokens.insert(pair<string, int>(yellow, isYellow));
intTokens.insert(pair<string, int>(blue, isBlue));
}
ClearViewElement(veButtons);
DrawViewElement(veButtons, &stringTokens, &intTokens);
return true;
}
bool cDisplayMenuView::DrawMessage(eMessageType type, const char *text) {
if (!ExecuteViewElement(veMessage)) {
2014-09-27 09:25:14 +02:00
return false;
}
if (!text) {
if (DetachViewElement(veMessage))
DestroyDetachedViewElement(veMessage);
else
ClearViewElement(veMessage);
2014-09-27 09:25:14 +02:00
return true;
}
if (DetachViewElement(veMessage)) {
cViewElement *viewElement = GetViewElement(veMessage);
if (!viewElement) {
viewElement = new cViewElementMenuMessage(tmplView->GetViewElement(veMessage), type, text);
AddViewElement(veMessage, viewElement);
viewElement->Start();
} else {
if (!viewElement->Starting())
viewElement->Render();
}
} else {
map < string, string > stringTokens;
map < string, int > intTokens;
SetMenuMessage(type, text, stringTokens, intTokens);
ClearViewElement(veMessage);
DrawViewElement(veMessage, &stringTokens, &intTokens);
}
2014-09-27 09:25:14 +02:00
return true;
}
void cDisplayMenuView::DrawScrollbar(int numMax, int numDisplayed, int offset) {
if (!ExecuteViewElement(veScrollbar)) {
2014-09-27 09:25:14 +02:00
return;
}
map < string, string > stringTokens;
map < string, int > intTokens;
if (numDisplayed < 1)
return;
int barHeight = 0;
if (numDisplayed < numMax)
barHeight = 1000;
else
barHeight = (double)numMax * 1000 / (double)numDisplayed;
int barOffset = (double)offset * 1000 / (double)numDisplayed;
intTokens.insert(pair<string, int>("height", barHeight));
intTokens.insert(pair<string, int>("offset", barOffset));
ClearViewElement(veScrollbar);
DrawViewElement(veScrollbar, &stringTokens, &intTokens);
}
bool cDisplayMenuView::DrawSortMode(void) {
if (!ExecuteViewElement(veSortMode)) {
return false;
}
if (sortMode == msmUnknown) {
if (sortModeLast != msmUnknown)
ClearViewElement(veSortMode);
sortModeLast = msmUnknown;
return true;
}
if (sortMode == sortModeLast)
return true;
sortModeLast = sortMode;
map < string, string > stringTokens;
map < string, int > intTokens;
bool sortNumber = (sortMode == msmNumber) ? true : false;
bool sortName = (sortMode == msmName) ? true : false;
bool sortTime = (sortMode == msmTime) ? true : false;
bool sortProvider = (sortMode == msmProvider) ? true : false;
intTokens.insert(pair<string, int>("sortnumber", sortNumber));
intTokens.insert(pair<string, int>("sortname", sortName));
intTokens.insert(pair<string, int>("sorttime", sortTime));
intTokens.insert(pair<string, int>("sortprovider", sortProvider));
ClearViewElement(veSortMode);
DrawViewElement(veSortMode, &stringTokens, &intTokens);
return true;
}
2014-09-27 09:25:14 +02:00
bool cDisplayMenuView::BackgroundImplemented(void) {
if (!ExecuteViewElement(veBackground)) {
2014-09-27 09:25:14 +02:00
return false;
}
return true;
}
void cDisplayMenuView::Action(void) {
SetInitFinished();
FadeIn();
DoFlush();
}
/************************************************************************
* cDisplayMenuMainView
************************************************************************/
cDisplayMenuMainView::cDisplayMenuMainView(cTemplateView *tmplView, bool menuInit, string currentRecording) : cDisplayMenuView(tmplView, menuInit) {
this->currentRecording = currentRecording;
2014-09-27 09:25:14 +02:00
initial = true;
InitDevices();
}
cDisplayMenuMainView::~cDisplayMenuMainView() {
CancelSave();
}
void cDisplayMenuMainView::DrawStaticViewElements(void) {
DrawTimers();
DrawLastRecordings();
2014-09-27 09:25:14 +02:00
DrawDiscUsage();
2015-01-06 06:07:48 +01:00
DrawTemperatures();
DrawCurrentSchedule();
DrawCurrentWeather();
2014-09-27 09:25:14 +02:00
}
bool cDisplayMenuMainView::DrawDynamicViewElements(void) {
bool loadChanged = DrawLoad();
bool memChanged = DrawMemory();
bool vdrChanged = DrawVdrStats();
2014-09-27 09:25:14 +02:00
bool devicesChanged = DrawDevices();
bool customTokensChanged = DrawCustomTokens();
2014-09-27 09:25:14 +02:00
initial = false;
return loadChanged || memChanged || vdrChanged || devicesChanged || customTokensChanged;
2014-09-27 09:25:14 +02:00
}
void cDisplayMenuMainView::DrawTimers(void) {
if (!ExecuteViewElement(veTimers)) {
2014-09-27 09:25:14 +02:00
return;
}
if (DetachViewElement(veTimers)) {
cViewElement *viewElement = GetViewElement(veTimers);
if (!viewElement) {
viewElement = new cViewElementTimers(tmplView->GetViewElement(veTimers));
AddViewElement(veTimers, viewElement);
viewElement->Start();
2014-09-27 09:25:14 +02:00
} else {
if (!viewElement->Starting())
viewElement->Render();
2014-09-27 09:25:14 +02:00
}
} else {
map < string, string > stringTokens;
map < string, int > intTokens;
map < string, vector< map< string, string > > > timerLoopTokens;
vector< map< string, string > > timers;
2014-09-27 09:25:14 +02:00
SetTimers(&intTokens, &stringTokens, &timers);
2014-09-27 09:25:14 +02:00
timerLoopTokens.insert(pair< string, vector< map< string, string > > >("timers", timers));
2014-09-27 09:25:14 +02:00
ClearViewElement(veTimers);
DrawViewElement(veTimers, &stringTokens, &intTokens, &timerLoopTokens);
}
2014-09-27 09:25:14 +02:00
}
void cDisplayMenuMainView::DrawLastRecordings(void) {
if (!ExecuteViewElement(veLastRecordings)) {
return;
}
if (DetachViewElement(veLastRecordings)) {
cViewElement *viewElement = GetViewElement(veLastRecordings);
if (!viewElement) {
viewElement = new cViewElementLastRecordings(tmplView->GetViewElement(veLastRecordings));
AddViewElement(veLastRecordings, viewElement);
viewElement->Start();
} else {
if (!viewElement->Starting())
viewElement->Render();
}
} else {
map < string, string > stringTokens;
map < string, int > intTokens;
map < string, vector< map< string, string > > > recordingLoopTokens;
vector< map< string, string > > lastRecordings;
SetLastRecordings(&intTokens, &stringTokens, &lastRecordings);
recordingLoopTokens.insert(pair< string, vector< map< string, string > > >("recordings", lastRecordings));
ClearViewElement(veLastRecordings);
DrawViewElement(veLastRecordings, &stringTokens, &intTokens, &recordingLoopTokens);
}
}
2014-09-27 09:25:14 +02:00
void cDisplayMenuMainView::DrawDiscUsage(void) {
if (!ExecuteViewElement(veDiscUsage)) {
2014-09-27 09:25:14 +02:00
return;
}
if (DetachViewElement(veDiscUsage)) {
cViewElement *viewElement = GetViewElement(veDiscUsage);
if (!viewElement) {
2015-05-10 12:55:23 +02:00
viewElement = new cViewElement(tmplView->GetViewElement(veDiscUsage), this);
viewElement->SetCallback(veDiscUsage, &cDisplayMenuMainView::SetDiscUsage);
AddViewElement(veDiscUsage, viewElement);
viewElement->Start();
} else {
if (!viewElement->Starting())
viewElement->Render();
}
} else {
map < string, string > stringTokens;
map < string, int > intTokens;
2015-05-10 12:55:23 +02:00
SetDiscUsage(false, stringTokens, intTokens);
ClearViewElement(veDiscUsage);
DrawViewElement(veDiscUsage, &stringTokens, &intTokens);
}
2014-09-27 09:25:14 +02:00
}
bool cDisplayMenuMainView::DrawLoad(void) {
if (!ExecuteViewElement(veSystemLoad)) {
2014-09-27 09:25:14 +02:00
return false;
}
bool changed = false;
if (DetachViewElement(veSystemLoad)) {
cViewElement *viewElement = GetViewElement(veSystemLoad);
if (!viewElement) {
2015-05-10 12:55:23 +02:00
viewElement = new cViewElement(tmplView->GetViewElement(veSystemLoad), this);
viewElement->SetCallback(veSystemLoad, &cDisplayMenuMainView::SetSystemLoad);
AddViewElement(veSystemLoad, viewElement);
viewElement->Start();
changed = true;
} else {
if (!viewElement->Starting())
changed = viewElement->Render();
2014-09-27 09:25:14 +02:00
}
} else {
map < string, string > stringTokens;
map < string, int > intTokens;
2015-05-10 12:55:23 +02:00
changed = SetSystemLoad(false, stringTokens, intTokens);
if (changed) {
ClearViewElement(veSystemLoad);
DrawViewElement(veSystemLoad, &stringTokens, &intTokens);
2015-01-06 06:07:48 +01:00
}
2014-09-27 09:25:14 +02:00
}
return changed;
2014-09-27 09:25:14 +02:00
}
bool cDisplayMenuMainView::DrawMemory(void) {
if (!ExecuteViewElement(veSystemMemory)) {
return false;
}
bool changed = false;
if (DetachViewElement(veSystemMemory)) {
cViewElement *viewElement = GetViewElement(veSystemMemory);
if (!viewElement) {
2015-05-10 12:55:23 +02:00
viewElement = new cViewElement(tmplView->GetViewElement(veSystemMemory), this);
viewElement->SetCallback(veSystemMemory, &cDisplayMenuMainView::SetSystemMemory);
AddViewElement(veSystemMemory, viewElement);
viewElement->Start();
changed = true;
} else {
if (!viewElement->Starting())
changed = viewElement->Render();
}
} else {
map < string, string > stringTokens;
map < string, int > intTokens;
2015-05-10 12:55:23 +02:00
changed = SetSystemMemory(false, stringTokens, intTokens);
if (changed) {
ClearViewElement(veSystemMemory);
DrawViewElement(veSystemMemory, &stringTokens, &intTokens);
}
}
return changed;
}
bool cDisplayMenuMainView::DrawVdrStats(void) {
if (!ExecuteViewElement(veVDRStats)) {
return false;
}
bool changed = false;
if (DetachViewElement(veVDRStats)) {
cViewElement *viewElement = GetViewElement(veVDRStats);
if (!viewElement) {
viewElement = new cViewElement(tmplView->GetViewElement(veVDRStats), this);
viewElement->SetCallback(veVDRStats, &cDisplayMenuMainView::SetVDRStats);
AddViewElement(veVDRStats, viewElement);
viewElement->Start();
changed = true;
} else {
if (!viewElement->Starting())
changed = viewElement->Render();
}
} else {
map < string, string > stringTokens;
map < string, int > intTokens;
changed = SetVDRStats(false, stringTokens, intTokens);
if (changed) {
ClearViewElement(veVDRStats);
DrawViewElement(veVDRStats, &stringTokens, &intTokens);
}
}
return changed;
}
2015-01-06 06:07:48 +01:00
void cDisplayMenuMainView::DrawTemperatures(void) {
if (!ExecuteViewElement(veTemperatures)) {
2015-01-06 06:07:48 +01:00
return;
}
if (DetachViewElement(veTemperatures)) {
cViewElement *viewElement = GetViewElement(veTemperatures);
if (!viewElement) {
2015-05-10 12:55:23 +02:00
viewElement = new cViewElement(tmplView->GetViewElement(veTemperatures), this);
viewElement->SetCallback(veTemperatures, &cDisplayMenuMainView::SetSystemTemperatures);
AddViewElement(veTemperatures, viewElement);
viewElement->Start();
} else {
if (!viewElement->Starting())
viewElement->Render();
}
2015-01-06 06:07:48 +01:00
} else {
map < string, string > stringTokens;
map < string, int > intTokens;
2015-05-10 12:55:23 +02:00
bool changed = SetSystemTemperatures(false, stringTokens, intTokens);
if (changed) {
ClearViewElement(veTemperatures);
DrawViewElement(veTemperatures, &stringTokens, &intTokens);
}
2015-01-06 06:07:48 +01:00
}
}
2014-09-27 09:25:14 +02:00
bool cDisplayMenuMainView::DrawDevices(void) {
if (!ExecuteViewElement(veDevices)) {
2014-09-27 09:25:14 +02:00
return false;
}
string mode = tmplView->GetViewElementMode(veDevices);
bool light = false;
if (!mode.compare("light")) {
light = true;
}
bool changed = false;
if (DetachViewElement(veDevices)) {
cViewElement *viewElement = GetViewElement(veDevices);
if (!viewElement) {
viewElement = new cViewElementDevices(light, tmplView->GetViewElement(veDevices));
AddViewElement(veDevices, viewElement);
viewElement->Start();
changed = true;
} else {
if (!viewElement->Starting())
changed = viewElement->Render();
}
} else {
map < string, string > stringTokens;
map < string, int > intTokens;
map < string, vector< map< string, string > > > deviceLoopTokens;
vector< map< string, string > > devices;
2014-09-27 09:25:14 +02:00
changed = SetDevices(initial, light, &intTokens, &devices);
if (!changed)
return false;
2014-09-27 09:25:14 +02:00
deviceLoopTokens.insert(pair< string, vector< map< string, string > > >("devices", devices));
ClearViewElement(veDevices);
DrawViewElement(veDevices, &stringTokens, &intTokens, &deviceLoopTokens);
}
return changed;
2014-09-27 09:25:14 +02:00
}
void cDisplayMenuMainView::DrawCurrentSchedule(void) {
if (!ExecuteViewElement(veCurrentSchedule)) {
return;
}
if (DetachViewElement(veCurrentSchedule)) {
cViewElement *viewElement = GetViewElement(veCurrentSchedule);
if (!viewElement) {
viewElement = new cViewElementCurrentSchedule(tmplView->GetViewElement(veCurrentSchedule), currentRecording);
AddViewElement(veCurrentSchedule, viewElement);
viewElement->Start();
} else {
if (!viewElement->Starting())
viewElement->Render();
}
} else {
map < string, string > stringTokens;
map < string, int > intTokens;
SetCurrentSchedule(currentRecording, stringTokens, intTokens);
ClearViewElement(veCurrentSchedule);
DrawViewElement(veCurrentSchedule, &stringTokens, &intTokens);
}
}
void cDisplayMenuMainView::DrawCurrentWeather(void) {
if (!ExecuteViewElement(veCurrentWeather)) {
return;
}
if (DetachViewElement(veCurrentWeather)) {
cViewElement *viewElement = GetViewElement(veCurrentWeather);
if (!viewElement) {
2015-05-10 12:55:23 +02:00
viewElement = new cViewElement(tmplView->GetViewElement(veCurrentWeather), this);
viewElement->SetCallback(veCurrentWeather, &cDisplayMenuMainView::SetCurrentWeatherTokens);
AddViewElement(veCurrentWeather, viewElement);
viewElement->Start();
} else {
if (!viewElement->Starting())
viewElement->Render();
}
} else {
map < string, string > stringTokens;
map < string, int > intTokens;
2015-05-10 12:55:23 +02:00
ClearViewElement(veCurrentWeather);
if (!SetCurrentWeatherTokens(false, stringTokens, intTokens)){
return;
}
DrawViewElement(veCurrentWeather, &stringTokens, &intTokens);
}
}
bool cDisplayMenuMainView::DrawCustomTokens(void) {
if (!ExecuteViewElement(veCustomTokens)) {
return false;
}
if (!tmplView)
return false;
if (!initial && !tmplView->CustomTokenChange())
return false;
if (DetachViewElement(veCustomTokens)) {
cViewElement *viewElement = GetViewElement(veCustomTokens);
if (!viewElement) {
viewElement = new cViewElementCustomTokens(tmplView->GetViewElement(veCustomTokens), tmplView);
AddViewElement(veCustomTokens, viewElement);
viewElement->Start();
} else {
if (!viewElement->Starting())
viewElement->Render();
}
} else {
map < string, string > stringTokens = tmplView->GetCustomStringTokens();
map < string, int > intTokens = tmplView->GetCustomIntTokens();
ClearViewElement(veCustomTokens);
DrawViewElement(veCustomTokens, &stringTokens, &intTokens);
}
return true;
}
2014-09-27 09:25:14 +02:00
/************************************************************************
* cDisplayMenuSchedulesView
************************************************************************/
cDisplayMenuSchedulesView::cDisplayMenuSchedulesView(cTemplateView *tmplView, eMenuCategory menuCat, bool menuInit) : cDisplayMenuView(tmplView, menuInit) {
cat = menuCat;
channel = NULL;
isEpgSearchFavoritesMenu = false;
2014-09-27 09:25:14 +02:00
}
cDisplayMenuSchedulesView::~cDisplayMenuSchedulesView() {
CancelSave();
}
bool cDisplayMenuSchedulesView::DrawHeader(void) {
if (!ExecuteViewElement(veHeader)) {
2014-09-27 09:25:14 +02:00
return false;
}
map < string, string > stringTokens;
map < string, int > intTokens;
intTokens.insert(pair<string,int>("whatson", (cat == mcSchedule)&&(!isEpgSearchFavoritesMenu) ? true: false));
2014-09-27 09:25:14 +02:00
intTokens.insert(pair<string,int>("whatsonnow", (cat == mcScheduleNow) ? true: false));
intTokens.insert(pair<string,int>("whatsonnext", (cat == mcScheduleNext) ? true: false));
intTokens.insert(pair<string,int>("whatsonfavorites", isEpgSearchFavoritesMenu ? true: false));
2014-09-27 09:25:14 +02:00
stringTokens.insert(pair<string,string>("title", menuTitle));
stringTokens.insert(pair<string,string>("vdrversion", VDRVERSION));
if (channel) {
stringTokens.insert(pair<string,string>("channelnumber", *cString::sprintf("%d", channel->Number())));
stringTokens.insert(pair<string,string>("channelname", channel->Name()));
string channelID = *(channel->GetChannelID().ToString());
stringTokens.insert(pair<string,string>("channelid", channelID));
intTokens.insert(pair<string, int>("channellogoexists", imgCache->LogoExists(channelID)));
} else {
stringTokens.insert(pair<string,string>("channelnumber", ""));
stringTokens.insert(pair<string,string>("channelname", ""));
stringTokens.insert(pair<string,string>("channelid", ""));
intTokens.insert(pair<string, int>("channellogoexists", 0));
2014-09-27 09:25:14 +02:00
}
2014-10-26 08:26:44 +01:00
bool hasIcon = false;
string icon = imgCache->GetIconName(menuTitle, cat);
if (icon.size() > 0)
hasIcon = true;
stringTokens.insert(pair<string,string>("icon", icon));
intTokens.insert(pair<string,int>("hasicon", hasIcon));
2014-09-27 09:25:14 +02:00
ClearViewElement(veHeader);
DrawViewElement(veHeader, &stringTokens, &intTokens);
return true;
}