summaryrefslogtreecommitdiff
path: root/plugins/HistorySweeperLight/src/options.cpp
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 /plugins/HistorySweeperLight/src/options.cpp
parent6c4136504c660bf3359e6641362672c4b9502be5 (diff)
merge with trunk
Diffstat (limited to 'plugins/HistorySweeperLight/src/options.cpp')
-rw-r--r--plugins/HistorySweeperLight/src/options.cpp74
1 files changed, 26 insertions, 48 deletions
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp
index 4dc71814f8..50db5990f5 100644
--- a/plugins/HistorySweeperLight/src/options.cpp
+++ b/plugins/HistorySweeperLight/src/options.cpp
@@ -21,6 +21,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static IconItem iconList[] =
+{
+ { LPGEN("Default Action"), "actG", IDI_ACTG },
+ { LPGEN("Action 1"), "act1", IDI_ACT1 },
+ { LPGEN("Action 2"), "act2", IDI_ACT2 },
+ { LPGEN("Delete All"), "actDel", IDI_ACTDEL }
+};
+
+static HANDLE hIconLibItem[_countof(iconList)];
+
+void InitIcons(void)
+{
+ g_plugin.registerIcon(MODULENAME, iconList, MODULENAME);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
// Time Stamps strings
wchar_t* time_stamp_strings[] =
{
@@ -44,44 +63,6 @@ wchar_t* keep_strings[] =
LPGENW("Keep 50 last events")
};
-static IconItem iconList[] =
-{
- { LPGEN("Default Action"), "actG", IDI_ACTG },
- { LPGEN("Action 1"), "act1", IDI_ACT1 },
- { LPGEN("Action 2"), "act2", IDI_ACT2 },
- { LPGEN("Delete All"), "actDel", IDI_ACTDEL }
-};
-
-static HANDLE hIconLibItem[_countof(iconList)];
-
-void InitIcons(void)
-{
- g_plugin.registerIcon(MODULENAME, iconList, MODULENAME);
-}
-
-HICON LoadIconEx(const char* name)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "%s_%s", MODULENAME, name);
- return IcoLib_GetIcon(szSettingName);
-}
-
-HANDLE GetIconHandle(const char* name)
-{
- for (auto &it : iconList)
- if (mir_strcmp(it.szName, name) == 0)
- return &it;
-
- return nullptr;
-}
-
-void ReleaseIconEx(const char* name)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "%s_%s", MODULENAME, name);
- IcoLib_Release(szSettingName);
-}
-
HANDLE hAllContacts, hSystemHistory;
static void ShowAllContactIcons(HWND hwndList)
@@ -182,20 +163,17 @@ INT_PTR CALLBACK DlgProcHSOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
TranslateDialogDefault(hwndDlg);
{
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR32, 2, 2);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
- HICON hIcon = Skin_LoadIcon(SKINICON_OTHER_SMALLDOT);
- ImageList_AddIcon(hIml, hIcon);
- IcoLib_ReleaseIcon(hIcon);
-
- hIcon = LoadIconEx("act1");
+ HICON hIcon = g_plugin.getIcon(IDI_ACT1);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ACT1, STM_SETICON, (WPARAM)hIcon, 0);
- hIcon = LoadIconEx("act2");
+ hIcon = g_plugin.getIcon(IDI_ACT2);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ACT2, STM_SETICON, (WPARAM)hIcon, 0);
- hIcon = LoadIconEx("actDel");
+ hIcon = g_plugin.getIcon(IDI_ACTDEL);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
@@ -206,9 +184,9 @@ INT_PTR CALLBACK DlgProcHSOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
case WM_DESTROY:
ImageList_Destroy((HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGELIST, 0, 0));
- ReleaseIconEx("act1");
- ReleaseIconEx("act2");
- ReleaseIconEx("actDel");
+ g_plugin.releaseIcon(IDI_ACT1);
+ g_plugin.releaseIcon(IDI_ACT2);
+ g_plugin.releaseIcon(IDI_ACTDEL);
break;
case WM_COMMAND: