mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 07:23:09 +02:00
- add function to integrate plugins
TODO: maybe find a solution without void *pluginsExec Thanks to micha-bbg and SatBaby
This commit is contained in:
@@ -956,6 +956,30 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
|
||||
return retval;
|
||||
}
|
||||
|
||||
void CMenuWidget::integratePlugins(void *pluginsExec, CPlugins::i_type_t integration)
|
||||
{
|
||||
CPluginsExec *_pluginsExec = static_cast<CPluginsExec*>(pluginsExec);
|
||||
bool separatorline = false;
|
||||
char id_plugin[5];
|
||||
unsigned int number_of_plugins = (unsigned int) g_PluginList->getNumberOfPlugins();
|
||||
for (unsigned int count = 0; count < number_of_plugins; count++)
|
||||
{
|
||||
if (g_PluginList->getIntegration(count) == integration)
|
||||
{
|
||||
if (!separatorline)
|
||||
{
|
||||
addItem(GenericMenuSeparatorLine);
|
||||
separatorline = true;
|
||||
}
|
||||
printf("[neutrino] integratePlugins: add %s\n", g_PluginList->getName(count));
|
||||
sprintf(id_plugin, "%d", count);
|
||||
CMenuForwarder *fw_plugin = new CMenuForwarder(g_PluginList->getName(count), true, NULL, _pluginsExec, id_plugin);
|
||||
fw_plugin->setHint("", g_PluginList->getDescription(count));
|
||||
addItem(fw_plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMenuWidget::hide()
|
||||
{
|
||||
if(savescreen && background)
|
||||
|
Reference in New Issue
Block a user