From 52fc28969b3abebc87e3ba3593658ac78a55bb5d Mon Sep 17 00:00:00 2001 From: BPanther Date: Sat, 18 Jan 2020 23:06:12 +0100 Subject: [PATCH] move ci ignore_messages to each slot menu (but still only valid for slot 0) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/471ec598b734a438e403261f3bc89254ac813e10 Author: BPanther Date: 2020-01-18 (Sat, 18 Jan 2020) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/cam_menu.cpp | 8 +++++--- src/neutrino.cpp | 10 ++++++++-- src/system/settings.h | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index 4f68f9ba7..b2188c4a9 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -163,7 +163,6 @@ int CCAMMenuHandler::doMainMenu() #endif cammenu->addItem(new CMenuOptionChooser(LOCALE_CI_RESET_STANDBY, &g_settings.ci_standby_reset, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); } - cammenu->addItem(new CMenuOptionChooser(LOCALE_CI_IGNORE_MSG, &g_settings.ci_ignore_messages, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); cammenu->addItem(new CMenuOptionChooser(LOCALE_CI_SAVE_PINCODE, &g_settings.ci_save_pincode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); #if HAVE_LIBSTB_HAL cammenu->addItem(new CMenuOptionChooser(LOCALE_CI_CHECK_LIVE_SLOT, &g_settings.ci_check_live, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); @@ -222,6 +221,7 @@ if (i == 0) { // only for slot 0 valid - fix later cammenu->addItem(new CMenuOptionNumberChooser(LOCALE_CI_CLOCK, &g_settings.ci_clock[i], true, 6, 12, this)); #endif cammenu->addItem(new CMenuOptionChooser(LOCALE_CI_RPR, &g_settings.ci_rpr[i], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); + cammenu->addItem(new CMenuOptionChooser(LOCALE_CI_IGNORE_MSG, &g_settings.ci_ignore_messages[i], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); } } else { snprintf(str1, sizeof(str1), "%s %d", g_Locale->getText(LOCALE_CI_EMPTY), i); @@ -342,7 +342,9 @@ int CCAMMenuHandler::handleCamMsg(const neutrino_msg_t msg, neutrino_msg_data_t printf("CCAMMenuHandler::handleCamMsg: CA msg %x from %s\n", MsgId, from_menu ? "menu" : "neutrino"); - if (g_settings.ci_ignore_messages && !from_menu) + if (g_settings.ci_ignore_messages[curslot] && !from_menu && MsgId != CA_MESSAGE_MSG_MMI_REQ_INPUT + && MsgId != CA_MESSAGE_MSG_MMI_CLOSE && MsgId != CA_MESSAGE_MSG_INIT_OK + && MsgId != CA_MESSAGE_MSG_INSERTED && MsgId != CA_MESSAGE_MSG_REMOVED) return 1; hideHintBox(); @@ -630,7 +632,7 @@ bool CCAMMenuHandler::changeNotify(const neutrino_locale_t OptionName, void * Da else #endif if (ARE_LOCALES_EQUAL(OptionName, LOCALE_CI_CLOCK)) { - printf("CCAMMenuHandler::changeNotify: ci_clock[%s] %d\n", CISlot, g_settings.ci_clock[CISlot]); + printf("CCAMMenuHandler::changeNotify: ci_clock[%d] %d\n", CISlot, g_settings.ci_clock[CISlot]); ca->SetTSClock(g_settings.ci_clock[CISlot] * 1000000); return true; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index c288dc7eb..8774ff299 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -502,7 +502,10 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.ci_rpr[i] = configfile.getInt32(cfg_key, 9); } #endif - g_settings.ci_ignore_messages = configfile.getInt32("ci_ignore_messages", 0); // TODO: for each slot + for (int i = 0; i < cCA::GetInstance()->GetNumberCISlots(); i++) { + sprintf(cfg_key, "ci_ignore_messages_%d", i); + g_settings.ci_ignore_messages[i] = configfile.getInt32(cfg_key, 0); + } g_settings.ci_save_pincode = configfile.getInt32("ci_save_pincode", 0); // TODO: for each slot g_settings.ci_check_live = configfile.getInt32("ci_check_live", 0); g_settings.ci_pincode = configfile.getString("ci_pincode", ""); // TODO: for each slot @@ -1502,7 +1505,10 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32(cfg_key, g_settings.ci_rpr[i]); } #endif - configfile.setInt32("ci_ignore_messages", g_settings.ci_ignore_messages); // TODO: for each slot + for (int i = 0; i < cCA::GetInstance()->GetNumberCISlots(); i++) { + sprintf(cfg_key, "ci_ignore_messages_%d", i); + configfile.setInt32(cfg_key, g_settings.ci_ignore_messages[i]); + } configfile.setInt32("ci_save_pincode", g_settings.ci_save_pincode); // TODO: for each slot configfile.setInt32("ci_check_live", g_settings.ci_check_live); configfile.setString("ci_pincode", g_settings.ci_pincode); // TODO: for each slot diff --git a/src/system/settings.h b/src/system/settings.h index f23048d36..4edd09a0b 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -290,7 +290,7 @@ struct SNeutrinoSettings int ci_delay; int ci_rpr[4]; #endif - int ci_ignore_messages; // TODO: for each slot + int ci_ignore_messages[4]; int ci_save_pincode; // TODO: for each slot int ci_check_live; int ci_tuner;