diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2017-08-22 22:56:51 +0300 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2017-08-22 22:56:51 +0300 |
commit | f29a8526f837b9f8bf04be88a619d536256b4b99 (patch) | |
tree | bde347829504c21c1559d5f93c05a4eaedd86762 /plugins/NewXstatusNotify/src | |
parent | 2be2a04af85d58577b2cd7d5e67191208c7cf604 (diff) |
NewXsatusNotify: all icons added to icolib (fixes #299)
Diffstat (limited to 'plugins/NewXstatusNotify/src')
-rw-r--r-- | plugins/NewXstatusNotify/src/indsnd.cpp | 16 | ||||
-rw-r--r-- | plugins/NewXstatusNotify/src/main.cpp | 22 | ||||
-rw-r--r-- | plugins/NewXstatusNotify/src/options.cpp | 32 | ||||
-rw-r--r-- | plugins/NewXstatusNotify/src/stdafx.h | 11 |
4 files changed, 43 insertions, 38 deletions
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index b3f0ed90a9..8d5a27e7b1 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -422,21 +422,21 @@ INT_PTR CALLBACK DlgProcFiltering(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) HIMAGELIST hImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 3, 3);
- ImageList_AddIcon(hImageList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_SOUND)));
+ ImageList_AddIcon(hImageList, IcoLib_GetIconByHandle(iconList[2].hIcolib));
SendDlgItemMessage(hwndDlg, IDC_SOUNDICON, STM_SETICON, (WPARAM)ImageList_GetIcon(hImageList, EXTRA_IMAGE_SOUND, ILD_NORMAL), 0);
- ImageList_AddIcon(hImageList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_POPUP)));
+ ImageList_AddIcon(hImageList, IcoLib_GetIconByHandle(iconList[1].hIcolib));
SendDlgItemMessage(hwndDlg, IDC_POPUPICON, STM_SETICON, (WPARAM)ImageList_GetIcon(hImageList, EXTRA_IMAGE_POPUP, ILD_NORMAL), 0);
- ImageList_AddIcon(hImageList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_XSTATUS)));
+ ImageList_AddIcon(hImageList, IcoLib_GetIconByHandle(iconList[5].hIcolib));
SendDlgItemMessage(hwndDlg, IDC_XSTATUSICON, STM_SETICON, (WPARAM)ImageList_GetIcon(hImageList, EXTRA_IMAGE_XSTATUS, ILD_NORMAL), 0);
- ImageList_AddIcon(hImageList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_LOGGING_XSTATUS)));
+ ImageList_AddIcon(hImageList, IcoLib_GetIconByHandle(iconList[10].hIcolib));
SendDlgItemMessage(hwndDlg, IDC_XLOGGINGICON, STM_SETICON, (WPARAM)ImageList_GetIcon(hImageList, EXTRA_IMAGE_XLOGGING, ILD_NORMAL), 0);
- ImageList_AddIcon(hImageList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_STATUS_MESSAGE)));
+ ImageList_AddIcon(hImageList, IcoLib_GetIconByHandle(iconList[9].hIcolib));
SendDlgItemMessage(hwndDlg, IDC_SMSGICON, STM_SETICON, (WPARAM)ImageList_GetIcon(hImageList, EXTRA_IMAGE_STATUSMSG, ILD_NORMAL), 0);
- ImageList_AddIcon(hImageList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_LOGGING_SMSG)));
+ ImageList_AddIcon(hImageList, IcoLib_GetIconByHandle(iconList[11].hIcolib));
SendDlgItemMessage(hwndDlg, IDC_SMSGLOGGINGICON, STM_SETICON, (WPARAM)ImageList_GetIcon(hImageList, EXTRA_IMAGE_SMSGLOGGING, ILD_NORMAL), 0);
- ImageList_AddIcon(hImageList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_DISABLEALL)));
+ ImageList_AddIcon(hImageList, IcoLib_GetIconByHandle(iconList[6].hIcolib));
SendDlgItemMessage(hwndDlg, IDC_DISABLEALLICON, STM_SETICON, (WPARAM)ImageList_GetIcon(hImageList, EXTRA_IMAGE_DISABLEALL, ILD_NORMAL), 0);
- ImageList_AddIcon(hImageList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_ENABLEALL)));
+ ImageList_AddIcon(hImageList, IcoLib_GetIconByHandle(iconList[7].hIcolib));
SendDlgItemMessage(hwndDlg, IDC_ENABLEALLICON, STM_SETICON, (WPARAM)ImageList_GetIcon(hImageList, EXTRA_IMAGE_ENABLEALL, ILD_NORMAL), 0);
ImageList_AddIcon(hImageList, Skin_LoadIcon(SKINICON_OTHER_SMALLDOT));
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index d39b141107..aca8e1d4fd 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -1080,10 +1080,20 @@ void InitMainMenuItem() EnableDisableMenuCommand(0, 0);
}
-static IconItem iconList[] =
+IconItem iconList[] =
{
+ { LPGEN("Reset"), ICO_RESET, IDI_RESET },
+ { LPGEN("Popups"), ICO_POPUP, IDI_POPUP },
+ { LPGEN("Sounds"), ICO_SOUND, IDI_SOUND },
{ LPGEN("Notification enabled"), ICO_NOTIFICATION_OFF, IDI_NOTIFICATION_OFF },
- { LPGEN("Notification disabled"), ICO_NOTIFICATION_ON, IDI_NOTIFICATION_ON }
+ { LPGEN("Notification disabled"), ICO_NOTIFICATION_ON, IDI_NOTIFICATION_ON },
+ { LPGEN("Extra status notify"), ICO_XSTATUS, IDI_XSTATUS },
+ { LPGEN("Disable all"), ICO_DISABLEALL, IDI_DISABLEALL },
+ { LPGEN("Enable all"), ICO_ENABLEALL, IDI_ENABLEALL },
+ { LPGEN("Variables"), ICO_VARIABLES, IDI_VARIABLES },
+ { LPGEN("Status message notify"), ICO_STATUS_MESSAGE, IDI_STATUS_MESSAGE },
+ { LPGEN("Extra status logging"), ICO_LOGGING_XSTATUS, IDI_LOGGING_XSTATUS },
+ { LPGEN("Status message logging"), ICO_LOGGING_SMSG, IDI_LOGGING_SMSG }
};
void InitIcolib()
@@ -1106,8 +1116,8 @@ int InitTopToolbar(WPARAM, LPARAM) tbb.pszService = MS_STATUSCHANGE_MENUCOMMAND;
tbb.dwFlags = (opt.TempDisabled ? 0 : TTBBF_PUSHED) | TTBBF_ASPUSHBUTTON;
tbb.name = LPGEN("Toggle status notification");
- tbb.hIconHandleUp = iconList[0].hIcolib;
- tbb.hIconHandleDn = iconList[1].hIcolib;
+ tbb.hIconHandleUp = iconList[3].hIcolib;
+ tbb.hIconHandleDn = iconList[4].hIcolib;
tbb.pszTooltipUp = LPGEN("Enable status notification");
tbb.pszTooltipDn = LPGEN("Disable status notification");
hToolbarButton = TopToolbar_AddButton(&tbb);
@@ -1164,9 +1174,9 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_CLIST_STATUSMODECHANGE, StatusModeChanged);
HookEvent(ME_PROTO_ACK, ProtoAck);
+ InitIcolib();
LoadOptions();
InitStatusList();
- InitIcolib();
InitSound();
db_set_resident("MetaContacts", "LastOnline");
@@ -1179,7 +1189,7 @@ extern "C" int __declspec(dllexport) Load(void) evtype.module = MODULE;
evtype.eventType = EVENTTYPE_STATUSCHANGE;
evtype.descr = LPGEN("Status change");
- evtype.eventIcon = iconList[0].hIcolib;
+ evtype.eventIcon = iconList[3].hIcolib;
evtype.flags = DETF_HISTORY | DETF_MSGWINDOW;
DbEvent_RegisterType(&evtype);
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index ffa1904a0a..6e2ca296df 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -558,14 +558,10 @@ INT_PTR CALLBACK DlgProcXPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM // Buttons
SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show available variables"), BATF_UNICODE);
- HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES));
- SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
- DestroyIcon(hIcon);
+ SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(iconList[8].hIcolib));
SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset all templates to default"), BATF_UNICODE);
- hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET));
- SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
- DestroyIcon(hIcon);
+ SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(iconList[0].hIcolib));
return TRUE;
}
@@ -692,14 +688,10 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA // Buttons
SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Show available variables"), BATF_UNICODE);
- HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES));
- SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
- DestroyIcon(hIcon);
+ SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(iconList[8].hIcolib));
SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)LPGENW("Reset all templates to default"), BATF_UNICODE);
- hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET));
- SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
- DestroyIcon(hIcon);
+ SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(iconList[0].hIcolib));
// proto list
HWND hList = GetDlgItem(hwndDlg, IDC_PROTOCOLLIST);
@@ -916,14 +908,10 @@ INT_PTR CALLBACK DlgProcXLogOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l // Buttons
SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Show available variables"), BATF_UNICODE);
- HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES));
- SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
- DestroyIcon(hIcon);
+ SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(iconList[8].hIcolib));
SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Reset all templates to default"), BATF_UNICODE);
- hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET));
- SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
- DestroyIcon(hIcon);
+ SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(iconList[0].hIcolib));
SendMessage(hwndDlg, WM_USER + 2, (WPARAM)opt.XLogToFile || opt.XLogToDB, 0);
@@ -1083,14 +1071,10 @@ INT_PTR CALLBACK DlgProcLogOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP // Buttons
SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Show available variables"), BATF_UNICODE);
- HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_VARIABLES));
- SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
- DestroyIcon(hIcon);
+ SendDlgItemMessage(hwndDlg, IDC_BT_VARIABLES, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(iconList[8].hIcolib));
SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Reset all templates to default"), BATF_UNICODE);
- hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_RESET));
- SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
- DestroyIcon(hIcon);
+ SendDlgItemMessage(hwndDlg, IDC_BT_RESET, BM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIconByHandle(iconList[0].hIcolib));
SendMessage(hwndDlg, WM_USER + 2, (WPARAM)opt.LogToFile || opt.LogToDB, 0);
SendMessage(hwndDlg, WM_USER + 3, (WPARAM)opt.SMsgLogToFile || opt.SMsgLogToDB, 0);
diff --git a/plugins/NewXstatusNotify/src/stdafx.h b/plugins/NewXstatusNotify/src/stdafx.h index 32feb569d4..1053b8e602 100644 --- a/plugins/NewXstatusNotify/src/stdafx.h +++ b/plugins/NewXstatusNotify/src/stdafx.h @@ -98,8 +98,18 @@ #define COLOR_BG_NAVAILDEFAULT RGB(255,189,189)
#define COLOR_TX_DEFAULT RGB(0,0,0)
+#define ICO_RESET "reset"
+#define ICO_POPUP "popup"
+#define ICO_SOUND "sound"
#define ICO_NOTIFICATION_OFF "notification_off"
#define ICO_NOTIFICATION_ON "notification_on"
+#define ICO_XSTATUS "xstatus"
+#define ICO_DISABLEALL "disable_all"
+#define ICO_ENABLEALL "enable_all"
+#define ICO_VARIABLES "variables"
+#define ICO_STATUS_MESSAGE "status_message"
+#define ICO_LOGGING_XSTATUS "logging_xstatus"
+#define ICO_LOGGING_SMSG "logging_status_message"
#define JS_PARSE_XMPP_URI "/ParseXmppURI"
@@ -149,6 +159,7 @@ extern HINSTANCE hInst; extern HGENMENU hEnableDisableMenu;
extern STATUS StatusList[STATUS_COUNT];
extern STATUS StatusListEx[STATUSEX_COUNT];
+extern IconItem iconList[];
wchar_t* GetStr(STATUSMSGINFO *n, const wchar_t *tmplt);
void LogSMsgToDB(STATUSMSGINFO *smi, const wchar_t *tmplt);
|