diff options
author | George Hazan <ghazan@miranda.im> | 2019-04-13 20:22:59 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-04-13 20:22:59 +0300 |
commit | 680873487c4a7987012606119a744e5ca725ad30 (patch) | |
tree | 8e5fbc68a253c3ec44287754c9295670f1ee44c3 /plugins/StartupSilence/src/main.cpp | |
parent | 6c4136504c660bf3359e6641362672c4b9502be5 (diff) |
merge with trunk
Diffstat (limited to 'plugins/StartupSilence/src/main.cpp')
-rw-r--r-- | plugins/StartupSilence/src/main.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index e2f8ab22be..5a2241f494 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. CMPlugin g_plugin;
HGENMENU hSSMenuToggleOnOff;
-HANDLE GetIconHandle(char *szIcon);
HANDLE hOptionsInitialize;
HANDLE hTTBarloaded = nullptr;
HANDLE Buttons = nullptr;
@@ -93,7 +92,7 @@ static void __cdecl AdvSt(void*) if (PopUp == 1) {
lpwzText = NonStatusAllow == 1 ? ALL_DISABLED_FLT : ALL_DISABLED;
- ppd.lchIcon = IcoLib_GetIconByHandle((NonStatusAllow == 1) ? GetIconHandle(ALL_ENABLED_FLT) : GetIconHandle(MENU_NAME));
+ ppd.lchIcon = IcoLib_GetIconByHandle((NonStatusAllow == 1) ? g_plugin.getIconHandle(IDI_SSFILTEREDON) : g_plugin.getIconHandle(IDI_SSICON));
ppd.lchContact = NULL;
ppd.iSeconds = PopUpTime;
wcsncpy_s(ppd.lpwzText, lpwzText, _TRUNCATE);
@@ -108,7 +107,7 @@ static void __cdecl AdvSt(void*) if (PopUp == 1) {
lpwzText = (DefEnabled == 1 && DefPopup == 1) ? TranslateT(ALL_ENABLED_FLT) : ALL_ENABLED;
- ppd.lchIcon = IcoLib_GetIconByHandle((DefEnabled == 1 && DefPopup == 1) ? GetIconHandle(ALL_ENABLED_FLT) : GetIconHandle(MENU_NAME));
+ ppd.lchIcon = IcoLib_GetIconByHandle((DefEnabled == 1 && DefPopup == 1) ? g_plugin.getIconHandle(IDI_SSFILTEREDON) : g_plugin.getIconHandle(IDI_SSICON));
wcsncpy_s(ppd.lpwzText, lpwzText, _TRUNCATE);
PUAddPopupW(&ppd);
}
@@ -213,7 +212,7 @@ static INT_PTR StartupSilenceEnabled(WPARAM, LPARAM) if (PopUp == 1) {
wchar_t * lpwzText = Enabled == 1 ? S_MODE_CHANGEDON : S_MODE_CHANGEDOFF;
POPUPDATAW ppd;
- ppd.lchIcon = IcoLib_GetIconByHandle((Enabled == 1) ? GetIconHandle(ENABLE_SILENCE) : GetIconHandle(DISABLE_SILENCE));
+ ppd.lchIcon = IcoLib_GetIconByHandle((Enabled == 1) ? g_plugin.getIconHandle(IDI_SSENABLE) : g_plugin.getIconHandle(IDI_SSDISABLE));
ppd.lchContact = NULL;
ppd.iSeconds = PopUpTime;
wcsncpy_s(ppd.lpwzText, lpwzText, _TRUNCATE);
@@ -237,7 +236,7 @@ static INT_PTR InitMenu() CMenuItem mi(&g_plugin);
SET_UID(mi, 0x9100c881, 0x6f76, 0x4cb5, 0x97, 0x66, 0xeb, 0xf5, 0xc5, 0x22, 0x46, 0x1f);
mi.position = 100000000;
- mi.hIcolibItem = GetIconHandle(MENU_NAME);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_SSICON);
mi.name.a = MENU_NAME;
mi.pszService = SS_SERVICE_NAME;
hSSMenuToggleOnOff = Menu_AddMainMenuItem(&mi);
@@ -248,9 +247,9 @@ static INT_PTR InitMenu() void UpdateMenu()
{
if (Enabled == 1)
- Menu_ModifyItem(hSSMenuToggleOnOff, _A2W(DISABLE_SILENCE), GetIconHandle(DISABLE_SILENCE));
+ Menu_ModifyItem(hSSMenuToggleOnOff, _A2W(DISABLE_SILENCE), g_plugin.getIconHandle(IDI_SSDISABLE));
else
- Menu_ModifyItem(hSSMenuToggleOnOff, _A2W(ENABLE_SILENCE), GetIconHandle(ENABLE_SILENCE));
+ Menu_ModifyItem(hSSMenuToggleOnOff, _A2W(ENABLE_SILENCE), g_plugin.getIconHandle(IDI_SSENABLE));
UpdateTTB();
}
@@ -266,8 +265,8 @@ static int CreateTTButtons(WPARAM, LPARAM) TTBButton ttb = {};
ttb.dwFlags = (Enabled == 1 ? 0 : TTBBF_PUSHED) | TTBBF_VISIBLE | TTBBF_ASPUSHBUTTON;
ttb.pszService = SS_SERVICE_NAME;
- ttb.hIconHandleDn = GetIconHandle(DISABLE_SILENCETTB);
- ttb.hIconHandleUp = GetIconHandle(ENABLE_SILENCETTB);
+ ttb.hIconHandleDn = g_plugin.getIconHandle(IDI_SSDISABLETTB);
+ ttb.hIconHandleUp = g_plugin.getIconHandle(IDI_SSENABLETTB);
ttb.name = TTBNAME;
ttb.pszTooltipUp = SS_IS_ON;
ttb.pszTooltipDn = SS_IS_OFF;
@@ -284,13 +283,6 @@ void RemoveTTButtons() ttbButtons.destroy();
}
-HANDLE GetIconHandle(char *szIcon)
-{
- char szSettingName[64];
- mir_snprintf(szSettingName, "%s_%s", MENU_NAME, szIcon);
- return IcoLib_GetIconHandle(szSettingName);
-}
-
static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
|