diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index bd4aa2716..ef8865313 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -887,20 +887,16 @@ int CScanSetup::showScanMenuLnbSetup() std::string satname = CServiceManager::getInstance()->GetSatelliteName(sit->first); //sub menu for sat settings to selectable sat item - CMenuWidget *tempsat = new CMenuWidget(satname.c_str(), NEUTRINO_ICON_SETTINGS, width); - addScanMenuTempSat(tempsat, sit->second); -#if 0 // option not refreshed. - if(sit->second.motor_position > 0) { - char mpos[10]; - sprintf(mpos, "%d", sit->second.motor_position); - sat_setup->addItem(new CMenuForwarderNonLocalized(satname.c_str(), true, mpos, tempsat)); - } else -#endif - { - CMenuForwarder * mf = new CMenuForwarderNonLocalized(satname.c_str(), true, NULL, tempsat); - mf->setHint("", LOCALE_MENU_HINT_SCAN_LNBCONFIG); - sat_setup->addItem(mf); - } + CMenuWidget *tempsat = new CMenuWidget(satname.c_str(), NEUTRINO_ICON_SETTINGS, width); + addScanMenuTempSat(tempsat, sit->second); + + char opt[100]; + sprintf(opt, "diseqc %2d / rotor %2d", sit->second.diseqc+1, sit->second.motor_position); + satoptions.push_back(opt); + CMenuForwarder * mf = new CMenuForwarderNonLocalized(satname.c_str(), true, satoptions[count].c_str(), tempsat); + mf->setHint("", LOCALE_MENU_HINT_SCAN_LNBCONFIG); + sat_setup->addItem(mf); + satmf.push_back(mf); tmp[count] = tempsat; count++; } @@ -910,6 +906,8 @@ int CScanSetup::showScanMenuLnbSetup() delete tmp[i]; } delete sat_setup; + satmf.clear(); + satoptions.clear(); return res; } @@ -1061,13 +1059,13 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satcon bool unicable = (dmode == DISEQC_UNICABLE); if (!unicable) { - diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); + diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, this, 1, -1, LOCALE_OPTIONS_OFF); diseqc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQC); comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); comm->setHint("", LOCALE_MENU_HINT_SCAN_COMMITED); uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); uncomm->setHint("", LOCALE_MENU_HINT_SCAN_UNCOMMITED); - motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF); + motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, this, 0, 0, LOCALE_OPTIONS_OFF); motor->setHint("", LOCALE_MENU_HINT_SCAN_MOTORPOS); usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &satconfig.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true /*dmode == DISEQC_ADVANCED*/); usals->setHint("", LOCALE_MENU_HINT_SCAN_USEUSALS); @@ -1515,6 +1513,21 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data* } } } + else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_MOTOR_POS) || + ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_DISEQC_INPUT)) { + CFrontend * fe = CFEManager::getInstance()->getFE(fenumber); + satellite_map_t & satmap = fe->getSatellites(); + int count = 0; + for (sat_iterator_t sit = satmap.begin(); sit != satmap.end(); ++sit) { + if(!sit->second.configured) + continue; + char opt[100]; + sprintf(opt, "diseqc %d / rotor %d", sit->second.diseqc+1, sit->second.motor_position); + satoptions[count] = opt; + satmf[count]->setOption(satoptions[count]); + count++; + } + } else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_LOGICAL_NUMBERS)) { printf("[neutrino] CScanSetup::%s: logical numbers %d\n", __FUNCTION__, scansettings.scan_logical_numbers); lcnhd->setActive(scansettings.scan_logical_numbers); diff --git a/src/gui/scan_setup.h b/src/gui/scan_setup.h index 42dd6d5af..428a32a43 100644 --- a/src/gui/scan_setup.h +++ b/src/gui/scan_setup.h @@ -79,6 +79,9 @@ class CScanSetup : public CMenuTarget, public CChangeObserver /* frontend link to number */ int femaster; + std::vector satoptions; + std::vector satmf; + /* flag to allow any operations which can damage recordings */ bool allow_start; /* flag to re-init frontends */