- channellist: add possibility to clear channel history

This commit is contained in:
svenhoefer
2016-05-19 16:59:56 +02:00
parent a2864a8e6d
commit ffd0e72251
5 changed files with 23 additions and 4 deletions

View File

@@ -255,6 +255,7 @@ channellist.foot_sort_freq Sortiert[freq]
channellist.foot_sort_sat Sortiert[sat] 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.keep_numbers Dauerhafte Kanalnummern channellist.keep_numbers Dauerhafte Kanalnummern
channellist.make_hdlist Erzeuge Bouquet mit HD-Kanälen channellist.make_hdlist Erzeuge Bouquet mit HD-Kanälen
channellist.make_newlist Erzeuge Bouquet mit neuen Kanälen channellist.make_newlist Erzeuge Bouquet mit neuen Kanälen

View File

@@ -255,6 +255,7 @@ channellist.foot_sort_freq sorted[freq]
channellist.foot_sort_sat sorted[sat] 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.keep_numbers Persistent channel numbers channellist.keep_numbers Persistent channel numbers
channellist.make_hdlist Create list of HD channels channellist.make_hdlist Create list of HD channels
channellist.make_newlist Create list of new channels channellist.make_newlist Create list of new channels

View File

@@ -311,6 +311,7 @@ int CChannelList::doChannelMenu(void)
bool empty = (*chanlist).empty(); bool empty = (*chanlist).empty();
bool allow_edit = (bouquet && bouquet->zapitBouquet && !bouquet->zapitBouquet->bOther && !bouquet->zapitBouquet->bWebtv); bool allow_edit = (bouquet && bouquet->zapitBouquet && !bouquet->zapitBouquet->bOther && !bouquet->zapitBouquet->bWebtv);
bool got_history = (CNeutrinoApp::getInstance()->channelList->getLastChannels().size() > 1);
int i = 0; int i = 0;
snprintf(cnt, sizeof(cnt), "%d", i); snprintf(cnt, sizeof(cnt), "%d", i);
@@ -328,6 +329,10 @@ int CChannelList::doChannelMenu(void)
snprintf(cnt, sizeof(cnt), "%d", i); snprintf(cnt, sizeof(cnt), "%d", i);
menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_RESET_ALL, reset_all, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++); menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_RESET_ALL, reset_all, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++);
menu->addItem(GenericMenuSeparator);
snprintf(cnt, sizeof(cnt), "%d", i);
menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_HISTORY_CLEAR, got_history, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++);
menu->addItem(new CMenuSeparator(CMenuSeparator::LINE)); menu->addItem(new CMenuSeparator(CMenuSeparator::LINE));
snprintf(cnt, sizeof(cnt), "%d", i); snprintf(cnt, sizeof(cnt), "%d", i);
menu->addItem(new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++); menu->addItem(new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++);
@@ -411,7 +416,14 @@ int CChannelList::doChannelMenu(void)
if(g_settings.make_new_list) if(g_settings.make_new_list)
CNeutrinoApp::getInstance()->MarkChannelsInit(); CNeutrinoApp::getInstance()->MarkChannelsInit();
break; break;
case 5: // settings case 5: // clear channel history
{
CNeutrinoApp::getInstance()->channelList->getLastChannels().clear();
printf("%s:%d lastChList cleared\n", __FUNCTION__, __LINE__);
ret = -2; // exit channellist
}
break;
case 6: // settings
{ {
previous_channellist_additional = g_settings.channellist_additional; previous_channellist_additional = g_settings.channellist_additional;
COsdSetup osd_setup; COsdSetup osd_setup;
@@ -713,10 +725,13 @@ int CChannelList::show()
if (selected + 1 < (*chanlist).size()) if (selected + 1 < (*chanlist).size())
selected++; selected++;
} }
if (ret != 0) { if (ret == -2) // exit channellist
paint(); loop = false;
else {
if (ret != 0)
paint();
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]);
} }
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]);
} }
else if (!empty && msg == (neutrino_msg_t) g_settings.key_list_start) { else if (!empty && msg == (neutrino_msg_t) g_settings.key_list_start) {
actzap = updateSelection(0); actzap = updateSelection(0);

View File

@@ -282,6 +282,7 @@ typedef enum
LOCALE_CHANNELLIST_FOOT_SORT_SAT, LOCALE_CHANNELLIST_FOOT_SORT_SAT,
LOCALE_CHANNELLIST_HEAD, LOCALE_CHANNELLIST_HEAD,
LOCALE_CHANNELLIST_HISTORY, LOCALE_CHANNELLIST_HISTORY,
LOCALE_CHANNELLIST_HISTORY_CLEAR,
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

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