mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
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:
@@ -244,13 +244,13 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
parent->hide();
|
parent->hide();
|
||||||
|
|
||||||
printf("[neutrino] CScanSetup::%s: %s \n", __FUNCTION__, actionKey.c_str());
|
printf("[neutrino] CScanSetup::%s: %s \n", __FUNCTION__, actionKey.c_str());
|
||||||
if(actionKey=="save_scansettings")
|
if(actionKey == "save_scansettings")
|
||||||
{
|
{
|
||||||
printf("[neutrino] CScanSetup::%s save_scansettings...\n", __FUNCTION__);
|
printf("[neutrino] CScanSetup::%s save_scansettings...\n", __FUNCTION__);
|
||||||
saveScanSetup();
|
saveScanSetup();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if(actionKey=="reloadchannels")
|
else if(actionKey == "reloadchannels")
|
||||||
{
|
{
|
||||||
printf("[neutrino] CScanSetup::%s reloadchannels...\n", __FUNCTION__);
|
printf("[neutrino] CScanSetup::%s reloadchannels...\n", __FUNCTION__);
|
||||||
if (reloadhintBox)
|
if (reloadhintBox)
|
||||||
@@ -261,18 +261,22 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
CNeutrinoApp::getInstance ()->SDTreloadChannels = false;
|
CNeutrinoApp::getInstance ()->SDTreloadChannels = false;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if(actionKey=="satsetup")
|
else if(actionKey == "satsetup")
|
||||||
{
|
{
|
||||||
return showScanMenuLnbSetup();
|
return showScanMenuLnbSetup();
|
||||||
}
|
}
|
||||||
else if(actionKey=="unisetup")
|
else if(actionKey == "unisetup")
|
||||||
{
|
{
|
||||||
return showUnicableSetup();
|
return showUnicableSetup();
|
||||||
}
|
}
|
||||||
else if(actionKey=="satfind")
|
else if(actionKey == "satfind")
|
||||||
{
|
{
|
||||||
return showScanMenuSatFind();
|
return showScanMenuSatFind();
|
||||||
}
|
}
|
||||||
|
else if(actionKey == "setup_frontend")
|
||||||
|
{
|
||||||
|
return showScanMenuFrontendSetup();
|
||||||
|
}
|
||||||
else if((loc = actionKey.find("config_frontend", 0)) != std::string::npos)
|
else if((loc = actionKey.find("config_frontend", 0)) != std::string::npos)
|
||||||
{
|
{
|
||||||
int number = actionKey.at(15) - '0';
|
int number = actionKey.at(15) - '0';
|
||||||
@@ -281,7 +285,7 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//starting scan
|
//starting scan
|
||||||
if(actionKey=="cable") {
|
if(actionKey == "cable") {
|
||||||
printf("[neutrino] CScanSetup::%s: simple cable scan\n", __FUNCTION__);
|
printf("[neutrino] CScanSetup::%s: simple cable scan\n", __FUNCTION__);
|
||||||
saveScanSetup();
|
saveScanSetup();
|
||||||
/* for simple cable scan, force some options */
|
/* for simple cable scan, force some options */
|
||||||
@@ -386,9 +390,12 @@ int CScanSetup::showScanMenu()
|
|||||||
//sat/provider selector
|
//sat/provider selector
|
||||||
|
|
||||||
if(CFEManager::getInstance()->haveSat() || CFEManager::getInstance()->getFrontendCount() > 1) {
|
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);
|
CMenuWidget * setupMenu = new CMenuWidget(LOCALE_SATSETUP_FE_SETUP, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_SCAN_FE_SETUP);
|
||||||
addScanMenuFrontendSetup(setupMenu);
|
addScanMenuFrontendSetup(setupMenu);
|
||||||
mf = new CMenuDForwarder(LOCALE_SATSETUP_FE_SETUP, allow_start, NULL, setupMenu, "", CRCInput::convertDigitToKey(shortcut++));
|
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);
|
mf->setHint("", LOCALE_MENU_HINT_SCAN_FESETUP);
|
||||||
settings->addItem(mf);
|
settings->addItem(mf);
|
||||||
}
|
}
|
||||||
@@ -550,11 +557,14 @@ int CScanSetup::showScanMenu()
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CScanSetup::addScanMenuFrontendSetup(CMenuWidget * setupMenu)
|
int CScanSetup::showScanMenuFrontendSetup()
|
||||||
{
|
{
|
||||||
CMenuForwarder * mf;
|
CMenuForwarder * mf;
|
||||||
int shortcut = 1;
|
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();
|
setupMenu->addIntroItems();
|
||||||
|
|
||||||
int count = CFEManager::getInstance()->getFrontendCount();
|
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 = 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);
|
nc->setHint("", LOCALE_MENU_HINT_SCAN_USALS_REPEAT);
|
||||||
setupMenu->addItem(nc);
|
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)
|
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)) {
|
else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_DISEQC)) {
|
||||||
printf("[neutrino] CScanSetup::%s: diseqc %d fenumber %d\n", __FUNCTION__, dmode, fenumber);
|
printf("[neutrino] CScanSetup::%s: diseqc %d fenumber %d\n", __FUNCTION__, dmode, fenumber);
|
||||||
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
|
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
|
||||||
|
if (fe->getDiseqcType() == (diseqc_t)dmode)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
fe_restart = true;
|
||||||
fe->setDiseqcType((diseqc_t) dmode);
|
fe->setDiseqcType((diseqc_t) dmode);
|
||||||
|
fe->setTsidOnid(0);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if(femode != CFEManager::FE_MODE_ALONE)
|
if(femode != CFEManager::FE_MODE_ALONE)
|
||||||
@@ -1408,6 +1434,10 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*
|
|||||||
fillSatSelect(satSelect);
|
fillSatSelect(satSelect);
|
||||||
#endif
|
#endif
|
||||||
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
|
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
|
||||||
|
if (fe->getMode() == femode)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
fe_restart = true;
|
||||||
fe->setMode(femode);
|
fe->setMode(femode);
|
||||||
if (fe && fe->getType() == FE_QPSK) {
|
if (fe && fe->getType() == FE_QPSK) {
|
||||||
if (linkfe)
|
if (linkfe)
|
||||||
|
@@ -80,6 +80,8 @@ class CScanSetup : public CMenuTarget, public CChangeObserver
|
|||||||
|
|
||||||
/* flag to allow any operations which can damage recordings */
|
/* flag to allow any operations which can damage recordings */
|
||||||
bool allow_start;
|
bool allow_start;
|
||||||
|
/* flag to re-init frontends */
|
||||||
|
bool fe_restart;
|
||||||
|
|
||||||
bool is_wizard;
|
bool is_wizard;
|
||||||
|
|
||||||
@@ -101,7 +103,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver
|
|||||||
void fillSatSelect(CMenuOptionStringChooser *select);
|
void fillSatSelect(CMenuOptionStringChooser *select);
|
||||||
void fillCableSelect(CMenuOptionStringChooser *select);
|
void fillCableSelect(CMenuOptionStringChooser *select);
|
||||||
|
|
||||||
void addScanMenuFrontendSetup(CMenuWidget *settings);
|
int showScanMenuFrontendSetup();
|
||||||
void addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t &satconfig);
|
void addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t &satconfig);
|
||||||
void addScanMenuManualScan(CMenuWidget *manual_Scan);
|
void addScanMenuManualScan(CMenuWidget *manual_Scan);
|
||||||
void addScanMenuAutoScanAll(CMenuWidget *auto_ScanAll);
|
void addScanMenuAutoScanAll(CMenuWidget *auto_ScanAll);
|
||||||
|
Reference in New Issue
Block a user