summaryrefslogtreecommitdiff
path: root/src/modules/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/protocols')
-rw-r--r--src/modules/protocols/protocols.cpp2
-rw-r--r--src/modules/protocols/protoopts.cpp23
2 files changed, 14 insertions, 11 deletions
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp
index a39e62899a..7589693e3b 100644
--- a/src/modules/protocols/protocols.cpp
+++ b/src/modules/protocols/protocols.cpp
@@ -122,7 +122,7 @@ static INT_PTR Proto_RegisterModule(WPARAM, LPARAM lParam)
memset(p, 0, sizeof(PROTOCOLDESCRIPTOR));
p->cbSize = PROTOCOLDESCRIPTOR_V3_SIZE;
p->type = pd->type;
- if (p->type == PROTOTYPE_PROTOCOL) {
+ if (p->type == PROTOTYPE_PROTOCOL || p->type == PROTOTYPE_VIRTUAL) {
// let's create a new container
PROTO_INTERFACE* ppi = AddDefaultAccount(pd->szName);
if (ppi) {
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);
}