mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
CTestMenu: rework member showTestMenu()
It's better to split this member. Newer tests can make it too messy.
This commit is contained in:
@@ -326,15 +326,32 @@ void CTestMenu::showTestMenu()
|
|||||||
//init
|
//init
|
||||||
char rev[255];
|
char rev[255];
|
||||||
sprintf(rev, "Test menu, System revision %d %s", system_rev, system_rev == 0 ? "WARNING - INVALID" : "");
|
sprintf(rev, "Test menu, System revision %d %s", system_rev, system_rev == 0 ? "WARNING - INVALID" : "");
|
||||||
CMenuWidget * TestMenu = new CMenuWidget(rev /*"Test menu"*/);
|
CMenuWidget w_test(rev /*"Test menu"*/, NEUTRINO_ICON_INFO, width);
|
||||||
TestMenu->setSelected(selected);
|
w_test.addIntroItems();
|
||||||
TestMenu->addIntroItems();
|
|
||||||
TestMenu->addItem(new CMenuForwarderNonLocalized("VFD", true, NULL, this, "vfd"));
|
//hardware
|
||||||
TestMenu->addItem(new CMenuForwarderNonLocalized("Network", true, NULL, this, "network"));
|
CMenuWidget * w_hw = new CMenuWidget("Hardware Test", NEUTRINO_ICON_INFO, width);
|
||||||
TestMenu->addItem(new CMenuForwarderNonLocalized("Smartcard 1", true, NULL, this, "card0"));
|
w_test.addItem(new CMenuForwarderNonLocalized(w_hw->getName().c_str(), true, NULL, w_hw));
|
||||||
TestMenu->addItem(new CMenuForwarderNonLocalized("Smartcard 2", true, NULL, this, "card1"));
|
showHWTests(w_hw);
|
||||||
TestMenu->addItem(new CMenuForwarderNonLocalized("HDD", true, NULL, this, "hdd"));
|
|
||||||
TestMenu->addItem(new CMenuForwarderNonLocalized("Buttons", true, NULL, this, "buttons"));
|
//buttons
|
||||||
|
w_test.addItem(new CMenuForwarderNonLocalized("Buttons", true, NULL, this, "buttons"));
|
||||||
|
|
||||||
|
//exit
|
||||||
|
w_test.exec(NULL, "");
|
||||||
|
selected = w_test.getSelected();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CTestMenu::showHWTests(CMenuWidget *widget)
|
||||||
|
{
|
||||||
|
widget->setSelected(selected);
|
||||||
|
widget->addIntroItems();
|
||||||
|
widget->addItem(new CMenuForwarderNonLocalized("VFD", true, NULL, this, "vfd"));
|
||||||
|
widget->addItem(new CMenuForwarderNonLocalized("Network", true, NULL, this, "network"));
|
||||||
|
widget->addItem(new CMenuForwarderNonLocalized("Smartcard 1", true, NULL, this, "card0"));
|
||||||
|
widget->addItem(new CMenuForwarderNonLocalized("Smartcard 2", true, NULL, this, "card1"));
|
||||||
|
widget->addItem(new CMenuForwarderNonLocalized("HDD", true, NULL, this, "hdd"));
|
||||||
|
|
||||||
CFEManager::getInstance()->setMode(CFEManager::FE_MODE_ALONE);
|
CFEManager::getInstance()->setMode(CFEManager::FE_MODE_ALONE);
|
||||||
|
|
||||||
@@ -349,22 +366,19 @@ void CTestMenu::showTestMenu()
|
|||||||
|
|
||||||
int count = CFEManager::getInstance()->getFrontendCount();
|
int count = CFEManager::getInstance()->getFrontendCount();
|
||||||
if (frontend->getInfo()->type == FE_QPSK) {
|
if (frontend->getInfo()->type == FE_QPSK) {
|
||||||
TestMenu->addItem(new CMenuForwarderNonLocalized("Tuner 1: Scan 12538000", true, NULL, this, "scan1"));
|
widget->addItem(new CMenuForwarderNonLocalized("Tuner 1: Scan 12538000", true, NULL, this, "scan1"));
|
||||||
TestMenu->addItem(new CMenuForwarderNonLocalized("Tuner 1: 22 Khz ON", true, NULL, this, "22kon1"));
|
widget->addItem(new CMenuForwarderNonLocalized("Tuner 1: 22 Khz ON", true, NULL, this, "22kon1"));
|
||||||
TestMenu->addItem(new CMenuForwarderNonLocalized("Tuner 1: 22 Khz OFF", true, NULL, this, "22koff1"));
|
widget->addItem(new CMenuForwarderNonLocalized("Tuner 1: 22 Khz OFF", true, NULL, this, "22koff1"));
|
||||||
if(count > 1) {
|
if(count > 1) {
|
||||||
satmap = CServiceManager::getInstance()->SatelliteList();
|
satmap = CServiceManager::getInstance()->SatelliteList();
|
||||||
satmap[192].configured = 1;
|
satmap[192].configured = 1;
|
||||||
frontend = CFEManager::getInstance()->getFE(1);
|
frontend = CFEManager::getInstance()->getFE(1);
|
||||||
frontend->setSatellites(satmap);
|
frontend->setSatellites(satmap);
|
||||||
|
|
||||||
TestMenu->addItem(new CMenuForwarderNonLocalized("Tuner 2: Scan 12538000", true, NULL, this, "scan2"));
|
widget->addItem(new CMenuForwarderNonLocalized("Tuner 2: Scan 12538000", true, NULL, this, "scan2"));
|
||||||
TestMenu->addItem(new CMenuForwarderNonLocalized("Tuner 2: 22 Khz ON", true, NULL, this, "22kon2"));
|
widget->addItem(new CMenuForwarderNonLocalized("Tuner 2: 22 Khz ON", true, NULL, this, "22kon2"));
|
||||||
TestMenu->addItem(new CMenuForwarderNonLocalized("Tuner 2: 22 Khz OFF", true, NULL, this, "22koff2"));
|
widget->addItem(new CMenuForwarderNonLocalized("Tuner 2: 22 Khz OFF", true, NULL, this, "22koff2"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TestMenu->exec(NULL, "");
|
|
||||||
selected = TestMenu->getSelected();
|
|
||||||
delete TestMenu;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
#include <gui/widget/menue.h>
|
#include <gui/widget/menue.h>
|
||||||
#include <gui/widget/icons.h>
|
#include <gui/widget/icons.h>
|
||||||
|
|
||||||
//#define TEST_MENU
|
// #define TEST_MENU
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@@ -42,6 +42,7 @@ class CTestMenu : public CMenuTarget
|
|||||||
int width, selected;
|
int width, selected;
|
||||||
|
|
||||||
void showTestMenu();
|
void showTestMenu();
|
||||||
|
void showHWTests(CMenuWidget *widget);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CTestMenu();
|
CTestMenu();
|
||||||
|
Reference in New Issue
Block a user