mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 17:31:20 +02:00
- neutrino-menu: formatting code using astyle; some manual code nicenings
Conflicts: src/neutrino_menue.cpp src/neutrino_menue.h Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include "gui/dboxinfo.h"
|
||||
#include "gui/epgplus.h"
|
||||
#include "gui/favorites.h"
|
||||
// #include "gui/hdd_info.h"
|
||||
#include "gui/hdd_menu.h"
|
||||
#include "gui/imageinfo.h"
|
||||
#include "gui/info_menue.h"
|
||||
@@ -77,7 +78,6 @@
|
||||
#include "driver/record.h"
|
||||
#include "driver/display.h"
|
||||
|
||||
|
||||
extern CPlugins *g_Plugins;
|
||||
extern CRemoteControl *g_RemoteControl;
|
||||
extern CCAMMenuHandler *g_CamHandler;
|
||||
@@ -101,20 +101,22 @@ void CNeutrinoApp::InitMenu()
|
||||
|
||||
// personalize: neutrino.h, neutrino.cpp
|
||||
personalize.enableUsermenu();
|
||||
personalize.enablePluginMenu();
|
||||
//personalize.enablePluginMenu();
|
||||
personalize.enablePinSetup();
|
||||
personalize.addWidgets(menu_widgets, MENU_MAX);
|
||||
|
||||
InitMenuMain();
|
||||
InitMenuSettings();
|
||||
InitMenuService();
|
||||
|
||||
// add submenu for media
|
||||
CMediaPlayerMenu::getInstance()->initMenuMedia(new CMenuWidget(LOCALE_MAINMENU_MEDIA, NEUTRINO_ICON_MULTIMEDIA, MENU_WIDTH), &personalize);
|
||||
|
||||
personalize.addPersonalizedItems();
|
||||
|
||||
//add PLUGIN_INTEGRATION_SETTING plugins
|
||||
unsigned int nextShortcut;
|
||||
|
||||
// add PLUGIN_INTEGRATION_SETTING plugins
|
||||
CMenuWidget &menuSettings = personalize.getWidget(MENU_SETTINGS);
|
||||
nextShortcut = (unsigned int)menuSettings.getNextShortcut();
|
||||
menuSettings.integratePlugins(PLUGIN_INTEGRATION_SETTING, nextShortcut);
|
||||
@@ -141,7 +143,7 @@ void CNeutrinoApp::InitMenuMain()
|
||||
// top
|
||||
personalize.addItem(MENU_MAIN, GenericMenuSeparator, NULL, false, CPersonalizeGui::PERSONALIZE_SHOW_NO);
|
||||
|
||||
//1st section***************************************************************************************************
|
||||
// 1st section ********************************************************
|
||||
|
||||
// tv <-> radio toggle
|
||||
CMenuForwarder *tvradio_switch = new CMenuForwarder(LOCALE_MAINMENU_TVRADIO_SWITCH, true, NULL, this, "tv_radio_switch", CRCInput::RC_red);
|
||||
@@ -169,8 +171,10 @@ void CNeutrinoApp::InitMenuMain()
|
||||
personalize.addItem(MENU_MAIN, media, &g_settings.personalize[SNeutrinoSettings::P_MAIN_MEDIA]);
|
||||
|
||||
// avinput mode
|
||||
if ((g_info.hw_caps->has_SCART_input) || (g_info.hw_caps->has_HDMI_input)) {
|
||||
if ((g_info.hw_caps->has_SCART_input) || (g_info.hw_caps->has_HDMI_input))
|
||||
{
|
||||
personalize.addSeparator(MENU_MAIN);
|
||||
|
||||
CMenuForwarder *avinputmode = new CMenuForwarder(LOCALE_MAINMENU_AVINPUTMODE, true, NULL, this, "avinput");
|
||||
avinputmode->setHint(NEUTRINO_ICON_HINT_AVINPUTMODE, LOCALE_MENU_HINT_AVINPUTMODE);
|
||||
personalize.addItem(MENU_MAIN, avinputmode, &g_settings.personalize[SNeutrinoSettings::P_MAIN_AVINPUT]);
|
||||
@@ -183,6 +187,7 @@ void CNeutrinoApp::InitMenuMain()
|
||||
}
|
||||
|
||||
CMenuForwarder *mf;
|
||||
|
||||
// games
|
||||
bool show_games = g_Plugins->hasPlugin(CPlugins::P_TYPE_GAME);
|
||||
mf = new CMenuForwarder(LOCALE_MAINMENU_GAMES, show_games, NULL, new CPluginList(LOCALE_MAINMENU_GAMES, CPlugins::P_TYPE_GAME));
|
||||
@@ -208,6 +213,7 @@ void CNeutrinoApp::InitMenuMain()
|
||||
mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_LUA);
|
||||
personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_LUA]);
|
||||
#else
|
||||
// plugins
|
||||
bool show_plugins = g_Plugins->hasPlugin(CPlugins::P_TYPE_NO_GAME);
|
||||
mf = new CMenuForwarder(LOCALE_MAINMENU_LUA, show_plugins, NULL, new CPluginList(LOCALE_MAINMENU_LUA, CPlugins::P_TYPE_NO_GAME));
|
||||
mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_LUA);
|
||||
@@ -217,7 +223,7 @@ void CNeutrinoApp::InitMenuMain()
|
||||
// separator
|
||||
personalize.addSeparator(MENU_MAIN);
|
||||
|
||||
//2nd section***************************************************************************************************
|
||||
// 2nd section ********************************************************
|
||||
|
||||
// settings, also as pin protected option in personalize menu, as a result of parameter value CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION
|
||||
mf = new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, &personalize.getWidget(MENU_SETTINGS));
|
||||
@@ -232,9 +238,8 @@ void CNeutrinoApp::InitMenuMain()
|
||||
// separator
|
||||
personalize.addSeparator(MENU_MAIN);
|
||||
|
||||
//3rd section***************************************************************************************************
|
||||
// 3rd section ********************************************************
|
||||
|
||||
//10. -- only 10 shortcuts (1-9, 0), the next could be the last also!(10. => 0)
|
||||
// sleeptimer
|
||||
mf = new CMenuForwarder(LOCALE_MAINMENU_SLEEPTIMER, true, NULL, new CSleepTimerWidget);
|
||||
mf->setHint(NEUTRINO_ICON_HINT_SLEEPTIMER, LOCALE_MENU_HINT_SLEEPTIMER);
|
||||
@@ -244,18 +249,26 @@ void CNeutrinoApp::InitMenuMain()
|
||||
mf = new CMenuForwarder(LOCALE_MAINMENU_REBOOT, true, NULL, this, "reboot");
|
||||
mf->setHint(NEUTRINO_ICON_HINT_REBOOT, LOCALE_MENU_HINT_REBOOT);
|
||||
personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_REBOOT]);
|
||||
|
||||
#if 0
|
||||
// standby
|
||||
mf = new CMenuForwarder(LOCALE_MAINMENU_STANDBY, true, NULL, this, "standby");
|
||||
mf->setHint(NEUTRINO_ICON_HINT_SHUTDOWN, LOCALE_MENU_HINT_STANDBY);
|
||||
personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_STANDBY]);
|
||||
#endif
|
||||
// shutdown
|
||||
if (g_info.hw_caps->can_shutdown) {
|
||||
mf = new CMenuForwarder(LOCALE_MAINMENU_SHUTDOWN, true, NULL, this, "shutdown", CRCInput::RC_standby);
|
||||
mf->setHint(NEUTRINO_ICON_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN);
|
||||
personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SHUTDOWN]);
|
||||
}
|
||||
|
||||
#if 0
|
||||
// blank screen
|
||||
mf = new CMenuForwarder(LOCALE_BLANK_SCREEN, true, NULL, this, "blank_screen", CRCInput::RC_pause);
|
||||
mf->setHint(NEUTRINO_ICON_HINT_BLANK_SCREEN, LOCALE_MENU_HINT_BLANK_SCREEN);
|
||||
personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_BLANK_SCREEN], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS);
|
||||
#endif
|
||||
// separator
|
||||
personalize.addSeparator(MENU_MAIN);
|
||||
|
||||
//4th section***************************************************************************************************
|
||||
// 4th section ********************************************************
|
||||
|
||||
// infomenu
|
||||
mf = new CMenuForwarder(LOCALE_MESSAGEBOX_INFO, true, NULL, new CInfoMenu(), NULL, CRCInput::RC_info);
|
||||
@@ -263,7 +276,8 @@ void CNeutrinoApp::InitMenuMain()
|
||||
personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_INFOMENU]);
|
||||
|
||||
// cisettings
|
||||
if (cCA::GetInstance()->GetNumberCISlots() > 0 || cCA::GetInstance()->GetNumberSmartCardSlots() > 0) {
|
||||
if (cCA::GetInstance()->GetNumberCISlots() > 0 || cCA::GetInstance()->GetNumberSmartCardSlots() > 0)
|
||||
{
|
||||
mf = new CMenuForwarder(LOCALE_CI_SETTINGS, true, NULL, g_CamHandler);
|
||||
mf->setHint(NEUTRINO_ICON_HINT_CI, LOCALE_MENU_HINT_CI);
|
||||
personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_CISETTINGS]);
|
||||
@@ -288,7 +302,7 @@ void CNeutrinoApp::InitMenuSettings()
|
||||
personalize.addIntroItems(MENU_SETTINGS);
|
||||
|
||||
static int show = CPersonalizeGui::PERSONALIZE_MODE_VISIBLE;
|
||||
//***************************************************************************************************
|
||||
|
||||
// save
|
||||
CMenuForwarder *mf;
|
||||
mf = new CMenuForwarder(LOCALE_MAINSETTINGS_SAVESETTINGSNOW, true, NULL, this, "savesettings", CRCInput::RC_red);
|
||||
@@ -298,7 +312,6 @@ void CNeutrinoApp::InitMenuSettings()
|
||||
// settings manager
|
||||
mf = new CMenuForwarder(LOCALE_MAINSETTINGS_MANAGE, true, NULL, new CSettingsManager(), NULL, CRCInput::RC_green);
|
||||
personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_SETTINGS_MANAGER], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION);
|
||||
|
||||
mf->setHint(NEUTRINO_ICON_HINT_MANAGE_SETTINGS, LOCALE_MENU_HINT_MANAGE_SETTINGS);
|
||||
|
||||
// personalize
|
||||
@@ -314,11 +327,9 @@ void CNeutrinoApp::InitMenuSettings()
|
||||
//separator
|
||||
personalize.addSeparator(MENU_SETTINGS);
|
||||
|
||||
//1st section***************************************************************************************************
|
||||
// 1st section ********************************************************
|
||||
|
||||
//use only 10 shortcuts (1-9, 0), >9 means -> no shortcut
|
||||
|
||||
// video.
|
||||
// video
|
||||
mf = new CMenuForwarder(LOCALE_MAINSETTINGS_VIDEO, true, NULL, g_videoSettings);
|
||||
mf->setHint(NEUTRINO_ICON_HINT_VIDEO, LOCALE_MENU_HINT_VIDEO);
|
||||
personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_VIDEO]);
|
||||
@@ -339,7 +350,8 @@ void CNeutrinoApp::InitMenuSettings()
|
||||
personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_NETWORK]);
|
||||
|
||||
// record settings
|
||||
if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) {
|
||||
if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)
|
||||
{
|
||||
mf = new CMenuForwarder(LOCALE_MAINSETTINGS_RECORDING, true, NULL, new CRecordSetup());
|
||||
mf->setHint(NEUTRINO_ICON_HINT_RECORDING, LOCALE_MENU_HINT_RECORDING);
|
||||
personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_RECORDING]);
|
||||
@@ -361,14 +373,13 @@ void CNeutrinoApp::InitMenuSettings()
|
||||
personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_VFD]);
|
||||
|
||||
// drive settings
|
||||
if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) {
|
||||
if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)
|
||||
{
|
||||
mf = new CMenuForwarder(LOCALE_HDD_SETTINGS, true, NULL, CHDDMenuHandler::getInstance());
|
||||
mf->setHint(NEUTRINO_ICON_HINT_HDD, LOCALE_MENU_HINT_HDD);
|
||||
personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_DRIVES]);
|
||||
}
|
||||
|
||||
// energy
|
||||
|
||||
// cisettings
|
||||
mf = new CMenuForwarder(LOCALE_CI_SETTINGS, true, NULL, g_CamHandler);
|
||||
mf->setHint(NEUTRINO_ICON_HINT_CI, LOCALE_MENU_HINT_CI);
|
||||
@@ -385,8 +396,7 @@ void CNeutrinoApp::InitMenuSettings()
|
||||
personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_MEDIAPLAYER]);
|
||||
}
|
||||
|
||||
|
||||
/* service menu*/
|
||||
// service menu
|
||||
void CNeutrinoApp::InitMenuService()
|
||||
{
|
||||
dprintf(DEBUG_DEBUG, "init service menu...\n");
|
||||
@@ -399,7 +409,7 @@ void CNeutrinoApp::InitMenuService()
|
||||
// back button, no personalized
|
||||
personalize.addIntroItems(MENU_SERVICE);
|
||||
|
||||
//1st section***************************************************************************************************
|
||||
// 1st section ********************************************************
|
||||
|
||||
bool force_fesetup = false;
|
||||
#if BOXMODEL_VUPLUS_ALL
|
||||
@@ -408,8 +418,10 @@ void CNeutrinoApp::InitMenuService()
|
||||
#endif
|
||||
|
||||
CMenuForwarder *mf;
|
||||
|
||||
// tuner setup
|
||||
if (CFEManager::getInstance()->haveSat() || CFEManager::getInstance()->getFrontendCount() > 1 || force_fesetup) {
|
||||
if (CFEManager::getInstance()->haveSat() || CFEManager::getInstance()->getFrontendCount() > 1 || force_fesetup)
|
||||
{
|
||||
mf = new CMenuForwarder(LOCALE_SATSETUP_FE_SETUP, true, NULL, CScanSetup::getInstance(), "setup_frontend", CRCInput::RC_red);
|
||||
mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_SCAN_FESETUP);
|
||||
personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_TUNER]);
|
||||
@@ -432,17 +444,15 @@ void CNeutrinoApp::InitMenuService()
|
||||
/* does not work with CLockedMenuForwarder yet?
|
||||
lf->setHint(NEUTRINO_ICON_HINT_BEDIT, LOCALE_MENU_HINT_BEDIT);
|
||||
*/
|
||||
|
||||
personalize.addItem(MENU_SERVICE, lf, &g_settings.personalize[SNeutrinoSettings::P_MSER_BOUQUET_EDIT]);
|
||||
|
||||
// channel reset
|
||||
CDataResetNotifier *resetNotifier = new CDataResetNotifier();
|
||||
mf = new CMenuForwarder(LOCALE_RESET_CHANNELS, true, NULL, resetNotifier, "channels");
|
||||
|
||||
mf->setHint(NEUTRINO_ICON_HINT_DELETE_CHANNELS, LOCALE_MENU_HINT_DELETE_CHANNELS);
|
||||
personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_RESET_CHANNELS]);
|
||||
|
||||
/* todo: only show if (g_settings.make_removed_list) */
|
||||
// TODO: only show if (g_settings.make_removed_list)
|
||||
mf = new CMenuForwarder(LOCALE_RESET_REMOVED, true, NULL, resetNotifier, "delete_removed");
|
||||
mf->setHint(NEUTRINO_ICON_HINT_DELETE_CHANNELS, LOCALE_MENU_HINT_DELETE_REMOVED);
|
||||
personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_RESET_CHANNELS]);
|
||||
@@ -450,14 +460,18 @@ void CNeutrinoApp::InitMenuService()
|
||||
// separator
|
||||
personalize.addSeparator(MENU_SERVICE);
|
||||
|
||||
|
||||
personalize.addSeparator(MENU_SERVICE);
|
||||
// 3rd section ********************************************************
|
||||
|
||||
// restart neutrino
|
||||
mf = new CMenuForwarder(LOCALE_SERVICEMENU_RESTART, true, NULL, this, "restart", CRCInput::RC_standby);
|
||||
mf->setHint(NEUTRINO_ICON_HINT_SOFT_RESTART, LOCALE_MENU_HINT_SOFT_RESTART);
|
||||
personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_RESTART]);
|
||||
|
||||
#if 0
|
||||
// restart tuner
|
||||
mf = new CMenuForwarder(LOCALE_SERVICEMENU_RESTART_TUNER, true, NULL, this, "restarttuner");
|
||||
mf->setHint(NEUTRINO_ICON_HINT_RELOAD_CHANNELS, LOCALE_MENU_HINT_RESTART_TUNER);
|
||||
personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_RESTART_TUNER]);
|
||||
#endif
|
||||
// reload plugins
|
||||
mf = new CMenuForwarder(LOCALE_SERVICEMENU_GETPLUGINS, true, NULL, this, "reloadplugins");
|
||||
mf->setHint(NEUTRINO_ICON_HINT_RELOAD_CHANNELS, LOCALE_MENU_HINT_RELOAD_PLUGINS);
|
||||
@@ -466,7 +480,7 @@ void CNeutrinoApp::InitMenuService()
|
||||
// separator
|
||||
personalize.addSeparator(MENU_SERVICE);
|
||||
|
||||
//2nd section***************************************************************************************************
|
||||
// 4th section ********************************************************
|
||||
|
||||
// infomenu
|
||||
mf = new CMenuForwarder(LOCALE_MESSAGEBOX_INFO, true, NULL, new CInfoMenu(), NULL, CRCInput::RC_info);
|
||||
@@ -475,7 +489,6 @@ void CNeutrinoApp::InitMenuService()
|
||||
|
||||
// firmware update
|
||||
mf = new CMenuForwarder(LOCALE_SERVICEMENU_UPDATE, true, NULL, new CSoftwareUpdate());
|
||||
|
||||
mf->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_SW_UPDATE);
|
||||
personalize.addItem(MENU_SERVICE, mf, &g_settings.personalize[SNeutrinoSettings::P_MSER_SOFTUPDATE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS);
|
||||
}
|
||||
|
@@ -33,11 +33,10 @@
|
||||
Otherwise ask the copyright owners, anything else would be theft!
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __neutrino_menue__
|
||||
#define __neutrino_menue__
|
||||
|
||||
//enums for menu widget indicies,
|
||||
// enums for menu widget indicies
|
||||
enum MN_WIDGET_ID
|
||||
{
|
||||
// settings manager
|
||||
|
Reference in New Issue
Block a user