gui/channellist.cpp: add menu option to reset all 'new' channels

This commit is contained in:
[CST] Focus
2013-09-25 15:15:31 +04:00
parent ba4298b119
commit 8d52885a5e
4 changed files with 14 additions and 1 deletions

View File

@@ -233,6 +233,7 @@ channellist.nonefound No channels were found!\nPlease execute a scan\n(MENU-key
channellist.numeric_adjust Numeric zap adjust channellist.numeric_adjust Numeric zap adjust
channellist.provs Providers channellist.provs Providers
channellist.recording_not_possible Recording not possible! channellist.recording_not_possible Recording not possible!
channellist.reset_all Reset 'new' flag for all channels
channellist.reset_flags Reset 'new' channel flag channellist.reset_flags Reset 'new' channel flag
channellist.sats Satellites channellist.sats Satellites
channellist.since since channellist.since since

View File

@@ -367,6 +367,9 @@ int CChannelList::doChannelMenu(void)
bool reset_enabled = chanlist[selected]->flags & CZapitChannel::NEW; bool reset_enabled = chanlist[selected]->flags & CZapitChannel::NEW;
menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_RESET_FLAGS, reset_enabled, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++); menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_RESET_FLAGS, reset_enabled, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++);
snprintf(cnt, sizeof(cnt), "%d", i); snprintf(cnt, sizeof(cnt), "%d", i);
bool reset_all = (name == g_Locale->getText(LOCALE_BOUQUETNAME_NEW));
menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_RESET_ALL, reset_all, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++);
snprintf(cnt, sizeof(cnt), "%d", i);
menu->addItem(new CMenuSeparator(CMenuSeparator::LINE)); menu->addItem(new CMenuSeparator(CMenuSeparator::LINE));
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++);
menu->exec(NULL, ""); menu->exec(NULL, "");
@@ -478,7 +481,14 @@ int CChannelList::doChannelMenu(void)
if(g_settings.make_new_list) if(g_settings.make_new_list)
return 2; return 2;
break; break;
case 5: // settings case 5: // reset all new
for (unsigned int j = 0 ; j < chanlist.size(); j++) {
chanlist[j]->flags &= ~CZapitChannel::NEW;
}
if (g_settings.make_new_list)
return 2;
break;
case 6: // settings
{ {
previous_channellist_additional = g_settings.channellist_additional; previous_channellist_additional = g_settings.channellist_additional;
COsdSetup osd_setup; COsdSetup osd_setup;

View File

@@ -260,6 +260,7 @@ typedef enum
LOCALE_CHANNELLIST_NUMERIC_ADJUST, LOCALE_CHANNELLIST_NUMERIC_ADJUST,
LOCALE_CHANNELLIST_PROVS, LOCALE_CHANNELLIST_PROVS,
LOCALE_CHANNELLIST_RECORDING_NOT_POSSIBLE, LOCALE_CHANNELLIST_RECORDING_NOT_POSSIBLE,
LOCALE_CHANNELLIST_RESET_ALL,
LOCALE_CHANNELLIST_RESET_FLAGS, LOCALE_CHANNELLIST_RESET_FLAGS,
LOCALE_CHANNELLIST_SATS, LOCALE_CHANNELLIST_SATS,
LOCALE_CHANNELLIST_SINCE, LOCALE_CHANNELLIST_SINCE,

View File

@@ -260,6 +260,7 @@ const char * locale_real_names[] =
"channellist.numeric_adjust", "channellist.numeric_adjust",
"channellist.provs", "channellist.provs",
"channellist.recording_not_possible", "channellist.recording_not_possible",
"channellist.reset_all",
"channellist.reset_flags", "channellist.reset_flags",
"channellist.sats", "channellist.sats",
"channellist.since", "channellist.since",