mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
pluginlist: use keyhelper to get hotkeys; allow colored keys from plugin.cfg
Origin commit data
------------------
Commit: 269cd4cef8
Author: vanhofen <vanhofen@gmx.de>
Date: 2014-11-07 (Fri, 07 Nov 2014)
Origin message was:
------------------
- pluginlist: use keyhelper to get hotkeys; allow colored keys from plugin.cfg
This commit is contained in:
@@ -87,6 +87,10 @@ int CPluginList::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
if (parent)
|
if (parent)
|
||||||
parent->hide();
|
parent->hide();
|
||||||
|
|
||||||
|
CColorKeyHelper keyhelper;
|
||||||
|
neutrino_msg_t key = CRCInput::RC_nokey;
|
||||||
|
const char * dummy = NULL;
|
||||||
|
|
||||||
number = -1;
|
number = -1;
|
||||||
if (actionKey != "")
|
if (actionKey != "")
|
||||||
number = atoi(actionKey.c_str());
|
number = atoi(actionKey.c_str());
|
||||||
@@ -106,11 +110,11 @@ int CPluginList::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
|
|
||||||
int nop = g_PluginList->getNumberOfPlugins();
|
int nop = g_PluginList->getNumberOfPlugins();
|
||||||
|
|
||||||
int shortcut = 1;
|
|
||||||
|
|
||||||
for(int count = 0; count < nop; count++) {
|
for(int count = 0; count < nop; count++) {
|
||||||
if ((g_PluginList->getType(count) & pluginlisttype) && !g_PluginList->isHidden(count) && (g_PluginList->getIntegration(count) == CPlugins::I_TYPE_DISABLED)) {
|
if ((g_PluginList->getType(count) & pluginlisttype) && !g_PluginList->isHidden(count) && (g_PluginList->getIntegration(count) == CPlugins::I_TYPE_DISABLED)) {
|
||||||
CMenuForwarder *f = new CMenuForwarder(std::string(g_PluginList->getName(count)), true, "", this, to_string(count).c_str(), CRCInput::convertDigitToKey(shortcut++));
|
neutrino_msg_t d_key = g_PluginList->getKey(count);
|
||||||
|
keyhelper.get(&key, &dummy, d_key);
|
||||||
|
CMenuForwarder *f = new CMenuForwarder(std::string(g_PluginList->getName(count)), true, NULL, this, to_string(count).c_str(), key);
|
||||||
f->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count));
|
f->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count));
|
||||||
m.addItem(f);
|
m.addItem(f);
|
||||||
}
|
}
|
||||||
|
@@ -80,7 +80,7 @@ class CUserMenu : public CChangeObserver
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// This is just a quick helper for the usermenu only.
|
// This is just a quick helper for the usermenu and pluginlist.
|
||||||
class CColorKeyHelper
|
class CColorKeyHelper
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
Reference in New Issue
Block a user