channellist: simplify key_zaphistory/key_current_transponder handling

* Remove strange list of "zapable" channels while recording. Channellist
(RC_ok) has same feature ... not avalable channels are marked inactive.

* Add hint, when no zapping histoty is available to confirm user's keypress


Origin commit data
------------------
Branch: ni/coolstream
Commit: 9034fd3ea6
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-03-21 (Wed, 21 Mar 2018)

Origin message was:
------------------
- channellist: simplify key_zaphistory/key_current_transponder handling

* Remove strange list of "zapable" channels while recording. Channellist
(RC_ok) has same feature ... not avalable channels are marked inactive.

* Add hint, when no zapping histoty is available to confirm user's keypress


------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2018-03-21 00:45:21 +01:00
parent b7bbace805
commit 319dadfadc
5 changed files with 61 additions and 38 deletions

View File

@@ -292,6 +292,7 @@ channellist.foot_sort_sat Sortiert[sat]
channellist.head Alle Kanäle channellist.head Alle Kanäle
channellist.history Verlauf channellist.history Verlauf
channellist.history_clear Verlauf löschen channellist.history_clear Verlauf löschen
channellist.history_empty Kein Verlauf verfügbar
channellist.keep_numbers Dauerhafte Kanalnummern channellist.keep_numbers Dauerhafte Kanalnummern
channellist.make_hdlist Erzeuge Bouquets mit HD- und UHD-Kanälen channellist.make_hdlist Erzeuge Bouquets mit HD- und UHD-Kanälen
channellist.make_newlist Erzeuge Bouquet mit neuen Kanälen channellist.make_newlist Erzeuge Bouquet mit neuen Kanälen
@@ -1008,7 +1009,7 @@ keybindingmenu.video Video
keybindingmenu.volume Lautstärke keybindingmenu.volume Lautstärke
keybindingmenu.volumedown Leiser keybindingmenu.volumedown Leiser
keybindingmenu.volumeup Lauter keybindingmenu.volumeup Lauter
keybindingmenu.zaphistory Zapping-History Bouquet keybindingmenu.zaphistory Senderverlauf
keychooser.head Neue Taste einstellen keychooser.head Neue Taste einstellen
keychooser.text Neue Taste drücken.\nZum Abbrechen ein paar Sekunden warten ... keychooser.text Neue Taste drücken.\nZum Abbrechen ein paar Sekunden warten ...
keychoosermenu.currentkey Derzeitige Taste keychoosermenu.currentkey Derzeitige Taste

View File

@@ -292,6 +292,7 @@ channellist.foot_sort_sat Sorted[sat]
channellist.head All services channellist.head All services
channellist.history History channellist.history History
channellist.history_clear Clear history channellist.history_clear Clear history
channellist.history_empty No history available
channellist.keep_numbers Persistent channel numbers channellist.keep_numbers Persistent channel numbers
channellist.make_hdlist Create lists of HD and UHD channels channellist.make_hdlist Create lists of HD and UHD channels
channellist.make_newlist Create list of new channels channellist.make_newlist Create list of new channels
@@ -1008,7 +1009,7 @@ keybindingmenu.video Video
keybindingmenu.volume Volume keybindingmenu.volume Volume
keybindingmenu.volumedown Decrease keybindingmenu.volumedown Decrease
keybindingmenu.volumeup Increase keybindingmenu.volumeup Increase
keybindingmenu.zaphistory Zapping History Bouquet keybindingmenu.zaphistory Channel history
keychooser.head Setup new key keychooser.head Setup new key
keychooser.text Press new key.\nWait a few seconds to abort ... keychooser.text Press new key.\nWait a few seconds to abort ...
keychoosermenu.currentkey current key keychoosermenu.currentkey current key

View File

@@ -1240,40 +1240,77 @@ void CChannelList::zapToChannel(CZapitChannel *channel, bool force)
int CChannelList::numericZap(int key) int CChannelList::numericZap(int key)
{ {
int res = -1; int res = -1;
if(showEmptyError()) if (showEmptyError())
return res; 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); 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 lastChList.clear_storedelay(); // ignore store delay
int new_mode = lastChList.get_mode(channel_id); int new_mode = lastChList.get_mode(channel_id);
if(new_mode >= 0) if (new_mode >= 0)
CNeutrinoApp::getInstance()->SetChannelMode(new_mode); CNeutrinoApp::getInstance()->SetChannelMode(new_mode);
zapTo_ChannelID(channel_id); zapTo_ChannelID(channel_id);
res = 0; res = 0;
} }
return res; 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)) { // 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)
{
t_channel_id channel_id = this->lastChList.getlast(i);
if (channel_id)
{
CZapitChannel* channel = getChannel(channel_id);
if (channel)
channelList->addChannel(channel);
}
}
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 * orgList = CNeutrinoApp::getInstance()->channelList;
CChannelList * channelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_CURRENT_TP), false, true); 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; 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) for (unsigned int i = 0; i < (*orgList->chanlist).size(); i++)
{
if (((*orgList->chanlist)[i]->getChannelID() >> 16) == recid)
channelList->addChannel((*orgList->chanlist)[i]); channelList->addChannel((*orgList->chanlist)[i]);
} }
} else { if (!channelList->isEmpty())
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()); channelList->adjustToChannelID(orgList->getActiveChannel_ChannelID());
this->frameBuffer->paintBackground(); this->frameBuffer->paintBackground();
res = channelList->exec(); res = channelList->exec();
@@ -1282,26 +1319,8 @@ int CChannelList::numericZap(int key)
delete channelList; delete channelList;
return res; return res;
} }
// -- zap history bouquet, similar to "0" quickzap, but shows a menue of last channels
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) { // real numeric zap
t_channel_id channel_id = this->lastChList.getlast(i);
if(channel_id) {
CZapitChannel* channel = getChannel(channel_id);
if(channel) channelList->addChannel(channel);
}
}
if ( !channelList->isEmpty() ) {
this->frameBuffer->paintBackground();
res = channelList->exec();
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
}
delete channelList;
}
return res;
}
size_t maxchansize = MaxChanNr().size(); size_t maxchansize = MaxChanNr().size();
int fw = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getMaxDigitWidth(); int fw = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getMaxDigitWidth();
int fh = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight(); int fh = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight();

View File

@@ -319,6 +319,7 @@ typedef enum
LOCALE_CHANNELLIST_HEAD, LOCALE_CHANNELLIST_HEAD,
LOCALE_CHANNELLIST_HISTORY, LOCALE_CHANNELLIST_HISTORY,
LOCALE_CHANNELLIST_HISTORY_CLEAR, LOCALE_CHANNELLIST_HISTORY_CLEAR,
LOCALE_CHANNELLIST_HISTORY_EMPTY,
LOCALE_CHANNELLIST_KEEP_NUMBERS, LOCALE_CHANNELLIST_KEEP_NUMBERS,
LOCALE_CHANNELLIST_MAKE_HDLIST, LOCALE_CHANNELLIST_MAKE_HDLIST,
LOCALE_CHANNELLIST_MAKE_NEWLIST, LOCALE_CHANNELLIST_MAKE_NEWLIST,

View File

@@ -319,6 +319,7 @@ const char * locale_real_names[] =
"channellist.head", "channellist.head",
"channellist.history", "channellist.history",
"channellist.history_clear", "channellist.history_clear",
"channellist.history_empty",
"channellist.keep_numbers", "channellist.keep_numbers",
"channellist.make_hdlist", "channellist.make_hdlist",
"channellist.make_newlist", "channellist.make_newlist",