diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 65d0a95b3..583182b26 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -53,6 +53,7 @@ libneutrino_gui_a_SOURCES = \ favorites.cpp \ filebrowser.cpp \ imageinfo.cpp \ + info_menue.cpp \ infoviewer.cpp \ keybind_setup.cpp \ mediaplayer.cpp \ diff --git a/src/gui/info_menue.cpp b/src/gui/info_menue.cpp new file mode 100644 index 000000000..9d5845bf1 --- /dev/null +++ b/src/gui/info_menue.cpp @@ -0,0 +1,91 @@ +/* + info menue - Neutrino-GUI + + Copyright (C) 2001 Steffen Hehn 'McClean' + and some other guys + Homepage: http://dbox.cyberphoria.org/ + + Copyright (C) 2011 T. Graf 'dbt' + Homepage: http://www.dbox2-tuning.net/ + + License: GPL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "gui/info_menue.h" +#include "gui/imageinfo.h" +#include "gui/dboxinfo.h" +#include + +#include + + +CInfoMenu::CInfoMenu() +{ + width = w_max (40, 10); + selected = -1; +} + + +CInfoMenu::~CInfoMenu() +{ + + +} + +int CInfoMenu::exec(CMenuTarget* parent, const std::string &/*actionKey*/) +{ + printf("[neutrino] CInfoMenu %s: init...\n",__FUNCTION__); + int res = menu_return::RETURN_REPAINT; + + if (parent) + parent->hide(); + + showMenu(); + + return res; +} + + + +void CInfoMenu::showMenu() +{ + printf("[neutrino] CInfoMenu call %s...\n", __FUNCTION__); + + CMenuWidget *info = new CMenuWidget(LOCALE_MESSAGEBOX_INFO, NEUTRINO_ICON_INFO); + info->setSelected(selected); + + info->addIntroItems(); + info->addItem(new CMenuForwarder(LOCALE_SERVICEMENU_IMAGEINFO, true, NULL, new CImageInfo(), NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED ), false); + info->addItem(new CMenuForwarder(LOCALE_EXTRA_DBOXINFO, true, NULL, new CDBoxInfoWidget, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); + info->addItem(new CMenuForwarder(LOCALE_STREAMINFO_HEAD, true, NULL, new CStreamInfo2Handler(), NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW)); + + info->exec(NULL, ""); + info->hide(); + selected = info->getSelected(); + delete info; +} + + + diff --git a/src/gui/info_menue.h b/src/gui/info_menue.h new file mode 100644 index 000000000..597e58be5 --- /dev/null +++ b/src/gui/info_menue.h @@ -0,0 +1,52 @@ +/* + info menue - Neutrino-GUI + + Copyright (C) 2001 Steffen Hehn 'McClean' + and some other guys + Homepage: http://dbox.cyberphoria.org/ + + Copyright (C) 2011 T. Graf 'dbt' + Homepage: http://www.dbox2-tuning.net/ + + License: GPL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef __INFO_MENU__ +#define __INFO_MENU__ + +#include +#include + +#include + + +class CInfoMenu : public CMenuTarget +{ + private: + int width, selected; + + void showMenu(); + + public: + CInfoMenu(); + ~CInfoMenu(); + + int exec(CMenuTarget* parent, const std::string & actionKey = ""); +}; + +#endif diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index cd9dee0e5..ec7ebf5b6 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -55,6 +55,7 @@ #include "gui/favorites.h" #include "gui/hdd_menu.h" #include "gui/imageinfo.h" +#include "gui/info_menue.h" #include "gui/keybind_setup.h" #include "gui/mediaplayer.h" #include "gui/mediaplayer_setup.h" @@ -140,14 +141,9 @@ void CNeutrinoApp::InitMainMenu(CMenuWidget &mainMenu, CMenuWidget &mainSettings mainMenu.addItem( new CMenuSeparator(CMenuSeparator::LINE) ); // start of infomenu - if (g_settings.show_infomenu == 0) { - CMenuWidget *info = new CMenuWidget(LOCALE_MESSAGEBOX_INFO, NEUTRINO_ICON_INFO); - info->addIntroItems(); - info->addItem(new CMenuForwarder(LOCALE_SERVICEMENU_IMAGEINFO, true, NULL, new CImageInfo(), NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED ), false); - info->addItem( new CMenuForwarder(LOCALE_EXTRA_DBOXINFO, true, NULL, new CDBoxInfoWidget, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); - info->addItem(new CMenuForwarder(LOCALE_STREAMINFO_HEAD, true, NULL, new CStreamInfo2Handler(), NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW)); - mainMenu.addItem(new CMenuForwarder(LOCALE_MESSAGEBOX_INFO, true, NULL, info, NULL, CRCInput::RC_help, NEUTRINO_ICON_BUTTON_HELP_SMALL )); - } + if (g_settings.show_infomenu == 0) + mainMenu.addItem(new CMenuForwarder(LOCALE_MESSAGEBOX_INFO, true, NULL, new CInfoMenu(), NULL, CRCInput::RC_help, NEUTRINO_ICON_BUTTON_HELP_SMALL )); + // end of infomenu /*if(system_rev != 10)*/ mainMenu.addItem( new CMenuForwarder(LOCALE_CI_SETTINGS, true, NULL, g_CamHandler, NULL, CRCInput::convertDigitToKey(0))); @@ -287,15 +283,11 @@ void CNeutrinoApp::InitServiceSettings(CMenuWidget &service/*, CMenuWidget &_sca service.addItem(GenericMenuSeparatorLine); service.addItem(new CMenuForwarder(LOCALE_SERVICEMENU_RESTART , true, NULL, this, "restart", CRCInput::RC_standby, NEUTRINO_ICON_BUTTON_POWER)); service.addItem(new CMenuForwarder(LOCALE_SERVICEMENU_GETPLUGINS, true, NULL, this, "reloadplugins")); + // start infomenu in service - if (g_settings.show_infomenu == 1) { - CMenuWidget *info = new CMenuWidget(LOCALE_MESSAGEBOX_INFO, NEUTRINO_ICON_INFO); - info->addIntroItems(); - info->addItem(new CMenuForwarder(LOCALE_SERVICEMENU_IMAGEINFO, true, NULL, new CImageInfo(), NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED ), false); - info->addItem( new CMenuForwarder(LOCALE_EXTRA_DBOXINFO, true, NULL, new CDBoxInfoWidget, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); - info->addItem(new CMenuForwarder(LOCALE_STREAMINFO_HEAD, true, NULL, new CStreamInfo2Handler(), NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW)); - service.addItem(new CMenuForwarder(LOCALE_MESSAGEBOX_INFO, true, NULL, info, NULL, CRCInput::RC_help, NEUTRINO_ICON_BUTTON_HELP_SMALL )); - } + if (g_settings.show_infomenu == 1) + service.addItem(new CMenuForwarder(LOCALE_MESSAGEBOX_INFO, true, NULL, new CInfoMenu(), NULL, CRCInput::RC_help, NEUTRINO_ICON_BUTTON_HELP_SMALL )); + // end of infomenu in service //softupdate //if(softupdate)