added {channelname}, {channelid}, {channellogoexists} for all schedules list and current views

This commit is contained in:
louis 2014-11-01 10:23:34 +01:00
parent 3d702a9ad5
commit 13817c785f
9 changed files with 33 additions and 15 deletions

View File

@ -47,5 +47,6 @@ Version 0.0.3
- changed skin metrixHD to display bitrate infos
- added "active" Token for cutting marks so that a mark can be displayed in a dedicated way if current position
in replay exactly hits the mark
- added {channelname}, {channelid}, {channellogoexists} for all schedules list and current views

View File

@ -81,17 +81,18 @@ bool cSDDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current,
return false;
if (config.blockFlush)
rootView->LockFlush();
if (Current) {
if (Channel) {
rootView->SetChannel(Channel);
} else if (Event) {
rootView->SetChannel(Channels.GetByChannelID(Event->ChannelID()));
}
const cChannel *channel = Channel;
if (!channel) {
channel = rootView->GetChannel();
}
if (!channel && Event) {
channel = Channels.GetByChannelID(Event->ChannelID());
rootView->SetChannel(channel);
}
cDisplayMenuListView *list = rootView->GetListView();
if (!list)
return false;
list->AddSchedulesMenuItem(Index, Event, Channel, TimerMatch, MenuCategory(), Current, Selectable);
list->AddSchedulesMenuItem(Index, Event, channel, TimerMatch, MenuCategory(), Current, Selectable);
if (state == vsIdle)
state = vsMenuUpdate;
return true;

View File

@ -40,8 +40,9 @@
{durationminutes} duration, rest of minutes
{current} true if item is currently selected
{separator} true if item is a list separator
{channelname} Channel Name (for what's on now and next)
{channelid} ChannelID as path to display channel logo (for what's on now and next)
{channelname} Channel Name
{channelid} ChannelID as path to display channel logo
{channellogoexists} true if a channel logo exists
{whatson} true if menu "What's on" is displayed
{whatsonnow} true if menu "What's on now" is displayed
{whatsonnext} true if menu "What's on next" is displayed
@ -124,7 +125,9 @@
{duration} duration of event
{durationhours} duration, full hours
{durationminutes} duration, rest of minutes
{channelname} Channel Name
{channelid} ChannelID as path to display channel logo
{channellogoexists} true if a channel logo exists
{hasposter} true if a scraped poster is available for this element
{posterwidth} width of scraped poster
{posterheight} height of scraped poster

View File

@ -34,8 +34,9 @@
{durationminutes} duration, rest of minutes
{current} true if item is currently selected
{separator} true if item is a list separator
{channelname} Channel Name (for what's on now and next)
{channelid} ChannelID as path to display channel logo (for what's on now and next)
{channelname} Channel Name
{channelid} ChannelID as path to display channel logo
{channellogoexists} true if a channel logo exists
{whatson} true if menu "What's on" is displayed
{whatsonnow} true if menu "What's on now" is displayed
{whatsonnext} true if menu "What's on next" is displayed
@ -65,7 +66,9 @@
{duration} duration of event
{durationhours} duration, full hours
{durationminutes} duration, rest of minutes
{channelname} Channel Name
{channelid} ChannelID as path to display channel logo
{channellogoexists} true if a channel logo exists
{hasposter} true if a scraped poster is available for this element
{posterwidth} width of scraped poster
{posterheight} height of scraped poster

View File

@ -165,7 +165,10 @@ void cDisplayMenuItemCurrentSchedulesView::Render(void) {
SetScraperPoster(event);
}
if (channel) {
stringTokens.insert(pair<string,string>("channelid", *(channel->GetChannelID().ToString())));
stringTokens.insert(pair<string,string>("channelname", channel->Name() ? channel->Name() : ""));
string channelID = *(channel->GetChannelID().ToString());
stringTokens.insert(pair<string,string>("channelid", channelID));
intTokens.insert(pair<string, int>("channellogoexists", imgCache->LogoExists(channelID)));
}
vector< map<string,string> > schedulesTokens;

View File

@ -333,13 +333,16 @@ void cDisplayMenuItemSchedulesView::SetTokens(void) {
}
if (channel) {
stringTokens.insert(pair<string,string>("channelname", channel->Name() ? channel->Name() : ""));
stringTokens.insert(pair<string,string>("channelid", *(channel->GetChannelID().ToString())));
string channelID = *(channel->GetChannelID().ToString());
stringTokens.insert(pair<string,string>("channelid", channelID));
intTokens.insert(pair<string, int>("channellogoexists", imgCache->LogoExists(channelID)));
if (!event && !selectable) {
stringTokens.insert(pair<string,string>("title", channel->Name() ? ParseSeparator(channel->Name()) : ""));
}
} else {
stringTokens.insert(pair<string,string>("channelname", ""));
stringTokens.insert(pair<string,string>("channelid", ""));
intTokens.insert(pair<string, int>("channellogoexists", 0));
}
}

View File

@ -36,6 +36,7 @@ public:
void SetMenu(eMenuCategory menuCat, bool menuInit);
void SetTitle(const char *title);
void SetChannel(const cChannel *channel) { view->SetChannel(channel); };
const cChannel *GetChannel(void) { return view->GetChannel(); };
void SetButtonTexts(const char *Red, const char *Green, const char *Yellow, const char *Blue);
void SetTabs(int tab1, int tab2, int tab3, int tab4, int tab5);
void SetMessage(eMessageType type, const char *text);

View File

@ -432,8 +432,9 @@ bool cDisplayMenuSchedulesView::DrawHeader(void) {
if (channel) {
stringTokens.insert(pair<string,string>("channelnumber", *cString::sprintf("%d", channel->Number())));
stringTokens.insert(pair<string,string>("channelname", channel->Name()));
stringTokens.insert(pair<string,string>("channelid", *(channel->GetChannelID().ToString())));
string channelID = *(channel->GetChannelID().ToString());
stringTokens.insert(pair<string,string>("channelid", channelID));
intTokens.insert(pair<string, int>("channellogoexists", imgCache->LogoExists(channelID)));
}
bool hasIcon = false;
string icon = imgCache->GetIconName(menuTitle, cat);

View File

@ -17,6 +17,7 @@ public:
void SetMenuCat(eMenuCategory newCat) { cat = newCat; };
void SetTitle(const char *title) {menuTitle = title; };
virtual void SetChannel(const cChannel *channel) {};
virtual const cChannel *GetChannel(void) { return NULL; };
void SetButtonTexts(string *buttonTexts) { this->buttonTexts = buttonTexts; };
bool DrawBackground(void);
virtual bool DrawHeader(void);
@ -51,6 +52,7 @@ public:
cDisplayMenuSchedulesView(cTemplateView *tmplView, eMenuCategory menuCat, bool menuInit);
virtual ~cDisplayMenuSchedulesView();
void SetChannel(const cChannel *channel) { this->channel = channel; };
const cChannel *GetChannel(void) { return channel; };
bool DrawHeader(void);
};