info-menu: allow cs_info (RC_help) only for COOL_HARDWARE; ...

add shortcut (RC_info) to execute ni-imageinfo


Origin commit data
------------------
Branch: ni/coolstream
Commit: 4cfbc3f226
Author: vanhofen <vanhofen@gmx.de>
Date: 2019-01-02 (Wed, 02 Jan 2019)

Origin message was:
------------------
- info-menu: allow cs_info (RC_help) only for COOL_HARDWARE; ...

add shortcut (RC_info) to execute ni-imageinfo


------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2019-01-02 01:27:07 +01:00
parent 2749b8cbdb
commit 7d5c2c2eef
2 changed files with 30 additions and 22 deletions

View File

@@ -34,10 +34,10 @@
#include <neutrino.h> #include <neutrino.h>
#include <neutrino_menue.h> #include <neutrino_menue.h>
#include <cs_api.h> //NI #include <cs_api.h>
#include <gui/hdd_info.h> //NI #include <gui/hdd_info.h>
#include <gui/info_menue.h> #include <gui/info_menue.h>
#include <gui/imageinfo_ni.h> //NI #include <gui/imageinfo_ni.h>
#include <gui/dboxinfo.h> #include <gui/dboxinfo.h>
#if HAVE_COOL_HARDWARE #if HAVE_COOL_HARDWARE
#include <gui/streaminfo1.h> #include <gui/streaminfo1.h>
@@ -47,37 +47,43 @@
#if 0 #if 0
#include <gui/buildinfo.h> #include <gui/buildinfo.h>
#endif #endif
#include <gui/widget/msgbox.h> //NI #include <gui/widget/msgbox.h>
#include <driver/screen_max.h> #include <driver/screen_max.h>
#include "gui/cam_menu.h" #include "gui/cam_menu.h"
extern CCAMMenuHandler * g_CamHandler; extern CCAMMenuHandler *g_CamHandler;
CInfoMenu::CInfoMenu() CInfoMenu::CInfoMenu()
{ {
width = 35; //NI width = 35;
} }
CInfoMenu::~CInfoMenu() CInfoMenu::~CInfoMenu()
{ {
} }
int CInfoMenu::exec(CMenuTarget* parent, const std::string &actionKey) //NI int CInfoMenu::exec(CMenuTarget *parent, const std::string &actionKey)
{ {
int res = menu_return::RETURN_REPAINT; int res = menu_return::RETURN_REPAINT;
if (parent != NULL) if (parent != NULL)
parent->hide(); parent->hide();
//NI if (actionKey == "cs_get_info")
if (actionKey == "info")
{ {
#if HAVE_COOL_HARDWARE
char str[1024]; char str[1024];
sprintf(str, "cs_get_revision(): 0x%02X\n", cs_get_revision()); sprintf(str, "cs_get_revision(): 0x%02X\n", cs_get_revision());
sprintf(str, "%scs_get_chip_type(): 0x%04X\n", str, cs_get_chip_type()); sprintf(str, "%scs_get_chip_type(): 0x%04X\n", str, cs_get_chip_type());
ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMsgBox::mbrBack, CMsgBox::mbBack); ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMsgBox::mbrBack, CMsgBox::mbBack);
return res; return res;
#endif
}
else if (actionKey == "imageinfo")
{
CImageInfoNI imageinfo;
return imageinfo.exec(NULL, "");
} }
res = showMenu(); res = showMenu();
@@ -88,19 +94,20 @@ int CInfoMenu::exec(CMenuTarget* parent, const std::string &actionKey) //NI
int CInfoMenu::showMenu() int CInfoMenu::showMenu()
{ {
CMenuWidget *info = new CMenuWidget(LOCALE_MESSAGEBOX_INFO, NEUTRINO_ICON_INFO, width, MN_WIDGET_ID_INFOMENUE); CMenuWidget *info = new CMenuWidget(LOCALE_MESSAGEBOX_INFO, NEUTRINO_ICON_INFO, width, MN_WIDGET_ID_INFOMENUE);
info->addKey(CRCInput::RC_info, this, "info"); //NI info->addKey(CRCInput::RC_help, this, "cs_get_info");
info->addKey(CRCInput::RC_info, this, "imageinfo");
CImageInfoNI imageinfo; //NI CImageInfoNI imageinfo;
CDBoxInfoWidget boxinfo; CDBoxInfoWidget boxinfo;
CHDDInfoMenu hddinfo; //NI CHDDInfoMenu hddinfo;
CStreamInfo2 streaminfo; CStreamInfo2 streaminfo;
info->addIntroItems(); info->addIntroItems();
CMenuForwarder * mf = new CMenuForwarder(LOCALE_SERVICEMENU_IMAGEINFO, true, NULL, &imageinfo, NULL, CRCInput::RC_red); CMenuForwarder *mf = new CMenuForwarder(LOCALE_SERVICEMENU_IMAGEINFO, true, NULL, &imageinfo, NULL, CRCInput::RC_red);
mf->setHint(NEUTRINO_ICON_HINT_IMAGEINFO, LOCALE_MENU_HINT_IMAGEINFO); mf->setHint(NEUTRINO_ICON_HINT_IMAGEINFO, LOCALE_MENU_HINT_IMAGEINFO);
info->addItem(mf); info->addItem(mf);
mf = new CMenuForwarder(LOCALE_EXTRA_DBOXINFO, true, NULL, &boxinfo, NULL, CRCInput::RC_green); mf = new CMenuForwarder(LOCALE_EXTRA_DBOXINFO, true, NULL, &boxinfo, NULL, CRCInput::RC_green);
mf->setHint(NEUTRINO_ICON_HINT_DBOXINFO, LOCALE_MENU_HINT_DBOXINFO); mf->setHint(NEUTRINO_ICON_HINT_DBOXINFO, LOCALE_MENU_HINT_DBOXINFO);
info->addItem(mf); info->addItem(mf);
@@ -108,13 +115,14 @@ int CInfoMenu::showMenu()
mf = new CMenuForwarder(LOCALE_STREAMINFO_HEAD, _mode_ts || !CNeutrinoApp::getInstance()->channelList->isEmpty(), NULL, &streaminfo, NULL, CRCInput::RC_yellow); mf = new CMenuForwarder(LOCALE_STREAMINFO_HEAD, _mode_ts || !CNeutrinoApp::getInstance()->channelList->isEmpty(), NULL, &streaminfo, NULL, CRCInput::RC_yellow);
mf->setHint(NEUTRINO_ICON_HINT_STREAMINFO, LOCALE_MENU_HINT_STREAMINFO); mf->setHint(NEUTRINO_ICON_HINT_STREAMINFO, LOCALE_MENU_HINT_STREAMINFO);
info->addItem(mf); info->addItem(mf);
#if 0 #if 0
CBuildInfo buildinfo; CBuildInfo buildinfo;
mf = new CMenuForwarder(LOCALE_BUILDINFO_MENU, true, NULL, &buildinfo, NULL, CRCInput::RC_blue); mf = new CMenuForwarder(LOCALE_BUILDINFO_MENU, true, NULL, &buildinfo, NULL, CRCInput::RC_blue);
mf->setHint(NEUTRINO_ICON_HINT_IMAGEINFO, LOCALE_MENU_HINT_BUILDINFO); mf->setHint(NEUTRINO_ICON_HINT_IMAGEINFO, LOCALE_MENU_HINT_BUILDINFO);
info->addItem(mf); info->addItem(mf);
#endif #endif
//NI
mf = new CMenuForwarder(LOCALE_HDD_INFO_HEAD, true, NULL, &hddinfo, NULL, CRCInput::RC_blue); mf = new CMenuForwarder(LOCALE_HDD_INFO_HEAD, true, NULL, &hddinfo, NULL, CRCInput::RC_blue);
mf->setHint(NEUTRINO_ICON_HINT_HDD_INFO, LOCALE_MENU_HINT_HDD_INFO); mf->setHint(NEUTRINO_ICON_HINT_HDD_INFO, LOCALE_MENU_HINT_HDD_INFO);
info->addItem(mf); info->addItem(mf);

View File

@@ -46,7 +46,7 @@ class CInfoMenu : public CMenuTarget
CInfoMenu(); CInfoMenu();
~CInfoMenu(); ~CInfoMenu();
int exec(CMenuTarget* parent, const std::string & actionKey = ""); int exec(CMenuTarget *parent, const std::string &actionKey = "");
}; };
#endif #endif