- plugins: type for listed plugins on blue key is selectable

* add mainmenu items for tools and lua-extensions
  (default not visible)
* add usermenu items for tools and lua-extensions
  (default off)
This commit is contained in:
svenhoefer
2014-02-04 09:08:21 +01:00
parent 31221edc47
commit f9ad30f183
13 changed files with 85 additions and 11 deletions

View File

@@ -123,7 +123,11 @@ bool CUserMenu::showUserMenu(int button)
CDBoxInfoWidget *boxinfo = NULL;
CNeutrinoApp * neutrino = NULL;
CPluginList * games = NULL;
CPluginList * tools = NULL;
CPluginList * scripts = NULL;
#if ENABLE_LUA
CPluginList * lua = NULL;
#endif
std::string txt = g_settings.usermenu_text[button];
neutrino_locale_t caption = user_menu[button].caption;
@@ -294,6 +298,14 @@ 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;
case SNeutrinoSettings::ITEM_TOOLS:
menu_items++;
menu_prev = SNeutrinoSettings::ITEM_TOOLS;
tools = new CPluginList(LOCALE_MAINMENU_TOOLS,CPlugins::P_TYPE_TOOL);
keyhelper.get(&key,&icon);
menu_item = new CMenuForwarder(LOCALE_MAINMENU_TOOLS, g_PluginList->hasPlugin(CPlugins::P_TYPE_TOOL), NULL, tools, "-1", key, icon );
menu->addItem(menu_item, false);
break;
case SNeutrinoSettings::ITEM_SCRIPTS:
menu_items++;
menu_prev = SNeutrinoSettings::ITEM_SCRIPTS;
@@ -302,17 +314,24 @@ 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
case SNeutrinoSettings::ITEM_LUA:
menu_items++;
menu_prev = SNeutrinoSettings::ITEM_LUA;
lua = new CPluginList(LOCALE_MAINMENU_LUA,CPlugins::P_TYPE_LUA);
keyhelper.get(&key,&icon);
menu_item = new CMenuForwarder(LOCALE_MAINMENU_LUA, g_PluginList->hasPlugin(CPlugins::P_TYPE_LUA), NULL, lua, "-1", key, icon );
menu->addItem(menu_item, false);
break;
#endif
case SNeutrinoSettings::ITEM_PLUGIN:
{
char id[5];
int cnt = 0;
for (unsigned int count = 0; count < (unsigned int) g_PluginList->getNumberOfPlugins(); count++)
{
bool show = g_PluginList->getType(count) == CPlugins::P_TYPE_TOOL;
bool show = g_PluginList->getType(count) == g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE];
#if ENABLE_LUA
show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_LUA;
#endif
if (show && !g_PluginList->isHidden(count))
{
sprintf(id, "%d", count);