gui/scan_setup.cpp: add flag to track fe mode, diseqc mode changes;

show tuners setup in its own function;
auto-apply tuners link if modes changed on quit from tuners setup menu;
re-zap to current channel if fe modes or diseqc mode changed


Origin commit data
------------------
Commit: 513f56426f
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2013-03-14 (Thu, 14 Mar 2013)
This commit is contained in:
[CST] Focus
2013-03-14 12:07:46 +04:00
parent 538e0534d5
commit 8f1a9dd234
2 changed files with 40 additions and 8 deletions

View File

@@ -273,6 +273,10 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey)
{
return showScanMenuSatFind();
}
else if(actionKey == "setup_frontend")
{
return showScanMenuFrontendSetup();
}
else if((loc = actionKey.find("config_frontend", 0)) != std::string::npos)
{
int number = actionKey.at(15) - '0';
@@ -386,9 +390,12 @@ int CScanSetup::showScanMenu()
//sat/provider selector
if(CFEManager::getInstance()->haveSat() || CFEManager::getInstance()->getFrontendCount() > 1) {
#if 0
CMenuWidget * setupMenu = new CMenuWidget(LOCALE_SATSETUP_FE_SETUP, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_SCAN_FE_SETUP);
addScanMenuFrontendSetup(setupMenu);
mf = new CMenuDForwarder(LOCALE_SATSETUP_FE_SETUP, allow_start, NULL, setupMenu, "", CRCInput::convertDigitToKey(shortcut++));
#endif
mf = new CMenuForwarder(LOCALE_SATSETUP_FE_SETUP, allow_start, NULL, this, "setup_frontend", CRCInput::convertDigitToKey(shortcut++));
mf->setHint("", LOCALE_MENU_HINT_SCAN_FESETUP);
settings->addItem(mf);
}
@@ -550,11 +557,14 @@ int CScanSetup::showScanMenu()
return res;
}
void CScanSetup::addScanMenuFrontendSetup(CMenuWidget * setupMenu)
int CScanSetup::showScanMenuFrontendSetup()
{
CMenuForwarder * mf;
int shortcut = 1;
fe_restart = false;
CMenuWidget * setupMenu = new CMenuWidget(LOCALE_SATSETUP_FE_SETUP, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_SCAN_FE_SETUP);
setupMenu->addIntroItems();
int count = CFEManager::getInstance()->getFrontendCount();
@@ -618,6 +628,17 @@ void CScanSetup::addScanMenuFrontendSetup(CMenuWidget * setupMenu)
nc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_USALS_REPEAT, (int *)&zapitCfg.repeatUsals, true, 0, 10, NULL, 0, 0, LOCALE_OPTIONS_OFF);
nc->setHint("", LOCALE_MENU_HINT_SCAN_USALS_REPEAT);
setupMenu->addItem(nc);
int res = setupMenu->exec(NULL, "");
delete setupMenu;
if (fe_restart) {
fe_restart = false;
CFEManager::getInstance()->linkFrontends(true);
t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID();
if (live_channel_id)
CNeutrinoApp::getInstance()->channelList->zapTo_ChannelID(live_channel_id, true);
}
return res;
}
int CScanSetup::showFrontendSetup(int number)
@@ -1351,7 +1372,12 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*
else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_DISEQC)) {
printf("[neutrino] CScanSetup::%s: diseqc %d fenumber %d\n", __FUNCTION__, dmode, fenumber);
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
if (fe->getDiseqcType() == (diseqc_t)dmode)
return ret;
fe_restart = true;
fe->setDiseqcType((diseqc_t) dmode);
fe->setTsidOnid(0);
#if 0
if(femode != CFEManager::FE_MODE_ALONE)
@@ -1408,6 +1434,10 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*
fillSatSelect(satSelect);
#endif
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
if (fe->getMode() == femode)
return ret;
fe_restart = true;
fe->setMode(femode);
if (fe && fe->getType() == FE_QPSK) {
if (linkfe)

View File

@@ -80,6 +80,8 @@ class CScanSetup : public CMenuTarget, public CChangeObserver
/* flag to allow any operations which can damage recordings */
bool allow_start;
/* flag to re-init frontends */
bool fe_restart;
bool is_wizard;
@@ -101,7 +103,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver
void fillSatSelect(CMenuOptionStringChooser *select);
void fillCableSelect(CMenuOptionStringChooser *select);
void addScanMenuFrontendSetup(CMenuWidget *settings);
int showScanMenuFrontendSetup();
void addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t &satconfig);
void addScanMenuManualScan(CMenuWidget *manual_Scan);
void addScanMenuAutoScanAll(CMenuWidget *auto_ScanAll);