diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index f2bafaa27..77a21faba 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -1026,9 +1026,13 @@ int CScanSetup::showFrontendSetup(int number) mc->setHint("", LOCALE_MENU_HINT_SCAN_SATENABLE); satToSelect->addItem(mc); } + fsatSelect = new CMenuDForwarder(LOCALE_SATSETUP_SELECT_SAT, allow_moptions, NULL, satToSelect, "", CRCInput::convertDigitToKey(shortcut++)); + setOptionSatSelect(fenumber, fsatSelect); fsatSelect->setHint("", LOCALE_MENU_HINT_SCAN_SATADD); setupMenu->addItem(fsatSelect); + if (satToSelect->OnAfterHide.empty()) + satToSelect->OnAfterHide.connect(sigc::bind(sigc::mem_fun(this, &CScanSetup::setOptionSatSelect), fenumber, fsatSelect)); fsatSetup = new CMenuForwarder(LOCALE_SATSETUP_SAT_SETUP, allow_moptions, NULL, this, "satsetup", CRCInput::convertDigitToKey(shortcut++)); fsatSetup->setHint("", LOCALE_MENU_HINT_SCAN_SATSETUP); @@ -1998,6 +2002,19 @@ void CScanSetup::updateManualSettings() } } +void CScanSetup::setOptionSatSelect(int fe_number, CMenuForwarder* menu_item) +{ + satellite_map_t & satmap = CFEManager::getInstance()->getFE(fe_number)->getSatellites(); + int count = 0; + for (sat_iterator_t sit = satmap.begin(); sit != satmap.end(); ++sit) { + if(!sit->second.configured) + continue; + count++; + } + std::string count_of = to_string(count) + char(0x2f) + to_string(satmap.size()); + menu_item->setOption(count_of); +} + int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &actionkey) { std::map tmplist; diff --git a/src/gui/scan_setup.h b/src/gui/scan_setup.h index 608e2d5a0..53eca560d 100644 --- a/src/gui/scan_setup.h +++ b/src/gui/scan_setup.h @@ -124,6 +124,9 @@ class CScanSetup : public CMenuTarget, public CChangeObserver void saveScanSetup(); CScanSetup(int wizard_mode = SNeutrinoSettings::WIZARD_OFF); + + /* required to set display count of selected satellites, see: showFrontendSetup() */ + void setOptionSatSelect(int fe_number, CMenuForwarder* menu_item); public: ~CScanSetup();