summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer
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
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')
-rw-r--r--plugins/Clist_nicer/src/clui.cpp2
-rw-r--r--plugins/Clist_nicer/src/cluiservices.cpp14
-rw-r--r--plugins/Clist_nicer/src/statusbar.cpp35
-rw-r--r--plugins/Clist_nicer/src/viewmodes.cpp42
4 files changed, 42 insertions, 51 deletions
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index c2203a4417..46120e83d1 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -802,7 +802,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
ConfigureCLUIGeometry(0);
for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
- statusNames[i - ID_STATUS_OFFLINE] = reinterpret_cast<TCHAR *>(CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)i, GSMDF_TCHAR));
+ statusNames[i-ID_STATUS_OFFLINE] = pcli->pfnGetStatusModeDescription(i, 0);
//delay creation of CLC so that it can get the status icons right the first time (needs protocol modules loaded)
if (cfg::dat.bLayeredHack) {
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp
index 8e373e9138..d6e5939c86 100644
--- a/plugins/Clist_nicer/src/cluiservices.cpp
+++ b/plugins/Clist_nicer/src/cluiservices.cpp
@@ -210,29 +210,27 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto )
iIcon = IconFromStatusMode(dbv.pszVal, (int) wStatus, 0, &hIcon);
}
mir_free(dbv.pszVal);
- } else {
+ }
+ else {
wStatus = maxStatus;
iIcon = IconFromStatusMode((wStatus >= ID_STATUS_CONNECTING && wStatus < ID_STATUS_OFFLINE) ? szMaxProto : NULL, (int) wStatus, 0, &hIcon);
g_maxStatus = (int)wStatus;
- if (szMaxProto) {
- lstrcpynA(g_maxProto, szMaxProto, 100);
- g_maxProto[99] = 0;
- }
+ if (szMaxProto)
+ strncpy_s(g_maxProto, SIZEOF(g_maxProto), szMaxProto, _TRUNCATE);
}
+
/*
* this is used globally (actually, by the clist control only) to determine if
* any protocol is "in connection" state. If true, then the clist discards redraws
* and uses timer based sort and redraw handling. This can improve performance
* when connecting multiple protocols significantly.
*/
- //g_isConnecting = (wStatus >= ID_STATUS_CONNECTING && wStatus < ID_STATUS_OFFLINE);
- szStatus = (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM) wStatus, GSMDF_TCHAR);
+ szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
/*
* set the global status icon and display the global (most online) status mode on the
* status mode button
*/
-
if (szStatus && pcli->hwndContactList) {
HWND hwndClistBtn = GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS);
if ( IsWindow(hwndClistBtn)) {
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;
}
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp
index 3ea740882e..c33fbb9b15 100644
--- a/plugins/Clist_nicer/src/viewmodes.cpp
+++ b/plugins/Clist_nicer/src/viewmodes.cpp
@@ -172,7 +172,7 @@ static int FillDialog(HWND hwnd)
{
LVCOLUMN lvc = {0};
HWND hwndList = GetDlgItem(hwnd, IDC_PROTOCOLS);
- LVITEMA item = {0};
+ LVITEM item = {0};
int protoCount = 0, i;
PROTOACCOUNT **accs = 0;
@@ -187,38 +187,32 @@ static int FillDialog(HWND hwnd)
ProtoEnumAccounts( &protoCount, &accs );
item.mask = LVIF_TEXT;
item.iItem = 1000;
- for (i = 0; i < protoCount; i++) {
- item.pszText = accs[i]->szModuleName;
- SendMessageA(hwndList, LVM_INSERTITEMA, 0, (LPARAM)&item);
+ for (i=0; i < protoCount; i++) {
+ item.pszText = accs[i]->tszAccountName;
+ ListView_InsertItem(hwndList, &item);
}
ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);
ListView_Arrange(hwndList, LVA_ALIGNLEFT | LVA_ALIGNTOP);
// fill groups
- {
- hwndList = GetDlgItem(hwnd, IDC_GROUPS);
+ hwndList = GetDlgItem(hwnd, IDC_GROUPS);
- ListView_SetExtendedListViewStyle(hwndList, LVS_EX_CHECKBOXES);
- lvc.mask = LVCF_FMT;
- lvc.fmt = LVCFMT_IMAGE | LVCFMT_LEFT;
- ListView_InsertColumn(hwndList, 0, &lvc);
+ ListView_SetExtendedListViewStyle(hwndList, LVS_EX_CHECKBOXES);
+ lvc.mask = LVCF_FMT;
+ lvc.fmt = LVCFMT_IMAGE | LVCFMT_LEFT;
+ ListView_InsertColumn(hwndList, 0, &lvc);
- LVITEM item = {0};
- item.mask = LVIF_TEXT;
- item.iItem = 1000;
+ item.pszText = TranslateT("Ungrouped contacts");
+ SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
- item.pszText = TranslateT("Ungrouped contacts");
+ TCHAR *grpName;
+ for (i = 1; (grpName = pcli->pfnGetGroupName(i, NULL)) != NULL; i++) {
+ item.pszText = grpName;
SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
-
- TCHAR *grpName;
- for (i = 1; (grpName = pcli->pfnGetGroupName(i, NULL)) != NULL; i++) {
- item.pszText = grpName;
- SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
- }
- ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);
- ListView_Arrange(hwndList, LVA_ALIGNLEFT | LVA_ALIGNTOP);
}
+ ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);
+ ListView_Arrange(hwndList, LVA_ALIGNLEFT | LVA_ALIGNTOP);
hwndList = GetDlgItem(hwnd, IDC_STATUSMODES);
ListView_SetExtendedListViewStyle(hwndList, LVS_EX_CHECKBOXES);
@@ -228,9 +222,9 @@ static int FillDialog(HWND hwnd)
ListView_InsertColumn(hwndList, 0, &lvc);
for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
- item.pszText = Translate((char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)i, 0));
+ item.pszText = TranslateTS(pcli->pfnGetStatusModeDescription(i, 0));
item.iItem = i - ID_STATUS_OFFLINE;
- SendMessageA(hwndList, LVM_INSERTITEMA, 0, (LPARAM)&item);
+ ListView_InsertItem(hwndList, &item);
}
ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);
ListView_Arrange(hwndList, LVA_ALIGNLEFT | LVA_ALIGNTOP);