summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-11-27 12:32:05 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-11-27 12:32:05 +0300
commitcc79c1d36c07b905f9d47e5002f90783de92e6cb (patch)
tree7bbad4f326de511109e641fb652133cf970dd4c6 /src
parent48affc01c9a19f3ce39a4600ec6b8e0b247b80c1 (diff)
slightly optimized way of getting menu item's module name
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/menu_options.cpp2
-rw-r--r--src/mir_app/src/miranda.h1
-rw-r--r--src/mir_app/src/newplugins.cpp13
3 files changed, 15 insertions, 1 deletions
diff --git a/src/mir_app/src/menu_options.cpp b/src/mir_app/src/menu_options.cpp
index 1fa1118f8c..a884e0cab3 100644
--- a/src/mir_app/src/menu_options.cpp
+++ b/src/mir_app/src/menu_options.cpp
@@ -515,7 +515,7 @@ public:
m_service.SetTextA(szText);
}
- m_module.SetTextA(iod->pimi->mi.Module);
+ m_module.SetTextA(GetPluginNameByLangpack(iod->pimi->mi.hLangpack));
m_btnInsMenu.Enable(iod->pimi->mi.root == nullptr);
m_btnDefault.Enable(mir_wstrcmp(iod->name, iod->defname) != 0);
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h
index 256bc8f5eb..2026d125df 100644
--- a/src/mir_app/src/miranda.h
+++ b/src/mir_app/src/miranda.h
@@ -68,6 +68,7 @@ extern wchar_t mirandabootini[MAX_PATH];
/**** newplugins.cpp *******************************************************************/
+char* GetPluginNameByLangpack(int _hLang);
char* GetPluginNameByInstance(HINSTANCE hInstance);
int LoadStdPlugins(void);
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp
index 72cf664159..1646196c27 100644
--- a/src/mir_app/src/newplugins.cpp
+++ b/src/mir_app/src/newplugins.cpp
@@ -176,6 +176,19 @@ int LoadStdPlugins()
/////////////////////////////////////////////////////////////////////////////////////////
// global functions
+char* GetPluginNameByLangpack(int _hLang)
+{
+ if (pluginList.getCount() == 0)
+ return "";
+
+ for (int i = 0; i < pluginList.getCount(); i++) {
+ pluginEntry *p = pluginList[i];
+ if (p->hLangpack == _hLang)
+ return p->bpi.pluginInfo->shortName;
+ }
+ return "";
+}
+
char* GetPluginNameByInstance(HINSTANCE hInstance)
{
if (pluginList.getCount() == 0)