diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 1f1f81cef..cb49826c4 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -259,6 +259,7 @@ channellist.foot_sort_sat Sortiert[sat] channellist.head Alle Kanäle channellist.history Verlauf channellist.history_clear Verlauf löschen +channellist.history_empty Kein Verlauf verfügbar channellist.keep_numbers Dauerhafte Kanalnummern channellist.make_hdlist Erzeuge Bouquets mit HD- und UHD-Kanälen channellist.make_newlist Erzeuge Bouquet mit neuen Kanälen @@ -871,7 +872,7 @@ keybindingmenu.video Video keybindingmenu.volume Lautstärke keybindingmenu.volumedown Leiser keybindingmenu.volumeup Lauter -keybindingmenu.zaphistory Zapping-History Bouquet +keybindingmenu.zaphistory Senderverlauf keychooser.head Neue Taste einstellen keychooser.text Neue Taste drücken.\nZum Abbrechen ein paar Sekunden warten ... keychoosermenu.currentkey Derzeitige Taste diff --git a/data/locale/english.locale b/data/locale/english.locale index f9f34be7a..d22cb90b8 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -258,8 +258,9 @@ channellist.foot_sort_freq Sorted[Freq] channellist.foot_sort_sat Sorted[Sat] channellist.head All Services channellist.history History -channellist.history_clear Clear History -channellist.keep_numbers Persistent Channel Numbers +channellist.history_clear Clear history +channellist.history_empty No history available +channellist.keep_numbers Persistent channel numbers channellist.make_hdlist Create lists of HD and UHD channels channellist.make_newlist Create list of new channels channellist.make_removedlist Create list of removed channels @@ -871,7 +872,7 @@ keybindingmenu.video Video keybindingmenu.volume Volume keybindingmenu.volumedown Decrease keybindingmenu.volumeup Increase -keybindingmenu.zaphistory Zapping History Bouquet +keybindingmenu.zaphistory Channel history keychooser.head Setup new key keychooser.text Press new key.\nWait a few seconds to abort ... keychoosermenu.currentkey current key diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 2ee71ea1a..672088482 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1223,68 +1223,87 @@ void CChannelList::zapToChannel(CZapitChannel *channel, bool force) int CChannelList::numericZap(int key) { int res = -1; - if(showEmptyError()) + if (showEmptyError()) return res; - // -- quickzap "0" to last seen channel... - if (key == g_settings.key_lastchannel) { + /* + 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)) { + if (channel_id && SameTP(channel_id)) + { lastChList.clear_storedelay(); // ignore store delay int new_mode = lastChList.get_mode(channel_id); - if(new_mode >= 0) + if (new_mode >= 0) CNeutrinoApp::getInstance()->SetChannelMode(new_mode); zapTo_ChannelID(channel_id); res = 0; } return res; } - if ((key == g_settings.key_zaphistory) || (key == g_settings.key_current_transponder)) { - if((!autoshift && CNeutrinoApp::getInstance()->recordingstatus) || (key == g_settings.key_current_transponder)) { - CChannelList * orgList = CNeutrinoApp::getInstance()->channelList; - CChannelList * channelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_CURRENT_TP), false, true); - if(key == g_settings.key_current_transponder) { - t_channel_id recid = (*chanlist)[selected]->getChannelID() >> 16; - for ( unsigned int i = 0 ; i < (*orgList->chanlist).size(); i++) { - if(((*orgList->chanlist)[i]->getChannelID() >> 16) == recid) - channelList->addChannel((*orgList->chanlist)[i]); - } - } else { - for ( unsigned int i = 0 ; i < (*orgList->chanlist).size(); i++) { - if(SameTP((*orgList->chanlist)[i])) - channelList->addChannel((*orgList->chanlist)[i]); - } - } - if ( !channelList->isEmpty()) { - channelList->adjustToChannelID(orgList->getActiveChannel_ChannelID()); - this->frameBuffer->paintBackground(); - res = channelList->exec(); - CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); - } - delete channelList; - return res; - } - // -- zap history bouquet, similar to "0" quickzap, but shows a menue of last channels - if (this->lastChList.size() > 1) { + // zap history bouquet + if (key == g_settings.key_zaphistory) + { + if (this->lastChList.size() > 1) + { CChannelList * channelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HISTORY), true, true); - for(unsigned int i = 1; i < this->lastChList.size() ; ++i) { + for (unsigned int i = 1; i < this->lastChList.size(); ++i) + { t_channel_id channel_id = this->lastChList.getlast(i); - if(channel_id) { + if (channel_id) + { CZapitChannel* channel = getChannel(channel_id); - if(channel) channelList->addChannel(channel); + if (channel) + channelList->addChannel(channel); } } - if ( !channelList->isEmpty() ) { + if (!channelList->isEmpty()) + { this->frameBuffer->paintBackground(); res = channelList->exec(); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); } delete channelList; } + else + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_CHANNELLIST_HISTORY_EMPTY); + return res; } + + // current transponder bouquet + if (key == g_settings.key_current_transponder) + { + CChannelList * orgList = CNeutrinoApp::getInstance()->channelList; + CChannelList * channelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_CURRENT_TP), false, true); + t_channel_id recid = (*chanlist)[selected]->getChannelID() >> 16; + + for (unsigned int i = 0; i < (*orgList->chanlist).size(); i++) + { + if (((*orgList->chanlist)[i]->getChannelID() >> 16) == recid) + channelList->addChannel((*orgList->chanlist)[i]); + } + if (!channelList->isEmpty()) + { + channelList->adjustToChannelID(orgList->getActiveChannel_ChannelID()); + this->frameBuffer->paintBackground(); + res = channelList->exec(); + CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); + } + delete channelList; + return res; + } + + // real 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/system/locals.h b/src/system/locals.h index fcce9298c..2cd7b3a6b 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -286,6 +286,7 @@ typedef enum LOCALE_CHANNELLIST_HEAD, LOCALE_CHANNELLIST_HISTORY, LOCALE_CHANNELLIST_HISTORY_CLEAR, + LOCALE_CHANNELLIST_HISTORY_EMPTY, LOCALE_CHANNELLIST_KEEP_NUMBERS, LOCALE_CHANNELLIST_MAKE_HDLIST, LOCALE_CHANNELLIST_MAKE_NEWLIST, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index aa44655be..cc9a8ea84 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -286,6 +286,7 @@ const char * locale_real_names[] = "channellist.head", "channellist.history", "channellist.history_clear", + "channellist.history_empty", "channellist.keep_numbers", "channellist.make_hdlist", "channellist.make_newlist",