mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
*neutrino usermenu plugin: fix plugin call
Plugin call was broken because of a merge error. add config parameter 'index' and 'key' for plugins This allows (optional) to config an user definied sort and setup rc-key for plugin via plugin.cfg. Sort by filename is still working as before in second instance. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1660 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -160,7 +160,8 @@ void CPlugins::loadPlugins()
|
||||
scanDir(PLUGINDIR_USB);
|
||||
scanDir(PLUGINDIR_VAR);
|
||||
scanDir(PLUGINDIR);
|
||||
sort(plugin_list.begin(), plugin_list.end());
|
||||
|
||||
sort (plugin_list.begin(), plugin_list.end());
|
||||
}
|
||||
|
||||
CPlugins::~CPlugins()
|
||||
@@ -182,6 +183,8 @@ bool CPlugins::parseCfg(plugin *plugin_data)
|
||||
while (linecount < 20 && getline(inFile, line[linecount++]))
|
||||
{};
|
||||
|
||||
plugin_data->index = 0;
|
||||
plugin_data->key = 0; //CRCInput::RC_nokey
|
||||
plugin_data->fb = false;
|
||||
plugin_data->rc = false;
|
||||
plugin_data->lcd = false;
|
||||
@@ -200,7 +203,15 @@ bool CPlugins::parseCfg(plugin *plugin_data)
|
||||
getline(iss, cmd, '=');
|
||||
getline(iss, parm, '=');
|
||||
|
||||
if (cmd == "pluginversion")
|
||||
if (cmd == "index")
|
||||
{
|
||||
plugin_data->index = atoi(parm.c_str());
|
||||
}
|
||||
else if (cmd == "key")
|
||||
{
|
||||
plugin_data->key = atoi(parm.c_str());
|
||||
}
|
||||
else if (cmd == "pluginversion")
|
||||
{
|
||||
plugin_data->version = atoi(parm.c_str());
|
||||
}
|
||||
|
@@ -62,7 +62,9 @@ class CPlugins
|
||||
|
||||
struct plugin
|
||||
{
|
||||
int index;
|
||||
std::string filename;
|
||||
int key;
|
||||
std::string cfgfile;
|
||||
std::string pluginfile;
|
||||
int version;
|
||||
@@ -81,7 +83,7 @@ class CPlugins
|
||||
bool hide;
|
||||
bool operator< (const plugin& a) const
|
||||
{
|
||||
return this->filename < a.filename ;
|
||||
return this->index < a.index ;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -116,6 +118,8 @@ class CPlugins
|
||||
inline const std::string & getDescription (const int number) const { return plugin_list[number].description ; }
|
||||
inline int getType (const int number) const { return plugin_list[number].type ; }
|
||||
inline bool isHidden (const int number) const { return plugin_list[number].hide ; }
|
||||
inline int getIndex (const int number) const { return plugin_list[number].index ; }
|
||||
inline neutrino_msg_t getKey (const int number) const { return (neutrino_msg_t)plugin_list[number].key; }
|
||||
|
||||
void startPlugin(int number,int param);
|
||||
void start_plugin_by_name(const std::string & filename,int param);// start plugins by "name=" in .cfg
|
||||
|
@@ -300,10 +300,12 @@ bool CUserMenu::showUserMenu(int button)
|
||||
sprintf(id, "%d", count);
|
||||
menu_items++;
|
||||
menu_prev = SNeutrinoSettings::ITEM_PLUGIN;
|
||||
//keyhelper.get(&key,&icon,CRCInput::RC_blue);
|
||||
keyhelper.get(&key,&icon);
|
||||
neutrino_msg_t d_key = g_PluginList->getKey(count);
|
||||
//printf("[neutrino usermenu] plugin %d, set key %d...\n", count, g_PluginList->getKey(count));
|
||||
StreamFeaturesChanger = new CStreamFeaturesChangeExec();
|
||||
keyhelper.get(&key,&icon, d_key);
|
||||
menu_item = new CMenuForwarderNonLocalized(g_PluginList->getName(count), true, NULL, StreamFeaturesChanger, id, key, icon);
|
||||
//menu->addItem(menu_item, (cnt == 0));
|
||||
|
||||
menu->addItem(menu_item, 0);
|
||||
cnt++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user