From 6029165c364f93a84ab7e98ef71d3a711b0f588c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 10 Apr 2013 21:08:51 +0000 Subject: attempt to fix the most crazy pieces of status icons related code git-svn-id: http://svn.miranda-ng.org/main/trunk@4417 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber.cpp | 32 ------------------------- protocols/JabberG/src/jabber_proto.cpp | 43 +++++++++++++++++++++++++++++++--- 2 files changed, 40 insertions(+), 35 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 43190cdfd7..2c76951eb0 100644 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -103,38 +103,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD miranda extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST}; -/////////////////////////////////////////////////////////////////////////////// -// OnPreShutdown - prepares Miranda to be shut down - -int __cdecl CJabberProto::OnPreShutdown(WPARAM, LPARAM) -{ - UI_SAFE_CLOSE_HWND(m_hwndAgentRegInput); - UI_SAFE_CLOSE_HWND(m_hwndRegProgress); - UI_SAFE_CLOSE_HWND(m_hwndMucVoiceList); - UI_SAFE_CLOSE_HWND(m_hwndMucMemberList); - UI_SAFE_CLOSE_HWND(m_hwndMucModeratorList); - UI_SAFE_CLOSE_HWND(m_hwndMucBanList); - UI_SAFE_CLOSE_HWND(m_hwndMucAdminList); - UI_SAFE_CLOSE_HWND(m_hwndMucOwnerList); - UI_SAFE_CLOSE_HWND(m_hwndJabberChangePassword); - UI_SAFE_CLOSE_HWND(m_hwndJabberAddBookmark); - UI_SAFE_CLOSE_HWND(m_hwndPrivacyRule); - - UI_SAFE_CLOSE(m_pDlgPrivacyLists); - UI_SAFE_CLOSE(m_pDlgBookmarks); - UI_SAFE_CLOSE(m_pDlgServiceDiscovery); - UI_SAFE_CLOSE(m_pDlgJabberJoinGroupchat); - UI_SAFE_CLOSE(m_pDlgNotes); - - m_iqManager.ExpireAll(); - m_iqManager.Shutdown(); - m_messageManager.Shutdown(); - m_presenceManager.Shutdown(); - m_sendManager.Shutdown(); - ConsoleUninit(); - return 0; -} - /////////////////////////////////////////////////////////////////////////////// // OnModulesLoaded - execute some code when all plugins are initialized diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index aa705faea9..8f68e215aa 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -295,13 +295,12 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) } if (ServiceExists(MS_MSG_ADDICON)) { - StatusIconData sid = {0}; - sid.cbSize = sizeof(sid); + StatusIconData sid = { sizeof(sid) }; sid.szModule = m_szModuleName; sid.hIcon = sid.hIconDisabled = LoadIconEx("main"); sid.flags = MBF_HIDDEN; sid.szTooltip = Translate("Jabber Resource"); - CallService(MS_MSG_ADDICON, 0, (LPARAM) &sid); + CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid); Skin_ReleaseIcon(sid.hIcon); JHookEvent(ME_MSG_ICONPRESSED, &CJabberProto::OnProcessSrmmIconClick); @@ -349,6 +348,44 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) return 0; } +/////////////////////////////////////////////////////////////////////////////// +// OnPreShutdown - prepares Miranda to be shut down + +int __cdecl CJabberProto::OnPreShutdown(WPARAM, LPARAM) +{ + UI_SAFE_CLOSE_HWND(m_hwndAgentRegInput); + UI_SAFE_CLOSE_HWND(m_hwndRegProgress); + UI_SAFE_CLOSE_HWND(m_hwndMucVoiceList); + UI_SAFE_CLOSE_HWND(m_hwndMucMemberList); + UI_SAFE_CLOSE_HWND(m_hwndMucModeratorList); + UI_SAFE_CLOSE_HWND(m_hwndMucBanList); + UI_SAFE_CLOSE_HWND(m_hwndMucAdminList); + UI_SAFE_CLOSE_HWND(m_hwndMucOwnerList); + UI_SAFE_CLOSE_HWND(m_hwndJabberChangePassword); + UI_SAFE_CLOSE_HWND(m_hwndJabberAddBookmark); + UI_SAFE_CLOSE_HWND(m_hwndPrivacyRule); + + UI_SAFE_CLOSE(m_pDlgPrivacyLists); + UI_SAFE_CLOSE(m_pDlgBookmarks); + UI_SAFE_CLOSE(m_pDlgServiceDiscovery); + UI_SAFE_CLOSE(m_pDlgJabberJoinGroupchat); + UI_SAFE_CLOSE(m_pDlgNotes); + + m_iqManager.ExpireAll(); + m_iqManager.Shutdown(); + m_messageManager.Shutdown(); + m_presenceManager.Shutdown(); + m_sendManager.Shutdown(); + ConsoleUninit(); + + if (ServiceExists(MS_MSG_REMOVEICON)) { + StatusIconData sid = { sizeof(sid) }; + sid.szModule = m_szModuleName; + CallService(MS_MSG_REMOVEICON, 0, (LPARAM)&sid); + } + return 0; +} + //////////////////////////////////////////////////////////////////////////////////////// // JabberAddToList - adds a contact to the contact list -- cgit v1.2.3