diff options
author | George Hazan <ghazan@miranda.im> | 2018-11-12 21:44:56 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-11-12 21:44:56 +0300 |
commit | 53fe3e46177d17b4941610de19f5cc6210700cb4 (patch) | |
tree | b67a6bc208dad141f9db14035cd7e42ff2a51872 /src/core | |
parent | 488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (diff) |
db_* functions replaced with g_plugin calls
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/stdautoaway/src/autoaway.cpp | 6 | ||||
-rw-r--r-- | src/core/stdaway/src/sendmsg.cpp | 16 | ||||
-rw-r--r-- | src/core/stdclist/src/clcopts.cpp | 72 | ||||
-rw-r--r-- | src/core/stdclist/src/clistopts.cpp | 66 | ||||
-rw-r--r-- | src/core/stdclist/src/cluiopts.cpp | 110 | ||||
-rw-r--r-- | src/core/stdclist/src/init.cpp | 4 | ||||
-rw-r--r-- | src/core/stdfile/src/file.cpp | 2 | ||||
-rw-r--r-- | src/core/stdfile/src/fileopts.cpp | 34 | ||||
-rw-r--r-- | src/core/stdfile/src/filerecvdlg.cpp | 16 | ||||
-rw-r--r-- | src/core/stdfile/src/filexferdlg.cpp | 10 | ||||
-rw-r--r-- | src/core/stdfile/src/ftmanager.cpp | 8 | ||||
-rw-r--r-- | src/core/stduserinfo/src/userinfo.cpp | 4 | ||||
-rw-r--r-- | src/core/stduseronline/src/useronline.cpp | 8 |
13 files changed, 178 insertions, 178 deletions
diff --git a/src/core/stdautoaway/src/autoaway.cpp b/src/core/stdautoaway/src/autoaway.cpp index b926c740f2..4445cfb00f 100644 --- a/src/core/stdautoaway/src/autoaway.cpp +++ b/src/core/stdautoaway/src/autoaway.cpp @@ -71,16 +71,16 @@ static int AutoAwayEvent(WPARAM, LPARAM lParam) continue;
// save old status of account and set to given status
- db_set_w(NULL, MODULENAME, pa->szModuleName, pa->iRealStatus);
+ g_plugin.setWord(pa->szModuleName, pa->iRealStatus);
Proto_SetStatus(pa->szModuleName, status);
}
else {
- int oldstatus = db_get_w(NULL, MODULENAME, pa->szModuleName, 0);
+ int oldstatus = g_plugin.getWord(pa->szModuleName, 0);
if (oldstatus != ID_STATUS_ONLINE && oldstatus != ID_STATUS_FREECHAT)
continue;
// returning from idle and this accout was set away, set it back
- db_unset(NULL, MODULENAME, pa->szModuleName);
+ g_plugin.delSetting(pa->szModuleName);
if (!mii.aaLock)
Proto_SetStatus(pa->szModuleName, oldstatus);
}
diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp index 5655e16e18..eeea51ba79 100644 --- a/src/core/stdaway/src/sendmsg.cpp +++ b/src/core/stdaway/src/sendmsg.cpp @@ -70,12 +70,12 @@ static const char* StatusModeToDbSetting(int status, const char *suffix) static bool GetStatusModeByte(int status, const char *suffix, bool bDefault = false)
{
- return db_get_b(NULL, MODULENAME, StatusModeToDbSetting(status, suffix), bDefault) != 0;
+ return g_plugin.getByte(StatusModeToDbSetting(status, suffix), bDefault) != 0;
}
static void SetStatusModeByte(int status, const char *suffix, BYTE value)
{
- db_set_b(NULL, MODULENAME, StatusModeToDbSetting(status, suffix), value);
+ g_plugin.setByte(StatusModeToDbSetting(status, suffix), value);
}
static wchar_t* GetAwayMessage(int statusMode, char *szProto)
@@ -88,11 +88,11 @@ static wchar_t* GetAwayMessage(int statusMode, char *szProto) DBVARIANT dbv;
if (GetStatusModeByte(statusMode, "UsePrev")) {
- if (db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(statusMode, "Msg"), &dbv))
+ if (g_plugin.getWString(StatusModeToDbSetting(statusMode, "Msg"), &dbv))
dbv.pwszVal = mir_wstrdup(GetDefaultMessage(statusMode));
}
else {
- if (db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(statusMode, "Default"), &dbv))
+ if (g_plugin.getWString(StatusModeToDbSetting(statusMode, "Default"), &dbv))
dbv.pwszVal = mir_wstrdup(GetDefaultMessage(statusMode));
for (int i = 0; dbv.pwszVal[i]; i++) {
@@ -265,7 +265,7 @@ static INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wPa wchar_t str[1024];
GetDlgItemText(hwndDlg, IDC_MSG, str, _countof(str));
ChangeAllProtoMessages(dat->szProto, dat->statusMode, str);
- db_set_ws(NULL, MODULENAME, StatusModeToDbSetting(dat->statusMode, "Msg"), str);
+ g_plugin.setWString(StatusModeToDbSetting(dat->statusMode, "Msg"), str);
DestroyWindow(hwndDlg);
}
else PostMessage(hwndDlg, WM_CLOSE, 0, 0);
@@ -388,8 +388,8 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam dat->info[j].usePrevious = GetStatusModeByte(it, "UsePrev");
DBVARIANT dbv;
- if (db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(it, "Default"), &dbv))
- if (db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(it, "Msg"), &dbv))
+ if (g_plugin.getWString(StatusModeToDbSetting(it, "Default"), &dbv))
+ if (g_plugin.getWString(StatusModeToDbSetting(it, "Msg"), &dbv))
dbv.pwszVal = mir_wstrdup(GetDefaultMessage(it));
mir_wstrcpy(dat->info[j].msg, dbv.pwszVal);
mir_free(dbv.pwszVal);
@@ -494,7 +494,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam SetStatusModeByte(status, "Ignore", (BYTE)dat->info[i].ignore);
SetStatusModeByte(status, "NoDlg", (BYTE)dat->info[i].noDialog);
SetStatusModeByte(status, "UsePrev", (BYTE)dat->info[i].usePrevious);
- db_set_ws(NULL, MODULENAME, StatusModeToDbSetting(status, "Default"), dat->info[i].msg);
+ g_plugin.setWString(StatusModeToDbSetting(status, "Default"), dat->info[i].msg);
}
return TRUE;
}
diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp index e88a137266..61fcd13d12 100644 --- a/src/core/stdclist/src/clcopts.cpp +++ b/src/core/stdclist/src/clcopts.cpp @@ -149,7 +149,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE,
GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
{
- DWORD exStyle = db_get_dw(NULL, "CLC", "ExStyle", Clist_GetDefaultExStyle());
+ DWORD exStyle = db_get_dw(0, "CLC", "ExStyle", Clist_GetDefaultExStyle());
for (auto &it : checkBoxToStyleEx)
CheckDlgButton(hwndDlg, it.id, (exStyle & it.flag) ^ (it.flag * it.not) ? BST_CHECKED : BST_UNCHECKED);
}
@@ -158,28 +158,28 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETRANGE, 0, MAKELONG(999, 0));
SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETACCEL, _countof(accel), (LPARAM)& accel);
SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETPOS, 0,
- MAKELONG(db_get_w(NULL, "CLC", "ScrollTime", CLCDEFAULT_SCROLLTIME), 0));
+ MAKELONG(db_get_w(0, "CLC", "ScrollTime", CLCDEFAULT_SCROLLTIME), 0));
}
- CheckDlgButton(hwndDlg, IDC_IDLE, db_get_b(NULL, "CLC", "ShowIdle", CLCDEFAULT_SHOWIDLE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_IDLE, db_get_b(0, "CLC", "ShowIdle", CLCDEFAULT_SHOWIDLE) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_SETRANGE, 0, MAKELONG(64, 0));
SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_SETPOS, 0,
- MAKELONG(db_get_b(NULL, "CLC", "LeftMargin", CLCDEFAULT_LEFTMARGIN), 0));
+ MAKELONG(db_get_b(0, "CLC", "LeftMargin", CLCDEFAULT_LEFTMARGIN), 0));
SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_SETRANGE, 0, MAKELONG(50, 0));
SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_SETPOS, 0,
- MAKELONG(db_get_b(NULL, "CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT), 0));
+ MAKELONG(db_get_b(0, "CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT), 0));
CheckDlgButton(hwndDlg, IDC_GREYOUT,
- db_get_dw(NULL, "CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_dw(0, "CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS) ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_SMOOTHTIME), IsDlgButtonChecked(hwndDlg, IDC_NOTNOSMOOTHSCROLLING));
EnableWindow(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), IsDlgButtonChecked(hwndDlg, IDC_GREYOUT));
FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), greyoutValues, _countof(greyoutValues),
- db_get_dw(NULL, "CLC", "FullGreyoutFlags", CLCDEFAULT_FULLGREYOUTFLAGS));
+ db_get_dw(0, "CLC", "FullGreyoutFlags", CLCDEFAULT_FULLGREYOUTFLAGS));
FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), offlineValues, _countof(offlineValues),
- db_get_dw(NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES));
- CheckDlgButton(hwndDlg, IDC_NOSCROLLBAR, db_get_b(NULL, "CLC", "NoVScrollBar", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_GAMMACORRECT, db_get_b(NULL, "CLC", "GammaCorrect", CLCDEFAULT_GAMMACORRECT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_dw(0, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES));
+ CheckDlgButton(hwndDlg, IDC_NOSCROLLBAR, db_get_b(0, "CLC", "NoVScrollBar", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_GAMMACORRECT, db_get_b(0, "CLC", "GammaCorrect", CLCDEFAULT_GAMMACORRECT) ? BST_CHECKED : BST_UNCHECKED);
{
LONG minHeight = CalcMinRowHeight();
- LONG rowHeight = db_get_b(NULL, "CLC", "RowHeight", CLCDEFAULT_ROWHEIGHT);
+ LONG rowHeight = db_get_b(0, "CLC", "RowHeight", CLCDEFAULT_ROWHEIGHT);
if (rowHeight < minHeight) {
rowHeight = minHeight;
}
@@ -244,23 +244,23 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam if ((IsDlgButtonChecked(hwndDlg, it.id) == 0) == it.not)
exStyle |= it.flag;
- db_set_dw(NULL, "CLC", "ExStyle", exStyle);
+ db_set_dw(0, "CLC", "ExStyle", exStyle);
{
DWORD fullGreyoutFlags = MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS));
- db_set_dw(NULL, "CLC", "FullGreyoutFlags", fullGreyoutFlags);
+ db_set_dw(0, "CLC", "FullGreyoutFlags", fullGreyoutFlags);
if (IsDlgButtonChecked(hwndDlg, IDC_GREYOUT))
- db_set_dw(NULL, "CLC", "GreyoutFlags", fullGreyoutFlags);
+ db_set_dw(0, "CLC", "GreyoutFlags", fullGreyoutFlags);
else
- db_set_dw(NULL, "CLC", "GreyoutFlags", 0);
+ db_set_dw(0, "CLC", "GreyoutFlags", 0);
}
- db_set_b(NULL, "CLC", "ShowIdle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0));
- db_set_dw(NULL, "CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS)));
- db_set_b(NULL, "CLC", "LeftMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
- db_set_w(NULL, "CLC", "ScrollTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0));
- db_set_b(NULL, "CLC", "GroupIndent", (BYTE)SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
- db_set_b(NULL, "CLC", "NoVScrollBar", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0));
- db_set_b(NULL, "CLC", "RowHeight", (BYTE)SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_GETPOS, 0, 0));
- db_set_b(NULL, "CLC", "GammaCorrect", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_GAMMACORRECT));
+ db_set_b(0, "CLC", "ShowIdle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0));
+ db_set_dw(0, "CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS)));
+ db_set_b(0, "CLC", "LeftMargin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
+ db_set_w(0, "CLC", "ScrollTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "GroupIndent", (BYTE)SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "NoVScrollBar", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0));
+ db_set_b(0, "CLC", "RowHeight", (BYTE)SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CLC", "GammaCorrect", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_GAMMACORRECT));
Clist_ClcOptionsChanged();
return TRUE;
}
@@ -281,18 +281,18 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg, IDC_BITMAP,
- db_get_b(NULL, "CLC", "UseBitmap", CLCDEFAULT_USEBITMAP) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(0, "CLC", "UseBitmap", CLCDEFAULT_USEBITMAP) ? BST_CHECKED : BST_UNCHECKED);
SendMessage(hwndDlg, WM_USER + 10, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_BKCOLOUR);
- SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETCOLOUR, 0, db_get_dw(NULL, "CLC", "BkColour", CLCDEFAULT_BKCOLOUR));
+ SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETCOLOUR, 0, db_get_dw(0, "CLC", "BkColour", CLCDEFAULT_BKCOLOUR));
SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_SELBKCOLOUR);
SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETCOLOUR, 0,
- db_get_dw(NULL, "CLC", "SelBkColour", CLCDEFAULT_SELBKCOLOUR));
- CheckDlgButton(hwndDlg, IDC_WINCOLOUR, db_get_b(NULL, "CLC", "UseWinColours", 0) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_dw(0, "CLC", "SelBkColour", CLCDEFAULT_SELBKCOLOUR));
+ CheckDlgButton(hwndDlg, IDC_WINCOLOUR, db_get_b(0, "CLC", "UseWinColours", 0) ? BST_CHECKED : BST_UNCHECKED);
SendMessage(hwndDlg, WM_USER + 11, 0, 0);
{
DBVARIANT dbv;
- if (!db_get_s(NULL, "CLC", "BkBitmap", &dbv)) {
+ if (!db_get_s(0, "CLC", "BkBitmap", &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_FILENAME, dbv.pszVal);
char szPath[MAX_PATH];
@@ -303,7 +303,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, }
}
{
- WORD bmpUse = db_get_w(NULL, "CLC", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
+ WORD bmpUse = db_get_w(0, "CLC", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
CheckDlgButton(hwndDlg, IDC_STRETCHH, bmpUse & CLB_STRETCHH ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_STRETCHV, bmpUse & CLB_STRETCHV ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_TILEH, bmpUse & CLBF_TILEH ? BST_CHECKED : BST_UNCHECKED);
@@ -370,28 +370,28 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(NULL, "CLC", "UseBitmap", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
+ db_set_b(0, "CLC", "UseBitmap", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
{
COLORREF col;
col = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR, 0, 0);
if (col == CLCDEFAULT_BKCOLOUR)
db_unset(NULL, "CLC", "BkColour");
else
- db_set_dw(NULL, "CLC", "BkColour", col);
+ db_set_dw(0, "CLC", "BkColour", col);
col = SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_GETCOLOUR, 0, 0);
if (col == CLCDEFAULT_SELBKCOLOUR)
db_unset(NULL, "CLC", "SelBkColour");
else
- db_set_dw(NULL, "CLC", "SelBkColour", col);
- db_set_b(NULL, "CLC", "UseWinColours", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR)));
+ db_set_dw(0, "CLC", "SelBkColour", col);
+ db_set_b(0, "CLC", "UseWinColours", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR)));
}
{
char str[MAX_PATH], strrel[MAX_PATH];
GetDlgItemTextA(hwndDlg, IDC_FILENAME, str, _countof(str));
if (PathToRelative(str, strrel))
- db_set_s(NULL, "CLC", "BkBitmap", strrel);
+ db_set_s(0, "CLC", "BkBitmap", strrel);
else
- db_set_s(NULL, "CLC", "BkBitmap", str);
+ db_set_s(0, "CLC", "BkBitmap", str);
}
{
WORD flags = 0;
@@ -407,7 +407,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, flags |= CLBF_SCROLL;
if (IsDlgButtonChecked(hwndDlg, IDC_PROPORTIONAL))
flags |= CLBF_PROPORTIONAL;
- db_set_w(NULL, "CLC", "BkBmpUse", flags);
+ db_set_w(0, "CLC", "BkBmpUse", flags);
}
Clist_ClcOptionsChanged();
return TRUE;
diff --git a/src/core/stdclist/src/clistopts.cpp b/src/core/stdclist/src/clistopts.cpp index 31c98f78ca..e014d2c458 100644 --- a/src/core/stdclist/src/clistopts.cpp +++ b/src/core/stdclist/src/clistopts.cpp @@ -46,38 +46,38 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)HookEventMessage(ME_DB_CONTACT_SETTINGCHANGED, hwndDlg, WM_USER + 1));
CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE,
- db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(0, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS,
- db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(0, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS,
- db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_SORTBYNAME, !db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT)
- && !db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(0, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_SORTBYNAME, !db_get_b(0, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT)
+ && !db_get_b(0, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SORTBYSTATUS,
- db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(0, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SORTBYPROTO,
- db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(0, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE,
- db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(0, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_ONECLK,
- db_get_b(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(0, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS,
- db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(0, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_ALWAYSMULTI,
- !db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ !db_get_b(0, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DONTCYCLE,
- db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(0, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CYCLE,
- db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_CYCLE ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(0, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_CYCLE ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_MULTITRAY,
- db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(0, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DISABLEBLINK,
- db_get_b(NULL, "CList", "DisableTrayFlash", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(0, "CList", "DisableTrayFlash", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKTIME), BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKSPIN), BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
EnableWindow(GetDlgItem(hwndDlg, IDC_STMSDELAY), BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
- CheckDlgButton(hwndDlg, IDC_ICONBLINK, db_get_b(NULL, "CList", "NoIconBlink", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ICONBLINK, db_get_b(0, "CList", "NoIconBlink", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
if (IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIMESPIN), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIME), FALSE);
@@ -93,7 +93,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_PRIMARYSTATUS), FALSE);
}
SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_SETRANGE, 0, MAKELONG(120, 1));
- SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT), 0));
+ SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(0, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT), 0));
{
ptrA szPrimaryStatus(db_get_sa(NULL, "CList", "PrimaryStatus"));
@@ -114,7 +114,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETCURSEL, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_BLINKTIME), 0); // set buddy
SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETRANGE, 0, MAKELONG(0x3FFF, 250));
- SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, "CList", "IconFlashTime", 550), 0));
+ SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETPOS, 0, MAKELONG(db_get_w(0, "CList", "IconFlashTime", 550), 0));
return TRUE;
case WM_COMMAND:
@@ -145,35 +145,35 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(NULL, "CList", "HideOffline", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE));
- db_set_b(NULL, "CList", "HideEmptyGroups", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEEMPTYGROUPS));
- db_set_b(NULL, "CList", "UseGroups", (BYTE)!IsDlgButtonChecked(hwndDlg, IDC_DISABLEGROUPS));
+ db_set_b(0, "CList", "HideOffline", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE));
+ db_set_b(0, "CList", "HideEmptyGroups", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDEEMPTYGROUPS));
+ db_set_b(0, "CList", "UseGroups", (BYTE)!IsDlgButtonChecked(hwndDlg, IDC_DISABLEGROUPS));
g_bSortByStatus = IsDlgButtonChecked(hwndDlg, IDC_SORTBYSTATUS);
g_bSortByProto = IsDlgButtonChecked(hwndDlg, IDC_SORTBYPROTO);
- db_set_b(NULL, "CList", "SortByStatus", (BYTE)g_bSortByStatus);
- db_set_b(NULL, "CList", "SortByProto", (BYTE)g_bSortByProto);
- db_set_b(NULL, "CList", "ConfirmDelete", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CONFIRMDELETE));
- db_set_b(NULL, "CList", "Tray1Click", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONECLK));
- db_set_b(NULL, "CList", "AlwaysStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSTATUS));
- db_set_b(NULL, "CList", "AlwaysMulti", (BYTE)!IsDlgButtonChecked(hwndDlg, IDC_ALWAYSMULTI));
- db_set_b(NULL, "CList", "TrayIcon",
+ db_set_b(0, "CList", "SortByStatus", (BYTE)g_bSortByStatus);
+ db_set_b(0, "CList", "SortByProto", (BYTE)g_bSortByProto);
+ db_set_b(0, "CList", "ConfirmDelete", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CONFIRMDELETE));
+ db_set_b(0, "CList", "Tray1Click", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONECLK));
+ db_set_b(0, "CList", "AlwaysStatus", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSTATUS));
+ db_set_b(0, "CList", "AlwaysMulti", (BYTE)!IsDlgButtonChecked(hwndDlg, IDC_ALWAYSMULTI));
+ db_set_b(0, "CList", "TrayIcon",
(BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE) ? SETTING_TRAYICON_SINGLE
: (IsDlgButtonChecked(hwndDlg, IDC_CYCLE) ? SETTING_TRAYICON_CYCLE : SETTING_TRAYICON_MULTI)));
- db_set_w(NULL, "CList", "CycleTime",
+ db_set_w(0, "CList", "CycleTime",
(WORD)SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_GETPOS, 0, 0));
- db_set_w(NULL, "CList", "IconFlashTime",
+ db_set_w(0, "CList", "IconFlashTime",
(WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
- db_set_b(NULL, "CList", "DisableTrayFlash", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
- db_set_b(NULL, "CList", "NoIconBlink", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ICONBLINK));
+ db_set_b(0, "CList", "DisableTrayFlash", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
+ db_set_b(0, "CList", "NoIconBlink", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ICONBLINK));
{
int cur = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0);
PROTOACCOUNT *pa = (PROTOACCOUNT*)SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETITEMDATA, cur, 0);
if (pa == nullptr)
db_unset(NULL, "CList", "PrimaryStatus");
else
- db_set_s(NULL, "CList", "PrimaryStatus", pa->szModuleName);
+ db_set_s(0, "CList", "PrimaryStatus", pa->szModuleName);
}
Clist_TrayIconIconsChanged();
diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp index 82ed81a612..cff3b28933 100644 --- a/src/core/stdclist/src/cluiopts.cpp +++ b/src/core/stdclist/src/cluiopts.cpp @@ -29,35 +29,35 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, db_get_b(NULL, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONTOP, db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TOOLWND, db_get_b(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_MIN2TRAY, db_get_b(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, db_get_b(0, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONTOP, db_get_b(0, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TOOLWND, db_get_b(0, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MIN2TRAY, db_get_b(0, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
if (IsDlgButtonChecked(hwndDlg, IDC_TOOLWND))
EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), FALSE);
- CheckDlgButton(hwndDlg, IDC_SHOWCAPTION, db_get_b(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, db_get_b(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, db_get_b(NULL, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWCAPTION, db_get_b(0, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, db_get_b(0, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, db_get_b(0, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_TOOLWND), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_TITLETEXT), FALSE);
}
- CheckDlgButton(hwndDlg, IDC_FADEINOUT, db_get_b(NULL, "CLUI", "FadeInOut", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOSIZE, db_get_b(NULL, "CLUI", "AutoSize", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DROPSHADOW, db_get_b(NULL, "CList", "WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONDESKTOP, db_get_b(NULL, "CList", "OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DISABLEDOCKING, db_get_b(NULL, "CLUI", "DockToSides", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_FADEINOUT, db_get_b(0, "CLUI", "FadeInOut", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOSIZE, db_get_b(0, "CLUI", "AutoSize", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DROPSHADOW, db_get_b(0, "CList", "WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONDESKTOP, db_get_b(0, "CList", "OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DISABLEDOCKING, db_get_b(0, "CLUI", "DockToSides", 1) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETRANGE, 0, MAKELONG(100, 0));
- SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLUI", "MaxSizeHeight", 75));
- CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, db_get_b(NULL, "CLUI", "AutoSizeUpward", 0) ? BST_CHECKED : BST_UNCHECKED);
+ SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETPOS, 0, db_get_b(0, "CLUI", "MaxSizeHeight", 75));
+ CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, db_get_b(0, "CLUI", "AutoSizeUpward", 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_AUTOHIDE,
- db_get_b(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(0, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETRANGE, 0, MAKELONG(900, 1));
SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETPOS, 0,
- MAKELONG(db_get_w(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), 0));
+ MAKELONG(db_get_w(0, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), 0));
EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC01), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
@@ -75,7 +75,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L else
SetDlgItemTextA(hwndDlg, IDC_TITLETEXT, MIRANDANAME);
}
- CheckDlgButton(hwndDlg, IDC_TRANSPARENT, db_get_b(NULL, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TRANSPARENT, db_get_b(0, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC11), FALSE);
@@ -88,8 +88,8 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
- SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETPOS, TRUE, db_get_b(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT));
- SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETPOS, TRUE, db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT));
+ SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETPOS, TRUE, db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT));
+ SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETPOS, TRUE, db_get_b(0, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT));
SendMessage(hwndDlg, WM_HSCROLL, 0x12345678, 0);
return TRUE;
@@ -145,29 +145,29 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- db_set_b(NULL, "CList", "OnTop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
- db_set_b(NULL, "CList", "ToolWindow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
- db_set_b(NULL, "CList", "BringToFront", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
- db_set_b(NULL, "CLUI", "FadeInOut", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT));
- db_set_b(NULL, "CLUI", "AutoSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
- db_set_b(NULL, "CLUI", "MaxSizeHeight", (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, nullptr, FALSE));
- db_set_b(NULL, "CLUI", "AutoSizeUpward", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZEUPWARD));
- db_set_b(NULL, "CList", "AutoHide", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
- db_set_w(NULL, "CList", "HideTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
- db_set_b(NULL, "CList", "Transparent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
- db_set_b(NULL, "CList", "Alpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
- db_set_b(NULL, "CList", "AutoAlpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
- db_set_b(NULL, "CList", "WindowShadow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
- db_set_b(NULL, "CList", "OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
- db_set_b(NULL, "CLUI", "DockToSides", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEDOCKING));
- db_set_b(NULL, "CLUI", "ShowCaption", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
- db_set_b(NULL, "CLUI", "ShowMainMenu", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU));
- db_set_b(NULL, "CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
- db_set_b(NULL, "CList", "Min2Tray", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
+ db_set_b(0, "CList", "OnTop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
+ db_set_b(0, "CList", "ToolWindow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
+ db_set_b(0, "CList", "BringToFront", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
+ db_set_b(0, "CLUI", "FadeInOut", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT));
+ db_set_b(0, "CLUI", "AutoSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
+ db_set_b(0, "CLUI", "MaxSizeHeight", (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, nullptr, FALSE));
+ db_set_b(0, "CLUI", "AutoSizeUpward", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZEUPWARD));
+ db_set_b(0, "CList", "AutoHide", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ db_set_w(0, "CList", "HideTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, "CList", "Transparent", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
+ db_set_b(0, "CList", "Alpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
+ db_set_b(0, "CList", "AutoAlpha", (BYTE)SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
+ db_set_b(0, "CList", "WindowShadow", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
+ db_set_b(0, "CList", "OnDesktop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
+ db_set_b(0, "CLUI", "DockToSides", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEDOCKING));
+ db_set_b(0, "CLUI", "ShowCaption", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
+ db_set_b(0, "CLUI", "ShowMainMenu", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU));
+ db_set_b(0, "CLUI", "ClientAreaDrag", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
+ db_set_b(0, "CList", "Min2Tray", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
{
wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
- db_set_ws(NULL, "CList", "TitleText", title);
+ db_set_ws(0, "CList", "TitleText", title);
SetWindowText(g_clistApi.hwndContactList, title);
}
@@ -218,7 +218,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L ShowWindow(g_clistApi.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW);
if (IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) {
SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
- SetLayeredWindowAttributes(g_clistApi.hwndContactList, RGB(0, 0, 0), (BYTE)db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
+ SetLayeredWindowAttributes(g_clistApi.hwndContactList, RGB(0, 0, 0), (BYTE)db_get_b(0, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
}
else
SetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_clistApi.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
@@ -237,18 +237,18 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_SHOWSBAR, db_get_b(NULL, "CLUI", "ShowSBar", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWSBAR, db_get_b(0, "CLUI", "ShowSBar", 1) ? BST_CHECKED : BST_UNCHECKED);
{
- BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1);
+ BYTE showOpts = db_get_b(0, "CLUI", "SBarShow", 1);
CheckDlgButton(hwndDlg, IDC_SHOWICON, showOpts & 1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWPROTO, showOpts & 2 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWSTATUS, showOpts & 4 ? BST_CHECKED : BST_UNCHECKED);
}
- CheckDlgButton(hwndDlg, IDC_RIGHTSTATUS, db_get_b(NULL, "CLUI", "SBarRightClk", 0) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_RIGHTSTATUS, db_get_b(0, "CLUI", "SBarRightClk", 0) ? BST_UNCHECKED : BST_CHECKED);
CheckDlgButton(hwndDlg, IDC_RIGHTMIRANDA, IsDlgButtonChecked(hwndDlg, IDC_RIGHTSTATUS) == BST_UNCHECKED ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EQUALSECTIONS, db_get_b(NULL, "CLUI", "EqualSections", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SBPANELBEVEL, db_get_b(NULL, "CLUI", "SBarBevel", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWGRIP, db_get_b(NULL, "CLUI", "ShowGrip", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_EQUALSECTIONS, db_get_b(0, "CLUI", "EqualSections", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SBPANELBEVEL, db_get_b(0, "CLUI", "SBarBevel", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWGRIP, db_get_b(0, "CLUI", "ShowGrip", 1) ? BST_CHECKED : BST_UNCHECKED);
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWICON), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWPROTO), FALSE);
@@ -275,23 +275,23 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- db_set_b(NULL, "CLUI", "ShowSBar", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
- db_set_b(NULL, "CLUI", "SBarShow",
+ db_set_b(0, "CLUI", "ShowSBar", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+ db_set_b(0, "CLUI", "SBarShow",
(BYTE)((IsDlgButtonChecked(hwndDlg, IDC_SHOWICON) ? 1 : 0) |
(IsDlgButtonChecked(hwndDlg, IDC_SHOWPROTO) ? 2 : 0) |
(IsDlgButtonChecked(hwndDlg, IDC_SHOWSTATUS) ? 4 : 0)));
- db_set_b(NULL, "CLUI", "SBarRightClk", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RIGHTMIRANDA));
- db_set_b(NULL, "CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS));
- db_set_b(NULL, "CLUI", "SBarBevel", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SBPANELBEVEL));
+ db_set_b(0, "CLUI", "SBarRightClk", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RIGHTMIRANDA));
+ db_set_b(0, "CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS));
+ db_set_b(0, "CLUI", "SBarBevel", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SBPANELBEVEL));
g_clistApi.pfnLoadCluiGlobalOpts();
- if (db_get_b(NULL, "CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) {
+ if (db_get_b(0, "CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) {
HWND parent = GetParent(g_clistApi.hwndStatus);
int flags = WS_CHILD | CCS_BOTTOM;
- db_set_b(NULL, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
+ db_set_b(0, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
ShowWindow(g_clistApi.hwndStatus, SW_HIDE);
DestroyWindow(g_clistApi.hwndStatus);
- flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
- flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
+ flags |= db_get_b(0, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
+ flags |= db_get_b(0, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
g_clistApi.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
}
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR))
diff --git a/src/core/stdclist/src/init.cpp b/src/core/stdclist/src/init.cpp index ce90b6e13d..56106b19e9 100644 --- a/src/core/stdclist/src/init.cpp +++ b/src/core/stdclist/src/init.cpp @@ -107,8 +107,8 @@ static INT_PTR GetStatusMode(WPARAM, LPARAM) int CMPlugin::Load()
{
- g_bSortByStatus = db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
- g_bSortByProto = db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
+ g_bSortByStatus = db_get_b(0, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
+ g_bSortByProto = db_get_b(0, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
Clist_GetInterface();
coreCli = g_clistApi;
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 7f99a783c0..29fab57a9f 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -101,7 +101,7 @@ void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam) cle.hContact = hContact;
cle.hDbEvent = hdbe;
cle.lParam = lParam;
- if (db_get_b(NULL, MODULENAME, "AutoAccept", 0) && !db_get_b(hContact, "CList", "NotOnList", 0)) {
+ if (g_plugin.getByte("AutoAccept", 0) && !db_get_b(hContact, "CList", "NotOnList", 0)) {
CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_FILERECV), NULL, DlgProcRecvFile, (LPARAM)&cle);
}
else {
diff --git a/src/core/stdfile/src/fileopts.cpp b/src/core/stdfile/src/fileopts.cpp index 41d8717635..549ab0b9b3 100644 --- a/src/core/stdfile/src/fileopts.cpp +++ b/src/core/stdfile/src/fileopts.cpp @@ -66,16 +66,16 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L GetContactReceivedFilesDir(NULL, str, _countof(str), FALSE);
SetDlgItemText(hwndDlg, IDC_FILEDIR, str);
- CheckDlgButton(hwndDlg, IDC_AUTOACCEPT, db_get_b(NULL, MODULENAME, "AutoAccept", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOMIN, db_get_b(NULL, MODULENAME, "AutoMin", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOCLOSE, db_get_b(NULL, MODULENAME, "AutoClose", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOCLEAR, db_get_b(NULL, MODULENAME, "AutoClear", 1) ? BST_CHECKED : BST_UNCHECKED);
- switch (db_get_b(NULL, MODULENAME, "UseScanner", VIRUSSCAN_DISABLE)) {
+ CheckDlgButton(hwndDlg, IDC_AUTOACCEPT, g_plugin.getByte("AutoAccept", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOMIN, g_plugin.getByte("AutoMin", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOCLOSE, g_plugin.getByte("AutoClose", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOCLEAR, g_plugin.getByte("AutoClear", 1) ? BST_CHECKED : BST_UNCHECKED);
+ switch (g_plugin.getByte("UseScanner", VIRUSSCAN_DISABLE)) {
case VIRUSSCAN_AFTERDL: CheckDlgButton(hwndDlg, IDC_SCANAFTERDL, BST_CHECKED); break;
case VIRUSSCAN_DURINGDL: CheckDlgButton(hwndDlg, IDC_SCANDURINGDL, BST_CHECKED); break;
default: CheckDlgButton(hwndDlg, IDC_NOSCANNER, BST_CHECKED); break;
}
- CheckDlgButton(hwndDlg, IDC_WARNBEFOREOPENING, db_get_b(NULL, MODULENAME, "WarnBeforeOpening", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_WARNBEFOREOPENING, g_plugin.getByte("WarnBeforeOpening", 1) ? BST_CHECKED : BST_UNCHECKED);
for (int i = 0; i < _countof(virusScanners); i++) {
wchar_t szScanExe[MAX_PATH];
@@ -90,7 +90,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L }
DBVARIANT dbv;
- if (db_get_ws(NULL, MODULENAME, "ScanCmdLine", &dbv) == 0) {
+ if (g_plugin.getWString("ScanCmdLine", &dbv) == 0) {
SetDlgItemText(hwndDlg, IDC_SCANCMDLINE, dbv.pwszVal);
db_free(&dbv);
}
@@ -99,7 +99,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L PostMessage(hwndDlg, M_SCANCMDLINESELCHANGE, 0, 0);
}
- switch (db_get_b(NULL, MODULENAME, "IfExists", FILERESUME_ASK)) {
+ switch (g_plugin.getByte("IfExists", FILERESUME_ASK)) {
case FILERESUME_RESUMEALL: CheckDlgButton(hwndDlg, IDC_RESUME, BST_CHECKED); break;
case FILERESUME_OVERWRITEALL: CheckDlgButton(hwndDlg, IDC_OVERWRITE, BST_CHECKED); break;
case FILERESUME_RENAMEALL: CheckDlgButton(hwndDlg, IDC_RENAME, BST_CHECKED); break;
@@ -205,16 +205,16 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L wchar_t str[512];
GetDlgItemText(hwndDlg, IDC_FILEDIR, str, _countof(str));
RemoveInvalidPathChars(str);
- db_set_ws(NULL, MODULENAME, "RecvFilesDirAdv", str);
- db_set_b(NULL, MODULENAME, "AutoAccept", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOACCEPT));
- db_set_b(NULL, MODULENAME, "AutoMin", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOMIN));
- db_set_b(NULL, MODULENAME, "AutoClose", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOCLOSE));
- db_set_b(NULL, MODULENAME, "AutoClear", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOCLEAR));
- db_set_b(NULL, MODULENAME, "UseScanner", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCANAFTERDL) ? VIRUSSCAN_AFTERDL : (IsDlgButtonChecked(hwndDlg, IDC_SCANDURINGDL) ? VIRUSSCAN_DURINGDL : VIRUSSCAN_DISABLE)));
+ g_plugin.setWString("RecvFilesDirAdv", str);
+ g_plugin.setByte("AutoAccept", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOACCEPT));
+ g_plugin.setByte("AutoMin", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOMIN));
+ g_plugin.setByte("AutoClose", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOCLOSE));
+ g_plugin.setByte("AutoClear", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOCLEAR));
+ g_plugin.setByte("UseScanner", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCANAFTERDL) ? VIRUSSCAN_AFTERDL : (IsDlgButtonChecked(hwndDlg, IDC_SCANDURINGDL) ? VIRUSSCAN_DURINGDL : VIRUSSCAN_DISABLE)));
GetDlgItemText(hwndDlg, IDC_SCANCMDLINE, str, _countof(str));
- db_set_ws(NULL, MODULENAME, "ScanCmdLine", str);
- db_set_b(NULL, MODULENAME, "WarnBeforeOpening", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WARNBEFOREOPENING));
- db_set_b(NULL, MODULENAME, "IfExists", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ASK) ? FILERESUME_ASK : (IsDlgButtonChecked(hwndDlg, IDC_RESUME) ? FILERESUME_RESUMEALL : (IsDlgButtonChecked(hwndDlg, IDC_OVERWRITE) ? FILERESUME_OVERWRITEALL : FILERESUME_RENAMEALL))));
+ g_plugin.setWString("ScanCmdLine", str);
+ g_plugin.setByte("WarnBeforeOpening", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WARNBEFOREOPENING));
+ g_plugin.setByte("IfExists", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ASK) ? FILERESUME_ASK : (IsDlgButtonChecked(hwndDlg, IDC_RESUME) ? FILERESUME_RESUMEALL : (IsDlgButtonChecked(hwndDlg, IDC_OVERWRITE) ? FILERESUME_OVERWRITEALL : FILERESUME_RENAMEALL))));
return TRUE;
}
break;
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index e975d01fe8..43a2958ba6 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -125,7 +125,7 @@ void GetContactReceivedFilesDir(MCONTACT hContact, wchar_t *szDir, int cchDir, B {
wchar_t tszTemp[MAX_PATH];
- ptrW tszRecvPath(db_get_wsa(NULL, MODULENAME, "RecvFilesDirAdv"));
+ ptrW tszRecvPath(g_plugin.getWStringA("RecvFilesDirAdv"));
if (tszRecvPath)
wcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
else
@@ -165,7 +165,7 @@ void GetReceivedFilesDir(wchar_t *szDir, int cchDir) {
wchar_t tszTemp[MAX_PATH];
- ptrW tszRecvPath(db_get_wsa(NULL, MODULENAME, "RecvFilesDirAdv"));
+ ptrW tszRecvPath(g_plugin.getWStringA("RecvFilesDirAdv"));
if (tszRecvPath)
wcsncpy_s(tszTemp, tszRecvPath, _TRUNCATE);
else
@@ -214,7 +214,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l mir_snprintf(idstr, "MruDir%d", i);
DBVARIANT dbv;
- if (db_get_ws(NULL, MODULENAME, idstr, &dbv))
+ if (g_plugin.getWString(idstr, &dbv))
break;
SendDlgItemMessage(hwndDlg, IDC_FILEDIR, CB_ADDSTRING, 0, (LPARAM)dbv.pwszVal);
db_free(&dbv);
@@ -257,7 +257,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l GetWindowRect(GetDlgItem(hwndDlg, IDC_DATE), &rcDateCtrl);
SetWindowPos(GetDlgItem(hwndDlg, IDC_DATE), 0, 0, 0, rcDateCtrl.right - rcDateCtrl.left - (rcBtn2.left - rcBtn1.left), rcDateCtrl.bottom - rcDateCtrl.top, SWP_NOZORDER | SWP_NOMOVE);
}
- else if (db_get_b(NULL, MODULENAME, "AutoAccept", 0)) {
+ else if (g_plugin.getByte("AutoAccept", 0)) {
//don't check auto-min here to fix BUG#647620
PostMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDOK, BN_CLICKED), (LPARAM)GetDlgItem(hwndDlg, IDOK));
}
@@ -313,12 +313,12 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l DBVARIANT dbv;
for (i = MAX_MRU_DIRS-2;i>=0;i--) {
mir_snprintf(idstr, "MruDir%d", i);
- if (db_get_ws(NULL, MODULENAME, idstr, &dbv)) continue;
+ if (g_plugin.getWString(idstr, &dbv)) continue;
mir_snprintf(idstr, "MruDir%d", i+1);
- db_set_ws(NULL, MODULENAME, idstr, dbv.pwszVal);
+ g_plugin.setWString(idstr, dbv.pwszVal);
db_free(&dbv);
}
- db_set_ws(NULL, MODULENAME, idstr, szRecvDir);
+ g_plugin.setWString(idstr, szRecvDir);
}
}
EnableWindow(GetDlgItem(hwndDlg, IDC_FILENAMES), FALSE);
@@ -332,7 +332,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l dat->hwndTransfer = FtMgr_AddTransfer(dat);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
//check for auto-minimize here to fix BUG#647620
- if (db_get_b(NULL, MODULENAME, "AutoAccept", 0) && db_get_b(NULL, MODULENAME, "AutoMin", 0)) {
+ if (g_plugin.getByte("AutoAccept", 0) && g_plugin.getByte("AutoMin", 0)) {
ShowWindow(hwndDlg, SW_HIDE);
ShowWindow(hwndDlg, SW_SHOWMINNOACTIVE);
}
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index 35d6884ad0..18391cb8e3 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -31,7 +31,7 @@ static int CheckVirusScanned(HWND hwnd, FileDlgData *dat, int i) if (dat->send) return 1; if (dat->fileVirusScanned == nullptr) return 0; if (dat->fileVirusScanned[i]) return 1; - if (db_get_b(NULL, MODULENAME, "WarnBeforeOpening", 1) == 0) return 1; + if (g_plugin.getByte("WarnBeforeOpening", 1) == 0) return 1; return IDYES == MessageBox(hwnd, TranslateT("This file has not yet been scanned for viruses. Are you certain you want to open it?"), TranslateT("File received"), MB_YESNO|MB_DEFBUTTON2); } @@ -94,7 +94,7 @@ void FillSendData(FileDlgData *dat, DBEVENTINFO& dbei) static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info) { DBVARIANT dbv; - if (!db_get_ws(NULL, MODULENAME, "ScanCmdLine", &dbv)) { + if (!g_plugin.getWString("ScanCmdLine", &dbv)) { if (dbv.pwszVal[0]) { STARTUPINFO si = { 0 }; si.cb = sizeof(si); @@ -246,7 +246,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR dat->fs = (HANDLE)ProtoChainSend(dat->hContact, PSS_FILEALLOW, (WPARAM)dat->fs, (LPARAM)dat->szSavePath); dat->transferStatus.szWorkingDir.w = mir_wstrdup(dat->szSavePath); if (db_get_b(dat->hContact, "CList", "NotOnList", 0)) dat->resumeBehaviour = FILERESUME_ASK; - else dat->resumeBehaviour = db_get_b(NULL, MODULENAME, "IfExists", FILERESUME_ASK); + else dat->resumeBehaviour = g_plugin.getByte("IfExists", FILERESUME_ASK); SetFtStatus(hwndDlg, LPGENW("Waiting for connection..."), FTS_TEXT); } @@ -518,7 +518,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SetDlgItemTextA(hwndDlg, IDC_FILENAME, ""); if (dat->transferStatus.currentFileNumber == 1 && dat->transferStatus.totalFiles > 1 && !dat->send) SetOpenFileButtonStyle(GetDlgItem(hwndDlg, IDC_OPENFILE), 1); - if (dat->transferStatus.currentFileNumber != -1 && dat->files && !dat->send && db_get_b(NULL, MODULENAME, "UseScanner", VIRUSSCAN_DISABLE) == VIRUSSCAN_DURINGDL) { + if (dat->transferStatus.currentFileNumber != -1 && dat->files && !dat->send && g_plugin.getByte("UseScanner", VIRUSSCAN_DISABLE) == VIRUSSCAN_DURINGDL) { if (GetFileAttributes(dat->files[dat->transferStatus.currentFileNumber])&FILE_ATTRIBUTE_DIRECTORY) PostMessage(hwndDlg, M_VIRUSSCANDONE, dat->transferStatus.currentFileNumber, 0); else { @@ -649,7 +649,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR LPGENW("Transfer completed, open folder."), FTS_OPEN); - int useScanner = db_get_b(NULL, MODULENAME, "UseScanner", VIRUSSCAN_DISABLE); + int useScanner = g_plugin.getByte("UseScanner", VIRUSSCAN_DISABLE); if (useScanner != VIRUSSCAN_DISABLE) { struct virusscanthreadstartinfo *vstsi; vstsi = (struct virusscanthreadstartinfo*)mir_alloc(sizeof(struct virusscanthreadstartinfo)); diff --git a/src/core/stdfile/src/ftmanager.cpp b/src/core/stdfile/src/ftmanager.cpp index 46d329b9f2..91b742ef9e 100644 --- a/src/core/stdfile/src/ftmanager.cpp +++ b/src/core/stdfile/src/ftmanager.cpp @@ -163,7 +163,7 @@ static INT_PTR CALLBACK FtMgrPageDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPA if (i == dat->wnds->realCount)
PostMessage(GetParent(hwnd), WM_TIMER, 1, NULL);
- if(dat->runningCount == 0 && wParam == ACKRESULT_SUCCESS && db_get_b(NULL, MODULENAME, "AutoClose", 0))
+ if(dat->runningCount == 0 && wParam == ACKRESULT_SUCCESS && g_plugin.getByte("AutoClose", 0))
ShowWindow(hwndFtMgr, SW_HIDE);
break;
@@ -414,7 +414,7 @@ static INT_PTR CALLBACK FtMgrDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_CLOSE:
ShowWindow(hwnd, SW_HIDE);
- if (db_get_b(NULL, MODULENAME, "AutoClear", 1)) {
+ if (g_plugin.getByte("AutoClear", 1)) {
PostMessage(dat->hwndIncoming, WM_FT_CLEANUP, 0, 0);
PostMessage(dat->hwndOutgoing, WM_FT_CLEANUP, 0, 0);
}
@@ -476,7 +476,7 @@ static INT_PTR CALLBACK FtMgrDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM HWND FtMgr_Show(bool bForceActivate, bool bFromMenu)
{
- bool bAutoMin = db_get_b(NULL, MODULENAME, "AutoMin", 0) != 0; /* lqbe */
+ bool bAutoMin = g_plugin.getByte("AutoMin", 0) != 0; /* lqbe */
bool bJustCreated = (hwndFtMgr == nullptr);
if (bJustCreated)
@@ -520,7 +520,7 @@ void FtMgr_ShowPage(int page) HWND FtMgr_AddTransfer(FileDlgData *fdd)
{
- bool bForceActivate = fdd->send || !db_get_b(NULL, MODULENAME, "AutoAccept", 0);
+ bool bForceActivate = fdd->send || !g_plugin.getByte("AutoAccept", 0);
TFtMgrData *dat = (TFtMgrData*)GetWindowLongPtr(FtMgr_Show(bForceActivate, false), GWLP_USERDATA);
if (dat == nullptr)
return nullptr;
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index 4a1385545b..169dfda7c3 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -265,7 +265,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP LPTSTR ptszLastTab;
DBVARIANT dbv;
- if (!db_get_ws(NULL, MODULENAME, "LastTab", &dbv)) {
+ if (!g_plugin.getWString("LastTab", &dbv)) {
ptszLastTab = NEWWSTR_ALLOCA(dbv.pwszVal);
db_free(&dbv);
}
@@ -584,7 +584,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP tvi.pszText = name;
tvi.cchTextMax = _countof(name);
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_PAGETREE), &tvi);
- db_set_ws(NULL, MODULENAME, "LastTab", name);
+ g_plugin.setWString("LastTab", name);
Window_FreeIcon_IcoLib(hwndDlg);
SendDlgItemMessage(hwndDlg, IDC_NAME, WM_SETFONT, SendDlgItemMessage(hwndDlg, IDC_WHITERECT, WM_GETFONT, 0, 0), 0);
diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index 14adec2c65..ef241c3ac9 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -49,7 +49,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) if ((newStatus == ID_STATUS_ONLINE || newStatus == ID_STATUS_FREECHAT) &&
oldStatus != ID_STATUS_ONLINE && oldStatus != ID_STATUS_FREECHAT) {
{
- DWORD ticked = db_get_dw(NULL, MODULENAME, cws->szModule, GetTickCount());
+ DWORD ticked = g_plugin.getDword(cws->szModule, GetTickCount());
// only play the sound (or show event) if this event happens at least 10 secs after the proto went from offline
if (GetTickCount() - ticked > (1000*10)) {
wchar_t tooltip[256];
@@ -77,7 +77,7 @@ static int UserOnlineAck(WPARAM, LPARAM lParam) ACKDATA * ack = (ACKDATA*) lParam;
if (ack != nullptr && ack->szModule && ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS && ack->hProcess == (HANDLE)ID_STATUS_OFFLINE) {
// if going from offline to any other mode, remember when it happened.
- db_set_dw(NULL, MODULENAME, ack->szModule, GetTickCount());
+ g_plugin.setDword(ack->szModule, GetTickCount());
}
return 0;
}
@@ -86,7 +86,7 @@ static int UserOnlineModulesLoaded(WPARAM, LPARAM) {
for (auto &pa : Accounts())
if (pa->IsEnabled())
- db_set_dw(NULL, MODULENAME, pa->szModuleName, GetTickCount());
+ g_plugin.setDword(pa->szModuleName, GetTickCount());
return 0;
}
@@ -100,7 +100,7 @@ static int UserOnlineAccountsChanged(WPARAM eventCode, LPARAM lParam) case PRAC_CHECKED:
// reset the counter
if (pa->IsEnabled())
- db_set_dw(NULL, MODULENAME, pa->szModuleName, GetTickCount());
+ g_plugin.setDword(pa->szModuleName, GetTickCount());
break;
}
return 0;
|