From 6c774bd20bdabda5a3c4d8b89b7ae5a7f68ceeaa Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 8 Apr 2013 16:00:40 +0000 Subject: fix for Jabber protocol "main" icon git-svn-id: http://svn.miranda-ng.org/main/trunk@4393 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber.h | 2 ++ protocols/JabberG/src/jabber_icolib.cpp | 11 ++++------- protocols/JabberG/src/jabber_misc.cpp | 2 ++ protocols/JabberG/src/jabber_proto.cpp | 5 +++-- 4 files changed, 11 insertions(+), 9 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber.h b/protocols/JabberG/src/jabber.h index d6cc3803df..b999103128 100644 --- a/protocols/JabberG/src/jabber.h +++ b/protocols/JabberG/src/jabber.h @@ -71,6 +71,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include +#include #include #include #include diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index db09e790c4..f727d0ee1f 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -26,10 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "jabber.h" #include "jabber_list.h" -#include - -#include - #define IDI_ONLINE 104 #define IDI_OFFLINE 105 #define IDI_AWAY 128 @@ -190,9 +186,10 @@ HICON CJabberProto::LoadIconEx(const char* name, bool big) if (HICON result = g_LoadIconEx(name, big)) return result; - char szSettingName[100]; - mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", m_szModuleName, name); - return Skin_GetIcon(szSettingName, big); + if ( !strcmp(name, "main")) + return Skin_GetIconByHandle(m_hProtoIcon, big); + + return NULL; } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 9e42b13f53..4ed270192e 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -633,6 +633,8 @@ void CJabberProto::InitPopups(void) ppc.colorText = RGB(255, 245, 225); //Yellow ppc.iSeconds = 60; m_hPopupClass = Popup_RegisterClass(&ppc); + + Skin_ReleaseIcon(ppc.hIcon); } void CJabberProto::MsgPopup(HANDLE hContact, const TCHAR *szMsg, const TCHAR *szTitle) diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 4986c7f401..fc296d7c18 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -298,11 +298,12 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) StatusIconData sid = {0}; sid.cbSize = sizeof(sid); sid.szModule = m_szModuleName; - sid.hIcon = LoadIconEx("main"); - sid.hIconDisabled = LoadIconEx("main"); + sid.hIcon = sid.hIconDisabled = LoadIconEx("main"); sid.flags = MBF_HIDDEN; sid.szTooltip = Translate("Jabber Resource"); CallService(MS_MSG_ADDICON, 0, (LPARAM) &sid); + Skin_ReleaseIcon(sid.hIcon); + JHookEvent(ME_MSG_ICONPRESSED, &CJabberProto::OnProcessSrmmIconClick); JHookEvent(ME_MSG_WINDOWEVENT, &CJabberProto::OnProcessSrmmEvent); -- cgit v1.2.3