summaryrefslogtreecommitdiff
path: root/src/modules/protocols/protoopts.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-26 22:28:47 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-26 22:28:47 +0000
commit7f47efb0c5973054e00fac918d2e1cdd187dd35a (patch)
treefa7adcd9166e58cd2ae2a15a2e744a5ea6b1b0b5 /src/modules/protocols/protoopts.cpp
parentc8ae2a45d384650fb562b078a06f024dc85caae8 (diff)
virtual protos, invisible in the Account Manager & status bar, but fortunately searchable
git-svn-id: http://svn.miranda-ng.org/main/trunk@2515 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/protocols/protoopts.cpp')
-rw-r--r--src/modules/protocols/protoopts.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp
index 9aa7436b4d..31f3302252 100644
--- a/src/modules/protocols/protoopts.cpp
+++ b/src/modules/protocols/protoopts.cpp
@@ -481,13 +481,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
EnableWindow( GetDlgItem(hwndDlg, IDC_REMOVE), FALSE);
EnableWindow( GetDlgItem(hwndDlg, IDC_OPTIONS), FALSE);
EnableWindow( GetDlgItem(hwndDlg, IDC_UPGRADE), FALSE);
-
{
LOGFONT lf;
- HDC hdc;
- HFONT hfnt;
- TEXTMETRIC tm;
-
GetObject((HFONT)SendMessage(hwndDlg, WM_GETFONT, 0, 0), sizeof(lf), &lf);
dat->hfntText = CreateFontIndirect(&lf);
@@ -495,11 +490,14 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
lf.lfWeight = FW_BOLD;
dat->hfntTitle = CreateFontIndirect(&lf);
- hdc = GetDC(hwndDlg);
- hfnt = (HFONT)SelectObject(hdc, dat->hfntTitle);
+ HDC hdc = GetDC(hwndDlg);
+ HFONT hfnt = (HFONT)SelectObject(hdc, dat->hfntTitle);
+
+ TEXTMETRIC tm;
GetTextMetrics(hdc, &tm);
dat->titleHeight = tm.tmHeight;
SelectObject(hdc, dat->hfntText);
+
GetTextMetrics(hdc, &tm);
dat->textHeight = tm.tmHeight;
SelectObject(hdc, hfnt);
@@ -660,10 +658,15 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
dat->iSelected = -1;
SendMessage(hList, LB_RESETCONTENT, 0, 0);
for (i=0; i < accounts.getCount(); i++) {
- int iItem = SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)accounts[i]->tszAccountName);
- SendMessage(hList, LB_SETITEMDATA, iItem, (LPARAM)accounts[i]);
+ PROTOACCOUNT *p = accounts[i];
+ PROTOCOLDESCRIPTOR *pd = Proto_IsProtocolLoaded(p->szProtoName);
+ if (pd == NULL || pd->type != PROTOTYPE_PROTOCOL)
+ continue;
+
+ int iItem = SendMessage(hList, LB_ADDSTRING, 0, (LPARAM)p->tszAccountName);
+ SendMessage(hList, LB_SETITEMDATA, iItem, (LPARAM)p);
- if (accounts[i] == acc)
+ if (p == acc)
ListBox_SetCurSel(hList, iItem);
}