From 943543342edbc6e66630810ec4486e1a579abc2f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 24 Feb 2014 14:06:12 +0000 Subject: toolbar button to be synced with a main menu item git-svn-id: http://svn.miranda-ng.org/main/trunk@8256 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewAwaySysMod/src/AwaySys.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index d4ffdca3f1..d9bca61bb8 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -411,9 +411,11 @@ INT_PTR ToggleSendOnEvent(WPARAM hContact, LPARAM) CContactSettings(g_ProtoStates[hContact ? GetContactProto(hContact) : NULL].Status, hContact).Autoreply.Toggle(); if (hContact == NULL) { + int SendOnEvent = CContactSettings(g_ProtoStates[(LPSTR)NULL].Status).Autoreply; + CLISTMENUITEM mi = { sizeof(mi) }; mi.flags = CMIM_ICON | CMIM_NAME | CMIF_TCHAR; - if (CContactSettings(g_ProtoStates[(LPSTR)NULL].Status).Autoreply) { + if (SendOnEvent) { mi.ptszName = ENABLE_SOE_COMMAND; mi.icolibItem = iconList[1].hIcolib; } @@ -422,6 +424,9 @@ INT_PTR ToggleSendOnEvent(WPARAM hContact, LPARAM) mi.icolibItem = iconList[0].hIcolib; } CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)g_hToggleSOEMenuItem, (LPARAM)&mi); + + if (g_hTopToolbarbutton) + CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)g_hTopToolbarbutton, SendOnEvent ? TTBST_PUSHED : TTBST_RELEASED); } return 0; -- cgit v1.2.3