diff options
-rw-r--r-- | plugins/AVS/src/main.cpp | 2 | ||||
-rw-r--r-- | plugins/DbChecker/src/main.cpp | 2 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/icons.cpp | 2 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/main_window.cpp | 2 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/stdafx.h | 2 | ||||
-rw-r--r-- | plugins/IEView/src/ieview_main.cpp | 2 | ||||
-rw-r--r-- | plugins/Import/src/utils.cpp | 2 | ||||
-rw-r--r-- | protocols/Discord/src/main.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/icolib.cpp | 2 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/main.cpp | 2 | ||||
-rw-r--r-- | protocols/IRCG/src/options.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_icolib.cpp | 2 | ||||
-rw-r--r-- | protocols/Omegle/src/theme.cpp | 2 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime.cpp | 2 | ||||
-rw-r--r-- | protocols/Telegram/src/main.cpp | 2 | ||||
-rw-r--r-- | protocols/Twitter/src/theme.cpp | 2 | ||||
-rw-r--r-- | protocols/YAMN/src/main.cpp | 2 | ||||
-rw-r--r-- | src/core/stduserinfo/src/stdafx.h | 2 | ||||
-rw-r--r-- | src/mir_app/src/IcoLib.h | 1 | ||||
-rw-r--r-- | src/mir_app/src/icolib.cpp | 23 | ||||
-rw-r--r-- | src/mir_app/src/proto_accs.cpp | 34 | ||||
-rw-r--r-- | src/mir_app/src/skin2opts.cpp | 5 |
22 files changed, 50 insertions, 49 deletions
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index bab379ba4d..f6869c6be2 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -352,7 +352,7 @@ static IconItem iconList[] = int CMPlugin::Load()
{
- registerIcon("AVS", iconList);
+ registerIcon(LPGEN("AVS"), iconList);
LoadACC();
diff --git a/plugins/DbChecker/src/main.cpp b/plugins/DbChecker/src/main.cpp index 4b9d56ea93..563bd7fafc 100644 --- a/plugins/DbChecker/src/main.cpp +++ b/plugins/DbChecker/src/main.cpp @@ -110,7 +110,7 @@ static IconItem iconList[] = { int CMPlugin::Load(void) { - g_plugin.registerIcon("DbChecker", iconList); + g_plugin.registerIcon(LPGEN("DbChecker"), iconList); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); diff --git a/plugins/DbEditorPP/src/icons.cpp b/plugins/DbEditorPP/src/icons.cpp index 2ae251916a..f514326664 100644 --- a/plugins/DbEditorPP/src/icons.cpp +++ b/plugins/DbEditorPP/src/icons.cpp @@ -38,7 +38,7 @@ static IconItem iconList[] = { void IcoLibRegister(void)
{
- g_plugin.registerIcon(modFullname, iconList);
+ g_plugin.registerIcon(LPGEN("Database") "/" modFullname, iconList);
}
HICON LoadSkinnedDBEIcon(int icon)
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp index 1553cbc8ea..0a07438f6c 100644 --- a/plugins/DbEditorPP/src/main_window.cpp +++ b/plugins/DbEditorPP/src/main_window.cpp @@ -501,7 +501,7 @@ LRESULT CMainDlg::OnCommand(UINT, WPARAM wParam, LPARAM) refreshTree(1);
break;
case MENU_OPEN_OPTIONS:
- g_plugin.openOptions(L"Database", _A2W(modFullname));
+ g_plugin.openOptions(L"Database", modFullnameW);
break;
}
return TRUE;
diff --git a/plugins/DbEditorPP/src/stdafx.h b/plugins/DbEditorPP/src/stdafx.h index 79e875b3b9..6bb0dc925c 100644 --- a/plugins/DbEditorPP/src/stdafx.h +++ b/plugins/DbEditorPP/src/stdafx.h @@ -44,7 +44,7 @@ //=======================================================
#define MODULENAME "DBEditorpp"
-#define modFullname "Database Editor++"
+#define modFullname LPGEN("Database Editor++")
#define modFullnameW L"Database Editor++"
struct CMPlugin : public PLUGIN<CMPlugin>
diff --git a/plugins/IEView/src/ieview_main.cpp b/plugins/IEView/src/ieview_main.cpp index a1baed139c..5932978502 100644 --- a/plugins/IEView/src/ieview_main.cpp +++ b/plugins/IEView/src/ieview_main.cpp @@ -104,7 +104,7 @@ int CMPlugin::Load() CreateServiceFunction(MS_IEVIEW_NAVIGATE, HandleIENavigate);
CreateServiceFunction("IEView/ReloadOptions", ReloadOptions);
hHookOptionsChanged = CreateHookableEvent(ME_IEVIEW_OPTIONSCHANGED);
- g_plugin.registerIcon("IEView", iconList, MODULENAME);
+ g_plugin.registerIcon(LPGEN("IEView"), iconList, MODULENAME);
return 0;
}
diff --git a/plugins/Import/src/utils.cpp b/plugins/Import/src/utils.cpp index d869ae2737..6e9f791115 100644 --- a/plugins/Import/src/utils.cpp +++ b/plugins/Import/src/utils.cpp @@ -76,5 +76,5 @@ static IconItem iconList[] = void RegisterIcons()
{
- g_plugin.registerIcon("Import", iconList);
+ g_plugin.registerIcon(LPGEN("Import"), iconList);
}
diff --git a/protocols/Discord/src/main.cpp b/protocols/Discord/src/main.cpp index 98f0b120de..0af99505b7 100644 --- a/protocols/Discord/src/main.cpp +++ b/protocols/Discord/src/main.cpp @@ -66,6 +66,6 @@ int CMPlugin::Load() {
HookEvent(ME_SYSTEM_MODULESLOADED, &OnModulesLoaded);
- g_plugin.registerIcon("Protocols/Discord", g_iconList);
+ g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Discord"), g_iconList);
return 0;
}
diff --git a/protocols/Gadu-Gadu/src/icolib.cpp b/protocols/Gadu-Gadu/src/icolib.cpp index db210254ed..1a119c0f4d 100644 --- a/protocols/Gadu-Gadu/src/icolib.cpp +++ b/protocols/Gadu-Gadu/src/icolib.cpp @@ -43,5 +43,5 @@ extern IconItem iconList[] = void gg_icolib_init()
{
- g_plugin.registerIcon("Protocols/" GGDEF_PROTO, iconList, GGDEF_PROTO);
+ g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("GG"), iconList, GGDEF_PROTO);
}
diff --git a/protocols/ICQ-WIM/src/main.cpp b/protocols/ICQ-WIM/src/main.cpp index b445bc7b29..f74dac11c7 100644 --- a/protocols/ICQ-WIM/src/main.cpp +++ b/protocols/ICQ-WIM/src/main.cpp @@ -93,7 +93,7 @@ int CMPlugin::Load() // register the second instance of this plugin as MRA
g_pluginMra.Register();
- registerIcon("Protocols/ICQ", iconList, "ICQ");
+ registerIcon(LPGEN("Protocols") "/" LPGEN("ICQ"), iconList, "ICQ");
HookEvent(ME_SYSTEM_MODULELOAD, ModuleLoad);
HookEvent(ME_SYSTEM_MODULEUNLOAD, ModuleLoad);
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 4f3439540d..8822b2e532 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -144,7 +144,7 @@ static IconItem iconList[] = void InitIcons(void)
{
- g_plugin.registerIcon("Protocols/IRC", iconList, "IRC");
+ g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("IRC"), iconList, "IRC");
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 7e08277418..f49324efaa 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -120,7 +120,7 @@ void CIconPool::RegisterIcon(const char *name, wchar_t *filename, int iconid, wc sid.description.w = szDescription;
sid.flags = SIDF_ALL_UNICODE;
sid.iDefaultIndex = iconid;
- item->m_hIcolibItem = IcoLib_AddIcon(&sid, &g_plugin);
+ item->m_hIcolibItem = g_plugin.addIcon(&sid);
m_items.insert(item);
}
diff --git a/protocols/Omegle/src/theme.cpp b/protocols/Omegle/src/theme.cpp index f9899adbe9..4c047d5d12 100644 --- a/protocols/Omegle/src/theme.cpp +++ b/protocols/Omegle/src/theme.cpp @@ -31,5 +31,5 @@ static IconItem iconList[] = void InitIcons(void)
{
- g_plugin.registerIcon("Protocols/Omegle", iconList, "Omegle");
+ g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Omegle"), iconList, "Omegle");
}
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 238f559d6b..56c3f54c98 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -82,7 +82,7 @@ static IconItem iconList[] = void SametimeInitIcons(void)
{
- g_plugin.registerIcon("Protocols/Sametime", iconList, "SAMETIME");
+ g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Sametime"), iconList, "SAMETIME");
}
// Copied from MSN plugin - sent acks need to be from different thread
diff --git a/protocols/Telegram/src/main.cpp b/protocols/Telegram/src/main.cpp index ee1aa1ecee..590a1ecd1b 100644 --- a/protocols/Telegram/src/main.cpp +++ b/protocols/Telegram/src/main.cpp @@ -47,7 +47,7 @@ static IconItem iconList[] = int CMPlugin::Load()
{
- registerIcon("Protocols/Telegram", iconList, "tg");
+ registerIcon(LPGEN("Protocols") "/" LPGEN("Telegram"), iconList, "tg");
m_hIcon = ExtraIcon_RegisterIcolib("tg_premium", LPGEN("Telegram Premium user"), getIconHandle(IDI_PREMIUM));
return 0;
diff --git a/protocols/Twitter/src/theme.cpp b/protocols/Twitter/src/theme.cpp index b7b8c01e97..566bcdb576 100644 --- a/protocols/Twitter/src/theme.cpp +++ b/protocols/Twitter/src/theme.cpp @@ -37,7 +37,7 @@ void TwitterInitSounds(void) // TODO: uninit
void InitIcons(void)
{
- g_plugin.registerIcon("Protocols/Twitter", iconList, "Twitter");
+ g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Twitter"), iconList, "Twitter");
iconList[_countof(iconList) - 1].hIcolib = Skin_GetIconHandle(SKINICON_EVENT_URL);
}
diff --git a/protocols/YAMN/src/main.cpp b/protocols/YAMN/src/main.cpp index 7522c4c0e8..7a17dd78d4 100644 --- a/protocols/YAMN/src/main.cpp +++ b/protocols/YAMN/src/main.cpp @@ -126,7 +126,7 @@ static IconItem iconList[] = void LoadIcons()
{
- g_plugin.registerIcon("YAMN", iconList);
+ g_plugin.registerIcon(LPGEN("YAMN"), iconList);
}
int CMPlugin::Load()
diff --git a/src/core/stduserinfo/src/stdafx.h b/src/core/stduserinfo/src/stdafx.h index ca5412f200..83358ce12f 100644 --- a/src/core/stduserinfo/src/stdafx.h +++ b/src/core/stduserinfo/src/stdafx.h @@ -70,7 +70,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "resource.h"
#include "utils.h"
-#define MODULENAME "UserInfo"
+#define MODULENAME LPGEN("UserInfo")
struct CMPlugin : public PLUGIN<CMPlugin>
{
diff --git a/src/mir_app/src/IcoLib.h b/src/mir_app/src/IcoLib.h index 4ab70b263e..73369b88a8 100644 --- a/src/mir_app/src/IcoLib.h +++ b/src/mir_app/src/IcoLib.h @@ -36,6 +36,7 @@ struct SectionItem : public MZeroedObject {
ptrW name;
int flags, maxOrder, ref_count;
+ HPLUGIN pPlugin;
};
struct IconSourceFile
diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp index fb174f428f..fc4cf444ba 100644 --- a/src/mir_app/src/icolib.cpp +++ b/src/mir_app/src/icolib.cpp @@ -393,24 +393,21 @@ int IconSourceItem::release() /////////////////////////////////////////////////////////////////////////////////////////
// Service functions
-static SectionItem* IcoLib_AddSection(wchar_t *sectionName, BOOL create_new)
+static SectionItem *IcoLib_AddSection(wchar_t *sectionName, HPLUGIN pPlugin)
{
if (!sectionName)
return nullptr;
int indx;
- if ((indx = sectionList.getIndex((SectionItem*)§ionName)) != -1)
+ if ((indx = sectionList.getIndex((SectionItem *)§ionName)) != -1)
return sectionList[indx];
- if (create_new) {
- SectionItem *newItem = new SectionItem();
- newItem->name = mir_wstrdup(sectionName);
- sectionList.insert(newItem);
- bNeedRebuild = TRUE;
- return newItem;
- }
-
- return nullptr;
+ SectionItem *newItem = new SectionItem();
+ newItem->name = mir_wstrdup(sectionName);
+ newItem->pPlugin = pPlugin;
+ sectionList.insert(newItem);
+ bNeedRebuild = TRUE;
+ return newItem;
}
static void IcoLib_RemoveSection(SectionItem *section)
@@ -493,11 +490,11 @@ MIR_APP_DLL(HANDLE) IcoLib_AddIcon(const SKINICONDESC *sid, HPLUGIN pPlugin) item->name = mir_strdup(sid->pszName);
if (sid->flags & SIDF_UNICODE) {
item->description = mir_wstrdup(sid->description.w);
- item->section = IcoLib_AddSection(sid->section.w, TRUE);
+ item->section = IcoLib_AddSection(sid->section.w, pPlugin);
}
else {
item->description = mir_a2u(sid->description.a);
- item->section = IcoLib_AddSection(_A2T(sid->section.a), TRUE);
+ item->section = IcoLib_AddSection(_A2T(sid->section.a), pPlugin);
}
if (item->section) {
diff --git a/src/mir_app/src/proto_accs.cpp b/src/mir_app/src/proto_accs.cpp index a6a52bca6e..af56d61399 100644 --- a/src/mir_app/src/proto_accs.cpp +++ b/src/mir_app/src/proto_accs.cpp @@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "clc.h"
+#define PROTO_MODULE LPGEN("Protocols")
+
bool CheckProtocolOrder(void);
void BuildProtoMenus();
@@ -62,13 +64,13 @@ static int EnumDbModules(const char *szModuleName, void*) void LoadDbAccounts(void)
{
- int ver = db_get_dw(0, "Protocols", "PrVer", -1);
- int count = db_get_dw(0, "Protocols", "ProtoCount", 0);
+ int ver = db_get_dw(0, PROTO_MODULE, "PrVer", -1);
+ int count = db_get_dw(0, PROTO_MODULE, "ProtoCount", 0);
for (int i = 0; i < count; i++) {
char buf[10];
_itoa(i, buf, 10);
- ptrA szModuleName(db_get_sa(0, "Protocols", buf));
+ ptrA szModuleName(db_get_sa(0, PROTO_MODULE, buf));
if (szModuleName == nullptr)
continue;
@@ -79,20 +81,20 @@ void LoadDbAccounts(void) }
_itoa(OFFSET_VISIBLE + i, buf, 10);
- pa->bIsVisible = db_get_dw(0, "Protocols", buf, 1) != 0;
+ pa->bIsVisible = db_get_dw(0, PROTO_MODULE, buf, 1) != 0;
_itoa(OFFSET_PROTOPOS + i, buf, 10);
- pa->iOrder = db_get_dw(0, "Protocols", buf, 1);
+ pa->iOrder = db_get_dw(0, PROTO_MODULE, buf, 1);
if (ver >= 4) {
_itoa(OFFSET_NAME + i, buf, 10);
- pa->tszAccountName = db_get_wsa(0, "Protocols", buf);
+ pa->tszAccountName = db_get_wsa(0, PROTO_MODULE, buf);
_itoa(OFFSET_ENABLED + i, buf, 10);
- pa->bIsEnabled = db_get_dw(0, "Protocols", buf, 1) != 0;
+ pa->bIsEnabled = db_get_dw(0, PROTO_MODULE, buf, 1) != 0;
if (!pa->bIsEnabled && !mir_strcmp(pa->szModuleName, META_PROTO)) {
pa->bIsEnabled = true;
- db_set_dw(0, "Protocols", buf, 1);
+ db_set_dw(0, PROTO_MODULE, buf, 1);
}
pa->szProtoName = db_get_sa(0, szModuleName, "AM_BaseProto");
}
@@ -121,7 +123,7 @@ void LoadDbAccounts(void) void WriteDbAccounts()
{
// enum all old settings to delete
- db_delete_module(0, "Protocols");
+ db_delete_module(0, PROTO_MODULE);
// write new data
for (int i = 0; i < g_arAccounts.getCount(); i++) {
@@ -129,23 +131,23 @@ void WriteDbAccounts() char buf[20];
_itoa(i, buf, 10);
- db_set_s(0, "Protocols", buf, pa->szModuleName);
+ db_set_s(0, PROTO_MODULE, buf, pa->szModuleName);
_itoa(OFFSET_PROTOPOS + i, buf, 10);
- db_set_dw(0, "Protocols", buf, pa->iOrder);
+ db_set_dw(0, PROTO_MODULE, buf, pa->iOrder);
_itoa(OFFSET_VISIBLE + i, buf, 10);
- db_set_dw(0, "Protocols", buf, pa->bIsVisible);
+ db_set_dw(0, PROTO_MODULE, buf, pa->bIsVisible);
_itoa(OFFSET_ENABLED + i, buf, 10);
- db_set_dw(0, "Protocols", buf, pa->bIsEnabled);
+ db_set_dw(0, PROTO_MODULE, buf, pa->bIsEnabled);
_itoa(OFFSET_NAME + i, buf, 10);
- db_set_ws(0, "Protocols", buf, pa->tszAccountName);
+ db_set_ws(0, PROTO_MODULE, buf, pa->tszAccountName);
}
- db_set_dw(0, "Protocols", "ProtoCount", g_arAccounts.getCount());
- db_set_dw(0, "Protocols", "PrVer", 4);
+ db_set_dw(0, PROTO_MODULE, "ProtoCount", g_arAccounts.getCount());
+ db_set_dw(0, PROTO_MODULE, "PrVer", 4);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp index 101b0e7ba7..538984541c 100644 --- a/src/mir_app/src/skin2opts.cpp +++ b/src/mir_app/src/skin2opts.cpp @@ -375,11 +375,12 @@ class CIcoLibOptsDlg : public CDlgBase m_categoryList.DeleteAllItems();
for (int indx = 0; indx < sectionList.getCount(); indx++) {
+ auto *pSection = sectionList[indx];
int sectionLevel = 0;
HTREEITEM hSection = nullptr;
wchar_t itemName[1024];
- mir_wstrcpy(itemName, sectionList[indx]->name);
+ mir_wstrncpy(itemName, pSection->name, _countof(itemName));
wchar_t *sectionName = itemName;
while (sectionName) {
@@ -392,7 +393,7 @@ class CIcoLibOptsDlg : public CDlgBase *sectionName = 0;
}
- pItemName = TranslateW(pItemName);
+ pItemName = TranslateW_LP(pItemName, pSection->pPlugin);
hItem = FindNamedTreeItemAt(hSection, pItemName);
if (!sectionName || !hItem) {
if (!hItem) {
|