mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 01:41:12 +02:00
test_menu: add CTermWindow() test
Origin commit data
------------------
Commit: 2ec0b463aa
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2018-01-15 (Mon, 15 Jan 2018)
This commit is contained in:
committed by
vanhofen
parent
6ec6be1a41
commit
8e7dc910a8
@@ -52,6 +52,7 @@
|
|||||||
|
|
||||||
#include <gui/widget/msgbox.h>
|
#include <gui/widget/msgbox.h>
|
||||||
#include <gui/widget/progresswindow.h>
|
#include <gui/widget/progresswindow.h>
|
||||||
|
#include <gui/widget/termwindow.h>
|
||||||
#include <gui/scan.h>
|
#include <gui/scan.h>
|
||||||
#include <gui/scan_setup.h>
|
#include <gui/scan_setup.h>
|
||||||
#include <zapit/zapit.h>
|
#include <zapit/zapit.h>
|
||||||
@@ -116,6 +117,11 @@ CTestMenu::~CTestMenu()
|
|||||||
|
|
||||||
//static int test_pos[4] = { 130, 192, 282, 360 };
|
//static int test_pos[4] = { 130, 192, 282, 360 };
|
||||||
|
|
||||||
|
void CTestMenu::handleShellOutput(std::string *line, int *, bool *)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s: %s\n", __func__, line->c_str());
|
||||||
|
}
|
||||||
|
|
||||||
int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||||
{
|
{
|
||||||
dprintf(DEBUG_DEBUG, "init test menu\n");
|
dprintf(DEBUG_DEBUG, "init test menu\n");
|
||||||
@@ -991,6 +997,19 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
else if (actionKey == "shellwindow"){
|
||||||
|
sigc::slot3<void, std::string*, int *, bool *> sl_shell_output;
|
||||||
|
sl_shell_output = sigc::mem_fun(*this, &CTestMenu::handleShellOutput);
|
||||||
|
int r = 0;
|
||||||
|
const char *c = getenv("TEST_COMMAND");
|
||||||
|
std::string cmd = "/bin/ps auxwf";
|
||||||
|
if (c)
|
||||||
|
cmd = (std::string)c;
|
||||||
|
CTermWindow term(cmd, CTermWindow::VERBOSE | CTermWindow::ACKNOWLEDGE, &r, false);
|
||||||
|
term.OnShellOutputLoop.connect(sl_shell_output);
|
||||||
|
term.exec();
|
||||||
|
return menu_return::RETURN_REPAINT;
|
||||||
|
}
|
||||||
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);
|
hintBox.setTimeOut(15);
|
||||||
@@ -1110,6 +1129,7 @@ int CTestMenu::showTestMenu()
|
|||||||
CMenuWidget w_test(rev /*"Test menu"*/, NEUTRINO_ICON_INFO, width, MN_WIDGET_ID_TESTMENU);
|
CMenuWidget w_test(rev /*"Test menu"*/, NEUTRINO_ICON_INFO, width, MN_WIDGET_ID_TESTMENU);
|
||||||
w_test.addIntroItems();
|
w_test.addIntroItems();
|
||||||
|
|
||||||
|
w_test.addItem(new CMenuForwarder("Shell Window Test", true, NULL, this, "shellwindow"));
|
||||||
//hardware
|
//hardware
|
||||||
CMenuWidget * w_hw = new CMenuWidget("Hardware Test", NEUTRINO_ICON_INFO, width, MN_WIDGET_ID_TESTMENU_HARDWARE);
|
CMenuWidget * w_hw = new CMenuWidget("Hardware Test", NEUTRINO_ICON_INFO, width, MN_WIDGET_ID_TESTMENU_HARDWARE);
|
||||||
w_test.addItem(new CMenuForwarder(w_hw->getName(), true, NULL, w_hw));
|
w_test.addItem(new CMenuForwarder(w_hw->getName(), true, NULL, w_hw));
|
||||||
|
@@ -62,6 +62,7 @@ class CTestMenu : public CMenuTarget
|
|||||||
void showCCTests(CMenuWidget *widget);
|
void showCCTests(CMenuWidget *widget);
|
||||||
void showMsgTests(CMenuWidget *widget);
|
void showMsgTests(CMenuWidget *widget);
|
||||||
void showRecords();
|
void showRecords();
|
||||||
|
void handleShellOutput(std::string *line, int *, bool *);
|
||||||
public:
|
public:
|
||||||
CTestMenu();
|
CTestMenu();
|
||||||
~CTestMenu();
|
~CTestMenu();
|
||||||
|
Reference in New Issue
Block a user