From 07d68996670b8e806b66e7dad34e7c0a37031e5d Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 27 Oct 2014 13:52:23 +0300 Subject: [PATCH] gui/miscsettings_menu.cpp: add option to enable/disable empty favorites in bouquet list Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8772d219f1e46edb8bb59acf808332a352611491 Author: [CST] Focus Date: 2014-10-27 (Mon, 27 Oct 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 2 +- src/gui/miscsettings_menu.cpp | 14 ++++++++++---- src/system/settings.h | 1 + 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 75b008a92..6bae65438 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2378,7 +2378,7 @@ void CChannelList::editMode(bool enable) channelsChanged = false; bouquet->zapitBouquet->getChannels(channels, tvmode); saveChanges(bouquet->zapitBouquet->bUser); - if ((*chanlist).empty()) + if (!g_settings.show_empty_favorites && (*chanlist).empty()) CNeutrinoApp::getInstance()->MarkChannelsInit(); } if (selected >= chanlist->size()) diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index e8dfa6485..03633f486 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -479,8 +479,9 @@ int CMiscMenue::showMiscSettingsMenuChanlist() CMenuWidget * ms_chanlist = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP_CHANNELLIST); ms_chanlist->addIntroItems(LOCALE_MISCSETTINGS_CHANNELLIST); - bool tmp1 = g_settings.make_hd_list; - bool tmp2 = g_settings.make_webtv_list; + bool make_hd_list = g_settings.make_hd_list; + bool make_webtv_list = g_settings.make_webtv_list; + bool show_empty_favorites = g_settings.show_empty_favorites; CMenuOptionChooser * mc; mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_MAKE_HDLIST , &g_settings.make_hd_list , OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); @@ -514,10 +515,15 @@ int CMiscMenue::showMiscSettingsMenuChanlist() mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_NUMERIC_ADJUST, &g_settings.channellist_numeric_adjust, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_NUMERIC_ADJUST); ms_chanlist->addItem(mc); + + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_SHOW_EMPTY_FAVS, &g_settings.show_empty_favorites, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_SHOW_EMPTY_FAVS); + ms_chanlist->addItem(mc); + int res = ms_chanlist->exec(NULL, ""); delete ms_chanlist; - if (tmp1 != g_settings.make_hd_list|| tmp2 != g_settings.make_webtv_list) - g_Zapit->reinitChannels(); + if (make_hd_list != g_settings.make_hd_list || make_webtv_list != g_settings.make_webtv_list || show_empty_favorites != g_settings.show_empty_favorites) + g_RCInput->postMsg(NeutrinoMessages::EVT_SERVICESCHANGED, 0); return res; } diff --git a/src/system/settings.h b/src/system/settings.h index 1911f7627..ab61c8e8c 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -192,6 +192,7 @@ struct SNeutrinoSettings int make_new_list; int make_removed_list; int keep_channel_numbers; + int show_empty_favorites; int avsync; int clockrec; int rounded_corners;