From 0d3d142017fd98f85adec5dc4d2dfe39bbf53f19 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 22 Mar 2018 00:09:41 +0100 Subject: [PATCH] channellist: move zaphistory/current_transponder handling into sepatate function Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8dbd41921adbaefeafdfba8b0eaeb7fce0988996 Author: vanhofen Date: 2018-03-22 (Thu, 22 Mar 2018) Origin message was: ------------------ - channellist: move zaphistory/current_transponder handling into sepatate function ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 54 +++++++++++++++++++++-------------------- src/gui/channellist.h | 1 + src/neutrino.cpp | 14 +++-------- 3 files changed, 33 insertions(+), 36 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 47cc621ce..52df47691 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1237,36 +1237,12 @@ void CChannelList::zapToChannel(CZapitChannel *channel, bool force) } } -/* Called only from "all" channel list */ -int CChannelList::numericZap(int key) +int CChannelList::showLiveBouquet(int key) { int res = -1; if (showEmptyError()) return res; - /* - TODO? - Move handling of key_zaphistory and key_current_transponder - into sepatate functions? - These keys do not zap numeric. Pseudo bouquets are shown. - */ - - // quickzap "0" to last seen channel - if (key == g_settings.key_lastchannel) - { - t_channel_id channel_id = lastChList.getlast(1); - if (channel_id && SameTP(channel_id)) - { - lastChList.clear_storedelay(); // ignore store delay - int new_mode = lastChList.get_mode(channel_id); - if (new_mode >= 0) - CNeutrinoApp::getInstance()->SetChannelMode(new_mode); - zapTo_ChannelID(channel_id); - res = 0; - } - return res; - } - // zap history bouquet if (key == g_settings.key_zaphistory) { @@ -1323,7 +1299,33 @@ int CChannelList::numericZap(int key) return res; } - // real numeric zap + return res; +} + +/* Called only from "all" channel list */ +int CChannelList::numericZap(int key) +{ + int res = -1; + if (showEmptyError()) + return res; + + // quickzap "0" to last seen channel + if (key == g_settings.key_lastchannel) + { + t_channel_id channel_id = lastChList.getlast(1); + if (channel_id && SameTP(channel_id)) + { + lastChList.clear_storedelay(); // ignore store delay + int new_mode = lastChList.get_mode(channel_id); + if (new_mode >= 0) + CNeutrinoApp::getInstance()->SetChannelMode(new_mode); + zapTo_ChannelID(channel_id); + res = 0; + } + return res; + } + + // numeric zap size_t maxchansize = MaxChanNr().size(); int fw = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getMaxDigitWidth(); int fh = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight(); diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 2c00d801e..8fd0da040 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -214,6 +214,7 @@ public: bool adjustToChannelID(const t_channel_id channel_id); bool showInfo(int pos, int epgpos = 0); void updateEvents(unsigned int from, unsigned int to); + int showLiveBouquet(int key); int numericZap(int key); int show(); int exec(); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 2be6c10b4..1343e492f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2708,7 +2708,7 @@ void CNeutrinoApp::quickZap(int msg) else ret = channelList->quickZap(msg); if (!ret) { - res = channelList->numericZap(g_settings.key_zaphistory); + res = channelList->showLiveBouquet(g_settings.key_zaphistory); StartSubtitles(res < 0); } } @@ -2924,12 +2924,7 @@ void CNeutrinoApp::RealRun() if (g_settings.mode_icons && g_settings.mode_icons_skin == INFOICONS_POPUP) InfoIcons->hideIcons(); } - - InfoClock->enableInfoClock(false); - InfoIcons->enableInfoIcons(false); //NI InfoIcons - numericZap(msg); - InfoClock->enableInfoClock(true); - InfoIcons->enableInfoIcons(true); //NI InfoIcons + showChannelList(msg); } #ifdef SCREENSHOT else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { @@ -3042,8 +3037,7 @@ void CNeutrinoApp::RealRun() StartSubtitles(); } else if (CRCInput::isNumeric(msg)) { - numericZap( msg ); - + numericZap(msg); } /* FIXME ??? */ else if (CRCInput::isNumeric(msg) && g_RemoteControl->director_mode ) { @@ -3181,7 +3175,7 @@ int CNeutrinoApp::showChannelList(const neutrino_msg_t _msg, bool from_menu) SetChannelMode(LIST_MODE_PROV); nNewChannel = bouquetList->exec(true); } else if (msg == (neutrino_msg_t) g_settings.key_zaphistory || msg == (neutrino_msg_t) g_settings.key_current_transponder) { - channelList->numericZap(msg); + channelList->showLiveBouquet(msg); } _repeat: printf("CNeutrinoApp::showChannelList: nNewChannel %d\n", nNewChannel);fflush(stdout);