From edf89c5538613aa7c7286eea34faa4283087149c Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 23 Jul 2018 19:48:47 +0200 Subject: [PATCH] - epgplus: move CEPGplusHandler::exec() code to end of file; ... * really minor code changes in CEPGDataHandler::exec() and CEventListHandler::exec() No binary changes, just code cosmetic. Signed-off-by: Thilo Graf --- src/gui/epgplus.cpp | 63 +++++++++++++++++++++---------------------- src/gui/epgview.cpp | 3 +-- src/gui/epgview.h | 4 +-- src/gui/eventlist.cpp | 5 +++- src/gui/eventlist.h | 2 +- 5 files changed, 38 insertions(+), 39 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 7976e5c7f..85c566958 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -1459,38 +1459,6 @@ void EpgPlus::paint() paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page, CC_SHADOW_RIGHT_CORNER_ALL); } -// -- EPG+ Menue Handler Class -// -- to be used for calls from Menue -// -- (2004-03-05 rasc) - -int CEPGplusHandler::exec(CMenuTarget * parent, const std::string & /*actionKey*/) -{ - int res = menu_return::RETURN_EXIT_ALL; - EpgPlus *e; - CChannelList *channelList; - - if (parent) - parent->hide(); - - e = new EpgPlus; - - //channelList = CNeutrinoApp::getInstance()->channelList; - int bnum = bouquetList->getActiveBouquetNumber(); - current_bouquet = bnum; - if (!bouquetList->Bouquets.empty() && !bouquetList->Bouquets[bnum]->channelList->isEmpty()) - channelList = bouquetList->Bouquets[bnum]->channelList; - else - channelList = CNeutrinoApp::getInstance()->channelList; - - e->exec(channelList, channelList->getSelectedChannelIndex(), bouquetList); - delete e; - // FIXME - //printf("CEPGplusHandler::exec old bouquet %d new %d current %d\n", bnum, bouquetList->getActiveBouquetNumber(), current_bouquet); - bouquetList->activateBouquet(current_bouquet, false); - - return res; -} - EpgPlus::MenuTargetAddReminder::MenuTargetAddReminder(EpgPlus * pepgPlus) { this->epgPlus = pepgPlus; @@ -1655,3 +1623,34 @@ int EpgPlus::MenuOptionChooserSwitchViewMode::exec(CMenuTarget * parent) return menu_return::RETURN_REPAINT; } + +// -- EPG+ Menu Handler Class +// -- to be used for calls from Menu + +int CEPGplusHandler::exec(CMenuTarget * parent, const std::string & /*actionKey*/) +{ + int res = menu_return::RETURN_EXIT_ALL; + EpgPlus *e; + CChannelList *channelList; + + if (parent) + parent->hide(); + + e = new EpgPlus; + + //channelList = CNeutrinoApp::getInstance()->channelList; + int bnum = bouquetList->getActiveBouquetNumber(); + current_bouquet = bnum; + if (!bouquetList->Bouquets.empty() && !bouquetList->Bouquets[bnum]->channelList->isEmpty()) + channelList = bouquetList->Bouquets[bnum]->channelList; + else + channelList = CNeutrinoApp::getInstance()->channelList; + + e->exec(channelList, channelList->getSelectedChannelIndex(), bouquetList); + delete e; + // FIXME + //printf("CEPGplusHandler::exec old bouquet %d new %d current %d\n", bnum, bouquetList->getActiveBouquetNumber(), current_bouquet); + bouquetList->activateBouquet(current_bouquet, false); + + return res; +} diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index c37110421..605f155e8 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1697,8 +1697,7 @@ void CEpgData::ResetModules() } // -- EPG Data Viewer Menu Handler Class -// -- to be used for calls from Menue -// -- (2004-03-06 rasc) +// -- to be used for calls from Menu int CEPGDataHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/) { diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 876fbd794..b9720d3f8 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -119,12 +119,10 @@ class CEpgData void ResetModules(); }; - - class CEPGDataHandler : public CMenuTarget { public: - int exec( CMenuTarget* parent, const std::string &actionkey); + int exec(CMenuTarget* parent, const std::string &actionkey); }; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 2fbc87225..bb0c480b3 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -1064,6 +1064,9 @@ void CEventList::paintFoot(t_channel_id channel_id) footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, full_width, footer_height, btn_cnt, buttons); } +// -- Eventlist Menu Handler Class +// -- to be used for calls from Menu + int CEventListHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/) { int res = menu_return::RETURN_EXIT_ALL; @@ -1072,7 +1075,7 @@ int CEventListHandler::exec(CMenuTarget* parent, const std::string &/*actionkey* parent->hide(); CEventList *e = new CEventList; - CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; + CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; e->exec(CZapit::getInstance()->GetCurrentChannelID(), channelList->getActiveChannelName()); delete e; diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 46cc510c8..499d07d15 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -133,7 +133,7 @@ class CEventList : public CListHelpers class CEventListHandler : public CMenuTarget { public: - int exec( CMenuTarget* parent, const std::string &actionkey); + int exec(CMenuTarget* parent, const std::string &actionkey); }; class CEventFinderMenu : public CMenuTarget, CChangeObserver