mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +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)
|
||||
|
2316
src/gui/widget/menue.cpp.orig
Normal file
2316
src/gui/widget/menue.cpp.orig
Normal file
File diff suppressed because it is too large
Load Diff
@@ -42,6 +42,7 @@
|
||||
#include <gui/widget/buttons.h>
|
||||
#include <gui/widget/icons.h>
|
||||
#include <gui/color.h>
|
||||
#include <gui/plugins.h>
|
||||
#include <gui/components/cc.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -556,6 +557,7 @@ class CMenuWidget : public CMenuTarget
|
||||
virtual void hide();
|
||||
virtual int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||
virtual const char *getName();
|
||||
virtual void integratePlugins(void *pluginsExec, CPlugins::i_type_t integration);
|
||||
void setSelected(const int &Preselected){ preselected = Preselected; };
|
||||
int getSelected()const { return selected; };
|
||||
void move(int xoff, int yoff);
|
||||
|
Reference in New Issue
Block a user