From fad4aa0f7f1088ac6e37a19fed83a68eba42536e Mon Sep 17 00:00:00 2001 From: seife Date: Sun, 12 Sep 2010 18:02:48 +0000 Subject: [PATCH] neutrino: make location of "information" menu configurable the location of the "information" menu can now be configured in neutrino.conf: show_infomenu=1 shows it below the service menu, show_infomenu=0 (default) in the main menu, as before. Patch by bazi98. Should probably be configurable somewhere in the GUI. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@766 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/neutrino.cpp | 2 ++ src/neutrino_menue.cpp | 29 +++++++++++++++++++++++++++-- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 1 + 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 960911314..82088ed8e 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -830,6 +830,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.volume_pos = configfile.getInt32("volume_pos", 0 ); g_settings.menu_pos = configfile.getInt32("menu_pos", 0 ); g_settings.infobar_show_var_hdd = configfile.getBool("infobar_show_var_hdd" , true ); + g_settings.show_infomenu = configfile.getInt32("show_infomenu", 0 ); //audio g_settings.audio_AnalogMode = configfile.getInt32( "audio_AnalogMode", 0 ); g_settings.audio_DolbyDigital = configfile.getBool("audio_DolbyDigital" , false); @@ -1371,6 +1372,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("volume_pos" , g_settings.volume_pos ); configfile.setInt32("menu_pos" , g_settings.menu_pos); configfile.setInt32("infobar_show_var_hdd" , g_settings.infobar_show_var_hdd ); + configfile.setInt32("show_infomenu" , g_settings.show_infomenu ); //audio configfile.setInt32( "audio_AnalogMode", g_settings.audio_AnalogMode ); diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 38409b775..41169c324 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -846,7 +846,16 @@ void CNeutrinoApp::InitMainMenu(CMenuWidget &mainMenu, CMenuWidget &mainSettings mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_SHUTDOWN, true, NULL, this, "shutdown", CRCInput::RC_standby, NEUTRINO_ICON_BUTTON_POWER)); mainMenu.addItem( new CMenuSeparator(CMenuSeparator::LINE) ); - mainMenu.addItem( new CMenuForwarder(LOCALE_DBOXINFO, true, NULL, new CDBoxInfoWidget, NULL, CRCInput::convertDigitToKey(shortcut++))); + // start of infomenu + if (g_settings.show_infomenu == 0) { + CMenuWidget *info = new CMenuWidget(LOCALE_MESSAGEBOX_INFO, NEUTRINO_ICON_INFO); + addMenueIntroItems(*info); + 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_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 )); + } + // end of infomenu mainMenu.addItem( new CMenuForwarder(LOCALE_CAM_SETTINGS, true, NULL, g_CamHandler, NULL, CRCInput::convertDigitToKey(0))); //settings menu @@ -1470,8 +1479,17 @@ void CNeutrinoApp::InitServiceSettings(CMenuWidget &service, CMenuWidget &_scanS service.addItem(new CMenuForwarder(LOCALE_SERVICEMENU_GETPLUGINS, true, NULL, this, "reloadplugins")); service.addItem(GenericMenuSeparatorLine); - service.addItem(new CMenuForwarder(LOCALE_SERVICEMENU_IMAGEINFO, true, NULL, new CImageInfo(), NULL, CRCInput::RC_help, NEUTRINO_ICON_BUTTON_HELP_SMALL ), false); service.addItem(new CMenuForwarder(LOCALE_SERVICEMENU_RESTART , true, NULL, this, "restart", CRCInput::RC_standby, NEUTRINO_ICON_BUTTON_POWER)); + // start infomenu in service + if (g_settings.show_infomenu == 1) { + CMenuWidget *info = new CMenuWidget(LOCALE_MESSAGEBOX_INFO, NEUTRINO_ICON_INFO); + addMenueIntroItems(*info); + 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_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 )); + } + // end of infomenu in service //softupdate //if(softupdate) { @@ -2515,6 +2533,13 @@ const CMenuOptionChooser::keyval INFOBAR_CASYSTEM_MODE_OPTIONS[INFOBAR_CASYSTEM_ { 3, LOCALE_OPTIONS_OFF }, }; +#define SHOW_INFOMENU_MODE_OPTION_COUNT 2 +const CMenuOptionChooser::keyval SHOW_INFOMENU_MODE_OPTIONS[SHOW_INFOMENU_MODE_OPTION_COUNT] = +{ + { 0, LOCALE_MAINMENU_HEAD }, + { 1, LOCALE_MAINMENU_SERVICE }, +}; + void CNeutrinoApp::InitColorSettings(CMenuWidget &colorSettings, CMenuWidget &fontSettings ) { CScreenSetup * ScreenSetup = new CScreenSetup(); diff --git a/src/system/locals.h b/src/system/locals.h index 40613a7c5..14aa37533 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -568,6 +568,7 @@ typedef enum { LOCALE_MISCSETTINGS_INFOBAR_SAT_DISPLAY, LOCALE_MISCSETTINGS_INFOBAR_SHOW, LOCALE_MISCSETTINGS_INFOBAR_SHOW_VAR_HDD, + LOCALE_MISCSETTINGS_SHOW_INFOMENU, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT1, LOCALE_MISCSETTINGS_SHUTDOWN_COUNT_HINT2, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 8c38f191c..313e5f191 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -568,6 +568,7 @@ const char *locale_real_names[] = { "miscsettings.infobar_sat_display", "miscsettings.infobar_show", "miscsettings.infobar_show_var_hdd", + "miscsettings.show_infomenu", "miscsettings.shutdown_count", "miscsettings.shutdown_count_hint1", "miscsettings.shutdown_count_hint2", diff --git a/src/system/settings.h b/src/system/settings.h index 94cce9f67..73feff459 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -64,6 +64,7 @@ struct SNeutrinoSettings int misc_spts; int fan_speed; int infobar_show; + int show_infomenu; int infobar_show_channellogo; int progressbar_color; int casystem_display;