mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
- plugins: don't add hidden plugins to usermenu; ...
... use CPuginsExec::exec() to execute and drop CUserMenu::exec()
This commit is contained in:
@@ -427,12 +427,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
|||||||
int number_of_plugins = g_PluginList->getNumberOfPlugins();
|
int number_of_plugins = g_PluginList->getNumberOfPlugins();
|
||||||
if (!number_of_plugins)
|
if (!number_of_plugins)
|
||||||
continue;
|
continue;
|
||||||
|
char id[5];
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for(; count < number_of_plugins; count++) {
|
for(; count < number_of_plugins; count++) {
|
||||||
const char *pname = g_PluginList->getFileName(count);
|
const char *pname = g_PluginList->getFileName(count);
|
||||||
if (pname && (std::string(pname) == *it)) {
|
if (pname && (std::string(pname) == *it) && !g_PluginList->isHidden(count)) {
|
||||||
|
sprintf(id, "%d", count);
|
||||||
keyhelper.get(&key,&icon);
|
keyhelper.get(&key,&icon);
|
||||||
menu_item = new CMenuForwarder(g_PluginList->getName(count), true, NULL, this, pname, key, icon);
|
menu_item = new CMenuForwarder(g_PluginList->getName(count), true, NULL, &plugins, id, key, icon);
|
||||||
menu_item->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count));
|
menu_item->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -580,11 +582,3 @@ bool CUserMenu::changeNotify(const neutrino_locale_t OptionName, void * Data)
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CUserMenu::exec(CMenuTarget* /*parent*/, const std::string & actionKey)
|
|
||||||
{
|
|
||||||
if (actionKey == "")
|
|
||||||
return menu_return::RETURN_NONE;
|
|
||||||
g_PluginList->startPlugin(actionKey.c_str());
|
|
||||||
return menu_return::RETURN_EXIT;
|
|
||||||
}
|
|
||||||
|
@@ -66,12 +66,11 @@ static user_menu_data_t user_menu[COL_BUTTONMAX] =
|
|||||||
// const neutrino_msg_t col_key_helper_msg_def[COL_BUTTONMAX]={CRCInput::RC_red,CRCInput::RC_green,CRCInput::RC_yellow,CRCInput::RC_blue};
|
// const neutrino_msg_t col_key_helper_msg_def[COL_BUTTONMAX]={CRCInput::RC_red,CRCInput::RC_green,CRCInput::RC_yellow,CRCInput::RC_blue};
|
||||||
// const char * col_key_helper_icon_def[COL_BUTTONMAX]={NEUTRINO_ICON_BUTTON_RED,NEUTRINO_ICON_BUTTON_GREEN,NEUTRINO_ICON_BUTTON_YELLOW,NEUTRINO_ICON_BUTTON_BLUE};
|
// const char * col_key_helper_icon_def[COL_BUTTONMAX]={NEUTRINO_ICON_BUTTON_RED,NEUTRINO_ICON_BUTTON_GREEN,NEUTRINO_ICON_BUTTON_YELLOW,NEUTRINO_ICON_BUTTON_BLUE};
|
||||||
|
|
||||||
class CUserMenu : public CChangeObserver, CMenuTarget
|
class CUserMenu : public CChangeObserver
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
int width;
|
int width;
|
||||||
bool changeNotify(const neutrino_locale_t OptionName, void *);
|
bool changeNotify(const neutrino_locale_t OptionName, void *);
|
||||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CUserMenu();
|
CUserMenu();
|
||||||
|
@@ -369,6 +369,9 @@ int CNVODChangeExec::exec(CMenuTarget* parent, const std::string & actionKey)
|
|||||||
|
|
||||||
int CPluginsExec::exec(CMenuTarget* parent, const std::string & actionKey)
|
int CPluginsExec::exec(CMenuTarget* parent, const std::string & actionKey)
|
||||||
{
|
{
|
||||||
|
if (actionKey.empty())
|
||||||
|
return menu_return::RETURN_NONE;
|
||||||
|
|
||||||
//printf("CPluginsExec exec: %s\n", actionKey.c_str());
|
//printf("CPluginsExec exec: %s\n", actionKey.c_str());
|
||||||
int sel= atoi(actionKey.c_str());
|
int sel= atoi(actionKey.c_str());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user