From 7961b56a6979e3c63a3c1625e82a772b8347d1aa Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 9 Dec 2021 23:35:50 +0100 Subject: [PATCH] - keybind-setup: fix/introduce g_settings.bouquetlist_mode --- data/y-web/Y_Settings_buttons.yhtm | 5 ++--- src/gui/keybind_setup.cpp | 11 +++++++++-- src/neutrino.cpp | 31 +++++++++++++++++++++++++----- src/system/settings.h | 6 ++++++ version_pseudo.h | 2 +- 5 files changed, 44 insertions(+), 11 deletions(-) diff --git a/data/y-web/Y_Settings_buttons.yhtm b/data/y-web/Y_Settings_buttons.yhtm index a9e0f8962..bb3b7fb43 100644 --- a/data/y-web/Y_Settings_buttons.yhtm +++ b/data/y-web/Y_Settings_buttons.yhtm @@ -232,9 +232,8 @@ function do_submit()  OK-Taste für diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index 5552f3ff2..f6014c800 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -146,6 +146,13 @@ int CKeybindSetup::exec(CMenuTarget *parent, const std::string &actionKey) return res; } +#define KEYBINDINGMENU_BOUQUETHANDLING_OPTION_COUNT 2 +const CMenuOptionChooser::keyval KEYBINDINGMENU_BOUQUETHANDLING_OPTIONS[KEYBINDINGMENU_BOUQUETHANDLING_OPTION_COUNT] = +{ + { SNeutrinoSettings::CHANNELLIST, LOCALE_KEYBINDINGMENU_CHANNELLIST }, + { SNeutrinoSettings::FAVORITES, LOCALE_KEYBINDINGMENU_FAVORITES } +}; + #define KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTION_COUNT 3 const CMenuOptionChooser::keyval KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTIONS[KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTION_COUNT] = { @@ -500,10 +507,10 @@ void CKeybindSetup::showKeyBindModeSetup(CMenuWidget *bindSettings_modes) void CKeybindSetup::showKeyBindChannellistSetup(CMenuWidget *bindSettings_chlist) { bindSettings_chlist->addIntroItems(LOCALE_KEYBINDINGMENU_CHANNELLIST); -#if 0 + CMenuOptionChooser *oj = new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_BOUQUETHANDLING, &g_settings.bouquetlist_mode, KEYBINDINGMENU_BOUQUETHANDLING_OPTIONS, KEYBINDINGMENU_BOUQUETHANDLING_OPTION_COUNT, true); bindSettings_chlist->addItem(oj); -#endif + for (int i = NKEY_LIST_START; i <= NKEY_CURRENT_TRANSPONDER; i++) { CMenuForwarder *mf = new CMenuForwarder(key_settings[i].keydescription, true, keychooser[i]->getKeyName(), keychooser[i]); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 7817a8ceb..7a309bc34 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1619,6 +1619,11 @@ void CNeutrinoApp::upgradeSetup(const char * fname) configfile.setString("usermenu_tv_yellow", g_settings.usermenu[SNeutrinoSettings::BUTTON_YELLOW]->items); } } + if (g_settings.version_pseudo < "20211209230000") + { + g_settings.bouquetlist_mode = SNeutrinoSettings::CHANNELLIST; + } + g_settings.version_pseudo = NEUTRINO_VERSION_PSEUDO; configfile.setString("version_pseudo", g_settings.version_pseudo); @@ -3858,10 +3863,26 @@ int CNeutrinoApp::showChannelList(const neutrino_msg_t _msg, bool from_menu) if(msg == CRCInput::RC_ok) { - if( !bouquetList->Bouquets.empty() && bouquetList->Bouquets[old_b]->channelList->getSize() > 0) - nNewChannel = bouquetList->Bouquets[old_b]->channelList->exec();//with ZAP! - else - nNewChannel = bouquetList->exec(true); + switch (g_settings.bouquetlist_mode) + { + case SNeutrinoSettings::FAVORITES: + { + SetChannelMode(LIST_MODE_FAV); + if (bouquetList->Bouquets.empty()) + SetChannelMode(LIST_MODE_PROV); + nNewChannel = bouquetList->exec(true); + break; + } + case SNeutrinoSettings::CHANNELLIST: + default: + { + if( !bouquetList->Bouquets.empty() && bouquetList->Bouquets[old_b]->channelList->getSize() > 0) + nNewChannel = bouquetList->Bouquets[old_b]->channelList->exec();//with ZAP! + else + nNewChannel = bouquetList->exec(true); + break; + } + } } else if(msg == CRCInput::RC_sat) { SetChannelMode(LIST_MODE_SAT); nNewChannel = bouquetList->exec(true); @@ -5942,7 +5963,7 @@ void CNeutrinoApp::loadKeys(const char *fname) g_settings.mpkey_time = tconfig->getInt32("mpkey.time", CRCInput::RC_timeshift); // key options - g_settings.bouquetlist_mode = tconfig->getInt32("bouquetlist_mode", 1); + g_settings.bouquetlist_mode = tconfig->getInt32("bouquetlist_mode", SNeutrinoSettings::CHANNELLIST); g_settings.menu_left_exit = tconfig->getInt32("menu_left_exit", 0); g_settings.repeat_blocker = tconfig->getInt32("repeat_blocker", 450); g_settings.repeat_genericblocker = tconfig->getInt32("repeat_genericblocker", 100); diff --git a/src/system/settings.h b/src/system/settings.h index a1b6abdd2..8fa2de9ef 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -1268,6 +1268,12 @@ struct SNeutrinoSettings INFOBAR = 3 }; + enum BOUQUETHANDLING_SETTINGS + { + CHANNELLIST = 0, + FAVORITES = 2 + }; + int mode_left_right_key_tv; }; diff --git a/version_pseudo.h b/version_pseudo.h index 2850fa16b..b92c2cb27 100644 --- a/version_pseudo.h +++ b/version_pseudo.h @@ -1 +1 @@ -#define NEUTRINO_VERSION_PSEUDO "20210801210000" +#define NEUTRINO_VERSION_PSEUDO "20211209230000"