tuner setup: Visualize current count of selected satellites.

This commit is contained in:
2018-02-04 23:00:37 +01:00
parent 77ca322a17
commit f0e567058e
2 changed files with 20 additions and 0 deletions

View File

@@ -1026,9 +1026,13 @@ int CScanSetup::showFrontendSetup(int number)
mc->setHint("", LOCALE_MENU_HINT_SCAN_SATENABLE); mc->setHint("", LOCALE_MENU_HINT_SCAN_SATENABLE);
satToSelect->addItem(mc); satToSelect->addItem(mc);
} }
fsatSelect = new CMenuDForwarder(LOCALE_SATSETUP_SELECT_SAT, allow_moptions, NULL, satToSelect, "", CRCInput::convertDigitToKey(shortcut++)); fsatSelect = new CMenuDForwarder(LOCALE_SATSETUP_SELECT_SAT, allow_moptions, NULL, satToSelect, "", CRCInput::convertDigitToKey(shortcut++));
setOptionSatSelect(fenumber, fsatSelect);
fsatSelect->setHint("", LOCALE_MENU_HINT_SCAN_SATADD); fsatSelect->setHint("", LOCALE_MENU_HINT_SCAN_SATADD);
setupMenu->addItem(fsatSelect); 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 = new CMenuForwarder(LOCALE_SATSETUP_SAT_SETUP, allow_moptions, NULL, this, "satsetup", CRCInput::convertDigitToKey(shortcut++));
fsatSetup->setHint("", LOCALE_MENU_HINT_SCAN_SATSETUP); 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) int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &actionkey)
{ {
std::map<int, transponder> tmplist; std::map<int, transponder> tmplist;

View File

@@ -124,6 +124,9 @@ class CScanSetup : public CMenuTarget, public CChangeObserver
void saveScanSetup(); void saveScanSetup();
CScanSetup(int wizard_mode = SNeutrinoSettings::WIZARD_OFF); 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: public:
~CScanSetup(); ~CScanSetup();