mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
- testmenu: formatting code using astyle; some manual code nicenings
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -143,7 +143,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
{
|
{
|
||||||
CVFD::getInstance()->Clear();
|
CVFD::getInstance()->Clear();
|
||||||
int icon = 0x00040000;
|
int icon = 0x00040000;
|
||||||
while (icon > 0x2) {
|
while (icon > 0x2)
|
||||||
|
{
|
||||||
CVFD::getInstance()->ShowIcon((fp_icon) icon, true);
|
CVFD::getInstance()->ShowIcon((fp_icon) icon, true);
|
||||||
icon /= 2;
|
icon /= 2;
|
||||||
}
|
}
|
||||||
@@ -261,9 +262,12 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
char buffer[255];
|
char buffer[255];
|
||||||
FILE *f = fopen("/proc/mounts", "r");
|
FILE *f = fopen("/proc/mounts", "r");
|
||||||
bool mounted = false;
|
bool mounted = false;
|
||||||
if (f != NULL) {
|
if (f != NULL)
|
||||||
while (fgets (buffer, 255, f) != NULL) {
|
{
|
||||||
if (strstr(buffer, "/dev/sda1")) {
|
while (fgets(buffer, 255, f) != NULL)
|
||||||
|
{
|
||||||
|
if (strstr(buffer, "/dev/sda1"))
|
||||||
|
{
|
||||||
mounted = true;
|
mounted = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -282,9 +286,12 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
char buffer[255];
|
char buffer[255];
|
||||||
FILE *f = fopen("/proc/mounts", "r");
|
FILE *f = fopen("/proc/mounts", "r");
|
||||||
bool mounted = false;
|
bool mounted = false;
|
||||||
if (f != NULL) {
|
if (f != NULL)
|
||||||
while (fgets (buffer, 255, f) != NULL) {
|
{
|
||||||
if (strstr(buffer, "/dev/mmcblk0p1")) {
|
while (fgets(buffer, 255, f) != NULL)
|
||||||
|
{
|
||||||
|
if (strstr(buffer, "/dev/mmcblk0p1"))
|
||||||
|
{
|
||||||
mounted = true;
|
mounted = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -331,7 +338,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
#if 0 //some parts DEPRECATED
|
#if 0
|
||||||
|
// some parts DEPRECATED
|
||||||
else if (actionKey.find("22kon") != std::string::npos)
|
else if (actionKey.find("22kon") != std::string::npos)
|
||||||
{
|
{
|
||||||
int fnum = atoi(actionKey.substr(5, 1).c_str());
|
int fnum = atoi(actionKey.substr(5, 1).c_str());
|
||||||
@@ -359,15 +367,19 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
delivery_system_t delsys = ALL_SAT;
|
delivery_system_t delsys = ALL_SAT;
|
||||||
|
|
||||||
CFrontend *frontend = CFEManager::getInstance()->getFE(fnum);
|
CFrontend *frontend = CFEManager::getInstance()->getFE(fnum);
|
||||||
if (frontend->hasSat()) {
|
if (frontend->hasSat())
|
||||||
|
{
|
||||||
scansettings.satName = CServiceManager::getInstance()->GetSatelliteName(test_pos[fnum]);
|
scansettings.satName = CServiceManager::getInstance()->GetSatelliteName(test_pos[fnum]);
|
||||||
scansettings.sat_TP_freq = to_string((fnum & 1) ? /*12439000*/ 3951000 : 4000000);
|
scansettings.sat_TP_freq = to_string((fnum & 1) ? /*12439000*/ 3951000 : 4000000);
|
||||||
scansettings.sat_TP_rate = to_string((fnum & 1) ? /*2500*1000*/ 9520 * 1000 : 27500 * 1000);
|
scansettings.sat_TP_rate = to_string((fnum & 1) ? /*2500*1000*/ 9520 * 1000 : 27500 * 1000);
|
||||||
scansettings.sat_TP_fec = FEC_3_4; //(fnum & 1) ? FEC_3_4 : FEC_1_2;
|
scansettings.sat_TP_fec = FEC_3_4; //(fnum & 1) ? FEC_3_4 : FEC_1_2;
|
||||||
scansettings.sat_TP_pol = (fnum & 1) ? 1 : 0;
|
scansettings.sat_TP_pol = (fnum & 1) ? 1 : 0;
|
||||||
} else if (frontend->hasCable()) {
|
}
|
||||||
|
else if (frontend->hasCable())
|
||||||
|
{
|
||||||
unsigned count = CFEManager::getInstance()->getFrontendCount();
|
unsigned count = CFEManager::getInstance()->getFrontendCount();
|
||||||
for (unsigned i = 0; i < count; i++) {
|
for (unsigned i = 0; i < count; i++)
|
||||||
|
{
|
||||||
CFrontend *fe = CFEManager::getInstance()->getFE(i);
|
CFrontend *fe = CFEManager::getInstance()->getFE(i);
|
||||||
if (fe->hasCable())
|
if (fe->hasCable())
|
||||||
fe->setMode(CFrontend::FE_MODE_UNUSED);
|
fe->setMode(CFrontend::FE_MODE_UNUSED);
|
||||||
@@ -379,7 +391,9 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
scansettings.cable_TP_fec = 1;
|
scansettings.cable_TP_fec = 1;
|
||||||
scansettings.cable_TP_mod = 5;
|
scansettings.cable_TP_mod = 5;
|
||||||
delsys = ALL_CABLE;
|
delsys = ALL_CABLE;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,26 +402,32 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (actionKey == "button"){
|
else if (actionKey == "button")
|
||||||
if (button == NULL){
|
{
|
||||||
|
if (button == NULL)
|
||||||
|
{
|
||||||
button = new CComponentsButtonRed(100, 100, 100, 50, "Test", NULL, false, true, CC_SHADOW_OFF);
|
button = new CComponentsButtonRed(100, 100, 100, 50, "Test", NULL, false, true, CC_SHADOW_OFF);
|
||||||
button->enableShadow();
|
button->enableShadow();
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
button->disableShadow();
|
button->disableShadow();
|
||||||
|
|
||||||
|
|
||||||
if (!button->isPainted()){
|
if (!button->isPainted())
|
||||||
|
{
|
||||||
if (button->isSelected())
|
if (button->isSelected())
|
||||||
button->setSelected(false);
|
button->setSelected(false);
|
||||||
else
|
else
|
||||||
button->setSelected(true);
|
button->setSelected(true);
|
||||||
button->paint();
|
button->paint();
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
button->hide();
|
button->hide();
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "circle"){
|
else if (actionKey == "circle")
|
||||||
|
{
|
||||||
if (circle == NULL)
|
if (circle == NULL)
|
||||||
circle = new CComponentsShapeCircle(100, 100, 100, NULL, CC_SHADOW_ON, COL_MENUCONTENT_PLUS_6, COL_MENUCONTENT_PLUS_0, COL_RED);
|
circle = new CComponentsShapeCircle(100, 100, 100, NULL, CC_SHADOW_ON, COL_MENUCONTENT_PLUS_6, COL_MENUCONTENT_PLUS_0, COL_RED);
|
||||||
|
|
||||||
@@ -417,8 +437,10 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
circle->hide();
|
circle->hide();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "square"){
|
else if (actionKey == "square")
|
||||||
if (sq == NULL){
|
{
|
||||||
|
if (sq == NULL)
|
||||||
|
{
|
||||||
sq = new CComponentsShapeSquare(0, 0, 100, 100, NULL, CC_SHADOW_ON, COL_DARK_YELLOW, COL_LIGHT_GRAY, COL_RED);
|
sq = new CComponentsShapeSquare(0, 0, 100, 100, NULL, CC_SHADOW_ON, COL_DARK_YELLOW, COL_LIGHT_GRAY, COL_RED);
|
||||||
sq->enableFrame(true, 1);
|
sq->enableFrame(true, 1);
|
||||||
}
|
}
|
||||||
@@ -429,7 +451,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
sq->hide();
|
sq->hide();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "picture"){
|
else if (actionKey == "picture")
|
||||||
|
{
|
||||||
if (pic == NULL)
|
if (pic == NULL)
|
||||||
pic = new CComponentsPicture(100, 100, 200, 100, ICONSDIR "/mp3-5.jpg");
|
pic = new CComponentsPicture(100, 100, 200, 100, ICONSDIR "/mp3-5.jpg");
|
||||||
|
|
||||||
@@ -439,7 +462,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
pic->hide();
|
pic->hide();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "picture_svg"){
|
else if (actionKey == "picture_svg")
|
||||||
|
{
|
||||||
if (picsvg == NULL)
|
if (picsvg == NULL)
|
||||||
picsvg = new CComponentsPicture(100, 100, 100, 0, "tux");
|
picsvg = new CComponentsPicture(100, 100, 100, 0, "tux");
|
||||||
|
|
||||||
@@ -450,7 +474,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "blink"){
|
else if (actionKey == "blink")
|
||||||
|
{
|
||||||
if (sq == NULL)
|
if (sq == NULL)
|
||||||
sq = new CComponentsShapeSquare(0, 0, 100, 100, NULL, CC_SHADOW_ON, COL_DARK_YELLOW, COL_LIGHT_GRAY, COL_RED);
|
sq = new CComponentsShapeSquare(0, 0, 100, 100, NULL, CC_SHADOW_ON, COL_DARK_YELLOW, COL_LIGHT_GRAY, COL_RED);
|
||||||
|
|
||||||
@@ -462,7 +487,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "blink_image"){
|
else if (actionKey == "blink_image")
|
||||||
|
{
|
||||||
if (pic == NULL)
|
if (pic == NULL)
|
||||||
pic = new CComponentsPicture(50, 50, 50, 50, ICONSDIR "/btn_pause.png");
|
pic = new CComponentsPicture(50, 50, 50, 50, ICONSDIR "/btn_pause.png");
|
||||||
|
|
||||||
@@ -474,7 +500,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "channellogo"){
|
else if (actionKey == "channellogo")
|
||||||
|
{
|
||||||
uint64_t chid = CZapit::getInstance()->GetCurrentChannelID();
|
uint64_t chid = CZapit::getInstance()->GetCurrentChannelID();
|
||||||
std::string chname = "";
|
std::string chname = "";
|
||||||
if (CServiceManager::getInstance()->FindChannel(chid))
|
if (CServiceManager::getInstance()->FindChannel(chid))
|
||||||
@@ -496,7 +523,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "form"){
|
else if (actionKey == "form")
|
||||||
|
{
|
||||||
if (form == NULL)
|
if (form == NULL)
|
||||||
form = new CComponentsForm();
|
form = new CComponentsForm();
|
||||||
form->setColorBody(COL_LIGHT_GRAY);
|
form->setColorBody(COL_LIGHT_GRAY);
|
||||||
@@ -525,8 +553,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
//form->removeCCItem(form->getCCItemId(t1));
|
//form->removeCCItem(form->getCCItemId(t1));
|
||||||
//form->insertCCItem(1, new CComponentsPicture(28, 0, 0, 0, NEUTRINO_ICON_BUTTON_RED));
|
//form->insertCCItem(1, new CComponentsPicture(28, 0, 0, 0, NEUTRINO_ICON_BUTTON_RED));
|
||||||
|
|
||||||
|
if (form->isPainted())
|
||||||
if (form->isPainted()) {
|
{
|
||||||
form->hide();
|
form->hide();
|
||||||
delete form;
|
delete form;
|
||||||
form = NULL;
|
form = NULL;
|
||||||
@@ -535,8 +563,10 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
form->paint();
|
form->paint();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "form_blink_item"){
|
else if (actionKey == "form_blink_item")
|
||||||
if (form == NULL){
|
{
|
||||||
|
if (form == NULL)
|
||||||
|
{
|
||||||
form = new CComponentsForm();
|
form = new CComponentsForm();
|
||||||
form->setColorBody(COL_DARK_GRAY);
|
form->setColorBody(COL_DARK_GRAY);
|
||||||
form->setDimensionsAll(100, 100, 250, 100);
|
form->setDimensionsAll(100, 100, 250, 100);
|
||||||
@@ -556,10 +586,12 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
ptmp->kill();
|
ptmp->kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (static_cast<CComponentsPicture*>(form->getCCItem(0))-> paintBlink(500)){
|
if (static_cast<CComponentsPicture *>(form->getCCItem(0))-> paintBlink(500))
|
||||||
|
{
|
||||||
ShowHint("Testmenu: Blink", "Testmenu: Blinking embedded image ...", 700, 10);
|
ShowHint("Testmenu: Blink", "Testmenu: Blinking embedded image ...", 700, 10);
|
||||||
}
|
}
|
||||||
if (form->getCCItem(0)->cancelBlink()){
|
if (form->getCCItem(0)->cancelBlink())
|
||||||
|
{
|
||||||
ShowHint("Testmenu: Blink", "Testmenu: Blinking embedded image stopped ...", 700, 2);
|
ShowHint("Testmenu: Blink", "Testmenu: Blinking embedded image stopped ...", 700, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -567,7 +599,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
delete form; form = NULL;
|
delete form; form = NULL;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "text"){
|
else if (actionKey == "text")
|
||||||
|
{
|
||||||
if (txt == NULL)
|
if (txt == NULL)
|
||||||
txt = new CComponentsText();
|
txt = new CComponentsText();
|
||||||
txt->setDimensionsAll(100, 100, 250, 100);
|
txt->setDimensionsAll(100, 100, 250, 100);
|
||||||
@@ -580,23 +613,28 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "blinking_text"){
|
else if (actionKey == "blinking_text")
|
||||||
if (txt == NULL){
|
{
|
||||||
|
if (txt == NULL)
|
||||||
|
{
|
||||||
txt = new CComponentsText();
|
txt = new CComponentsText();
|
||||||
txt->setDimensionsAll(50, 50, 250, 100);
|
txt->setDimensionsAll(50, 50, 250, 100);
|
||||||
txt->setText("This is a text for testing textbox", CTextBox::NO_AUTO_LINEBREAK);
|
txt->setText("This is a text for testing textbox", CTextBox::NO_AUTO_LINEBREAK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (txt->paintBlink(50)){
|
if (txt->paintBlink(50))
|
||||||
|
{
|
||||||
ShowHint("Testmenu: Blink", "Testmenu: Blinking text is running ...", 700, 10);
|
ShowHint("Testmenu: Blink", "Testmenu: Blinking text is running ...", 700, 10);
|
||||||
}
|
}
|
||||||
if (txt->cancelBlink()){
|
if (txt->cancelBlink())
|
||||||
|
{
|
||||||
ShowHint("Testmenu: Blink", "Testmenu: Blinking text stopped ...", 700, 2);
|
ShowHint("Testmenu: Blink", "Testmenu: Blinking text stopped ...", 700, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "text_ext"){
|
else if (actionKey == "text_ext")
|
||||||
|
{
|
||||||
if (text_ext == NULL)
|
if (text_ext == NULL)
|
||||||
text_ext = new CComponentsExtTextForm();
|
text_ext = new CComponentsExtTextForm();
|
||||||
text_ext->setDimensionsAll(10, 20, 300, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight() + 2 * 2);
|
text_ext->setDimensionsAll(10, 20, 300, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight() + 2 * 2);
|
||||||
@@ -610,30 +648,37 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
text_ext->paint();
|
text_ext->paint();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "blinking_text_ext"){
|
else if (actionKey == "blinking_text_ext")
|
||||||
if (text_ext == NULL){
|
{
|
||||||
|
if (text_ext == NULL)
|
||||||
|
{
|
||||||
text_ext = new CComponentsExtTextForm();
|
text_ext = new CComponentsExtTextForm();
|
||||||
text_ext->setDimensionsAll(10, 20, 300, 48);
|
text_ext->setDimensionsAll(10, 20, 300, 48);
|
||||||
text_ext->setLabelAndText("Label", "Text for demo", g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]);
|
text_ext->setLabelAndText("Label", "Text for demo", g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]);
|
||||||
text_ext->setFrameThickness(2);
|
text_ext->setFrameThickness(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text_ext->paintBlink(500)){
|
if (text_ext->paintBlink(500))
|
||||||
|
{
|
||||||
ShowHint("Testmenu: Blink", "Testmenu: Blinking extended text is running ...", 700, 10);
|
ShowHint("Testmenu: Blink", "Testmenu: Blinking extended text is running ...", 700, 10);
|
||||||
}
|
}
|
||||||
if (text_ext->cancelBlink()){
|
if (text_ext->cancelBlink())
|
||||||
|
{
|
||||||
ShowHint("Testmenu: Blink", "Testmenu: Blinking extended text stopped ...", 700, 2);
|
ShowHint("Testmenu: Blink", "Testmenu: Blinking extended text stopped ...", 700, 2);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "header"){
|
else if (actionKey == "header")
|
||||||
|
{
|
||||||
int hh = 0; //g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
|
int hh = 0; //g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
|
||||||
if (header == NULL){
|
if (header == NULL)
|
||||||
|
{
|
||||||
header = new CComponentsHeader(100, 50, 500, hh, "Test-Header"/*, NEUTRINO_ICON_INFO, CComponentsHeader::CC_BTN_HELP | CComponentsHeader::CC_BTN_EXIT | CComponentsHeader::CC_BTN_MENU*/);
|
header = new CComponentsHeader(100, 50, 500, hh, "Test-Header"/*, NEUTRINO_ICON_INFO, CComponentsHeader::CC_BTN_HELP | CComponentsHeader::CC_BTN_EXIT | CComponentsHeader::CC_BTN_MENU*/);
|
||||||
header->addContextButton(NEUTRINO_ICON_BUTTON_RED);
|
header->addContextButton(NEUTRINO_ICON_BUTTON_RED);
|
||||||
header->addContextButton(CComponentsHeader::CC_BTN_HELP | CComponentsHeader::CC_BTN_EXIT | CComponentsHeader::CC_BTN_MENU);
|
header->addContextButton(CComponentsHeader::CC_BTN_HELP | CComponentsHeader::CC_BTN_EXIT | CComponentsHeader::CC_BTN_MENU);
|
||||||
}
|
}
|
||||||
else{ //For existing instances it's recommended to remove old button icons before add new buttons,
|
else // For existing instances it's recommended to remove old button icons before add new buttons,
|
||||||
|
{
|
||||||
// otherwise icons will be appended to already existent icons, alternatively use the setContextButton() methode
|
// otherwise icons will be appended to already existent icons, alternatively use the setContextButton() methode
|
||||||
header->removeContextButtons();
|
header->removeContextButtons();
|
||||||
// enable clock in header with default format
|
// enable clock in header with default format
|
||||||
@@ -653,8 +698,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
//v_buttons.push_back(NEUTRINO_ICON_BUTTON_YELLOW);
|
//v_buttons.push_back(NEUTRINO_ICON_BUTTON_YELLOW);
|
||||||
//v_buttons.push_back(NEUTRINO_ICON_BUTTON_RED);
|
//v_buttons.push_back(NEUTRINO_ICON_BUTTON_RED);
|
||||||
//header->addContextButton(v_buttons);
|
//header->addContextButton(v_buttons);
|
||||||
//
|
|
||||||
// // add any other button icon via string
|
// add any other button icon via string
|
||||||
//header->addContextButton(NEUTRINO_ICON_BUTTON_BLUE);
|
//header->addContextButton(NEUTRINO_ICON_BUTTON_BLUE);
|
||||||
//header->addContextButton(NEUTRINO_ICON_BUTTON_GREEN);
|
//header->addContextButton(NEUTRINO_ICON_BUTTON_GREEN);
|
||||||
//header->addContextButton(CComponentsHeader::CC_BTN_HELP | CComponentsHeader::CC_BTN_EXIT | CComponentsHeader::CC_BTN_MENU);
|
//header->addContextButton(CComponentsHeader::CC_BTN_HELP | CComponentsHeader::CC_BTN_EXIT | CComponentsHeader::CC_BTN_MENU);
|
||||||
@@ -674,19 +719,22 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
// insert the ne object
|
// insert the ne object
|
||||||
//header->insertCCItem(1, logo); //replace text with logo
|
//header->insertCCItem(1, logo); //replace text with logo
|
||||||
|
|
||||||
|
if (!header->isPainted())
|
||||||
if (!header->isPainted()){
|
{
|
||||||
header->paint();
|
header->paint();
|
||||||
}
|
}
|
||||||
else{
|
else
|
||||||
|
{
|
||||||
header->hide();
|
header->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "footer"){
|
else if (actionKey == "footer")
|
||||||
|
{
|
||||||
int hh = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
|
int hh = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
|
||||||
if (footer == NULL){
|
if (footer == NULL)
|
||||||
|
{
|
||||||
footer = new CComponentsFooter(100, 30, 1000, hh, CComponentsFooter::CC_BTN_HELP | CComponentsFooter::CC_BTN_EXIT | CComponentsFooter::CC_BTN_MENU | CComponentsFooter::CC_BTN_MUTE_ZAP_ACTIVE, NULL, true);
|
footer = new CComponentsFooter(100, 30, 1000, hh, CComponentsFooter::CC_BTN_HELP | CComponentsFooter::CC_BTN_EXIT | CComponentsFooter::CC_BTN_MENU | CComponentsFooter::CC_BTN_MUTE_ZAP_ACTIVE, NULL, true);
|
||||||
//int start = 5, btnw =90, btnh = 37;
|
//int start = 5, btnw =90, btnh = 37;
|
||||||
footer->setButtonFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]);
|
footer->setButtonFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]);
|
||||||
@@ -707,23 +755,28 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
|
|
||||||
if (!footer->isPainted())
|
if (!footer->isPainted())
|
||||||
footer->paint();
|
footer->paint();
|
||||||
else{
|
else
|
||||||
|
{
|
||||||
footer->hide();
|
footer->hide();
|
||||||
delete footer;
|
delete footer;
|
||||||
footer = NULL;
|
footer = NULL;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "scrollbar"){
|
else if (actionKey == "scrollbar")
|
||||||
|
{
|
||||||
if (scrollbar == NULL)
|
if (scrollbar == NULL)
|
||||||
scrollbar = new CComponentsScrollBar(50, 100, 20, 400, 1);
|
scrollbar = new CComponentsScrollBar(50, 100, 20, 400, 1);
|
||||||
|
|
||||||
if (scrollbar->isPainted()){
|
if (scrollbar->isPainted())
|
||||||
if (scrollbar->getMarkID() == scrollbar->getSegmentCount()){
|
{
|
||||||
|
if (scrollbar->getMarkID() == scrollbar->getSegmentCount())
|
||||||
|
{
|
||||||
scrollbar->hide();
|
scrollbar->hide();
|
||||||
scrollbar->setSegmentCount(scrollbar->getSegmentCount() + 1);
|
scrollbar->setSegmentCount(scrollbar->getSegmentCount() + 1);
|
||||||
}
|
}
|
||||||
else{
|
else
|
||||||
|
{
|
||||||
scrollbar->setMarkID(scrollbar->getMarkID() + 1);
|
scrollbar->setMarkID(scrollbar->getMarkID() + 1);
|
||||||
scrollbar->paint();
|
scrollbar->paint();
|
||||||
}
|
}
|
||||||
@@ -733,15 +786,19 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "icon") {
|
else if (actionKey == "icon")
|
||||||
|
{
|
||||||
int y = 100;
|
int y = 100;
|
||||||
for (int i = 0; i < 10; i++){
|
for (int i = 0; i < 10; i++)
|
||||||
|
{
|
||||||
paintIcon(NEUTRINO_ICON_BUTTON_BLUE, 100, y, to_string(i), CNeutrinoFonts::FONT_STYLE_BOLD, COL_MENUCONTENT_PLUS_0, COL_MENUCONTENT_TEXT);
|
paintIcon(NEUTRINO_ICON_BUTTON_BLUE, 100, y, to_string(i), CNeutrinoFonts::FONT_STYLE_BOLD, COL_MENUCONTENT_PLUS_0, COL_MENUCONTENT_TEXT);
|
||||||
y += 30;
|
y += 30;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (actionKey == "iconform"){
|
else if (actionKey == "iconform")
|
||||||
if (iconform == NULL){
|
{
|
||||||
|
if (iconform == NULL)
|
||||||
|
{
|
||||||
iconform = new CComponentsIconForm();
|
iconform = new CComponentsIconForm();
|
||||||
iconform->setColorBody(COL_LIGHT_GRAY);
|
iconform->setColorBody(COL_LIGHT_GRAY);
|
||||||
iconform->setDimensionsAll(100, 100, 80/*480*/, 80);
|
iconform->setDimensionsAll(100, 100, 80/*480*/, 80);
|
||||||
@@ -775,10 +832,12 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
CComponentsPicture *img = static_cast<CComponentsPicture *>(iconform->getCCItem(2));
|
CComponentsPicture *img = static_cast<CComponentsPicture *>(iconform->getCCItem(2));
|
||||||
img->kill();
|
img->kill();
|
||||||
|
|
||||||
if (img->paintBlink(500)){
|
if (img->paintBlink(500))
|
||||||
|
{
|
||||||
ShowHint("Testmenu: Blink", "Testmenu: Blinking image is running ...", 700, 10);
|
ShowHint("Testmenu: Blink", "Testmenu: Blinking image is running ...", 700, 10);
|
||||||
}
|
}
|
||||||
if (img->cancelBlink(true)){
|
if (img->cancelBlink(true))
|
||||||
|
{
|
||||||
ShowHint("Testmenu: Blink", "Testmenu: Blinking image stopped ...", 700, 2);
|
ShowHint("Testmenu: Blink", "Testmenu: Blinking image stopped ...", 700, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -787,8 +846,10 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
iconform = NULL;
|
iconform = NULL;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "window"){
|
else if (actionKey == "window")
|
||||||
if (window == NULL){
|
{
|
||||||
|
if (window == NULL)
|
||||||
|
{
|
||||||
window = new CComponentsWindow();
|
window = new CComponentsWindow();
|
||||||
window->setWindowCaption("|........HEADER........|", CCHeaderTypes::CC_TITLE_CENTER);
|
window->setWindowCaption("|........HEADER........|", CCHeaderTypes::CC_TITLE_CENTER);
|
||||||
window->setDimensionsAll(50, 50, 500, 500);
|
window->setDimensionsAll(50, 50, 500, 500);
|
||||||
@@ -843,10 +904,12 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
window->addWindowItem(pic2);
|
window->addWindowItem(pic2);
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
if (!window->isPainted()){
|
if (!window->isPainted())
|
||||||
|
{
|
||||||
window->paint(); // if no other page has been defined, 1st page always painted
|
window->paint(); // if no other page has been defined, 1st page always painted
|
||||||
}
|
}
|
||||||
else{
|
else
|
||||||
|
{
|
||||||
#endif // or paint direct a defined page
|
#endif // or paint direct a defined page
|
||||||
//if (window->getCurrentPage() == 1)
|
//if (window->getCurrentPage() == 1)
|
||||||
window->enablePageScroll(CComponentsWindow::PG_SCROLL_M_UP_DOWN_KEY | CComponentsWindow::PG_SCROLL_M_LEFT_RIGHT_KEY);
|
window->enablePageScroll(CComponentsWindow::PG_SCROLL_M_UP_DOWN_KEY | CComponentsWindow::PG_SCROLL_M_LEFT_RIGHT_KEY);
|
||||||
@@ -859,20 +922,25 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
#endif
|
#endif
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "running_clock"){
|
else if (actionKey == "running_clock")
|
||||||
if (clock_r == NULL){
|
{
|
||||||
|
if (clock_r == NULL)
|
||||||
|
{
|
||||||
clock_r = new CComponentsFrmClock(100, 50, NULL, "%H.%M:%S", NULL, true);
|
clock_r = new CComponentsFrmClock(100, 50, NULL, "%H.%M:%S", NULL, true);
|
||||||
clock_r->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]);
|
clock_r->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]);
|
||||||
clock_r->setClockInterval(1);
|
clock_r->setClockInterval(1);
|
||||||
//clock_r->doPaintBg(false);
|
//clock_r->doPaintBg(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!clock_r->isPainted()){
|
if (!clock_r->isPainted())
|
||||||
|
{
|
||||||
if (clock_r->Start())
|
if (clock_r->Start())
|
||||||
return menu_return::RETURN_EXIT_ALL;;
|
return menu_return::RETURN_EXIT_ALL;;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
if (clock_r->Stop()){
|
{
|
||||||
|
if (clock_r->Stop())
|
||||||
|
{
|
||||||
clock_r->kill();
|
clock_r->kill();
|
||||||
delete clock_r;
|
delete clock_r;
|
||||||
clock_r = NULL;
|
clock_r = NULL;
|
||||||
@@ -880,27 +948,32 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (actionKey == "clock"){
|
else if (actionKey == "clock")
|
||||||
if (clock == NULL){
|
{
|
||||||
|
if (clock == NULL)
|
||||||
|
{
|
||||||
clock = new CComponentsFrmClock(100, 50, NULL, "%d.%m.%Y-%H:%M");
|
clock = new CComponentsFrmClock(100, 50, NULL, "%d.%m.%Y-%H:%M");
|
||||||
clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]);
|
clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!clock->isPainted())
|
if (!clock->isPainted())
|
||||||
clock->paint();
|
clock->paint();
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
clock->hide();
|
clock->hide();
|
||||||
delete clock;
|
delete clock;
|
||||||
clock = NULL;
|
clock = NULL;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "progress_window"){
|
else if (actionKey == "progress_window")
|
||||||
|
{
|
||||||
// classical
|
// classical
|
||||||
CProgressWindow pw0("Test 1: Local Bar Classic");
|
CProgressWindow pw0("Test 1: Local Bar Classic");
|
||||||
pw0.paint();
|
pw0.paint();
|
||||||
size_t max = 4;
|
size_t max = 4;
|
||||||
for(size_t i = 0; i<= max; i++){
|
for (size_t i = 0; i <= max; i++)
|
||||||
|
{
|
||||||
pw0.showStatus(i, max, to_string(i));
|
pw0.showStatus(i, max, to_string(i));
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
@@ -908,9 +981,11 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
|
|
||||||
CProgressWindow pw1("Test 2: Local/Global Bars Classic");
|
CProgressWindow pw1("Test 2: Local/Global Bars Classic");
|
||||||
pw1.paint();
|
pw1.paint();
|
||||||
for(size_t i = 1; i<= max; i++){
|
for (size_t i = 1; i <= max; i++)
|
||||||
|
{
|
||||||
pw1.showGlobalStatus(i, max, to_string(i));
|
pw1.showGlobalStatus(i, max, to_string(i));
|
||||||
for(size_t j = 1; j<= max; j++){
|
for (size_t j = 1; j <= max; j++)
|
||||||
|
{
|
||||||
pw1.showLocalStatus(j, max, to_string(j));
|
pw1.showLocalStatus(j, max, to_string(j));
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
@@ -923,7 +998,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
CProgressWindow pw2("Test 3: Local Bar via Signal/Slot", CCW_PERCENT 50, CCW_PERCENT 30, &OnProgress);
|
CProgressWindow pw2("Test 3: Local Bar via Signal/Slot", CCW_PERCENT 50, CCW_PERCENT 30, &OnProgress);
|
||||||
pw2.paint();
|
pw2.paint();
|
||||||
|
|
||||||
for(size_t i = 0; i<= max; i++){
|
for (size_t i = 0; i <= max; i++)
|
||||||
|
{
|
||||||
OnProgress(i, max, to_string(i));
|
OnProgress(i, max, to_string(i));
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
@@ -935,9 +1011,11 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
CProgressWindow pw3("Test 4: Local/Global via Signal/Slot", CCW_PERCENT 50, CCW_PERCENT 20, &OnProgress, &OnProgress1);
|
CProgressWindow pw3("Test 4: Local/Global via Signal/Slot", CCW_PERCENT 50, CCW_PERCENT 20, &OnProgress, &OnProgress1);
|
||||||
pw3.paint();
|
pw3.paint();
|
||||||
|
|
||||||
for(size_t i = 1; i <= max; i++){
|
for (size_t i = 1; i <= max; i++)
|
||||||
|
{
|
||||||
OnProgress1(i, max, to_string(i));
|
OnProgress1(i, max, to_string(i));
|
||||||
for(size_t j = 1; j<= 7; j++){
|
for (size_t j = 1; j <= 7; j++)
|
||||||
|
{
|
||||||
OnProgress(j, 7, to_string(j));
|
OnProgress(j, 7, to_string(j));
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
@@ -952,8 +1030,10 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
pw4.paint();
|
pw4.paint();
|
||||||
//OnSetGlobalMax(max);
|
//OnSetGlobalMax(max);
|
||||||
pw4.setGlobalMax(max);
|
pw4.setGlobalMax(max);
|
||||||
for(size_t i = 1; i <= max; i++){
|
for (size_t i = 1; i <= max; i++)
|
||||||
for(size_t j = 1; j<= 8; j++){
|
{
|
||||||
|
for (size_t j = 1; j <= 8; j++)
|
||||||
|
{
|
||||||
pw4.showStatus(j, 8, to_string(j));
|
pw4.showStatus(j, 8, to_string(j));
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
@@ -977,7 +1057,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
ShowHint("MsgBox test returns", msg_txt.c_str());
|
ShowHint("MsgBox test returns", msg_txt.c_str());
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
else if (actionKey == "msgbox_test_cancel"){
|
else if (actionKey == "msgbox_test_cancel")
|
||||||
|
{
|
||||||
CMsgBox *msgBox = new CMsgBox("Testmenu: MsgBox exit test", "Please press key");
|
CMsgBox *msgBox = new CMsgBox("Testmenu: MsgBox exit test", "Please press key");
|
||||||
//msgBox->setTimeOut(g_settings.handling_infobar[SNeutrinoSettings::HANDLING_INFOBAR]);
|
//msgBox->setTimeOut(g_settings.handling_infobar[SNeutrinoSettings::HANDLING_INFOBAR]);
|
||||||
msgBox->paint();
|
msgBox->paint();
|
||||||
@@ -992,7 +1073,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "msgbox_test_all"){
|
else if (actionKey == "msgbox_test_all")
|
||||||
|
{
|
||||||
int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbAll, NULL, 700);
|
int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbAll, NULL, 700);
|
||||||
|
|
||||||
std::string msg_txt = "Return value of MsgBox test is ";
|
std::string msg_txt = "Return value of MsgBox test is ";
|
||||||
@@ -1000,7 +1082,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
ShowHint("MsgBox test returns", msg_txt.c_str());
|
ShowHint("MsgBox test returns", msg_txt.c_str());
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
else if (actionKey == "msgbox_test_yes_no_cancel"){
|
else if (actionKey == "msgbox_test_yes_no_cancel")
|
||||||
|
{
|
||||||
int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrCancel, CMsgBox::mbYes | CMsgBox::mbNo | CMsgBox::mbCancel, NULL, 500);
|
int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrCancel, CMsgBox::mbYes | CMsgBox::mbNo | CMsgBox::mbCancel, NULL, 500);
|
||||||
|
|
||||||
std::string msg_txt = "Return value of MsgBox test is ";
|
std::string msg_txt = "Return value of MsgBox test is ";
|
||||||
@@ -1008,7 +1091,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
ShowHint("MsgBox test returns", msg_txt.c_str());
|
ShowHint("MsgBox test returns", msg_txt.c_str());
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
else if (actionKey == "msgbox_test_ok_cancel"){
|
else if (actionKey == "msgbox_test_ok_cancel")
|
||||||
|
{
|
||||||
int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbOk | CMsgBox::mbCancel, NULL, 500);
|
int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbOk | CMsgBox::mbCancel, NULL, 500);
|
||||||
|
|
||||||
std::string msg_txt = "Return value of MsgBox test is ";
|
std::string msg_txt = "Return value of MsgBox test is ";
|
||||||
@@ -1016,7 +1100,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
ShowHint("MsgBox test returns", msg_txt.c_str());
|
ShowHint("MsgBox test returns", msg_txt.c_str());
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
else if (actionKey == "msgbox_test_no_yes"){
|
else if (actionKey == "msgbox_test_no_yes")
|
||||||
|
{
|
||||||
int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbNoYes, NULL, 500);
|
int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbNoYes, NULL, 500);
|
||||||
|
|
||||||
std::string msg_txt = "Return value of MsgBox test is ";
|
std::string msg_txt = "Return value of MsgBox test is ";
|
||||||
@@ -1024,7 +1109,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
ShowHint("MsgBox test returns", msg_txt.c_str());
|
ShowHint("MsgBox test returns", msg_txt.c_str());
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
else if (actionKey == "msgbox_test_ok"){
|
else if (actionKey == "msgbox_test_ok")
|
||||||
|
{
|
||||||
int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press ok key! ...", CMsgBox::mbrOk, CMsgBox::mbOk, NULL, 500);
|
int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press ok key! ...", CMsgBox::mbrOk, CMsgBox::mbOk, NULL, 500);
|
||||||
|
|
||||||
std::string msg_txt = "Return value of MsgBox test is ";
|
std::string msg_txt = "Return value of MsgBox test is ";
|
||||||
@@ -1032,7 +1118,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
ShowHint("MsgBox test returns", msg_txt.c_str());
|
ShowHint("MsgBox test returns", msg_txt.c_str());
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
else if (actionKey == "msgbox_test_cancel_timeout"){
|
else if (actionKey == "msgbox_test_cancel_timeout")
|
||||||
|
{
|
||||||
int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press ok key or wait! ...", CMsgBox::mbrCancel, CMsgBox::mbOKCancel, NULL, 500, 6, true);
|
int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press ok key or wait! ...", CMsgBox::mbrCancel, CMsgBox::mbOKCancel, NULL, 500, 6, true);
|
||||||
|
|
||||||
std::string msg_txt = "Return value of MsgBox test is ";
|
std::string msg_txt = "Return value of MsgBox test is ";
|
||||||
@@ -1040,15 +1127,18 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
ShowHint("MsgBox test returns", msg_txt.c_str());
|
ShowHint("MsgBox test returns", msg_txt.c_str());
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
else if (actionKey == "msgbox_error"){
|
else if (actionKey == "msgbox_error")
|
||||||
|
{
|
||||||
DisplayErrorMessage("Error Test!");
|
DisplayErrorMessage("Error Test!");
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
else if (actionKey == "msgbox_info"){
|
else if (actionKey == "msgbox_info")
|
||||||
|
{
|
||||||
DisplayInfoMessage("Info Test!");
|
DisplayInfoMessage("Info Test!");
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
else if (actionKey == "short_hint"){
|
else if (actionKey == "short_hint")
|
||||||
|
{
|
||||||
CHint *hint = new CHint("Short hint with sleep and CHint instance");
|
CHint *hint = new CHint("Short hint with sleep and CHint instance");
|
||||||
// Set the message window outside of screen mid to demonstrate the hide behavior,
|
// Set the message window outside of screen mid to demonstrate the hide behavior,
|
||||||
// so that the hide behavior will not be influenced by any other window or menu.
|
// so that the hide behavior will not be influenced by any other window or menu.
|
||||||
@@ -1061,15 +1151,18 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
delete hint;
|
delete hint;
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
else if (actionKey == "short_hint_timed"){
|
else if (actionKey == "short_hint_timed")
|
||||||
|
{
|
||||||
ShowHintS("Info Test...", 3, true);
|
ShowHintS("Info Test...", 3, true);
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
else if (actionKey == "short_hint_timed_slot"){
|
else if (actionKey == "short_hint_timed_slot")
|
||||||
|
{
|
||||||
ShowHintS("Info test with function...", sigc::mem_fun(*this, &CTestMenu::showRecords), 3);
|
ShowHintS("Info test with function...", sigc::mem_fun(*this, &CTestMenu::showRecords), 3);
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
else if (actionKey == "short_hint_struct"){
|
else if (actionKey == "short_hint_struct")
|
||||||
|
{
|
||||||
hint_message_data_t hint;
|
hint_message_data_t hint;
|
||||||
hint.text = "Info Test...";
|
hint.text = "Info Test...";
|
||||||
hint.slot = sigc::mem_fun(*this, &CTestMenu::showRecords);
|
hint.slot = sigc::mem_fun(*this, &CTestMenu::showRecords);
|
||||||
@@ -1077,7 +1170,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
ShowHintS(hint);
|
ShowHintS(hint);
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
else if (actionKey == "shellwindow"){
|
else if (actionKey == "shellwindow")
|
||||||
|
{
|
||||||
sigc::slot3<void, std::string *, int *, bool *> sl_shell_output;
|
sigc::slot3<void, std::string *, int *, bool *> sl_shell_output;
|
||||||
sl_shell_output = sigc::mem_fun(*this, &CTestMenu::handleShellOutput);
|
sl_shell_output = sigc::mem_fun(*this, &CTestMenu::handleShellOutput);
|
||||||
int r = 0;
|
int r = 0;
|
||||||
@@ -1090,7 +1184,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
term.exec();
|
term.exec();
|
||||||
return menu_return::RETURN_REPAINT;
|
return menu_return::RETURN_REPAINT;
|
||||||
}
|
}
|
||||||
else if (actionKey == "msgbox_alt_btn"){
|
else if (actionKey == "msgbox_alt_btn")
|
||||||
|
{
|
||||||
CMsgBox msgBox("Variable buttontext...", "Msgbox Test");
|
CMsgBox msgBox("Variable buttontext...", "Msgbox Test");
|
||||||
msgBox.setShowedButtons(CMsgBox::mbNo | CMsgBox::mbYes);
|
msgBox.setShowedButtons(CMsgBox::mbNo | CMsgBox::mbYes);
|
||||||
msgBox.setButtonText(CMsgBox::mbNo, "Left Button");
|
msgBox.setButtonText(CMsgBox::mbNo, "Left Button");
|
||||||
@@ -1106,7 +1201,8 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "footer_key"){
|
else if (actionKey == "footer_key")
|
||||||
|
{
|
||||||
CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, "Footer-Key pressed. Press EXIT to return", 350, NULL, NULL, CComponentsHeader::CC_BTN_EXIT);
|
CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, "Footer-Key pressed. Press EXIT to return", 350, NULL, NULL, CComponentsHeader::CC_BTN_EXIT);
|
||||||
hintBox.setTimeOut(15, true);
|
hintBox.setTimeOut(15, true);
|
||||||
|
|
||||||
@@ -1123,25 +1219,29 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "rate_banner"){
|
else if (actionKey == "rate_banner")
|
||||||
|
{
|
||||||
CRateBanner banner(50, 50, 5.5, 10, NEUTRINO_ICON_TMDB);
|
CRateBanner banner(50, 50, 5.5, 10, NEUTRINO_ICON_TMDB);
|
||||||
banner.paint();
|
banner.paint();
|
||||||
sleep(6);
|
sleep(6);
|
||||||
banner.hide();
|
banner.hide();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "show_records"){
|
else if (actionKey == "show_records")
|
||||||
|
{
|
||||||
showRecords();
|
showRecords();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "hourglass"){
|
else if (actionKey == "hourglass")
|
||||||
|
{
|
||||||
CHourGlass hg(20, 20);
|
CHourGlass hg(20, 20);
|
||||||
hg.paint();
|
hg.paint();
|
||||||
sleep(10);
|
sleep(10);
|
||||||
hg.hide();
|
hg.hide();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
else if (actionKey == "hourglass_proc"){
|
else if (actionKey == "hourglass_proc")
|
||||||
|
{
|
||||||
CHourGlassProc proc(20, 20, sigc::mem_fun(*this, &CTestMenu::showRecords));
|
CHourGlassProc proc(20, 20, sigc::mem_fun(*this, &CTestMenu::showRecords));
|
||||||
proc.exec();
|
proc.exec();
|
||||||
return res;
|
return res;
|
||||||
@@ -1219,7 +1319,8 @@ void CTestMenu::showRecords()
|
|||||||
recordsbox->setDimensionsAll(box_posX, box_posY, w_recbox + w_shadow, h_rbox);
|
recordsbox->setDimensionsAll(box_posX, box_posY, w_recbox + w_shadow, h_rbox);
|
||||||
recordsbox->paint0();
|
recordsbox->paint0();
|
||||||
|
|
||||||
for(size_t j = 0; j< images.size(); j++){
|
for (size_t j = 0; j < images.size(); j++)
|
||||||
|
{
|
||||||
images[j]->kill();
|
images[j]->kill();
|
||||||
images[j]->paintBlink(timer);
|
images[j]->paintBlink(timer);
|
||||||
}
|
}
|
||||||
@@ -1232,7 +1333,7 @@ void CTestMenu::showRecords()
|
|||||||
ShowHint("Testmenu: Records", "No records ...", 200, 30, NULL, NEUTRINO_ICON_HINT_RECORDING, CComponentsHeader::CC_BTN_EXIT);
|
ShowHint("Testmenu: Records", "No records ...", 200, 30, NULL, NEUTRINO_ICON_HINT_RECORDING, CComponentsHeader::CC_BTN_EXIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* shows entries for proxy settings */
|
// shows entries for proxy settings
|
||||||
int CTestMenu::showTestMenu()
|
int CTestMenu::showTestMenu()
|
||||||
{
|
{
|
||||||
unsigned int system_rev = cs_get_revision();
|
unsigned int system_rev = cs_get_revision();
|
||||||
@@ -1287,7 +1388,8 @@ int CTestMenu::showTestMenu()
|
|||||||
w_test.addItem(new CMenuForwarder(LOCALE_SERVICEMENU_RESTART, true, NULL, CNeutrinoApp::getInstance(), "restart", CRCInput::RC_standby));
|
w_test.addItem(new CMenuForwarder(LOCALE_SERVICEMENU_RESTART, true, NULL, CNeutrinoApp::getInstance(), "restart", CRCInput::RC_standby));
|
||||||
|
|
||||||
// footer buttons
|
// footer buttons
|
||||||
static const struct button_label footerButtons[2] = {
|
static const struct button_label footerButtons[2] =
|
||||||
|
{
|
||||||
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_COLORCHOOSER_RED },
|
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_COLORCHOOSER_RED },
|
||||||
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_COLORCHOOSER_GREEN }
|
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_COLORCHOOSER_GREEN }
|
||||||
};
|
};
|
||||||
@@ -1345,27 +1447,35 @@ void CTestMenu::showHWTests(CMenuWidget *widget)
|
|||||||
widget->addItem(new CMenuForwarder("SD/MMC", true, NULL, this, "mmc"));
|
widget->addItem(new CMenuForwarder("SD/MMC", true, NULL, this, "mmc"));
|
||||||
widget->addItem(new CMenuForwarder("Tuner Reset", true, NULL, CNeutrinoApp::getInstance(), "restarttuner"));
|
widget->addItem(new CMenuForwarder("Tuner Reset", true, NULL, CNeutrinoApp::getInstance(), "restarttuner"));
|
||||||
|
|
||||||
#if 0 //some parts DEPRECATED
|
#if 0
|
||||||
for (unsigned i = 0; i < sizeof(test_pos)/sizeof(int); i++) {
|
// some parts DEPRECATED
|
||||||
|
for (unsigned i = 0; i < sizeof(test_pos) / sizeof(int); i++)
|
||||||
|
{
|
||||||
CServiceManager::getInstance()->InitSatPosition(test_pos[i], NULL, true);
|
CServiceManager::getInstance()->InitSatPosition(test_pos[i], NULL, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned count = CFEManager::getInstance()->getFrontendCount();
|
unsigned count = CFEManager::getInstance()->getFrontendCount();
|
||||||
for (unsigned i = 0; i < count; i++) {
|
for (unsigned i = 0; i < count; i++)
|
||||||
|
{
|
||||||
widget->addItem(GenericMenuSeparatorLine);
|
widget->addItem(GenericMenuSeparatorLine);
|
||||||
CFrontend *frontend = CFEManager::getInstance()->getFE(i);
|
CFrontend *frontend = CFEManager::getInstance()->getFE(i);
|
||||||
char title[100];
|
char title[100];
|
||||||
char scan[100];
|
char scan[100];
|
||||||
sprintf(scan, "scan%d", i);
|
sprintf(scan, "scan%d", i);
|
||||||
if (frontend->hasSat()) {
|
if (frontend->hasSat())
|
||||||
|
{
|
||||||
sprintf(title, "Satellite tuner %d: Scan %s", i + 1, (i & 1) ? /*"12439-02500-H-5/6"*/"3951-9520-V-3/4" : "4000-27500-V-3/4");
|
sprintf(title, "Satellite tuner %d: Scan %s", i + 1, (i & 1) ? /*"12439-02500-H-5/6"*/"3951-9520-V-3/4" : "4000-27500-V-3/4");
|
||||||
} else if (frontend->hasCable()) {
|
}
|
||||||
|
else if (frontend->hasCable())
|
||||||
|
{
|
||||||
sprintf(title, "Cable tuner %d: Scan 474-6875-QAM-256", i + 1);
|
sprintf(title, "Cable tuner %d: Scan 474-6875-QAM-256", i + 1);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
widget->addItem(new CMenuForwarder(title, true, NULL, this, scan));
|
widget->addItem(new CMenuForwarder(title, true, NULL, this, scan));
|
||||||
if (frontend->hasSat()) {
|
if (frontend->hasSat())
|
||||||
|
{
|
||||||
frontend->setMode(CFrontend::FE_MODE_INDEPENDENT);
|
frontend->setMode(CFrontend::FE_MODE_INDEPENDENT);
|
||||||
|
|
||||||
satellite_map_t satmap = CServiceManager::getInstance()->SatelliteList();
|
satellite_map_t satmap = CServiceManager::getInstance()->SatelliteList();
|
||||||
@@ -1373,19 +1483,23 @@ void CTestMenu::showHWTests(CMenuWidget *widget)
|
|||||||
satmap[test_pos[i]].lnbOffsetLow = 5150;
|
satmap[test_pos[i]].lnbOffsetLow = 5150;
|
||||||
satmap[test_pos[i]].lnbOffsetHigh = 5150;
|
satmap[test_pos[i]].lnbOffsetHigh = 5150;
|
||||||
frontend->setSatellites(satmap);
|
frontend->setSatellites(satmap);
|
||||||
if (i == 0) {
|
if (i == 0)
|
||||||
|
{
|
||||||
widget->addItem(new CMenuForwarder("Tuner 1: 22 Khz ON", true, NULL, this, "22kon0"));
|
widget->addItem(new CMenuForwarder("Tuner 1: 22 Khz ON", true, NULL, this, "22kon0"));
|
||||||
widget->addItem(new CMenuForwarder("Tuner 1: 22 Khz OFF", true, NULL, this, "22koff0"));
|
widget->addItem(new CMenuForwarder("Tuner 1: 22 Khz OFF", true, NULL, this, "22koff0"));
|
||||||
}
|
}
|
||||||
if (i == 1) {
|
if (i == 1)
|
||||||
|
{
|
||||||
widget->addItem(new CMenuForwarder("Tuner 2: 22 Khz ON", true, NULL, this, "22kon1"));
|
widget->addItem(new CMenuForwarder("Tuner 2: 22 Khz ON", true, NULL, this, "22kon1"));
|
||||||
widget->addItem(new CMenuForwarder("Tuner 2: 22 Khz OFF", true, NULL, this, "22koff1"));
|
widget->addItem(new CMenuForwarder("Tuner 2: 22 Khz OFF", true, NULL, this, "22koff1"));
|
||||||
}
|
}
|
||||||
if (i == 2) {
|
if (i == 2)
|
||||||
|
{
|
||||||
widget->addItem(new CMenuForwarder("Tuner 3: 22 Khz ON", true, NULL, this, "22kon2"));
|
widget->addItem(new CMenuForwarder("Tuner 3: 22 Khz ON", true, NULL, this, "22kon2"));
|
||||||
widget->addItem(new CMenuForwarder("Tuner 3: 22 Khz OFF", true, NULL, this, "22koff2"));
|
widget->addItem(new CMenuForwarder("Tuner 3: 22 Khz OFF", true, NULL, this, "22koff2"));
|
||||||
}
|
}
|
||||||
if (i == 3) {
|
if (i == 3)
|
||||||
|
{
|
||||||
widget->addItem(new CMenuForwarder("Tuner 4: 22 Khz ON", true, NULL, this, "22kon3"));
|
widget->addItem(new CMenuForwarder("Tuner 4: 22 Khz ON", true, NULL, this, "22kon3"));
|
||||||
widget->addItem(new CMenuForwarder("Tuner 4: 22 Khz OFF", true, NULL, this, "22koff3"));
|
widget->addItem(new CMenuForwarder("Tuner 4: 22 Khz OFF", true, NULL, this, "22koff3"));
|
||||||
}
|
}
|
||||||
|
@@ -71,5 +71,4 @@ class CTestMenu : public CMenuTarget
|
|||||||
int exec(CMenuTarget *parent, const std::string &actionKey);
|
int exec(CMenuTarget *parent, const std::string &actionKey);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user