summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer/src/cluiservices.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-08-10 12:11:15 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-08-10 12:11:15 +0000
commit3edfebd9fbf17fd9e77b371ffc14a7ec264bb485 (patch)
tree770ac65c0d515935389ee3ff5248e679937c396d /plugins/Clist_nicer/src/cluiservices.cpp
parent8e71ba6e620317052a0122135270e6fd4275e74a (diff)
- fix for Clist Nicer status button
- code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@1426 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/src/cluiservices.cpp')
-rw-r--r--plugins/Clist_nicer/src/cluiservices.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp
index d446872f16..d5cba25d3d 100644
--- a/plugins/Clist_nicer/src/cluiservices.cpp
+++ b/plugins/Clist_nicer/src/cluiservices.cpp
@@ -201,7 +201,7 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto )
caps1 = CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
if ((caps1 & PF1_IM) && (caps2 & (PF2_LONGAWAY | PF2_SHORTAWAY))) {
onlineness = GetStatusOnlineness(status);
- if(onlineness > maxOnline) {
+ if (onlineness > maxOnline) {
maxStatus = status;
maxOnline = onlineness;
szMaxProto = pa->szModuleName;
@@ -221,7 +221,7 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto )
wStatus = maxStatus;
iIcon = IconFromStatusMode((wStatus >= ID_STATUS_CONNECTING && wStatus < ID_STATUS_OFFLINE) ? szMaxProto : NULL, (int) wStatus, 0, &hIcon);
g_maxStatus = (int)wStatus;
- if(szMaxProto) {
+ if (szMaxProto) {
lstrcpynA(g_maxProto, szMaxProto, 100);
g_maxProto[99] = 0;
}
@@ -241,21 +241,25 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto )
*/
if (szStatus) {
- if(pcli->hwndContactList && IsWindow(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS)) && IsWindow(GetDlgItem(pcli->hwndContactList, IDC_TBTOPSTATUS))) {
+ if (pcli->hwndContactList && IsWindow(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS))) {
+ HWND hwndTtbStatus = ClcGetButtonWindow(IDC_TBTOPSTATUS);
+
SendMessage(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS), WM_SETTEXT, 0, (LPARAM) szStatus);
if (!hIcon) {
SendMessage(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS), BUTTONSETIMLICON, (WPARAM) hCListImages, (LPARAM) iIcon);
- if(g_ButtonItems == NULL)
- SendMessage(GetDlgItem(pcli->hwndContactList, IDC_TBTOPSTATUS), BUTTONSETIMLICON, (WPARAM) hCListImages, (LPARAM) iIcon);
+ if (g_ButtonItems == NULL && hwndTtbStatus)
+ SendMessage( hwndTtbStatus, BUTTONSETIMLICON, (WPARAM) hCListImages, (LPARAM) iIcon);
}
else {
SendMessage(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS), BM_SETIMAGE, IMAGE_ICON, (LPARAM) hIcon);
- if(g_ButtonItems == NULL)
- SendMessage(GetDlgItem(pcli->hwndContactList, IDC_TBTOPSTATUS), BM_SETIMAGE, IMAGE_ICON, (LPARAM) hIcon);
+ if (g_ButtonItems == NULL && hwndTtbStatus)
+ SendMessage(hwndTtbStatus, BM_SETIMAGE, IMAGE_ICON, (LPARAM) hIcon);
}
InvalidateRect(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS), NULL, TRUE);
- InvalidateRect(GetDlgItem(pcli->hwndContactList, IDC_TBTOPSTATUS), NULL, TRUE);
+ if (hwndTtbStatus)
+ InvalidateRect(hwndTtbStatus, NULL, TRUE);
SFL_Update(hIcon, iIcon, hCListImages, szStatus, TRUE);
- } }
+ }
+ }
return;
}