From a670ec4346718095e7ea666d41c0b89a9ba8ec75 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 16 Feb 2014 18:38:03 +0100 Subject: [PATCH] revert the split into lots of plugin types * present the user with only two types of extensions: games and everything else (lua, script, binary .so) * use lua locale, right now it is translated to just "Plugins" :-) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/44e127a8ddc66384d17414a80ba6da9a127ce9fa Author: Stefan Seyfried Date: 2014-02-16 (Sun, 16 Feb 2014) Origin message was: ------------------ revert the split into lots of plugin types * present the user with only two types of extensions: games and everything else (lua, script, binary .so) * use lua locale, right now it is translated to just "Plugins" :-) --- src/gui/personalize.cpp | 8 ++++++++ src/gui/user_menue.cpp | 20 +++++++++++++------- src/gui/user_menue_setup.cpp | 9 ++++++++- src/neutrino_menue.cpp | 15 ++++++++------- 4 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/gui/personalize.cpp b/src/gui/personalize.cpp index 887cf60b4..c4f7d85da 100644 --- a/src/gui/personalize.cpp +++ b/src/gui/personalize.cpp @@ -9,6 +9,8 @@ Reworked by dbt (Thilo Graf) Copyright (C) 2010, 2011 dbt + Copyright (C) 2014 Stefan Seyfried + Comment: This is the customization menu, as originally showcased in @@ -455,6 +457,11 @@ void CPersonalizeGui::ShowUserMenu(CMenuWidget* p_widget, vectoraddItem(GenericMenuSeparator); p_widget->addItem(new CMenuOptionChooser(LOCALE_PERSONALIZE_USERMENU_SHOW_CANCEL, &g_settings.personalize[SNeutrinoSettings::P_UMENU_SHOW_CANCEL], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); +#if 0 + /* distinguishing between plugin types is useful for what? + * maybe disabling games / eveything else might make sense, + * but why distinguish between scripts / "tools" (binaries) / LUA? + */ pluginSelectionMenu = new CMenuWidget(LOCALE_PERSONALIZE_USERMENU_PLUGIN_TYPES, NEUTRINO_ICON_SETTINGS); pluginSelectionMenu->addIntroItems(LOCALE_MAINMENU_SETTINGS); pluginSelectionMenu->addItem(new CMenuOptionChooser(LOCALE_MAINMENU_GAMES, &g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_GAMES], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); @@ -463,6 +470,7 @@ void CPersonalizeGui::ShowUserMenu(CMenuWidget* p_widget, vectoraddItem(new CMenuOptionChooser(LOCALE_MAINMENU_LUA, &g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_LUA], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); p_widget->addItem(new CMenuForwarder(LOCALE_PERSONALIZE_USERMENU_PLUGIN_TYPES, true, NULL, pluginSelectionMenu)); +#endif } diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 96ddfb889..4d176c652 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -11,6 +11,7 @@ Copyright (C) 2011 T. Graf 'dbt' Homepage: http://www.dbox2-tuning.net/ + Copyright (C) 2013-2014 Stefan Seyfried License: GPL @@ -126,11 +127,11 @@ bool CUserMenu::showUserMenu(int button) CDBoxInfoWidget *boxinfo = NULL; CNeutrinoApp * neutrino = NULL; CPluginList * games = NULL; +#if 0 CPluginList * tools = NULL; CPluginList * scripts = NULL; -#if ENABLE_LUA - CPluginList * lua = NULL; #endif + CPluginList * lua = NULL; std::string txt = g_settings.usermenu_text[button]; neutrino_locale_t caption = user_menu[button].caption; @@ -301,6 +302,7 @@ bool CUserMenu::showUserMenu(int button) menu_item = new CMenuForwarder(LOCALE_MAINMENU_GAMES, g_PluginList->hasPlugin(CPlugins::P_TYPE_GAME), NULL, games, "-1", key, icon ); menu->addItem(menu_item, false); break; +#if 0 case SNeutrinoSettings::ITEM_TOOLS: menu_items++; menu_prev = SNeutrinoSettings::ITEM_TOOLS; @@ -317,16 +319,16 @@ bool CUserMenu::showUserMenu(int button) menu_item = new CMenuForwarder(LOCALE_MAINMENU_SCRIPTS, g_PluginList->hasPlugin(CPlugins::P_TYPE_SCRIPT), NULL, scripts, "-1", key, icon ); menu->addItem(menu_item, false); break; -#if ENABLE_LUA +#endif case SNeutrinoSettings::ITEM_LUA: menu_items++; menu_prev = SNeutrinoSettings::ITEM_LUA; - lua = new CPluginList(LOCALE_MAINMENU_LUA,CPlugins::P_TYPE_LUA); + lua = new CPluginList(LOCALE_MAINMENU_LUA, CPlugins::P_TYPE_NO_GAME); keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_MAINMENU_LUA, g_PluginList->hasPlugin(CPlugins::P_TYPE_LUA), NULL, lua, "-1", key, icon ); + menu_item = new CMenuForwarder(LOCALE_MAINMENU_LUA, g_PluginList->hasPlugin(CPlugins::P_TYPE_NO_GAME), NULL, lua, "-1", key, icon ); menu->addItem(menu_item, false); break; -#endif +#if 0 case SNeutrinoSettings::ITEM_PLUGIN_TYPES: { char id[5]; @@ -359,7 +361,7 @@ bool CUserMenu::showUserMenu(int button) } } break; - +#endif case SNeutrinoSettings::ITEM_VTXT: menu_items++; menu_prev = SNeutrinoSettings::ITEM_VTXT; @@ -463,7 +465,11 @@ bool CUserMenu::showUserMenu(int button) if (imageinfo) delete imageinfo; if (boxinfo) delete boxinfo; if (games) delete games; +#if 0 if (scripts) delete scripts; + if (tools) delete tools; +#endif + if (lua) delete lua; if (menu) delete menu; InfoClock->enableInfoClock(true); diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index 2c7ae6de2..4713424bd 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -11,6 +11,7 @@ Copyright (C) 2010 T. Graf 'dbt' Homepage: http://www.dbox2-tuning.net/ + Copyright (C) 2014 Stefan Seyfried License: GPL @@ -63,7 +64,7 @@ CUserMenuSetup::~CUserMenuSetup() delete ums; } -#define USERMENU_ITEM_OPTION_COUNT SNeutrinoSettings::ITEM_MAX +#define USERMENU_ITEM_OPTION_COUNT (SNeutrinoSettings::ITEM_MAX - 3) const CMenuOptionChooser::keyval USERMENU_ITEM_OPTIONS[USERMENU_ITEM_OPTION_COUNT] = { { SNeutrinoSettings::ITEM_NONE, LOCALE_USERMENU_ITEM_NONE }, @@ -79,18 +80,24 @@ const CMenuOptionChooser::keyval USERMENU_ITEM_OPTIONS[USERMENU_ITEM_OPTION_COUN { SNeutrinoSettings::ITEM_REMOTE, LOCALE_RCLOCK_MENUEADD }, { SNeutrinoSettings::ITEM_FAVORITS, LOCALE_FAVORITES_MENUEADD }, { SNeutrinoSettings::ITEM_TECHINFO, LOCALE_EPGMENU_STREAMINFO }, +#if 0 { SNeutrinoSettings::ITEM_PLUGIN_TYPES, LOCALE_USERMENU_ITEM_PLUGIN_TYPES }, +#endif { SNeutrinoSettings::ITEM_VTXT, LOCALE_USERMENU_ITEM_VTXT }, { SNeutrinoSettings::ITEM_IMAGEINFO, LOCALE_SERVICEMENU_IMAGEINFO }, { SNeutrinoSettings::ITEM_BOXINFO, LOCALE_EXTRA_DBOXINFO }, { SNeutrinoSettings::ITEM_CAM, LOCALE_CI_SETTINGS }, { SNeutrinoSettings::ITEM_CLOCK, LOCALE_CLOCK_SWITCH_ON }, { SNeutrinoSettings::ITEM_GAMES, LOCALE_MAINMENU_GAMES }, +#if 0 { SNeutrinoSettings::ITEM_SCRIPTS, LOCALE_MAINMENU_SCRIPTS }, +#endif { SNeutrinoSettings::ITEM_RECORD, LOCALE_TIMERLIST_TYPE_RECORD }, { SNeutrinoSettings::ITEM_YOUTUBE, LOCALE_MOVIEPLAYER_YTPLAYBACK }, { SNeutrinoSettings::ITEM_FILEPLAY, LOCALE_MOVIEPLAYER_FILEPLAYBACK }, +#if 0 { SNeutrinoSettings::ITEM_TOOLS, LOCALE_MAINMENU_TOOLS }, +#endif { SNeutrinoSettings::ITEM_LUA, LOCALE_MAINMENU_LUA } }; diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 2ada22cad..79fc88fd4 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -5,13 +5,7 @@ and some other guys Homepage: http://dbox.cyberphoria.org/ - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - + Copyright (C) 2009-2014 Stefan Seyfried License: GPL @@ -195,6 +189,7 @@ void CNeutrinoApp::InitMenuMain() mf->setHint(NEUTRINO_ICON_HINT_GAMES, LOCALE_MENU_HINT_GAMES); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_GAMES]); +#if 0 //tools bool show_tools = g_PluginList->hasPlugin(CPlugins::P_TYPE_TOOL); mf = new CMenuForwarder(LOCALE_MAINMENU_TOOLS, show_tools, NULL, new CPluginList(LOCALE_MAINMENU_TOOLS,CPlugins::P_TYPE_TOOL)); @@ -213,6 +208,12 @@ void CNeutrinoApp::InitMenuMain() mf = new CMenuForwarder(LOCALE_MAINMENU_LUA, show_lua, NULL, new CPluginList(LOCALE_MAINMENU_LUA,CPlugins::P_TYPE_LUA)); mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_LUA); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_LUA]); +#endif +#else + bool show_plugins = g_PluginList->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); + personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_LUA]); #endif }