From 25410f69ef317b0381e88013caf4d3e50998f66e Mon Sep 17 00:00:00 2001 From: Lucian Muresan Date: Thu, 24 Apr 2014 14:16:13 +0200 Subject: [PATCH] moved epg source channel mapping menu up --- setup.cpp | 55 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/setup.cpp b/setup.cpp index 4038c8c..09115fe 100644 --- a/setup.cpp +++ b/setup.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #define CHNUMWIDTH (numdigits(Channels.MaxNumber())+1) @@ -1069,8 +1070,34 @@ void cMenuSetupXmltv2vdrChannelMap::output(void) int current=Current(); Clear(); - cOsdItem *first=NewTitle(tr("epg source channel options")); + + hasmaps=false; + cOsdItem *first=NewTitle(tr("epg source channel mappings")); Add(first,true); + for (int i=0; iNumChannelIDs(); i++) + { + cChannel *chan=Channels.GetByChannelID(lmap->ChannelIDs()[i]); + if (chan) + { + cString buffer = cString::sprintf("%-*i %s", CHNUMWIDTH, chan->Number(),chan->Name()); + Add(new cOsdItem(buffer),true); + if (!hasmaps) cm=Current(); + hasmaps=true; + } + else + { + // invalid channelid? remove from list + lmap->RemoveChannel(lmap->ChannelIDs()[i],true); + } + } + lmap->RemoveInvalidChannels(); + if (!hasmaps) + { + Add(new cOsdItem(tr("none")),true); + cm=Current(); + } + + Add(NewTitle(tr("epg source channel options")),true); Add(new cMyMenuEditBitItem(tr("type of processing"),&flags,OPT_APPEND,tr("merge"),tr("create")),true); c1=Current(); @@ -1122,35 +1149,11 @@ void cMenuSetupXmltv2vdrChannelMap::output(void) Add(new cMyMenuEditBitItem(tr(" add shorttext/title from list"),&flags,OPT_SEASON_STEXTITLE),true); } - hasmaps=false; - Add(NewTitle(tr("epg source channel mappings")),true); - for (int i=0; iNumChannelIDs(); i++) - { - cChannel *chan=Channels.GetByChannelID(lmap->ChannelIDs()[i]); - if (chan) - { - cString buffer = cString::sprintf("%-*i %s", CHNUMWIDTH, chan->Number(),chan->Name()); - Add(new cOsdItem(buffer),true); - if (!hasmaps) cm=Current(); - hasmaps=true; - } - else - { - // invalid channelid? remove from list - lmap->RemoveChannel(lmap->ChannelIDs()[i],true); - } - } - lmap->RemoveInvalidChannels(); - if (!hasmaps) - { - Add(new cOsdItem(tr("none")),true); - cm=Current(); - } - if (current==-1) { SetCurrent(first); CursorDown(); + cRemote::Put(kUp); // this also refreshes the coloured buttons properly } else { -- 1.9.1