From 7f47efb0c5973054e00fac918d2e1cdd187dd35a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 26 Nov 2012 22:28:47 +0000 Subject: 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 --- src/modules/protocols/protoopts.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/modules/protocols/protoopts.cpp') 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); } -- cgit v1.2.3