From 84f12b6debdeaa0b1125d391e2f0689a69f58a40 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 7 Nov 2014 15:42:25 +0100 Subject: [PATCH] pluginlist: use keyhelper to get hotkeys; allow colored keys from plugin.cfg Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/269cd4cef89dc1025045a8ad32a668ac760e9f90 Author: vanhofen Date: 2014-11-07 (Fri, 07 Nov 2014) Origin message was: ------------------ - pluginlist: use keyhelper to get hotkeys; allow colored keys from plugin.cfg ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/pluginlist.cpp | 10 +++++++--- src/gui/user_menue.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gui/pluginlist.cpp b/src/gui/pluginlist.cpp index 499ce2e51..4e757090c 100644 --- a/src/gui/pluginlist.cpp +++ b/src/gui/pluginlist.cpp @@ -87,6 +87,10 @@ int CPluginList::exec(CMenuTarget* parent, const std::string &actionKey) if (parent) parent->hide(); + CColorKeyHelper keyhelper; + neutrino_msg_t key = CRCInput::RC_nokey; + const char * dummy = NULL; + number = -1; if (actionKey != "") number = atoi(actionKey.c_str()); @@ -106,11 +110,11 @@ int CPluginList::exec(CMenuTarget* parent, const std::string &actionKey) int nop = g_PluginList->getNumberOfPlugins(); - int shortcut = 1; - 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)) { - 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)); m.addItem(f); } diff --git a/src/gui/user_menue.h b/src/gui/user_menue.h index 44c2f96ab..5d15efa5b 100644 --- a/src/gui/user_menue.h +++ b/src/gui/user_menue.h @@ -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 { private: