diff options
author | George Hazan <george.hazan@gmail.com> | 2012-10-07 11:42:28 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-10-07 11:42:28 +0000 |
commit | 197fe77f67654cf8c46c53376190fc321176c08b (patch) | |
tree | 1a161cf7fb7968e3781b1d11771195d9b5e4c26c /src/modules/clist | |
parent | 4bcab3fc00696ca2daf1396bfc75bd49009644d6 (diff) |
old database macros removed from m_database.h
git-svn-id: http://svn.miranda-ng.org/main/trunk@1796 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/clist')
-rw-r--r-- | src/modules/clist/Docking.cpp | 18 | ||||
-rw-r--r-- | src/modules/clist/clc.cpp | 6 | ||||
-rw-r--r-- | src/modules/clist/clcitems.cpp | 8 | ||||
-rw-r--r-- | src/modules/clist/clcmsgs.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/clcutils.cpp | 42 | ||||
-rw-r--r-- | src/modules/clist/clistcore.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/clistevents.cpp | 4 | ||||
-rw-r--r-- | src/modules/clist/clistmenus.cpp | 8 | ||||
-rw-r--r-- | src/modules/clist/clistmod.cpp | 14 | ||||
-rw-r--r-- | src/modules/clist/clistsettings.cpp | 6 | ||||
-rw-r--r-- | src/modules/clist/clisttray.cpp | 28 | ||||
-rw-r--r-- | src/modules/clist/clui.cpp | 84 | ||||
-rw-r--r-- | src/modules/clist/cluiservices.cpp | 20 | ||||
-rw-r--r-- | src/modules/clist/contact.cpp | 14 | ||||
-rw-r--r-- | src/modules/clist/genmenu.cpp | 12 | ||||
-rw-r--r-- | src/modules/clist/genmenuopt.cpp | 8 | ||||
-rw-r--r-- | src/modules/clist/groups.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/keyboard.cpp | 2 |
18 files changed, 140 insertions, 140 deletions
diff --git a/src/modules/clist/Docking.cpp b/src/modules/clist/Docking.cpp index 382794b9d7..c2aeafec93 100644 --- a/src/modules/clist/Docking.cpp +++ b/src/modules/clist/Docking.cpp @@ -150,8 +150,8 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) if (docked)
{
DBWriteContactSettingByte(NULL, "CList", "Docked", (BYTE) docked);
- DBWriteContactSettingDword(NULL, "CList", "DockX", (DWORD) dockPos.x);
- DBWriteContactSettingDword(NULL, "CList", "DockY", (DWORD) dockPos.y);
+ db_set_dw(NULL, "CList", "DockX", (DWORD) dockPos.x);
+ db_set_dw(NULL, "CList", "DockY", (DWORD) dockPos.y);
}
else
{
@@ -168,10 +168,10 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) {
case WM_CREATE:
draggingTitle = 0;
- docked = DBGetContactSettingByte(NULL, "CLUI", "DockToSides", 1) ?
- (char) DBGetContactSettingByte(NULL, "CList", "Docked", 0) : 0;
- dockPos.x = (int) DBGetContactSettingDword(NULL, "CList", "DockX", 0);
- dockPos.y = (int) DBGetContactSettingDword(NULL, "CList", "DockY", 0);
+ docked = db_get_b(NULL, "CLUI", "DockToSides", 1) ?
+ (char) db_get_b(NULL, "CList", "Docked", 0) : 0;
+ dockPos.x = (int) db_get_dw(NULL, "CList", "DockX", 0);
+ dockPos.y = (int) db_get_dw(NULL, "CList", "DockY", 0);
break;
case WM_ACTIVATE:
@@ -284,7 +284,7 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) if (((ptCursor.x < rcMonitor.left + EDGESENSITIVITY) ||
(ptCursor.x >= rcMonitor.right - EDGESENSITIVITY)) &&
- DBGetContactSettingByte(NULL, "CLUI", "DockToSides", 1))
+ db_get_b(NULL, "CLUI", "DockToSides", 1))
{
docked = (ptCursor.x < rcMonitor.left + EDGESENSITIVITY) ? DOCKED_LEFT : DOCKED_RIGHT;
PostMessage(msg->hwnd, WM_LBUTTONUP, 0, MAKELPARAM(ptCursor.x, ptCursor.y));
@@ -350,8 +350,8 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y));
SetWindowPos(msg->hwnd, 0, pt.x - rc.right / 2,
pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2,
- DBGetContactSettingDword(NULL, "CList", "Width", 0),
- DBGetContactSettingDword(NULL, "CList", "Height", 0),
+ db_get_dw(NULL, "CList", "Width", 0),
+ db_get_dw(NULL, "CList", "Height", 0),
SWP_NOZORDER);
Docking_Command(msg->hwnd, ABM_REMOVE);
}
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index a46879aaad..dba24ad84b 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -482,7 +482,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, flags = contact->flags;
}
cli.pfnDeleteItemFromTree(hwnd, (HANDLE) wParam);
- if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !DBGetContactSettingByte((HANDLE) wParam, "CList", "Hidden", 0)) {
+ if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b((HANDLE) wParam, "CList", "Hidden", 0)) {
NMCLISTCONTROL nm;
cli.pfnAddContactToTree(hwnd, dat, (HANDLE) wParam, 1, 1);
if (cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL)) {
@@ -519,7 +519,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, // this means an offline msg is flashing, so the contact should be shown
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
- shouldShow = (style & CLS_SHOWHIDDEN || !DBGetContactSettingByte((HANDLE) wParam, "CList", "Hidden", 0))
+ shouldShow = (style & CLS_SHOWHIDDEN || !db_get_b((HANDLE) wParam, "CList", "Hidden", 0))
&& ( !cli.pfnIsHiddenMode(dat, status) || CallService(MS_CLIST_GETCONTACTICON, wParam, 0) != lParam);
if ( !cli.pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
@@ -638,7 +638,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, if (szProto == NULL)
break;
contact->flags &= ~CONTACTF_IDLE;
- if (DBGetContactSettingDword((HANDLE) wParam, szProto, "IdleTS", 0)) {
+ if (db_get_dw((HANDLE) wParam, szProto, "IdleTS", 0)) {
contact->flags |= CONTACTF_IDLE;
}
cli.pfnInvalidateRect(hwnd, NULL, FALSE);
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index 77ae140f73..4ef4118104 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -200,9 +200,9 @@ int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact) group->cl.items[i]->flags |= CONTACTF_VISTO;
else if (apparentMode)
group->cl.items[i]->flags |= CONTACTF_VISTO | CONTACTF_INVISTO;
- if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
+ if (db_get_b(hContact, "CList", "NotOnList", 0))
group->cl.items[i]->flags |= CONTACTF_NOTONLIST;
- idleMode = szProto != NULL ? DBGetContactSettingDword(hContact, szProto, "IdleTS", 0) : 0;
+ idleMode = szProto != NULL ? db_get_dw(hContact, szProto, "IdleTS", 0) : 0;
if (idleMode)
group->cl.items[i]->flags |= CONTACTF_IDLE;
lstrcpyn(group->cl.items[i]->szText, cli.pfnGetContactDisplayName(hContact, 0), SIZEOF(group->cl.items[i]->szText));
@@ -365,7 +365,7 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat) DBVARIANT dbv;
dat->list.expanded = 1;
- dat->list.hideOffline = DBGetContactSettingByte(NULL, "CLC", "HideOfflineRoot", 0) && style&CLS_USEGROUPS;
+ dat->list.hideOffline = db_get_b(NULL, "CLC", "HideOfflineRoot", 0) && style&CLS_USEGROUPS;
dat->list.cl.count = dat->list.cl.limit = 0;
dat->selection = -1;
{
@@ -383,7 +383,7 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat) hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact) {
- if (style & CLS_SHOWHIDDEN || !DBGetContactSettingByte(hContact, "CList", "Hidden", 0)) {
+ if (style & CLS_SHOWHIDDEN || !db_get_b(hContact, "CList", "Hidden", 0)) {
if (DBGetContactSettingTString(hContact, "CList", "Group", &dbv))
group = &dat->list;
else {
diff --git a/src/modules/clist/clcmsgs.cpp b/src/modules/clist/clcmsgs.cpp index 8c4de5232d..3c209fb62a 100644 --- a/src/modules/clist/clcmsgs.cpp +++ b/src/modules/clist/clcmsgs.cpp @@ -173,7 +173,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR return (LRESULT) dat->fontInfo[wParam].hFont;
case CLM_GETHIDEOFFLINEROOT:
- return DBGetContactSettingByte(NULL, "CLC", "HideOfflineRoot", 0);
+ return db_get_b(NULL, "CLC", "HideOfflineRoot", 0);
case CLM_GETINDENT:
return dat->groupIndent;
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index dc3acdfe9e..84ab62c86e 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -698,18 +698,18 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour) mir_free(dbv.pszVal);
}
mir_snprintf(idstr, SIZEOF(idstr), "Font%dCol", i);
- *colour = DBGetContactSettingDword(NULL, "CLC", idstr, *colour);
+ *colour = db_get_dw(NULL, "CLC", idstr, *colour);
mir_snprintf(idstr, SIZEOF(idstr), "Font%dSize", i);
- lf->lfHeight = (char) DBGetContactSettingByte(NULL, "CLC", idstr, lf->lfHeight);
+ lf->lfHeight = (char) db_get_b(NULL, "CLC", idstr, lf->lfHeight);
mir_snprintf(idstr, SIZEOF(idstr), "Font%dSty", i);
- style = (BYTE) DBGetContactSettingByte(NULL, "CLC", idstr, (lf->lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf->lfItalic ? DBFONTF_ITALIC : 0) | (lf->lfUnderline ? DBFONTF_UNDERLINE : 0));
+ style = (BYTE) db_get_b(NULL, "CLC", idstr, (lf->lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf->lfItalic ? DBFONTF_ITALIC : 0) | (lf->lfUnderline ? DBFONTF_UNDERLINE : 0));
lf->lfWidth = lf->lfEscapement = lf->lfOrientation = 0;
lf->lfWeight = style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = (style & DBFONTF_ITALIC) != 0;
lf->lfUnderline = (style & DBFONTF_UNDERLINE) != 0;
lf->lfStrikeOut = 0;
mir_snprintf(idstr, SIZEOF(idstr), "Font%dSet", i);
- lf->lfCharSet = DBGetContactSettingByte(NULL, "CLC", idstr, lf->lfCharSet);
+ lf->lfCharSet = db_get_b(NULL, "CLC", idstr, lf->lfCharSet);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
@@ -718,7 +718,7 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour) void fnLoadClcOptions(HWND hwnd, struct ClcData *dat)
{
- dat->rowHeight = DBGetContactSettingByte(NULL, "CLC", "RowHeight", CLCDEFAULT_ROWHEIGHT);
+ dat->rowHeight = db_get_b(NULL, "CLC", "RowHeight", CLCDEFAULT_ROWHEIGHT);
LOGFONT lf;
SIZE fontSize;
@@ -742,23 +742,23 @@ void fnLoadClcOptions(HWND hwnd, struct ClcData *dat) }
ReleaseDC(hwnd, hdc);
- dat->leftMargin = DBGetContactSettingByte(NULL, "CLC", "LeftMargin", CLCDEFAULT_LEFTMARGIN);
- dat->exStyle = DBGetContactSettingDword(NULL, "CLC", "ExStyle", cli.pfnGetDefaultExStyle());
+ dat->leftMargin = db_get_b(NULL, "CLC", "LeftMargin", CLCDEFAULT_LEFTMARGIN);
+ dat->exStyle = db_get_dw(NULL, "CLC", "ExStyle", cli.pfnGetDefaultExStyle());
dat->scrollTime = DBGetContactSettingWord(NULL, "CLC", "ScrollTime", CLCDEFAULT_SCROLLTIME);
- dat->groupIndent = DBGetContactSettingByte(NULL, "CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT);
- dat->gammaCorrection = DBGetContactSettingByte(NULL, "CLC", "GammaCorrect", CLCDEFAULT_GAMMACORRECT);
- dat->showIdle = DBGetContactSettingByte(NULL, "CLC", "ShowIdle", CLCDEFAULT_SHOWIDLE);
- dat->noVScrollbar = DBGetContactSettingByte(NULL, "CLC", "NoVScrollBar", 0);
- dat->filterSearch = DBGetContactSettingByte(NULL, "CLC", "FilterSearch", 1);
+ dat->groupIndent = db_get_b(NULL, "CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT);
+ dat->gammaCorrection = db_get_b(NULL, "CLC", "GammaCorrect", CLCDEFAULT_GAMMACORRECT);
+ dat->showIdle = db_get_b(NULL, "CLC", "ShowIdle", CLCDEFAULT_SHOWIDLE);
+ dat->noVScrollbar = db_get_b(NULL, "CLC", "NoVScrollBar", 0);
+ dat->filterSearch = db_get_b(NULL, "CLC", "FilterSearch", 1);
SendMessage(hwnd, INTM_SCROLLBARCHANGED, 0, 0);
if ( !dat->bkChanged) {
DBVARIANT dbv;
- dat->bkColour = DBGetContactSettingDword(NULL, "CLC", "BkColour", CLCDEFAULT_BKCOLOUR);
+ dat->bkColour = db_get_dw(NULL, "CLC", "BkColour", CLCDEFAULT_BKCOLOUR);
if (dat->hBmpBackground) {
DeleteObject(dat->hBmpBackground);
dat->hBmpBackground = NULL;
}
- if (DBGetContactSettingByte(NULL, "CLC", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
+ if (db_get_b(NULL, "CLC", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
if ( !DBGetContactSettingString(NULL, "CLC", "BkBitmap", &dbv)) {
dat->hBmpBackground = (HBITMAP) CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM) dbv.pszVal);
mir_free(dbv.pszVal);
@@ -766,13 +766,13 @@ void fnLoadClcOptions(HWND hwnd, struct ClcData *dat) }
dat->backgroundBmpUse = DBGetContactSettingWord(NULL, "CLC", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
}
- dat->greyoutFlags = DBGetContactSettingDword(NULL, "CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS);
- dat->offlineModes = DBGetContactSettingDword(NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES);
- dat->selBkColour = DBGetContactSettingDword(NULL, "CLC", "SelBkColour", CLCDEFAULT_SELBKCOLOUR);
- dat->selTextColour = DBGetContactSettingDword(NULL, "CLC", "SelTextColour", CLCDEFAULT_SELTEXTCOLOUR);
- dat->hotTextColour = DBGetContactSettingDword(NULL, "CLC", "HotTextColour", CLCDEFAULT_HOTTEXTCOLOUR);
- dat->quickSearchColour = DBGetContactSettingDword(NULL, "CLC", "QuickSearchColour", CLCDEFAULT_QUICKSEARCHCOLOUR);
- dat->useWindowsColours = DBGetContactSettingByte(NULL, "CLC", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
+ dat->greyoutFlags = db_get_dw(NULL, "CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS);
+ dat->offlineModes = db_get_dw(NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES);
+ dat->selBkColour = db_get_dw(NULL, "CLC", "SelBkColour", CLCDEFAULT_SELBKCOLOUR);
+ dat->selTextColour = db_get_dw(NULL, "CLC", "SelTextColour", CLCDEFAULT_SELTEXTCOLOUR);
+ dat->hotTextColour = db_get_dw(NULL, "CLC", "HotTextColour", CLCDEFAULT_HOTTEXTCOLOUR);
+ dat->quickSearchColour = db_get_dw(NULL, "CLC", "QuickSearchColour", CLCDEFAULT_QUICKSEARCHCOLOUR);
+ dat->useWindowsColours = db_get_b(NULL, "CLC", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
NMHDR hdr;
hdr.code = CLN_OPTIONSCHANGED;
diff --git a/src/modules/clist/clistcore.cpp b/src/modules/clist/clistcore.cpp index 0ac6bb9a7f..12fbcc032e 100644 --- a/src/modules/clist/clistcore.cpp +++ b/src/modules/clist/clistcore.cpp @@ -56,7 +56,7 @@ static void fnOnCreateClc(void) static void fnReloadProtoMenus(void)
{
RebuildMenuOrder();
- if (DBGetContactSettingByte(NULL, "CList", "MoveProtoMenus", TRUE))
+ if (db_get_b(NULL, "CList", "MoveProtoMenus", TRUE))
BuildProtoMenus();
cli.pfnCluiProtocolStatusChanged(0, 0);
}
diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp index 96d5a95a9e..0e19129dee 100644 --- a/src/modules/clist/clistevents.cpp +++ b/src/modules/clist/clistevents.cpp @@ -397,8 +397,8 @@ int InitCListEvents(void) memset(&cli.events, 0, sizeof(cli.events));
cli.events.increment = 10;
- disableTrayFlash = DBGetContactSettingByte(NULL, "CList", "DisableTrayFlash", 0);
- disableIconFlash = DBGetContactSettingByte(NULL, "CList", "NoIconBlink", 0);
+ disableTrayFlash = db_get_b(NULL, "CList", "DisableTrayFlash", 0);
+ disableIconFlash = db_get_b(NULL, "CList", "NoIconBlink", 0);
CreateServiceFunction(MS_CLIST_ADDEVENT, AddEventSyncStub); //need to be called through sync to keep flash timer workable
CreateServiceFunction(MS_CLIST_ADDEVENT"_SYNC", AddEventStub);
CreateServiceFunction(MS_CLIST_REMOVEEVENT, RemoveEventStub);
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp index 00d5ad157a..364461d688 100644 --- a/src/modules/clist/clistmenus.cpp +++ b/src/modules/clist/clistmenus.cpp @@ -335,7 +335,7 @@ static INT_PTR BuildContactMenu(WPARAM wParam, LPARAM) BuildContactParam bcp;
bcp.szProto = szProto;
- bcp.isOnList = (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 0);
+ bcp.isOnList = (db_get_b(hContact, "CList", "NotOnList", 0) == 0);
bcp.isOnline = (szProto != NULL && ID_STATUS_OFFLINE != DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE));
ListParam param = { 0 };
@@ -571,7 +571,7 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM) char *prot = smep->proto;
char szHumanName[64] = {0};
PROTOACCOUNT * acc = Proto_GetAccount(smep->proto);
- int i = (DBGetContactSettingByte(NULL, prot, "LockMainStatus", 0)?0:1);
+ int i = (db_get_b(NULL, prot, "LockMainStatus", 0)?0:1);
DBWriteContactSettingByte(NULL, prot, "LockMainStatus", (BYTE)i);
CallProtoServiceInt(NULL,smep->proto, PS_GETNAME, (WPARAM)SIZEOF(szHumanName), (LPARAM)szHumanName);
@@ -824,7 +824,7 @@ void RebuildMenuOrder(void) int i, j, s;
DWORD flags;
- BYTE bHideStatusMenu = DBGetContactSettingByte(NULL, "CLUI", "DontHideStatusMenu", 0); // cool perversion, though
+ BYTE bHideStatusMenu = db_get_b(NULL, "CLUI", "DontHideStatusMenu", 0); // cool perversion, though
//clear statusmenu
RecursiveDeleteMenu(hStatusMenu);
@@ -1253,7 +1253,7 @@ static INT_PTR HotkeySetStatus(WPARAM wParam, LPARAM lParam) static INT_PTR AddProtoMenuItem(WPARAM wParam, LPARAM lParam)
{
- if (DBGetContactSettingByte(NULL, "CList", "MoveProtoMenus", TRUE))
+ if (db_get_b(NULL, "CList", "MoveProtoMenus", TRUE))
return AddStatusMenuItem(wParam, lParam);
return AddMainMenuItem(wParam, lParam);
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp index 375b80367f..2f1cbfbfd0 100644 --- a/src/modules/clist/clistmod.cpp +++ b/src/modules/clist/clistmod.cpp @@ -150,7 +150,7 @@ static int ProtocolAck(WPARAM, LPARAM lParam) while (hContact) {
char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if (szProto != NULL && !strcmp(szProto, ack->szModule))
- if (DBGetContactSettingByte(hContact, "CList", "Delete", 0))
+ if (db_get_b(hContact, "CList", "Delete", 0))
CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0);
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
}
@@ -379,7 +379,7 @@ int fnShowHide(WPARAM, LPARAM) switch (iVisibleState) {
case GWVS_PARTIALLY_COVERED:
//If we don't want to bring it to top, we can use a simple break. This goes against readability ;-) but the comment explains it.
- if ( !DBGetContactSettingByte(NULL, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT))
+ if ( !db_get_b(NULL, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT))
break;
case GWVS_COVERED: //Fall through (and we're already falling)
case GWVS_HIDDEN:
@@ -396,7 +396,7 @@ int fnShowHide(WPARAM, LPARAM) RECT rcWindow;
ShowWindow(cli.hwndContactList, SW_RESTORE);
- if ( !DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
+ if ( !db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
SetWindowPos(cli.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
else
SetWindowPos(cli.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
@@ -412,8 +412,8 @@ int fnShowHide(WPARAM, LPARAM) }
}
else { //It needs to be hidden
- if (DBGetContactSettingByte(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ||
- DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) {
+ if (db_get_b(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ||
+ db_get_b(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) {
ShowWindow(cli.hwndContactList, SW_HIDE);
DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_HIDDEN);
}
@@ -422,7 +422,7 @@ int fnShowHide(WPARAM, LPARAM) DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_MINIMIZED);
}
- if (MySetProcessWorkingSetSize != NULL && DBGetContactSettingByte(NULL, "CList", "DisableWorkingSet", 1))
+ if (MySetProcessWorkingSetSize != NULL && db_get_b(NULL, "CList", "DisableWorkingSet", 1))
MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
}
return 0;
@@ -555,7 +555,7 @@ void UnloadContactListModule() HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact != NULL) {
HANDLE hNext = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
- if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
+ if (db_get_b(hContact, "CList", "NotOnList", 0))
CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0);
hContact = hNext;
}
diff --git a/src/modules/clist/clistsettings.cpp b/src/modules/clist/clistsettings.cpp index 4e25504853..62795e8450 100644 --- a/src/modules/clist/clistsettings.cpp +++ b/src/modules/clist/clistsettings.cpp @@ -74,7 +74,7 @@ void fnCheckCacheItem(ClcCacheEntryBase* p) }
if (p->bIsHidden == -1)
- p->bIsHidden = DBGetContactSettingByte(p->hContact, "CList", "Hidden", 0);
+ p->bIsHidden = db_get_b(p->hContact, "CList", "Hidden", 0);
}
void fnFreeCacheItem(ClcCacheEntryBase* p)
@@ -241,8 +241,8 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) CallService(MS_CLUI_CONTACTRENAMED, wParam, 0);
}
else if ( !strcmp(cws->szSetting, "Status")) {
- if ( !DBGetContactSettingByte(hContact, "CList", "Hidden", 0)) {
- if (DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) {
+ if ( !db_get_b(hContact, "CList", "Hidden", 0)) {
+ if (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) {
// User's state is changing, and we are hideOffline-ing
if (cws->value.wVal == ID_STATUS_OFFLINE) {
cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(cws->szModule, cws->value.wVal, hContact), 0);
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp index 91af2f6b21..aaf7d79fcd 100644 --- a/src/modules/clist/clisttray.cpp +++ b/src/modules/clist/clisttray.cpp @@ -108,7 +108,7 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto) if (szPrefix && szPrefix[0]) {
lstrcpyn(cli.szTip, szPrefix, MAX_TIP_SIZE);
- if ( !DBGetContactSettingByte(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT))
+ if ( !db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT))
{ ulock; return cli.szTip; }
}
else cli.szTip[0] = '\0';
@@ -158,7 +158,7 @@ TCHAR* fnTrayIconMakeTooltip(const TCHAR *szPrefix, const char *szProto) ProtoXStatus = sttGetXStatus(szProto);
szStatus = cli.pfnGetStatusModeDescription(CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0), 0);
if (szPrefix && szPrefix[0]) {
- if (DBGetContactSettingByte(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) {
+ if (db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT)) {
if (mToolTipTrayTips) {
if (ProtoXStatus)
mir_sntprintf(cli.szTip, MAX_TIP_SIZE, _T("%s%s<b>%-12.12s</b>\t%s%s%-24.24s"), szPrefix, szSeparator, pa->tszAccountName, szStatus, szSeparator, ProtoXStatus);
@@ -269,14 +269,14 @@ int fnTrayIconInit(HWND hwnd) {
cli.trayIcon = (trayIconInfo_t *) mir_calloc(sizeof(trayIconInfo_t) * accounts.getCount());
- int trayIconSetting = DBGetContactSettingByte(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT);
+ int trayIconSetting = db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT);
if (trayIconSetting == SETTING_TRAYICON_SINGLE)
{
DBVARIANT dbv = { DBVT_DELETED };
char *szProto;
if ( !DBGetContactSettingString(NULL, "CList", "PrimaryStatus", &dbv)
- && (averageMode < 0 || DBGetContactSettingByte(NULL, "CList", "AlwaysPrimary", 0)))
+ && (averageMode < 0 || db_get_b(NULL, "CList", "AlwaysPrimary", 0)))
szProto = dbv.pszVal;
else
szProto = NULL;
@@ -285,7 +285,7 @@ int fnTrayIconInit(HWND hwnd) DBFreeVariant(&dbv);
}
else if (trayIconSetting == SETTING_TRAYICON_MULTI &&
- (averageMode < 0 || DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
+ (averageMode < 0 || db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
{
cli.trayIconCount = netProtoCount;
for (int i=0; i < accounts.getCount(); ++i)
@@ -422,7 +422,7 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer SetTaskBarIcon(NULL, NULL);
cli.trayIcon[i].isBase = isBase;
- if (DBGetContactSettingByte(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
+ if (db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
{
DWORD time1 = DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT)*200;
DWORD time2 = DBGetContactSettingWord(NULL, "CList", "IconFlashTime", 550)+1000;
@@ -455,8 +455,8 @@ int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto) }
if ((cli.pfnGetProtocolVisibility(szPreferredProto))
&& (GetAverageMode() == -1)
- && (DBGetContactSettingByte(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
- && !(DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
+ && (db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
+ && !(db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
goto LBL_Error;
}
@@ -528,11 +528,11 @@ void fnTrayIconUpdateBase(const char *szChangedProto) if (netProtoCount > 0)
{
- int trayIconSetting = DBGetContactSettingByte(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT);
+ int trayIconSetting = db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT);
if (averageMode > 0) {
if (trayIconSetting == SETTING_TRAYICON_MULTI) {
- if (DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
+ if (db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
//changed = cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode((char*)szChangedProto, NULL, averageMode), (char*)szChangedProto);
changed = cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(NULL, szChangedProto, CallProtoServiceInt(NULL,szChangedProto, PS_GETSTATUS, 0, 0)), (char*)szChangedProto);
else if (cli.trayIcon && cli.trayIcon[0].szProto != NULL) {
@@ -571,7 +571,7 @@ void fnTrayIconUpdateBase(const char *szChangedProto) if ( !cli.trayIcon) {
cli.pfnTrayIconRemove(NULL, NULL);
}
- else if ((cli.trayIconCount > 1 || netProtoCount == 1) || DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
+ else if ((cli.trayIconCount > 1 || netProtoCount == 1) || db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
changed = cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(NULL, szChangedProto, CallProtoServiceInt(NULL,szChangedProto, PS_GETSTATUS, 0, 0)), (char*)szChangedProto);
else {
cli.pfnTrayIconDestroy(hwnd);
@@ -643,7 +643,7 @@ int fnTrayIconPauseAutoHide(WPARAM, LPARAM) {
initcheck 0;
lock;
- if (DBGetContactSettingByte(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
+ if (db_get_b(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
if (GetActiveWindow() != cli.hwndContactList) {
KillTimer(NULL, autoHideTimerId);
autoHideTimerId = SetTimer(NULL, 0, 1000 * DBGetContactSettingWord(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
@@ -721,7 +721,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) break;
case WM_ACTIVATE:
- if (DBGetContactSettingByte(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
+ if (db_get_b(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
if (LOWORD(msg->wParam) == WA_INACTIVE)
autoHideTimerId = SetTimer(NULL, 0, 1000 * DBGetContactSettingWord(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
else
@@ -742,7 +742,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) if (msg->lParam == WM_MBUTTONUP)
cli.pfnShowHide(0, 0);
- else if (msg->lParam == (DBGetContactSettingByte(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? WM_LBUTTONUP : WM_LBUTTONDBLCLK)) {
+ else if (msg->lParam == (db_get_b(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? WM_LBUTTONUP : WM_LBUTTONDBLCLK)) {
if ((GetAsyncKeyState(VK_CONTROL) & 0x8000))
{
POINT pt;
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index 45b38ccdc6..3d24e77a92 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -48,10 +48,10 @@ static CluiOpts cluiopt = {0}; void fnLoadCluiGlobalOpts()
{
- cluiopt.showsbar = DBGetContactSettingByte(NULL, "CLUI", "ShowSBar", 1);
- cluiopt.showgrip = DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1);
- cluiopt.transparent = DBGetContactSettingByte(NULL, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT);
- cluiopt.alpha = DBGetContactSettingByte(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT);
+ cluiopt.showsbar = db_get_b(NULL, "CLUI", "ShowSBar", 1);
+ cluiopt.showgrip = db_get_b(NULL, "CLUI", "ShowGrip", 1);
+ cluiopt.transparent = db_get_b(NULL, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT);
+ cluiopt.alpha = db_get_b(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT);
}
static int CluiModulesLoaded(WPARAM, LPARAM)
@@ -178,7 +178,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) //see notes about deleting contacts on PF1_SERVERCLIST servers in m_protosvc.h
UINT_PTR action;
- if (DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) &&
+ if (db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) &&
!(GetKeyState(VK_SHIFT)&0x8000))
// Ask user for confirmation, and if the contact should be archived (hidden, not deleted)
action = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_DELETECONTACT), (HWND) lParam, AskForConfirmationDlgProc, wParam);
@@ -290,7 +290,7 @@ int LoadCLUIModule(void) RegisterClassEx(&wndclass);
wndclass.style = CS_HREDRAW | CS_VREDRAW | ((IsWinVerXPPlus() &&
- DBGetContactSettingByte(NULL, "CList", "WindowShadow", 0) == 1) ? CS_DROPSHADOW : 0);
+ db_get_b(NULL, "CList", "WindowShadow", 0) == 1) ? CS_DROPSHADOW : 0);
wndclass.lpfnWndProc = ContactListWndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
@@ -311,24 +311,24 @@ int LoadCLUIModule(void) }
RECT pos;
- pos.left = (int) DBGetContactSettingDword(NULL, "CList", "x", 700);
- pos.top = (int) DBGetContactSettingDword(NULL, "CList", "y", 221);
- pos.right = pos.left + (int) DBGetContactSettingDword(NULL, "CList", "Width", 108);
- pos.bottom = pos.top + (int) DBGetContactSettingDword(NULL, "CList", "Height", 310);
+ pos.left = (int) db_get_dw(NULL, "CList", "x", 700);
+ pos.top = (int) db_get_dw(NULL, "CList", "y", 221);
+ pos.right = pos.left + (int) db_get_dw(NULL, "CList", "Width", 108);
+ pos.bottom = pos.top + (int) db_get_dw(NULL, "CList", "Height", 310);
Utils_AssertInsideScreen(&pos);
cli.hwndContactList = CreateWindowEx(
- (DBGetContactSettingByte(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? WS_EX_TOOLWINDOW : WS_EX_APPWINDOW),
+ (db_get_b(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? WS_EX_TOOLWINDOW : WS_EX_APPWINDOW),
_T(MIRANDACLASS),
titleText,
WS_POPUPWINDOW | WS_THICKFRAME | WS_CLIPCHILDREN |
- (DBGetContactSettingByte(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? WS_CAPTION | WS_SYSMENU |
- (DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? 0 : WS_MINIMIZEBOX) : 0),
+ (db_get_b(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? WS_CAPTION | WS_SYSMENU |
+ (db_get_b(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? 0 : WS_MINIMIZEBOX) : 0),
pos.left, pos.top, pos.right - pos.left, pos.bottom - pos.top,
NULL, NULL, cli.hInst, NULL);
- if (DBGetContactSettingByte(NULL, "CList", "OnDesktop", 0)) {
+ if (db_get_b(NULL, "CList", "OnDesktop", 0)) {
HWND hProgMan = FindWindow(_T("Progman"), NULL);
if (IsWindow(hProgMan))
SetParent(cli.hwndContactList, hProgMan);
@@ -339,16 +339,16 @@ int LoadCLUIModule(void) PostMessage(cli.hwndContactList, M_RESTORESTATUS, 0, 0);
{
- int state = DBGetContactSettingByte(NULL, "CList", "State", SETTING_STATE_NORMAL);
+ int state = db_get_b(NULL, "CList", "State", SETTING_STATE_NORMAL);
cli.hMenuMain = GetMenu(cli.hwndContactList);
- if ( !DBGetContactSettingByte(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
+ if ( !db_get_b(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
SetMenu(cli.hwndContactList, NULL);
if (state == SETTING_STATE_NORMAL)
ShowWindow(cli.hwndContactList, SW_SHOW);
else if (state == SETTING_STATE_MINIMIZED)
ShowWindow(cli.hwndContactList, SW_SHOWMINIMIZED);
SetWindowPos(cli.hwndContactList,
- DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST,
+ db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST,
0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
}
{
@@ -527,9 +527,9 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM cli.hwndContactTree = CreateWindow(CLISTCONTROL_CLASS, _T(""),
WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN
| CLS_CONTACTLIST
- | (DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
- | (DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0)
- | (DBGetContactSettingByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ?
+ | (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
+ | (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0)
+ | (db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ?
CLS_HIDEEMPTYGROUPS : 0), 0, 0, 0, 0, hwnd, NULL, cli.hInst, NULL);
SendMessage(hwnd, WM_SIZE, 0, 0);
break;
@@ -584,7 +584,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (wParam == SIZE_MINIMIZED)
{
if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) ||
- DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT))
+ db_get_b(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT))
{
ShowWindow(hwnd, SW_HIDE);
DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_HIDDEN);
@@ -592,7 +592,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM else
DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_MINIMIZED);
- if (MySetProcessWorkingSetSize != NULL && DBGetContactSettingByte(NULL, "CList", "DisableWorkingSet", 1))
+ if (MySetProcessWorkingSetSize != NULL && db_get_b(NULL, "CList", "DisableWorkingSet", 1))
MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
}
// drop thru
@@ -602,11 +602,11 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM GetWindowRect(hwnd, &rc);
if ( !CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) { //if docked, dont remember pos (except for width)
- DBWriteContactSettingDword(NULL, "CList", "Height", (DWORD) (rc.bottom - rc.top));
- DBWriteContactSettingDword(NULL, "CList", "x", (DWORD) rc.left);
- DBWriteContactSettingDword(NULL, "CList", "y", (DWORD) rc.top);
+ db_set_dw(NULL, "CList", "Height", (DWORD) (rc.bottom - rc.top));
+ db_set_dw(NULL, "CList", "x", (DWORD) rc.left);
+ db_set_dw(NULL, "CList", "y", (DWORD) rc.top);
}
- DBWriteContactSettingDword(NULL, "CList", "Width", (DWORD) (rc.right - rc.left));
+ db_set_dw(NULL, "CList", "Width", (DWORD) (rc.right - rc.left));
}
return FALSE;
@@ -647,7 +647,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM result = DefWindowProc(hwnd, WM_NCHITTEST, wParam, lParam);
if (result == HTSIZE || result == HTTOP || result == HTTOPLEFT || result == HTTOPRIGHT ||
result == HTBOTTOM || result == HTBOTTOMRIGHT || result == HTBOTTOMLEFT)
- if (DBGetContactSettingByte(NULL, "CLUI", "AutoSize", 0))
+ if (db_get_b(NULL, "CLUI", "AutoSize", 0))
return HTCLIENT;
return result;
}
@@ -673,7 +673,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (transparentFocus)
setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) cluiopt.alpha, LWA_ALPHA);
else
- setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) DBGetContactSettingByte(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
+ setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
}
if ( !transparentFocus)
KillTimer(hwnd, TM_AUTOALPHA);
@@ -687,7 +687,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
if (noRecurse)
break;
- if ( !DBGetContactSettingByte(NULL, "CLUI", "FadeInOut", 0) || !IsWinVer2000Plus())
+ if ( !db_get_b(NULL, "CLUI", "FadeInOut", 0) || !IsWinVer2000Plus())
break;
if (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_LAYERED) {
DWORD thisTick, startTick;
@@ -739,12 +739,12 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case SC_MINIMIZE:
case SC_CLOSE:
if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) ||
- DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT))
+ db_get_b(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT))
{
ShowWindow(hwnd, SW_HIDE);
DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_HIDDEN);
- if (MySetProcessWorkingSetSize != NULL && DBGetContactSettingByte(NULL, "CList", "DisableWorkingSet", 1))
+ if (MySetProcessWorkingSetSize != NULL && db_get_b(NULL, "CList", "DisableWorkingSet", 1))
MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
return 0;
@@ -872,11 +872,11 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM RECT rcWindow, rcTree, rcWorkArea;
int maxHeight, newHeight;
- if ( !DBGetContactSettingByte(NULL, "CLUI", "AutoSize", 0))
+ if ( !db_get_b(NULL, "CLUI", "AutoSize", 0))
break;
if (CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0))
break;
- maxHeight = DBGetContactSettingByte(NULL, "CLUI", "MaxSizeHeight", 75);
+ maxHeight = db_get_b(NULL, "CLUI", "MaxSizeHeight", 75);
GetWindowRect(hwnd, &rcWindow);
GetWindowRect(cli.hwndContactTree, &rcTree);
@@ -893,7 +893,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM newHeight = max(nmc->pt.y, 9) + 1 + (rcWindow.bottom - rcWindow.top) - (rcTree.bottom - rcTree.top);
if (newHeight > (rcWorkArea.bottom - rcWorkArea.top) * maxHeight / 100)
newHeight = (rcWorkArea.bottom - rcWorkArea.top) * maxHeight / 100;
- if (DBGetContactSettingByte(NULL, "CLUI", "AutoSizeUpward", 0)) {
+ if (db_get_b(NULL, "CLUI", "AutoSizeUpward", 0)) {
rcWindow.top = rcWindow.bottom - newHeight;
if (rcWindow.top < rcWorkArea.top)
rcWindow.top = rcWorkArea.top;
@@ -916,7 +916,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
if ((hitFlags & (CLCHT_NOWHERE | CLCHT_INLEFTMARGIN | CLCHT_BELOWITEMS)) == 0)
break;
- if (DBGetContactSettingByte(NULL, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)) {
+ if (db_get_b(NULL, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)) {
POINT pt;
pt = nm->pt;
ClientToScreen(cli.hwndContactTree, &pt);
@@ -1002,7 +1002,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM hMenu = GetSubMenu(LoadMenu(cli.hInst, MAKEINTRESOURCE(IDR_CONTEXT)), 1);
TranslateMenu(hMenu);
CheckMenuItem(hMenu, POPUP_HIDEOFFLINE,
- DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? MF_CHECKED : MF_UNCHECKED);
+ db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hMenu, POPUP_HIDEOFFLINEROOT, SendMessage(cli.hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(hMenu, POPUP_HIDEEMPTYGROUPS,
GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS ? MF_CHECKED : MF_UNCHECKED);
@@ -1014,7 +1014,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM GetWindowRect(cli.hwndStatus, &rc);
if (PtInRect(&rc, pt)) {
HMENU hMenu;
- if (DBGetContactSettingByte(NULL, "CLUI", "SBarRightClk", 0))
+ if (db_get_b(NULL, "CLUI", "SBarRightClk", 0))
hMenu = (HMENU) CallService(MS_CLIST_MENUGETMAIN, 0, 0);
else
hMenu = (HMENU) CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
@@ -1038,7 +1038,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (szProto == NULL) return 0;
int status, x;
SIZE textSize;
- BYTE showOpts = DBGetContactSettingByte(NULL, "CLUI", "SBarShow", 1);
+ BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1);
status = CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0);
SetBkMode(dis->hDC, TRANSPARENT);
x = dis->rcItem.left;
@@ -1102,11 +1102,11 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM GetWindowRect(hwnd, &rc);
if ( !CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) { //if docked, dont remember pos (except for width)
- DBWriteContactSettingDword(NULL, "CList", "Height", (DWORD) (rc.bottom - rc.top));
- DBWriteContactSettingDword(NULL, "CList", "x", (DWORD) rc.left);
- DBWriteContactSettingDword(NULL, "CList", "y", (DWORD) rc.top);
+ db_set_dw(NULL, "CList", "Height", (DWORD) (rc.bottom - rc.top));
+ db_set_dw(NULL, "CList", "x", (DWORD) rc.left);
+ db_set_dw(NULL, "CList", "y", (DWORD) rc.top);
}
- DBWriteContactSettingDword(NULL, "CList", "Width", (DWORD) (rc.right - rc.left));
+ db_set_dw(NULL, "CList", "Width", (DWORD) (rc.right - rc.left));
}
RemoveMenu(cli.hMenuMain, 0, MF_BYPOSITION);
diff --git a/src/modules/clist/cluiservices.cpp b/src/modules/clist/cluiservices.cpp index ea3c153d36..6054f55bee 100644 --- a/src/modules/clist/cluiservices.cpp +++ b/src/modules/clist/cluiservices.cpp @@ -91,22 +91,22 @@ static INT_PTR ListEndRebuild(WPARAM, LPARAM) {
int rebuild = 0;
//CLC does this automatically, but we need to force it if hideoffline or hideempty has changed
- if ((DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) == 0) != ((GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_HIDEOFFLINE) == 0)) {
- if (DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT))
+ if ((db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) == 0) != ((GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_HIDEOFFLINE) == 0)) {
+ if (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT))
SetWindowLongPtr(cli.hwndContactTree, GWL_STYLE, GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) | CLS_HIDEOFFLINE);
else
SetWindowLongPtr(cli.hwndContactTree, GWL_STYLE, GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & ~CLS_HIDEOFFLINE);
rebuild = 1;
}
- if ((DBGetContactSettingByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) == 0) != ((GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) == 0)) {
- if (DBGetContactSettingByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT))
+ if ((db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) == 0) != ((GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) == 0)) {
+ if (db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT))
SetWindowLongPtr(cli.hwndContactTree, GWL_STYLE, GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) | CLS_HIDEEMPTYGROUPS);
else
SetWindowLongPtr(cli.hwndContactTree, GWL_STYLE, GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & ~CLS_HIDEEMPTYGROUPS);
rebuild = 1;
}
- if ((DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) == 0) != ((GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_USEGROUPS) == 0)) {
- if (DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT))
+ if ((db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) == 0) != ((GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_USEGROUPS) == 0)) {
+ if (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT))
SetWindowLongPtr(cli.hwndContactTree, GWL_STYLE, GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) | CLS_USEGROUPS);
else
SetWindowLongPtr(cli.hwndContactTree, GWL_STYLE, GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & ~CLS_USEGROUPS);
@@ -166,17 +166,17 @@ void fnCluiProtocolStatusChanged(int, const char*) SendMessage(cli.hwndStatus, SB_GETBORDERS, 0, (LPARAM)&borders);
partWidths = (int*)alloca(cli.menuProtoCount * sizeof(int));
- if (DBGetContactSettingByte(NULL, "CLUI", "EqualSections", 0)) {
+ if (db_get_b(NULL, "CLUI", "EqualSections", 0)) {
RECT rc;
GetClientRect(cli.hwndStatus, &rc);
- rc.right -= borders[0] * 2 + (DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) ? GetSystemMetrics(SM_CXVSCROLL) : 0);
+ rc.right -= borders[0] * 2 + (db_get_b(NULL, "CLUI", "ShowGrip", 1) ? GetSystemMetrics(SM_CXVSCROLL) : 0);
for (i=0; i < cli.menuProtoCount; i++)
partWidths[ i ] = (i+1) * rc.right / cli.menuProtoCount - (borders[2] >> 1);
}
else {
HDC hdc;
SIZE textSize;
- BYTE showOpts = DBGetContactSettingByte(NULL, "CLUI", "SBarShow", 1);
+ BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1);
hdc = GetDC(NULL);
SelectObject(hdc, (HFONT) SendMessage(cli.hwndStatus, WM_GETFONT, 0, 0));
@@ -213,7 +213,7 @@ void fnCluiProtocolStatusChanged(int, const char*) SendMessage(cli.hwndStatus, SB_SETMINHEIGHT, g_IconHeight, 0);
SendMessage(cli.hwndStatus, SB_SETPARTS, cli.menuProtoCount, (LPARAM)partWidths);
flags = SBT_OWNERDRAW;
- if (DBGetContactSettingByte(NULL, "CLUI", "SBarBevel", 1) == 0)
+ if (db_get_b(NULL, "CLUI", "SBarBevel", 1) == 0)
flags |= SBT_NOBORDERS;
for (i=0; i < cli.menuProtoCount; i++) {
SendMessage(cli.hwndStatus, SB_SETTEXT, i | flags, (LPARAM)cli.menuProtos[i].szProto);
diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp index a523c3b262..932efb03fc 100644 --- a/src/modules/clist/contact.cpp +++ b/src/modules/clist/contact.cpp @@ -78,16 +78,16 @@ void fnLoadContactTree(void) CallService(MS_CLUI_GROUPADDED, i, 0);
}
- hideOffline = DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
+ hideOffline = db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while (hContact != NULL) {
status = GetContactStatus(hContact);
- if (( !hideOffline || status != ID_STATUS_OFFLINE) && !DBGetContactSettingByte(hContact, "CList", "Hidden", 0))
+ if (( !hideOffline || status != ID_STATUS_OFFLINE) && !db_get_b(hContact, "CList", "Hidden", 0))
cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode((char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0), status, hContact), 1);
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
}
- sortByStatus = DBGetContactSettingByte(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
- sortByProto = DBGetContactSettingByte(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
+ sortByStatus = db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
+ sortByProto = db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
CallService(MS_CLUI_SORTLIST, 0, 0);
CallService(MS_CLUI_LISTENDREBUILD, 0, 0);
}
@@ -148,8 +148,8 @@ static VOID CALLBACK SortContactsTimer(HWND, UINT, UINT_PTR, DWORD) void fnSortContacts(void)
{
//avoid doing lots of resorts in quick succession
- sortByStatus = DBGetContactSettingByte(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
- sortByProto = DBGetContactSettingByte(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
+ sortByStatus = db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
+ sortByProto = db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
if (resortTimerId)
KillTimer(NULL, resortTimerId);
// setting this to a higher delay causes shutdown waits.
@@ -185,7 +185,7 @@ int fnSetHideOffline(WPARAM wParam, LPARAM) break;
case -1:
DBWriteContactSettingByte(NULL, "CList", "HideOffline",
- (BYTE) ! DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
+ (BYTE) ! db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
break;
}
cli.pfnLoadContactTree();
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index 1a42b7af57..e68463c781 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -236,7 +236,7 @@ INT_PTR MO_GetProtoRootMenu(WPARAM wParam, LPARAM lParam) if (szProto == NULL)
return 0;
- if (DBGetContactSettingByte(NULL, "CList", "MoveProtoMenus", TRUE))
+ if (db_get_b(NULL, "CList", "MoveProtoMenus", TRUE))
return (INT_PTR)cli.pfnGetProtocolMenu(szProto);
int objidx = GetMenuObjbyId((int)hMainMenuObject);
@@ -912,11 +912,11 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para // check if it visible
mir_snprintf(DBString, SIZEOF(DBString), "%s_visible", menuItemName);
- if (DBGetContactSettingByte(NULL, MenuNameItems, DBString, -1) == -1)
+ if (db_get_b(NULL, MenuNameItems, DBString, -1) == -1)
DBWriteContactSettingByte(NULL, MenuNameItems, DBString, 1);
pmi->OverrideShow = TRUE;
- if ( !DBGetContactSettingByte(NULL, MenuNameItems, DBString, 1)) {
+ if ( !db_get_b(NULL, MenuNameItems, DBString, 1)) {
pmi->OverrideShow = FALSE;
continue; // find out what value to return if not getting added
}
@@ -930,8 +930,8 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para }
mir_snprintf(DBString, SIZEOF(DBString), "%s_pos", menuItemName);
- if ((pos = DBGetContactSettingDword(NULL, MenuNameItems, DBString, -1)) == -1) {
- DBWriteContactSettingDword(NULL, MenuNameItems, DBString, mi->position);
+ if ((pos = db_get_dw(NULL, MenuNameItems, DBString, -1)) == -1) {
+ db_set_dw(NULL, MenuNameItems, DBString, mi->position);
if (pmi->submenu.first)
mi->position = 0;
}
@@ -1180,7 +1180,7 @@ int InitGenMenu() CreateServiceFunction(MO_SETOPTIONSMENUOBJECT, SRVMO_SetOptionsMenuObject);
CreateServiceFunction(MO_SETOPTIONSMENUITEM, SRVMO_SetOptionsMenuItem);
- bIconsDisabled = DBGetContactSettingByte(NULL, "CList", "DisableMenuIcons", 0) != 0;
+ bIconsDisabled = db_get_b(NULL, "CList", "DisableMenuIcons", 0) != 0;
bIsGenMenuInited = true;
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index 9da91f314d..96d44ff50f 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -107,7 +107,7 @@ static int SaveTree(HWND hwndDlg) DBWriteContactSettingByte(NULL, MenuNameItems, DBString, iod->show);
mir_snprintf(DBString, SIZEOF(DBString), "%s_pos", menuItemName);
- DBWriteContactSettingDword(NULL, MenuNameItems, DBString, runtimepos);
+ db_set_dw(NULL, MenuNameItems, DBString, runtimepos);
mir_snprintf(DBString, SIZEOF(DBString), "%s_name", menuItemName);
if (lstrcmp(iod->name, iod->defname) != 0)
@@ -272,11 +272,11 @@ static int BuildTree(HWND hwndDlg, int MenuObjectId, BOOL bReread) PD->defname = mir_tstrdup(GetMenuItemText(p));
mir_snprintf(buf, SIZEOF(buf), "%s_visible", menuItemName);
- PD->show = DBGetContactSettingByte(NULL, MenuNameItems, buf, 1);
+ PD->show = db_get_b(NULL, MenuNameItems, buf, 1);
if (bReread) {
mir_snprintf(buf, SIZEOF(buf), "%s_pos", menuItemName);
- PD->pos = DBGetContactSettingDword(NULL, MenuNameItems, buf, 1);
+ PD->pos = db_get_dw(NULL, MenuNameItems, buf, 1);
}
else PD->pos = (PD->pimi) ? PD->pimi->originalPosition : 0;
@@ -432,7 +432,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA dat = (struct OrderData*)mir_alloc(sizeof(struct OrderData));
SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_USERDATA, (LONG_PTR)dat);
dat->dragging = 0;
- dat->iInitMenuValue = DBGetContactSettingByte(NULL, "CList", "MoveProtoMenus", TRUE);
+ dat->iInitMenuValue = db_get_b(NULL, "CList", "MoveProtoMenus", TRUE);
MyOldWindowProc = (WNDPROC)GetWindowLongPtr( GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_WNDPROC);
SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_WNDPROC, (LONG_PTR)&LBTNDOWNProc);
{
diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp index 740ed163a8..931a06d36e 100644 --- a/src/modules/clist/groups.cpp +++ b/src/modules/clist/groups.cpp @@ -164,7 +164,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) return 1;
lstrcpyn(name, dbv.ptszVal + 1, SIZEOF(name));
DBFreeVariant(&dbv);
- if (DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT))
+ if (db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT))
{
TCHAR szQuestion[256+100];
mir_sntprintf(szQuestion, SIZEOF(szQuestion), TranslateT("Are you sure you want to delete group '%s'? This operation can not be undone."), name);
diff --git a/src/modules/clist/keyboard.cpp b/src/modules/clist/keyboard.cpp index e580681e5c..95df7f4ae2 100644 --- a/src/modules/clist/keyboard.cpp +++ b/src/modules/clist/keyboard.cpp @@ -34,7 +34,7 @@ INT_PTR hkSearch(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv = {0};
if ( !DBGetContactSettingString(NULL, "CList", "SearchUrl", &dbv)) {
- CallService(MS_UTILS_OPENURL, DBGetContactSettingByte(NULL, "CList", "HKSearchNewWnd", 0), (LPARAM)dbv.pszVal);
+ CallService(MS_UTILS_OPENURL, db_get_b(NULL, "CList", "HKSearchNewWnd", 0), (LPARAM)dbv.pszVal);
DBFreeVariant(&dbv);
}
return 0;
|