summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer/src/statusbar.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-10 15:13:20 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-10 15:13:20 +0000
commit45a5b1f9b7709f8d93b57abea7ba46b44eac5707 (patch)
tree03f5a5db7a5e8a951951710a3d383a936a14ce74 /plugins/Clist_nicer/src/statusbar.cpp
parenteb25a0d7ed0da6bd4630c553be933df5bd46b6b9 (diff)
- MS_CLIST_GETSTATUSMODEDESCRIPTION replaced with the direct clist call
- crazy & obsolete constant GSMDF_PREFIXONLINE removed git-svn-id: http://svn.miranda-ng.org/main/trunk@6428 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/src/statusbar.cpp')
-rw-r--r--plugins/Clist_nicer/src/statusbar.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp
index 98ac8c008e..33014a64f7 100644
--- a/plugins/Clist_nicer/src/statusbar.cpp
+++ b/plugins/Clist_nicer/src/statusbar.cpp
@@ -152,25 +152,24 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
for (int i = 0; i < nParts; i++) {
RECT rc;
SendMessage(hwnd, SB_GETRECT, i, (LPARAM)&rc);
- if (PtInRect(&rc,pt)) {
+ if ( PtInRect(&rc,pt)) {
ProtocolData *PD = (ProtocolData *)SendMessageA(hwnd, SB_GETTEXTA, i, 0);
- if (PD) {
- if (NotifyEventHooks(hStatusBarShowToolTipEvent, (WPARAM)PD->RealName, 0) > 0) // a plugin handled this event
- tooltip_active = TRUE;
- else if (cfg::getDword("mToolTip", "ShowStatusTip", 0)) {
- CLCINFOTIP ti = {0};
- BYTE isLocked = 0;
- char szTipText[256], *szStatus = NULL;
- WORD wStatus;
-
- ti.cbSize = sizeof(ti);
- ti.isTreeFocused = GetFocus() == pcli->hwndContactList ? 1 : 0;
- wStatus = (WORD)CallProtoService(PD->RealName, PS_GETSTATUS, 0, 0);
- isLocked = cfg::getByte(PD->RealName, "LockMainStatus", 0);
- szStatus = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)wStatus, 0);
- mir_snprintf(szTipText, 256, "<b>%s</b>: %s%s", PD->RealName, szStatus, isLocked ? " (LOCKED)" : "");
- CallService("mToolTip/ShowTip", (WPARAM)szTipText, (LPARAM)&ti);
- }
+ if (PD == NULL)
+ continue;
+
+ if (NotifyEventHooks(hStatusBarShowToolTipEvent, (WPARAM)PD->RealName, 0) > 0) // a plugin handled this event
+ tooltip_active = TRUE;
+ else if (cfg::getDword("mToolTip", "ShowStatusTip", 0)) {
+ WORD wStatus = (WORD)CallProtoService(PD->RealName, PS_GETSTATUS, 0, 0);
+ BYTE isLocked = cfg::getByte(PD->RealName, "LockMainStatus", 0);
+
+ TCHAR szTipText[256];
+ mir_sntprintf(szTipText, SIZEOF(szTipText), _T("<b>%s</b>: %s%s"),
+ PD->RealName, pcli->pfnGetStatusModeDescription(wStatus, 0), isLocked ? _T(" (LOCKED)") : _T(""));
+
+ CLCINFOTIP ti = { sizeof(ti) };
+ ti.isTreeFocused = (GetFocus() == pcli->hwndContactList);
+ CallService("mToolTip/ShowTipW", (WPARAM)szTipText, (LPARAM)&ti);
}
break;
}