summaryrefslogtreecommitdiff
path: root/protocols/CloudFile
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-04-13 20:22:59 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-04-13 20:22:59 +0300
commit680873487c4a7987012606119a744e5ca725ad30 (patch)
tree8e5fbc68a253c3ec44287754c9295670f1ee44c3 /protocols/CloudFile
parent6c4136504c660bf3359e6641362672c4b9502be5 (diff)
merge with trunk
Diffstat (limited to 'protocols/CloudFile')
-rw-r--r--protocols/CloudFile/src/Services/dropbox_service.cpp2
-rw-r--r--protocols/CloudFile/src/Services/google_service.cpp2
-rw-r--r--protocols/CloudFile/src/Services/microsoft_service.cpp2
-rw-r--r--protocols/CloudFile/src/Services/yandex_service.cpp2
-rw-r--r--protocols/CloudFile/src/icons.cpp34
-rw-r--r--protocols/CloudFile/src/menus.cpp4
-rw-r--r--protocols/CloudFile/src/srmm.cpp2
-rw-r--r--protocols/CloudFile/src/stdafx.h3
8 files changed, 12 insertions, 39 deletions
diff --git a/protocols/CloudFile/src/Services/dropbox_service.cpp b/protocols/CloudFile/src/Services/dropbox_service.cpp
index a2cfa5a2e5..f4b9a22b3d 100644
--- a/protocols/CloudFile/src/Services/dropbox_service.cpp
+++ b/protocols/CloudFile/src/Services/dropbox_service.cpp
@@ -18,7 +18,7 @@ g_pluginDropbox;
CDropboxService::CDropboxService(const char *protoName, const wchar_t *userName) :
CCloudService(protoName, userName, &g_pluginDropbox)
{
- m_hProtoIcon = GetIconHandle(IDI_DROPBOX);
+ m_hProtoIcon = g_plugin.getIconHandle(IDI_DROPBOX);
}
CDropboxService* CDropboxService::Init(const char *moduleName, const wchar_t *userName)
diff --git a/protocols/CloudFile/src/Services/google_service.cpp b/protocols/CloudFile/src/Services/google_service.cpp
index 536d2ff65e..db4cfc1cbd 100644
--- a/protocols/CloudFile/src/Services/google_service.cpp
+++ b/protocols/CloudFile/src/Services/google_service.cpp
@@ -19,7 +19,7 @@ g_pluginGoogle;
CGDriveService::CGDriveService(const char *protoName, const wchar_t *userName) :
CCloudService(protoName, userName, &g_pluginGoogle)
{
- m_hProtoIcon = GetIconHandle(IDI_GDRIVE);
+ m_hProtoIcon = g_plugin.getIconHandle(IDI_GDRIVE);
}
CGDriveService* CGDriveService::Init(const char *moduleName, const wchar_t *userName)
diff --git a/protocols/CloudFile/src/Services/microsoft_service.cpp b/protocols/CloudFile/src/Services/microsoft_service.cpp
index 992312e2a8..27ec0df7fb 100644
--- a/protocols/CloudFile/src/Services/microsoft_service.cpp
+++ b/protocols/CloudFile/src/Services/microsoft_service.cpp
@@ -18,7 +18,7 @@ g_pluginOnedrive;
COneDriveService::COneDriveService(const char *protoName, const wchar_t *userName) :
CCloudService(protoName, userName, &g_pluginOnedrive)
{
- m_hProtoIcon = GetIconHandle(IDI_ONEDRIVE);
+ m_hProtoIcon = g_plugin.getIconHandle(IDI_ONEDRIVE);
}
COneDriveService* COneDriveService::Init(const char *moduleName, const wchar_t *userName)
diff --git a/protocols/CloudFile/src/Services/yandex_service.cpp b/protocols/CloudFile/src/Services/yandex_service.cpp
index 4bd0210ca1..816e6ea5e4 100644
--- a/protocols/CloudFile/src/Services/yandex_service.cpp
+++ b/protocols/CloudFile/src/Services/yandex_service.cpp
@@ -18,7 +18,7 @@ g_pluginYandex;
CYandexService::CYandexService(const char *protoName, const wchar_t *userName) :
CCloudService(protoName, userName, &g_pluginYandex)
{
- m_hProtoIcon = GetIconHandle(IDI_YADISK);
+ m_hProtoIcon = g_plugin.getIconHandle(IDI_YADISK);
}
CYandexService* CYandexService::Init(const char *moduleName, const wchar_t *userName)
diff --git a/protocols/CloudFile/src/icons.cpp b/protocols/CloudFile/src/icons.cpp
index 001df50240..0b42ad77fc 100644
--- a/protocols/CloudFile/src/icons.cpp
+++ b/protocols/CloudFile/src/icons.cpp
@@ -2,38 +2,14 @@
static IconItem iconList[] =
{
- { LPGEN("Upload file(s)"), "upload", IDI_UPLOAD },
- { LPGEN("Dropbox"), "dropbox", IDI_DROPBOX },
- { LPGEN("Google Drive"), "gdrive", IDI_GDRIVE },
- { LPGEN("OneDrive"), "onedrive", IDI_ONEDRIVE },
- { LPGEN("Yandex.Disk"), "yadisk", IDI_YADISK }
+ { LPGEN("Upload file(s)"), "upload", IDI_UPLOAD },
+ { LPGEN("Dropbox"), "dropbox", IDI_DROPBOX },
+ { LPGEN("Google Drive"), "gdrive", IDI_GDRIVE },
+ { LPGEN("OneDrive"), "onedrive", IDI_ONEDRIVE },
+ { LPGEN("Yandex.Disk"), "yadisk", IDI_YADISK }
};
void InitializeIcons()
{
g_plugin.registerIcon("Protocols/" MODULENAME, iconList, MODULENAME);
}
-
-HANDLE GetIconHandle(int iconId)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return it.hIcolib;
- return nullptr;
-}
-
-HANDLE GetIconHandle(const char *name)
-{
- for (auto &it : iconList)
- if (mir_strcmpi(it.szName, name) == 0)
- return it.hIcolib;
- return nullptr;
-}
-
-HICON LoadIconEx(int iconId, bool big)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return IcoLib_GetIconByHandle(it.hIcolib, big);
- return nullptr;
-} \ No newline at end of file
diff --git a/protocols/CloudFile/src/menus.cpp b/protocols/CloudFile/src/menus.cpp
index 3ca1b085b9..33fe369406 100644
--- a/protocols/CloudFile/src/menus.cpp
+++ b/protocols/CloudFile/src/menus.cpp
@@ -26,7 +26,7 @@ void InitializeMenus()
}
mi.position = -2000019999;
- mi.hIcon = LoadIconEx(IDI_UPLOAD);
+ mi.hIcon = g_plugin.getIcon(IDI_UPLOAD);
hContactMenu = Menu_AddContactMenuItem(&mi);
}
@@ -39,7 +39,7 @@ void CCloudService::OnModulesLoaded()
mi.flags = CMIF_SYSTEM | CMIF_UNICODE;
mi.name.w = (wchar_t*)GetUserName();
mi.position = Services.getCount();
- mi.hIcolibItem = GetIconHandle(GetIconId());
+ mi.hIcolibItem = g_plugin.getIconHandle(GetIconId());
Menu_AddContactMenuItem(&mi);
CreateServiceFunctionObj(mi.pszService, UploadMenuCommand, this);
diff --git a/protocols/CloudFile/src/srmm.cpp b/protocols/CloudFile/src/srmm.cpp
index b4d44c9fdd..161ddfffd0 100644
--- a/protocols/CloudFile/src/srmm.cpp
+++ b/protocols/CloudFile/src/srmm.cpp
@@ -8,7 +8,7 @@ int OnSrmmToolbarLoaded(WPARAM, LPARAM)
CMStringW tooltip(FORMAT, TranslateT("Upload files to..."));
bbd.pwszTooltip = tooltip;
- bbd.hIcon = GetIconHandle(IDI_UPLOAD);
+ bbd.hIcon = g_plugin.getIconHandle(IDI_UPLOAD);
bbd.dwButtonID = BBB_ID_FILE_SEND;
bbd.dwDefPos = 100 + bbd.dwButtonID;
Srmm_AddButton(&bbd, &g_plugin);
diff --git a/protocols/CloudFile/src/stdafx.h b/protocols/CloudFile/src/stdafx.h
index 58801c4a34..c0bb92b713 100644
--- a/protocols/CloudFile/src/stdafx.h
+++ b/protocols/CloudFile/src/stdafx.h
@@ -81,9 +81,6 @@ int OnModulesLoaded(WPARAM, LPARAM);
// icons
void InitializeIcons();
-HANDLE GetIconHandle(int iconId);
-HANDLE GetIconHandle(const char *name);
-HICON LoadIconEx(int iconId, bool big = false);
// menus
extern HGENMENU hContactMenu;