From 24204cb38630a8973bc50332fc4a19bcb40e23b4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 28 Aug 2022 21:16:24 +0200 Subject: [PATCH] scan-setup: add addScanMenuFrontendOptions() only once Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/cdac7400845793bde5d12820aee9656bc8a0c8b3 Author: vanhofen Date: 2022-08-28 (Sun, 28 Aug 2022) Origin message was: ------------------ - scan-setup: add addScanMenuFrontendOptions() only once --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/scan_setup.cpp | 36 +++++++++++++++++++++--------------- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 0ff686a45..bf107031f 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2936,6 +2936,7 @@ tunersetup.mode Betriebsmodus tunersetup.power 5V-Versorgung bei DVB-T/T2 Kanälen tunersetup.sat Satellit (DVB-S/S2) tunersetup.terr Terrestrisch (DVB-T/T2) +tunersetup.tunersetup Tunereinstellungen unicable.lnb Unicable Eingang unicable.pin Unicable PIN unicable.pin_hint PIN (1 - 255) für Benutzerfrequenz\n0 bedeutet inaktiv / aus diff --git a/data/locale/english.locale b/data/locale/english.locale index da56d4cd0..dd5ddf5e8 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2936,6 +2936,7 @@ tunersetup.mode Operation mode tunersetup.power 5V supply on DVB-T/T2 channels tunersetup.sat Satellite (DVB-S/S2) tunersetup.terr Terrestrial (DVB-T/T2) +tunersetup.tunersetup Tuner setup unicable.lnb Unicable Input unicable.pin Unicable PIN unicable.pin_hint PIN (1 - 255) for user frequency\n0 means inactive / off diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 86fd73ceb..33a81557d 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -608,7 +608,7 @@ int CScanSetup::showScanMenu() //back settings->addIntroItems(/*is_wizard ? NONEXISTANT_LOCALE : */ LOCALE_SERVICEMENU_SCANTS); - //---------------------------------------------------------------------- + #if 0 //save scan settings mf = new CMenuForwarder(LOCALE_MAINSETTINGS_SAVESETTINGSNOW, true, NULL, this, "save_scansettings", CRCInput::RC_red); @@ -618,7 +618,7 @@ int CScanSetup::showScanMenu() settings->addItem(GenericMenuSeparatorLine); //---------------------------------------------------------------------- #endif - //sat/provider selector + #if 0 if(CFEManager::getInstance()->haveSat() || CFEManager::getInstance()->getFrontendCount() > 1) { mf = new CMenuForwarder(LOCALE_SATSETUP_FE_TUNER, allow_start, NULL, this, "setup_frontend", CRCInput::convertDigitToKey(shortcut++)); @@ -626,6 +626,8 @@ int CScanSetup::showScanMenu() settings->addItem(mf); } #endif + + //sat/provider selector if (CFEManager::getInstance()->haveSat()) { r_system = ALL_SAT; @@ -647,7 +649,7 @@ int CScanSetup::showScanMenu() //auto scan all CMenuWidget * autoScanAll = new CMenuWidget(LOCALE_SATSETUP_AUTO_SCAN_ALL, NEUTRINO_ICON_SETTINGS, w/*width*/, MN_WIDGET_ID_SCAN_AUTO_SCAN_ALL); addScanMenuAutoScanAll(autoScanAll); - fautoScanAll = new CMenuDForwarder(LOCALE_SATSETUP_AUTO_SCAN_ALL, true /*(dmode != NO_DISEQC)*/, NULL, autoScanAll, "", CRCInput::RC_blue); + fautoScanAll = new CMenuDForwarder(LOCALE_SATSETUP_AUTO_SCAN_ALL, true /*(dmode != NO_DISEQC)*/, NULL, autoScanAll, "", CRCInput::RC_green); fautoScanAll->setHint("", LOCALE_MENU_HINT_SCAN_AUTOALL); settings->addItem(fautoScanAll); @@ -657,32 +659,31 @@ int CScanSetup::showScanMenu() mf = new CMenuDForwarder(LOCALE_SATSETUP_MANUAL_SCAN, true, NULL, manualScan, "", CRCInput::RC_yellow); mf->setHint("", LOCALE_MENU_HINT_SCAN_MANUAL); settings->addItem(mf); + #ifdef ENABLE_FASTSCAN //fast scan CMenuWidget * fastScanMenu = new CMenuWidget(LOCALE_SATSETUP_FASTSCAN_HEAD, NEUTRINO_ICON_SETTINGS, w, MN_WIDGET_ID_SCAN_FAST_SCAN); addScanMenuFastScan(fastScanMenu); - mf = new CMenuDForwarder(LOCALE_SATSETUP_FASTSCAN_HEAD, true, NULL, fastScanMenu, "", CRCInput::RC_0); + mf = new CMenuDForwarder(LOCALE_SATSETUP_FASTSCAN_HEAD, true, NULL, fastScanMenu, "", CRCInput::RC_blue); mf->setHint("", LOCALE_MENU_HINT_SCAN_FAST); settings->addItem(mf); #endif + #if 0 //signal test CMenuWidget * sTest = new CMenuWidget(LOCALE_SCANTS_TEST, NEUTRINO_ICON_SETTINGS, w/*width*/, MN_WIDGET_ID_SCAN_MANUAL_SCAN); addScanMenuManualScan(sTest, true); - mf = new CMenuDForwarder(LOCALE_SCANTS_TEST, true, NULL, sTest, "", CRCInput::RC_green); + mf = new CMenuDForwarder(LOCALE_SCANTS_TEST, true, NULL, sTest, "", CRCInput::RC_0); mf->setHint("", LOCALE_MENU_HINT_SCAN_TEST); settings->addItem(mf); #endif - //settings->addItem(GenericMenuSeparatorLine); } if (CFEManager::getInstance()->haveCable()) { r_system = ALL_CABLE; settings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_TUNERSETUP_CABLE )); - //tune timeout - if(CFEManager::getInstance()->getFrontendCount() <= 1) - addScanMenuFrontendOptions(settings); + //nid = new CIntInput(LOCALE_SATSETUP_CABLE_NID, (int&) scansettings.cable_nid, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); //auto scan @@ -703,13 +704,13 @@ int CScanSetup::showScanMenu() mf = new CMenuDForwarder(LOCALE_SATSETUP_MANUAL_SCAN, true, NULL, manualScan, "", have_other ? CRCInput::convertDigitToKey(shortcut++) : CRCInput::RC_yellow); mf->setHint("", LOCALE_MENU_HINT_SCAN_MANUAL); settings->addItem(mf); + //simple cable scan CMenuWidget * cableScan = new CMenuWidget(LOCALE_SATSETUP_CABLE, NEUTRINO_ICON_SETTINGS, w/*width*/, MN_WIDGET_ID_SCAN_CABLE_SCAN); addScanMenuCable(cableScan); CMenuForwarder * fcableScan = new CMenuDForwarder(LOCALE_SATSETUP_CABLE, true, NULL, cableScan, "", have_other ? CRCInput::convertDigitToKey(shortcut++) : CRCInput::RC_blue); fcableScan->setHint("", LOCALE_MENU_HINT_SCAN_CABLE_SIMPLE); settings->addItem(fcableScan); - //settings->addItem(GenericMenuSeparatorLine); } if (CFEManager::getInstance()->haveTerr()) { @@ -717,10 +718,6 @@ int CScanSetup::showScanMenu() settings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_TUNERSETUP_TERR )); - // tune timeout, "Setup tuner" is not shown for only one non-sat tuner - if (CFEManager::getInstance()->getFrontendCount() <= 1) - addScanMenuFrontendOptions(settings); - //auto scan char autoscan[64]; std::string s_capt_part = g_Locale->getText(LOCALE_TERRESTRIALSETUP_PROVIDER); @@ -740,7 +737,16 @@ int CScanSetup::showScanMenu() mf = new CMenuForwarder(LOCALE_SATSETUP_MANUAL_SCAN, true, NULL, manualScan, "", have_other ? CRCInput::convertDigitToKey(shortcut++) : CRCInput::RC_yellow); mf->setHint("", LOCALE_MENU_HINT_SCAN_MANUAL); settings->addItem(mf); - //settings->addItem(GenericMenuSeparatorLine); + } + + if (CFEManager::getInstance()->haveCable() || CFEManager::getInstance()->haveTerr()) + { + if (CFEManager::getInstance()->getFrontendCount() <= 1) + { + // tune timeout, "Setup tuner" is not shown for only one non-sat tuner + settings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_TUNERSETUP_TUNERSETUP)); + addScanMenuFrontendOptions(settings); + } } settings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SCANTS_PREVERENCES_RECEIVING_SYSTEM )); diff --git a/src/system/locals.h b/src/system/locals.h index 0d3512661..6e0ca00aa 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2963,6 +2963,7 @@ typedef enum LOCALE_TUNERSETUP_POWER, LOCALE_TUNERSETUP_SAT, LOCALE_TUNERSETUP_TERR, + LOCALE_TUNERSETUP_TUNERSETUP, LOCALE_UNICABLE_LNB, LOCALE_UNICABLE_PIN, LOCALE_UNICABLE_PIN_HINT, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 6e3a3001c..fab7a3623 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2963,6 +2963,7 @@ const char * locale_real_names[] = "tunersetup.power", "tunersetup.sat", "tunersetup.terr", + "tunersetup.tunersetup", "unicable.lnb", "unicable.pin", "unicable.pin_hint",