summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-08 16:00:40 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-08 16:00:40 +0000
commit6c774bd20bdabda5a3c4d8b89b7ae5a7f68ceeaa (patch)
tree5f976f6cc2042a179c49bb2437abd0545a6521c9
parent377d84e3a4c8d4457eb6d95debd4113d4a80d31c (diff)
fix for Jabber protocol "main" icon
git-svn-id: http://svn.miranda-ng.org/main/trunk@4393 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/JabberG/src/jabber.h2
-rw-r--r--protocols/JabberG/src/jabber_icolib.cpp11
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp2
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp5
4 files changed, 11 insertions, 9 deletions
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 <m_skin.h>
#include <m_chat.h>
#include <m_clc.h>
+#include <m_icolib.h>
+#include <m_cluiframes.h>
#include <m_clistint.h>
#include <m_button.h>
#include <m_avatars.h>
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 <m_icolib.h>
-
-#include <m_cluiframes.h>
-
#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);