gui/scan_setup.cpp: show tuners mode also in top tuner menu

Origin commit data
------------------
Commit: c70f94e89b
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2013-03-29 (Fri, 29 Mar 2013)
This commit is contained in:
[CST] Focus
2013-03-29 17:16:15 +04:00
parent 3304b1024e
commit 1a76a360bc
2 changed files with 21 additions and 1 deletions

View File

@@ -557,6 +557,21 @@ int CScanSetup::showScanMenu()
return res; return res;
} }
neutrino_locale_t CScanSetup::getModeLocale(int mode)
{
neutrino_locale_t lmode = LOCALE_SATSETUP_FE_MODE_UNUSED;
if (mode == CFrontend::FE_MODE_INDEPENDENT)
lmode = LOCALE_SATSETUP_FE_MODE_INDEPENDENT;
else if (mode == CFrontend::FE_MODE_MASTER)
lmode = LOCALE_SATSETUP_FE_MODE_MASTER;
else if (mode == CFrontend::FE_MODE_LINK_LOOP)
lmode = LOCALE_SATSETUP_FE_MODE_LINK_LOOP;
else if (mode == CFrontend::FE_MODE_LINK_TWIN)
lmode = LOCALE_SATSETUP_FE_MODE_LINK_TWIN;
return lmode;
}
int CScanSetup::showScanMenuFrontendSetup() int CScanSetup::showScanMenuFrontendSetup()
{ {
CMenuForwarder * mf; CMenuForwarder * mf;
@@ -574,6 +589,7 @@ int CScanSetup::showScanMenuFrontendSetup()
char tmp[32]; char tmp[32];
snprintf(tmp, sizeof(tmp), "config_frontend%d", i); snprintf(tmp, sizeof(tmp), "config_frontend%d", i);
char name[255]; char name[255];
snprintf(name, sizeof(name), "%s %d: %s", g_Locale->getText(LOCALE_SATSETUP_FE_SETUP), i+1, fe->getInfo()->name); snprintf(name, sizeof(name), "%s %d: %s", g_Locale->getText(LOCALE_SATSETUP_FE_SETUP), i+1, fe->getInfo()->name);
@@ -593,7 +609,8 @@ int CScanSetup::showScanMenuFrontendSetup()
icon = NEUTRINO_ICON_BUTTON_BLUE; icon = NEUTRINO_ICON_BUTTON_BLUE;
} }
mf = new CMenuForwarderNonLocalized(name, true, NULL, this, tmp, key, icon); modestr[i] = g_Locale->getText(getModeLocale(fe->getMode()));
mf = new CMenuForwarderNonLocalized(name, true, modestr[i], this, tmp, key, icon);
mf->setHint("", LOCALE_MENU_HINT_SCAN_SETUP_FE); mf->setHint("", LOCALE_MENU_HINT_SCAN_SETUP_FE);
setupMenu->addItem(mf); setupMenu->addItem(mf);
if(i != 0) if(i != 0)
@@ -1437,6 +1454,7 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*
if (fe->getMode() == femode) if (fe->getMode() == femode)
return ret; return ret;
modestr[fenumber] = g_Locale->getText(getModeLocale(femode));
fe_restart = true; fe_restart = true;
fe->setMode(femode); fe->setMode(femode);
if (fe && fe->getType() == FE_QPSK) { if (fe && fe->getType() == FE_QPSK) {

View File

@@ -67,6 +67,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver
CMenuOptionChooser * lcnhd; CMenuOptionChooser * lcnhd;
CMenuOptionChooser * linkfe; CMenuOptionChooser * linkfe;
std::string modestr[4];
/* variables for selected frontend */ /* variables for selected frontend */
/* diseqc mode */ /* diseqc mode */
@@ -103,6 +104,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver
void fillSatSelect(CMenuOptionStringChooser *select); void fillSatSelect(CMenuOptionStringChooser *select);
void fillCableSelect(CMenuOptionStringChooser *select); void fillCableSelect(CMenuOptionStringChooser *select);
neutrino_locale_t getModeLocale(int mode);
int showScanMenuFrontendSetup(); 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);