summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-10-13 22:25:04 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-10-13 22:25:04 +0000
commit5849172a0425c813f3f57abbbf941022fa420950 (patch)
tree4fde5541febfb4a46fb8c02c9f1107f43d86c7ee /src
parent27290a93d4a46e8b7ecdd1b12114067630390cba (diff)
fix for proto options drawing
git-svn-id: http://svn.miranda-ng.org/main/trunk@1914 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/modules/protocols/protoaccs.cpp7
-rw-r--r--src/modules/protocols/protoopts.cpp17
2 files changed, 9 insertions, 15 deletions
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index 2f0a4d29c5..49c8a87765 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -185,7 +185,7 @@ void WriteDbAccounts()
db_set_dw(NULL, "Protocols", buf, pa->bIsEnabled);
_itoa(OFFSET_NAME+i, buf, 10);
- DBWriteContactSettingTString(NULL, "Protocols", buf, pa->tszAccountName);
+ db_set_ts(NULL, "Protocols", buf, pa->tszAccountName);
}
DBDeleteContactSetting(0, "Protocols", "ProtoCount");
@@ -268,10 +268,8 @@ int LoadAccountsModule(void)
if (pa->ppro)
continue;
- if ( !Proto_IsAccountEnabled(pa)) {
- pa->bDynDisabled = TRUE;
+ if ( !Proto_IsAccountEnabled(pa))
continue;
- }
if ( !ActivateAccount(pa))
pa->bDynDisabled = TRUE;
@@ -535,7 +533,6 @@ void DeactivateAccount(PROTOACCOUNT* pa, bool bIsDynamic, bool bErase)
param->bIsDynamic = bIsDynamic;
param->bErase = bErase;
pa->ppro = NULL;
- pa->bDynDisabled = TRUE;
if (bIsDynamic)
mir_forkthread((pThreadFunc)DeactivationThread, param);
else
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp
index d5734105f0..e5adade60a 100644
--- a/src/modules/protocols/protoopts.cpp
+++ b/src/modules/protocols/protoopts.cpp
@@ -139,8 +139,7 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
idx = accounts.getIndex(pa);
UnloadAccount(pa, false, false);
accounts.remove(idx);
- if (oldProto && UnloadPlugin(szPlugin, SIZEOF(szPlugin)))
- {
+ if (oldProto && UnloadPlugin(szPlugin, SIZEOF(szPlugin))) {
TCHAR szNewName[MAX_PATH];
mir_sntprintf(szNewName, SIZEOF(szNewName), _T("%s~"), szPlugin);
MoveFile(szPlugin, szNewName);
@@ -152,8 +151,8 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
pa = (PROTOACCOUNT*)mir_calloc(sizeof(PROTOACCOUNT));
pa->cbSize = sizeof(PROTOACCOUNT);
pa->bIsEnabled = TRUE;
- pa->bIsVisible = TRUE;
-
+ pa->bIsVisible = TRUE;
+
pa->iOrder = accounts.getCount();
break;
}
@@ -163,8 +162,7 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
mir_free(pa->tszAccountName);
pa->tszAccountName = mir_tstrdup(buf);
}
- if (param->action == PRAC_ADDED || param->action == PRAC_UPGRADED)
- {
+ if (param->action == PRAC_ADDED || param->action == PRAC_UPGRADED) {
char buf[200];
GetDlgItemTextA(hwndDlg, IDC_PROTOTYPECOMBO, buf, SIZEOF(buf));
pa->szProtoName = mir_strdup(buf);
@@ -178,7 +176,8 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
if (DBGetContactSettingString(NULL, buf, "AM_BaseProto", &dbv))
break;
DBFreeVariant(&dbv);
- } }
+ }
+ }
pa->szModuleName = mir_strdup(buf);
if ( !pa->tszAccountName[0]) {
@@ -189,12 +188,11 @@ static INT_PTR CALLBACK AccFormDlgProc(HWND hwndDlg, UINT message, WPARAM wParam
DBWriteContactSettingString(NULL, pa->szModuleName, "AM_BaseProto", pa->szProtoName);
accounts.insert(pa);
- if (ActivateAccount(pa)) {
+ if ( ActivateAccount(pa)) {
pa->ppro->OnEvent(EV_PROTO_ONLOAD, 0, 0);
if ( !db_get_b(NULL, "CList", "MoveProtoMenus", TRUE))
pa->ppro->OnEvent(EV_PROTO_ONMENU, 0, 0);
}
- else pa->bDynDisabled = TRUE;
}
WriteDbAccounts();
@@ -778,7 +776,6 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
if ( !db_get_b(NULL, "CList", "MoveProtoMenus", TRUE))
pa->ppro->OnEvent(EV_PROTO_ONMENU, 0, 0);
}
- else pa->bDynDisabled = TRUE;
}
else {
DWORD dwStatus = CallProtoServiceInt(NULL,pa->szModuleName, PS_GETSTATUS, 0, 0);