diff options
45 files changed, 346 insertions, 381 deletions
diff --git a/plugins/Clist_mw/src/BkgrCfg.cpp b/plugins/Clist_mw/src/BkgrCfg.cpp index dba17a1ca4..33932c7e5f 100644 --- a/plugins/Clist_mw/src/BkgrCfg.cpp +++ b/plugins/Clist_mw/src/BkgrCfg.cpp @@ -69,17 +69,17 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->item[indx].selColor = DBGetContactSettingDword(NULL,module, "SelBkColour", DEFAULT_SELBKCOLOUR);
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(NULL,module,"BkBitmap",&dbv))
+ if ( !DBGetContactSettingString(NULL,module,"BkBitmap",&dbv))
{
int retval = CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)dat->item[indx].filename);
- if (!retval || retval == CALLSERVICE_NOTFOUND)
+ if ( !retval || retval == CALLSERVICE_NOTFOUND)
lstrcpynA(dat->item[indx].filename, dbv.pszVal, MAX_PATH);
mir_free(dbv.pszVal);
}
else
*dat->item[indx].filename = 0;
}
- dat->item[indx].flags = DBGetContactSettingWord(NULL,module,"BkBmpUse", DEFAULT_BKBMPUSE);
+ dat->item[indx].flags = db_get_w(NULL,module,"BkBmpUse", DEFAULT_BKBMPUSE);
jndx = SendMessageA(hList, CB_ADDSTRING, 0, (LPARAM)Translate(bkgrList[indx]));
SendMessage(hList, CB_SETITEMDATA, jndx, indx);
}
@@ -175,7 +175,7 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP ofn.nMaxFile = sizeof(str);
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = "bmp";
- if (!GetOpenFileNameA(&ofn)) break;
+ if ( !GetOpenFileNameA(&ofn)) break;
SetDlgItemTextA(hwndDlg, IDC_FILENAME, str);
}
else if (LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE)
@@ -216,7 +216,7 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (dat->item[indx].changed)
{
char *module = bkgrList[indx] + strlen(bkgrList[indx]) + 1;
- DBWriteContactSettingByte(NULL, module, "UseBitmap", (BYTE)dat->item[indx].useBitmap);
+ db_set_b(NULL, module, "UseBitmap", (BYTE)dat->item[indx].useBitmap);
{
COLORREF col;
@@ -235,10 +235,10 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP int retval = CallService(MS_UTILS_PATHTOABSOLUTE,
(WPARAM)dat->item[indx].filename,
(LPARAM)str);
- if (!retval || retval == CALLSERVICE_NOTFOUND)
- DBWriteContactSettingString(NULL, module, "BkBitmap", dat->item[indx].filename);
+ if ( !retval || retval == CALLSERVICE_NOTFOUND)
+ db_set_s(NULL, module, "BkBitmap", dat->item[indx].filename);
else
- DBWriteContactSettingString(NULL, module, "BkBitmap", str);
+ db_set_s(NULL, module, "BkBitmap", str);
}
DBWriteContactSettingWord(NULL, module, "BkBmpUse", dat->item[indx].flags);
dat->item[indx].changed = FALSE;
diff --git a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp index 2226988142..7c9381f7cc 100644 --- a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp @@ -492,9 +492,9 @@ int DBLoadFrameSettingsAtPos(int pos,int Frameid) Frames[Frameid].visible = db_get_b(0,CLUIFrameModule,AS(buf,"Visible",sadd),Frames[Frameid].visible);
Frames[Frameid].TitleBar.ShowTitleBar = db_get_b(0,CLUIFrameModule,AS(buf,"TBVisile",sadd),Frames[Frameid].TitleBar.ShowTitleBar);
- Frames[Frameid].height = DBGetContactSettingWord(0,CLUIFrameModule,AS(buf,"Height",sadd),Frames[Frameid].height);
- Frames[Frameid].HeightWhenCollapsed = DBGetContactSettingWord(0,CLUIFrameModule,AS(buf,"HeightCollapsed",sadd),0);
- Frames[Frameid].align = DBGetContactSettingWord(0,CLUIFrameModule,AS(buf,"Align",sadd),Frames[Frameid].align);
+ Frames[Frameid].height = db_get_w(0,CLUIFrameModule,AS(buf,"Height",sadd),Frames[Frameid].height);
+ Frames[Frameid].HeightWhenCollapsed = db_get_w(0,CLUIFrameModule,AS(buf,"HeightCollapsed",sadd),0);
+ Frames[Frameid].align = db_get_w(0,CLUIFrameModule,AS(buf,"Align",sadd),Frames[Frameid].align);
Frames[Frameid].FloatingPos.x = DBGetContactSettingRangedWord(0,CLUIFrameModule,AS(buf,"FloatX",sadd),100,0,1024);
Frames[Frameid].FloatingPos.y = DBGetContactSettingRangedWord(0,CLUIFrameModule,AS(buf,"FloatY",sadd),100,0,1024);
@@ -502,7 +502,7 @@ int DBLoadFrameSettingsAtPos(int pos,int Frameid) Frames[Frameid].FloatingSize.y = DBGetContactSettingRangedWord(0,CLUIFrameModule,AS(buf,"FloatH",sadd),100,0,1024);
Frames[Frameid].floating = db_get_b(0,CLUIFrameModule,AS(buf,"Floating",sadd),0);
- Frames[Frameid].order = DBGetContactSettingWord(0,CLUIFrameModule,AS(buf,"Order",sadd),0);
+ Frames[Frameid].order = db_get_w(0,CLUIFrameModule,AS(buf,"Order",sadd),0);
Frames[Frameid].UseBorder = db_get_b(0,CLUIFrameModule,AS(buf,"UseBorder",sadd),Frames[Frameid].UseBorder);
@@ -518,10 +518,10 @@ int DBStoreFrameSettingsAtPos(int pos,int Frameid) DBWriteContactSettingTString(0,CLUIFrameModule,AS(buf,"Name",sadd),Frames[Frameid].name);
//boolean
- DBWriteContactSettingByte(0,CLUIFrameModule,AS(buf,"Collapse",sadd),(BYTE)btoint(Frames[Frameid].collapsed));
- DBWriteContactSettingByte(0,CLUIFrameModule,AS(buf,"Locked",sadd),(BYTE)btoint(Frames[Frameid].Locked));
- DBWriteContactSettingByte(0,CLUIFrameModule,AS(buf,"Visible",sadd),(BYTE)btoint(Frames[Frameid].visible));
- DBWriteContactSettingByte(0,CLUIFrameModule,AS(buf,"TBVisile",sadd),(BYTE)btoint(Frames[Frameid].TitleBar.ShowTitleBar));
+ db_set_b(0,CLUIFrameModule,AS(buf,"Collapse",sadd),(BYTE)btoint(Frames[Frameid].collapsed));
+ db_set_b(0,CLUIFrameModule,AS(buf,"Locked",sadd),(BYTE)btoint(Frames[Frameid].Locked));
+ db_set_b(0,CLUIFrameModule,AS(buf,"Visible",sadd),(BYTE)btoint(Frames[Frameid].visible));
+ db_set_b(0,CLUIFrameModule,AS(buf,"TBVisile",sadd),(BYTE)btoint(Frames[Frameid].TitleBar.ShowTitleBar));
DBWriteContactSettingWord(0,CLUIFrameModule,AS(buf,"Height",sadd),(WORD)Frames[Frameid].height);
DBWriteContactSettingWord(0,CLUIFrameModule,AS(buf,"HeightCollapsed",sadd),(WORD)Frames[Frameid].HeightWhenCollapsed);
@@ -532,10 +532,10 @@ int DBStoreFrameSettingsAtPos(int pos,int Frameid) DBWriteContactSettingWord(0,CLUIFrameModule,AS(buf,"FloatW",sadd),(WORD)Frames[Frameid].FloatingSize.x);
DBWriteContactSettingWord(0,CLUIFrameModule,AS(buf,"FloatH",sadd),(WORD)Frames[Frameid].FloatingSize.y);
- DBWriteContactSettingByte(0,CLUIFrameModule,AS(buf,"Floating",sadd),(BYTE)btoint(Frames[Frameid].floating));
- DBWriteContactSettingByte(0,CLUIFrameModule,AS(buf,"UseBorder",sadd),(BYTE)btoint(Frames[Frameid].UseBorder));
+ db_set_b(0,CLUIFrameModule,AS(buf,"Floating",sadd),(BYTE)btoint(Frames[Frameid].floating));
+ db_set_b(0,CLUIFrameModule,AS(buf,"UseBorder",sadd),(BYTE)btoint(Frames[Frameid].UseBorder));
DBWriteContactSettingWord(0,CLUIFrameModule,AS(buf,"Order",sadd),(WORD)Frames[Frameid].order);
- //DBWriteContactSettingString(0,CLUIFrameModule,AS(buf,"TBName",sadd),Frames[Frameid].TitleBar.tbname);
+ //db_set_s(0,CLUIFrameModule,AS(buf,"TBName",sadd),Frames[Frameid].TitleBar.tbname);
return 0;
}
@@ -564,7 +564,7 @@ int CLUIFramesLoadFrameSettings(int Frameid) if (Frameid < 0 || Frameid >= nFramescount)
return -1;
- int maxstored = DBGetContactSettingWord(0,CLUIFrameModule,"StoredFrames",-1);
+ int maxstored = db_get_w(0,CLUIFrameModule,"StoredFrames",-1);
if (maxstored == -1)
return 0;
@@ -581,7 +581,7 @@ int CLUIFramesStoreFrameSettings(int Frameid) if (Frameid < 0 || Frameid >= nFramescount)
return -1;
- int maxstored = DBGetContactSettingWord(0,CLUIFrameModule,"StoredFrames",-1);
+ int maxstored = db_get_w(0,CLUIFrameModule,"StoredFrames",-1);
if (maxstored == -1) maxstored = 0;
int storpos = LocateStorePosition(Frameid,maxstored);
@@ -933,11 +933,11 @@ INT_PTR CLUIFramesGetFrameOptions(WPARAM wParam,LPARAM lParam) case FO_FLAGS:
retval = 0;
if (Frames[pos].visible) retval |= F_VISIBLE;
- if (!Frames[pos].collapsed) retval |= F_UNCOLLAPSED;
+ if ( !Frames[pos].collapsed) retval |= F_UNCOLLAPSED;
if (Frames[pos].Locked) retval |= F_LOCKED;
if (Frames[pos].TitleBar.ShowTitleBar) retval |= F_SHOWTB;
if (Frames[pos].TitleBar.ShowTitleBarTip) retval |= F_SHOWTBTIP;
- if (!(GetWindowLongPtr(Frames[pos].hWnd,GWL_STYLE)&WS_BORDER)) retval |= F_NOBORDER;
+ if ( !(GetWindowLongPtr(Frames[pos].hWnd,GWL_STYLE)&WS_BORDER)) retval |= F_NOBORDER;
break;
case FO_NAME:
@@ -1071,7 +1071,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam,LPARAM lParam) if (lParam<0) {ulockfrm(); return -1;}
retval = Frames[pos].height;
Frames[pos].height = lParam;
- if (!CLUIFramesFitInSize()) Frames[pos].height = retval;
+ if ( !CLUIFramesFitInSize()) Frames[pos].height = retval;
retval = Frames[pos].height;
ulockfrm();
@@ -1148,7 +1148,7 @@ INT_PTR CLUIFramesShowHideFrame(WPARAM wParam,LPARAM lParam) CLUIFrameResizeFloatingFrame(pos);
ulockfrm();
- if (!Frames[pos].floating)
+ if ( !Frames[pos].floating)
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
return 0;
}
@@ -1353,8 +1353,8 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam,LPARAM lParam) Frames[FrameId].collapsed = TRUE;
}
- if (!Frames[FrameId].floating) {
- if (!CLUIFramesFitInSize()) {
+ if ( !Frames[FrameId].floating) {
+ if ( !CLUIFramesFitInSize()) {
//cant collapse,we can resize only for height<alclient frame height
int alfrm = CLUIFramesGetalClientFrame();
@@ -1392,7 +1392,7 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam,LPARAM lParam) ulockfrm();
- if (!Frames[FrameId].floating)
+ if ( !Frames[FrameId].floating)
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
else {
//SetWindowPos(Frames[FrameId].hWnd,HWND_TOP,0,0,Frames[FrameId].wndSize.right-Frames[FrameId].wndSize.left,Frames[FrameId].height,SWP_SHOWWINDOW|SWP_NOMOVE);
@@ -1549,7 +1549,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam,LPARAM lParam) if (pcli->hwndContactList == 0) return -1;
if (FramesSysNotStarted) return -1;
if (clfrm->cbSize != sizeof(CLISTFrame)) return -1;
- if (!(TitleBarFont)) TitleBarFont = CLUILoadTitleBarFont();
+ if ( !(TitleBarFont)) TitleBarFont = CLUILoadTitleBarFont();
lockfrm();
if (nFramescount>=MAX_FRAMES) { ulockfrm(); return -1;}
@@ -1801,7 +1801,7 @@ int CLUIFramesResize(const RECT newsize) tbh = (TitleBarH+GapBetweenTitlebar)*btoint(Frames[clientfrm].TitleBar.ShowTitleBar);
for (i = 0; i < nFramescount; i++) {
- if (!Frames[i].floating) {
+ if ( !Frames[i].floating) {
Frames[i].needhide = FALSE;
Frames[i].wndSize.left = 0;
Frames[i].wndSize.right = newsize.right-0;
@@ -1991,12 +1991,12 @@ int OnFrameTitleBarBackgroundChange(WPARAM wParam,LPARAM lParam) if (hBmpBackground) {DeleteObject(hBmpBackground); hBmpBackground = NULL;}
if ( db_get_b(NULL,"FrameTitleBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if (!DBGetContactSetting(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
+ if ( !DBGetContactSetting(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
mir_free(dbv.pszVal);
}
}
- backgroundBmpUse = DBGetContactSettingWord(NULL,"FrameTitleBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
+ backgroundBmpUse = db_get_w(NULL,"FrameTitleBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
CLUIFramesOnClistResize(0,0);
return 0;
@@ -2119,7 +2119,7 @@ void DrawBackGroundTTB(HWND hwnd,HDC mhdc) DeleteDC(hdcMem);
paintst.fErase = FALSE;
//DeleteObject(hFont);
- if (!mhdc)
+ if ( !mhdc)
EndPaint(hwnd,&paintst);
}
@@ -2156,7 +2156,7 @@ static int DrawTitleBar(HDC dc,RECT rect,int Frameid) SelBkColour = DBGetContactSettingDword(NULL,"CLUIFrames","FramesTitleBarFontCol",0);
if (SelBkColour) SetTextColor(hdcMem,SelBkColour);
- if (!AlignCOLLIconToLeft) {
+ if ( !AlignCOLLIconToLeft) {
if (Frames[pos].TitleBar.hicon != NULL) {
//(TitleBarH>>1)-(GetSystemMetrics(SM_CXSMICON)>>1)
@@ -2169,7 +2169,7 @@ static int DrawTitleBar(HDC dc,RECT rect,int Frameid) else
TextOut(hdcMem,GetSystemMetrics(SM_CXSMICON)+2,0,Frames[pos].TitleBar.tbname,lstrlen(Frames[pos].TitleBar.tbname));
- if (!AlignCOLLIconToLeft)
+ if ( !AlignCOLLIconToLeft)
DrawIconEx(hdcMem,Frames[pos].TitleBar.wndSize.right-GetSystemMetrics(SM_CXSMICON)-2,((TitleBarH>>1)-(GetSystemMetrics(SM_CXSMICON)>>1)),Frames[pos].collapsed?LoadSkinnedIcon(SKINICON_OTHER_GROUPOPEN):LoadSkinnedIcon(SKINICON_OTHER_GROUPSHUT),GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
else
DrawIconEx(hdcMem,0,((TitleBarH>>1)-(GetSystemMetrics(SM_CXSMICON)>>1)),Frames[pos].collapsed?LoadSkinnedIcon(SKINICON_OTHER_GROUPOPEN):LoadSkinnedIcon(SKINICON_OTHER_GROUPSHUT),GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
@@ -2417,7 +2417,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA GetWindowRect(pcli->hwndContactList, &rcMiranda );
- if (!IntersectRect( &rcOverlap, &rcwnd, &rcMiranda )) {
+ if ( !IntersectRect( &rcOverlap, &rcwnd, &rcMiranda )) {
ulockfrm();
GetCursorPos(&curpt);
GetWindowRect( Frames[pos].hWnd, &rcwnd );
@@ -2543,7 +2543,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA if (newh > 0) {
prevold = Frames[Framemod].height;
Frames[Framemod].height = newh;
- if (!CLUIFramesFitInSize()) {
+ if ( !CLUIFramesFitInSize()) {
Frames[Framemod].height = prevold;
ulockfrm();
return TRUE;
@@ -2593,7 +2593,7 @@ int CLUIFrameResizeFloatingFrame(int framepos) int width,height;
RECT rect;
- if (!Frames[framepos].floating){return 0;}
+ if ( !Frames[framepos].floating){return 0;}
if (Frames[framepos].ContainerWnd == 0){return 0;}
GetClientRect(Frames[framepos].ContainerWnd,&rect);
@@ -2650,7 +2650,7 @@ LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wParam, L lockfrm();
framepos = id2pos(Frameid);
if (framepos<0||framepos>=nFramescount){ulockfrm();break;}
- if (!Frames[framepos].minmaxenabled){ulockfrm();break;}
+ if ( !Frames[framepos].minmaxenabled){ulockfrm();break;}
if (Frames[framepos].ContainerWnd == 0){ulockfrm();break;}
if (Frames[framepos].Locked) {
@@ -2777,7 +2777,7 @@ INT_PTR CLUIFrameSetFloat(WPARAM wParam,LPARAM lParam) GetWindowRect(frame->hWnd,&rectw);
GetWindowRect(frame->TitleBar.hwnd,&recttb);
- if (!frame->TitleBar.ShowTitleBar)
+ if ( !frame->TitleBar.ShowTitleBar)
recttb.top = recttb.bottom = recttb.left = recttb.right = 0;
frame->ContainerWnd = CreateContainerWindow(pcli->hwndContactList,frame->FloatingPos.x,frame->FloatingPos.y,10,10);
diff --git a/plugins/Clist_mw/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_mw/src/CLUIFrames/framesmenu.cpp index d3c0480cd1..f850143c20 100644 --- a/plugins/Clist_mw/src/CLUIFrames/framesmenu.cpp +++ b/plugins/Clist_mw/src/CLUIFrames/framesmenu.cpp @@ -180,7 +180,7 @@ int InitFramesMenus(void) {
TMenuParam tmp;
- if (!ServiceExists(MO_REMOVEMENUOBJECT))
+ if ( !ServiceExists(MO_REMOVEMENUOBJECT))
{
InitCustomMenus();
diff --git a/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp b/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp index c8c62c1bd4..2c88c43175 100644 --- a/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp +++ b/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp @@ -42,7 +42,7 @@ int OnStatusBarBackgroundChange() }
}
- backgroundBmpUse = DBGetContactSettingWord(NULL,"StatusBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
+ backgroundBmpUse = db_get_w(NULL,"StatusBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
extraspace = DBGetContactSettingDword(NULL,"StatusBar","BkExtraSpace",0);
RecreateStatusBar(pcli->hwndContactList);
@@ -106,7 +106,7 @@ void DrawDataForStatusBar(LPDRAWITEMSTRUCT dis) if (showOpts & 4) {
TCHAR *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
- if (!szStatus)
+ if ( !szStatus)
szStatus = _T("");
GetTextExtentPoint32(dis->hDC,szStatus,lstrlen(szStatus),&textSize);
TextOut(dis->hDC,x,(dis->rcItem.top+dis->rcItem.bottom-textSize.cy)>>1,szStatus,lstrlen(szStatus));
@@ -262,7 +262,7 @@ void DrawBackGround(HWND hwnd,HDC mhdc) DeleteObject(hBmpOsb);
DeleteDC(hdcMem);
paintst.fErase = FALSE;
- if (!mhdc)
+ if ( !mhdc)
EndPaint(hwnd,&paintst);
}
@@ -309,7 +309,7 @@ LRESULT CALLBACK StatusHelperProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa case WM_SHOWWINDOW:
if (hFrameHelperStatusBar) {
int res = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),0);
- DBWriteContactSettingByte(0, "CLUI", "ShowSBar", (res & F_VISIBLE) != 0);
+ db_set_b(0, "CLUI", "ShowSBar", (res & F_VISIBLE) != 0);
}
if (tooltipshoing){
@@ -345,7 +345,7 @@ LRESULT CALLBACK StatusHelperProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa return 0;
NotifyEventHooks(hStatusBarShowToolTipEvent,(WPARAM)PD->RealName,0);
- SetTimer(hwnd,TM_STATUSBARHIDE,DBGetContactSettingWord(NULL,"CLUIFrames","HideToolTipTime",5000),0);
+ SetTimer(hwnd,TM_STATUSBARHIDE,db_get_w(NULL,"CLUIFrames","HideToolTipTime",5000),0);
tooltipshoing = TRUE;
break;
}
@@ -368,7 +368,7 @@ LRESULT CALLBACK StatusHelperProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa tooltipshoing = FALSE;
}
KillTimer(hwnd,TM_STATUSBAR);
- SetTimer(hwnd,TM_STATUSBAR,DBGetContactSettingWord(NULL,"CLC","InfoTipHoverTime",750),0);
+ SetTimer(hwnd,TM_STATUSBAR,db_get_w(NULL,"CLC","InfoTipHoverTime",750),0);
}
return 0;
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp index 8735d1c2bd..dce9541b22 100644 --- a/plugins/Clist_mw/src/clc.cpp +++ b/plugins/Clist_mw/src/clc.cpp @@ -61,7 +61,7 @@ void StatusUpdaterThread(void*) if ( db_get_b(hContact,"CList","StatusMsgAuto",0)) {
for (i = 0; i<5; i++) {
if (hContact != NULL) {
- pClcCacheEntry pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry((HANDLE)hContact);
+ ClcCacheEntry *pdnce = (ClcCacheEntry *)pcli->pfnGetCacheEntry((HANDLE)hContact);
if (pdnce && !pdnce->protoNotExists && pdnce->szProto)
CallContactService(hContact, PSS_GETAWAYMSG, 0, 0);
@@ -102,7 +102,7 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) if ((HANDLE)wParam != NULL && !strcmp(cws->szModule,"CList")) {
if ( !strcmp( cws->szSetting, "noOffline" ))
pcli->pfnClcBroadcast( INTM_NAMEORDERCHANGED, wParam, lParam );
- else if (!strcmp(cws->szSetting,"StatusMsg"))
+ else if ( !strcmp(cws->szSetting,"StatusMsg"))
pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED, wParam, lParam );
}
return 0;
@@ -144,7 +144,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L int recalcScrollBar = 0,shouldShow;
HANDLE hSelItem = NULL;
struct ClcContact *selcontact = NULL;
- pClcCacheEntry cacheEntry = GetContactFullCacheEntry((HANDLE)wParam);
+ ClcCacheEntry *cacheEntry = GetContactFullCacheEntry((HANDLE)wParam);
WORD status;
int needsResort = 0;
@@ -159,7 +159,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L ClcContact *contact;
ClcGroup *group;
- if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) {
+ if ( !FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection>=0 && GetRowByIndex(dat,dat->selection,&selcontact,NULL) != -1)
hSelItem = pcli->pfnContactToHItem(selcontact);
@@ -180,7 +180,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (contact->iImage == (WORD)lParam) break;
if (sortByStatus) dat->needsResort = 1;
- if (!shouldShow && !(style&CLS_NOHIDEOFFLINE) && (style&CLS_HIDEOFFLINE || group->hideOffline)) {
+ if ( !shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
if (dat->selection>=0 && GetRowByIndex(dat,dat->selection,&selcontact,NULL) != -1)
hSelItem = pcli->pfnContactToHItem(selcontact);
RemoveItemFromGroup(hwnd,group,contact,0);
@@ -191,7 +191,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L int oldflags;
contact->iImage = (WORD)lParam;
oldflags = contact->flags;
- if (!pcli->pfnIsHiddenMode(dat,status)||cacheEntry->noHiddenOffline) contact->flags |= CONTACTF_ONLINE;
+ if ( !pcli->pfnIsHiddenMode(dat,status)||cacheEntry->noHiddenOffline) contact->flags |= CONTACTF_ONLINE;
else contact->flags &= ~CONTACTF_ONLINE;
if (oldflags != contact->flags)
dat->needsResort = 1;
@@ -212,14 +212,14 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L {
DBVARIANT dbv;
- if (!(dat->style & CLS_SHOWSTATUSMESSAGES))
+ if ( !(dat->style & CLS_SHOWSTATUSMESSAGES))
break;
ClcContact *contact;
ClcGroup *group;
if ( FindItem(hwnd,dat,(HANDLE)wParam,&contact,&group,NULL) && contact != NULL) {
contact->flags &= ~CONTACTF_STATUSMSG;
- if (!DBGetContactSettingTString((HANDLE)wParam, "CList", "StatusMsg", &dbv)) {
+ if ( !DBGetContactSettingTString((HANDLE)wParam, "CList", "StatusMsg", &dbv)) {
int j;
if (dbv.ptszVal == NULL||_tcslen(dbv.ptszVal) == 0) break;
lstrcpyn(contact->szStatusMsg, dbv.ptszVal, SIZEOF(contact->szStatusMsg));
@@ -254,7 +254,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L KillTimer(hwnd,TIMERID_SUBEXPAND);
if (hitcontact) {
if (hitcontact->SubExpanded) hitcontact->SubExpanded = 0; else hitcontact->SubExpanded = 1;
- DBWriteContactSettingByte(hitcontact->hContact,"CList","Expanded",hitcontact->SubExpanded);
+ db_set_b(hitcontact->hContact,"CList","Expanded",hitcontact->SubExpanded);
}
hitcontact = NULL;
dat->needsResort = 1;
diff --git a/plugins/Clist_mw/src/clcidents.cpp b/plugins/Clist_mw/src/clcidents.cpp index 8c254fef90..43a34f4e61 100644 --- a/plugins/Clist_mw/src/clcidents.cpp +++ b/plugins/Clist_mw/src/clcidents.cpp @@ -80,7 +80,7 @@ int GetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex) return -1;
}
-pClcCacheEntry GetCLCFullCacheEntry(struct ClcData *dat,HANDLE hContact)
+ClcCacheEntry *GetCLCFullCacheEntry(struct ClcData *dat,HANDLE hContact)
{
if (hContact == 0)
return NULL;
@@ -109,14 +109,14 @@ pClcCacheEntry GetCLCFullCacheEntry(struct ClcData *dat,HANDLE hContact) void ClearClcContactCache(struct ClcData *dat,HANDLE hContact)
{
- pClcCacheEntry cacheEntry;
+ ClcCacheEntry *cacheEntry;
if (hContact == INVALID_HANDLE_VALUE) {
int i,tick;
tick = GetTickCount();
for (i = 0;i<(dat->lCLCContactsCache.realCount);i++) {
- pClcCacheEntry pdnce = (pClcCacheEntry)dat->lCLCContactsCache.items[i];
+ ClcCacheEntry *pdnce = (ClcCacheEntry *)dat->lCLCContactsCache.items[i];
pdnce->ClcContact = NULL;
}
tick = GetTickCount()-tick;
@@ -135,7 +135,7 @@ void ClearClcContactCache(struct ClcData *dat,HANDLE hContact) void SetClcContactCacheItem(struct ClcData *dat,HANDLE hContact,void *contact)
{
- pClcCacheEntry cacheEntry;
+ ClcCacheEntry *cacheEntry;
if ( !IsHContactGroup(hContact) && !IsHContactInfo(hContact)) {
cacheEntry = GetCLCFullCacheEntry(dat,hContact);
if (cacheEntry != NULL)
@@ -153,7 +153,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont if (isVisible == NULL && hItem != NULL && subgroup == NULL && !IsHContactGroup(hItem) && !IsHContactInfo(hItem)) {
//try use cache
- pClcCacheEntry cacheEntry;
+ ClcCacheEntry *cacheEntry;
cacheEntry = GetCLCFullCacheEntry(dat,hItem);
if (cacheEntry != NULL) {
if (cacheEntry->ClcContact == NULL) {
@@ -185,7 +185,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont nowVisible = 1;
for (tgroup = group;tgroup;tgroup = tgroup->parent)
- if (!group->expanded) {
+ if ( !group->expanded) {
nowVisible = 0;
break;
}
@@ -198,7 +198,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont (IsHContactContact(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->hContact == hItem) ||
(IsHContactInfo(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->hContact == (HANDLE)((UINT_PTR)hItem&~HCONTACT_ISINFO))) {
if (isVisible) {
- if (!nowVisible) *isVisible = 0;
+ if ( !nowVisible) *isVisible = 0;
else {
if ((index+1)*dat->rowHeight<dat->yScroll) *isVisible = 0;
else {
@@ -242,7 +242,7 @@ ClcGroup *CacheIndex[CacheArrSize] = {NULL}; boolean CacheIndexClear = TRUE;
void ClearRowByIndexCache()
{
- if (!CacheIndexClear) {
+ if ( !CacheIndexClear) {
memset(CacheIndex,0,sizeof(CacheIndex));
CacheIndexClear = TRUE;
}
diff --git a/plugins/Clist_mw/src/clcitems.cpp b/plugins/Clist_mw/src/clcitems.cpp index 5935022209..bea0430653 100644 --- a/plugins/Clist_mw/src/clcitems.cpp +++ b/plugins/Clist_mw/src/clcitems.cpp @@ -41,7 +41,7 @@ void AddSubcontacts(struct ClcContact * cont) {
int subcount,i,j;
HANDLE hsub;
- pClcCacheEntry cacheEntry;
+ ClcCacheEntry *cacheEntry;
cacheEntry = GetContactFullCacheEntry(cont->hContact);
OutputDebugStringA("Proceed AddSubcontacts\r\n");
subcount = (int)CallService(MS_MC_GETNUMCONTACTS,(WPARAM)cont->hContact,0);
@@ -50,11 +50,10 @@ void AddSubcontacts(struct ClcContact * cont) cont->subcontacts = (struct ClcContact *) mir_realloc(cont->subcontacts, sizeof(struct ClcContact)*subcount);
cont->SubAllocated = subcount;
i = 0;
- for (j = 0; j<subcount; j++)
- {
+ for (j = 0; j<subcount; j++) {
hsub = (HANDLE)CallService(MS_MC_GETSUBCONTACT,(WPARAM)cont->hContact,j);
cacheEntry = GetContactFullCacheEntry(hsub);
- if (!( db_get_b(NULL,"CLC","MetaHideOfflineSub",1) && db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT))||
+ if ( !(db_get_b(NULL,"CLC","MetaHideOfflineSub",1) && db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) ||
cacheEntry->status != ID_STATUS_OFFLINE )
{
cont->subcontacts[i].hContact = cacheEntry->hContact;
@@ -69,7 +68,8 @@ void AddSubcontacts(struct ClcContact * cont) }
}
cont->SubAllocated = i;
- if (!i) mir_free(cont->subcontacts);
+ if (i == 0)
+ mir_free(cont->subcontacts);
}
void FreeContact(struct ClcContact *p)
@@ -89,11 +89,9 @@ int AddItemToGroup(ClcGroup *group,int iAboveItem) ClcGroup *AddGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers)
{
- ClcGroup* result;
-
ClearRowByIndexCache();
dat->needsResort = 1;
- result = saveAddGroup( hwnd, dat, szName, flags, groupId, calcTotalMembers);
+ ClcGroup *result = saveAddGroup( hwnd, dat, szName, flags, groupId, calcTotalMembers);
ClearRowByIndexCache();
return result;
}
@@ -111,7 +109,7 @@ int AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText) return i;
}
-static struct ClcContact * AddContactToGroup(struct ClcData *dat,ClcGroup *group,pClcCacheEntry cacheEntry)
+static struct ClcContact * AddContactToGroup(struct ClcData *dat,ClcGroup *group,ClcCacheEntry *cacheEntry)
{
char *szProto;
WORD apparentMode;
@@ -168,7 +166,7 @@ static struct ClcContact * AddContactToGroup(struct ClcData *dat,ClcGroup *group group->cl.items[i]->proto = szProto;
if (dat->style & CLS_SHOWSTATUSMESSAGES) {
- if (!DBGetContactSettingTString(hContact, "CList", "StatusMsg", &dbv)) {
+ if ( !DBGetContactSettingTString(hContact, "CList", "StatusMsg", &dbv)) {
int j;
lstrcpyn(group->cl.items[i]->szStatusMsg, dbv.ptszVal, SIZEOF(group->cl.items[i]->szStatusMsg));
for (j = (int)_tcslen(group->cl.items[i]->szStatusMsg)-1;j>=0;j--) {
@@ -192,7 +190,7 @@ void AddContactToTree(HWND hwnd, ClcData *dat, HANDLE hContact, int updateTotalC if ( FindItem(hwnd,dat,hContact,NULL,NULL,NULL) == 1)
return;
- pClcCacheEntry cacheEntry = GetContactFullCacheEntry(hContact);
+ ClcCacheEntry *cacheEntry = GetContactFullCacheEntry(hContact);
if (cacheEntry == NULL)
return;
@@ -236,10 +234,10 @@ void AddContactToTree(HWND hwnd, ClcData *dat, HANDLE hContact, int updateTotalC TCHAR *szGroupName = pcli->pfnGetGroupName(i, &groupFlags);
if (szGroupName == NULL)
return; //never happens
- if (!lstrcmp(szGroupName,cacheEntry->tszGroup))
+ if ( !lstrcmp(szGroupName,cacheEntry->tszGroup))
break;
size_t len = lstrlen(szGroupName);
- if (!_tcsncmp(szGroupName,cacheEntry->tszGroup,len) && cacheEntry->tszGroup[len] == '\\')
+ if ( !_tcsncmp(szGroupName,cacheEntry->tszGroup,len) && cacheEntry->tszGroup[len] == '\\')
AddGroup(hwnd,dat,szGroupName,groupFlags,i,1);
}
group = AddGroup(hwnd,dat,cacheEntry->tszGroup,groupFlags,i,1);
@@ -247,7 +245,7 @@ void AddContactToTree(HWND hwnd, ClcData *dat, HANDLE hContact, int updateTotalC }
if (checkHideOffline) {
- if (pcli->pfnIsHiddenMode(dat,status) && (style&CLS_HIDEOFFLINE || group->hideOffline)) {
+ if (pcli->pfnIsHiddenMode(dat,status) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
if (updateTotalCount) group->totalMembers++;
return;
}
@@ -288,10 +286,10 @@ void DeleteItemFromTree(HWND hwnd,HANDLE hItem) ClearRowByIndexCache();
dat->needsResort = 1;
- if (!FindItem(hwnd,dat,hItem,&contact,&group,NULL)) {
+ if ( !FindItem(hwnd,dat,hItem,&contact,&group,NULL)) {
DBVARIANT dbv;
int i,nameOffset;
- if (!IsHContactContact(hItem)) return;
+ if ( !IsHContactContact(hItem)) return;
ClearClcContactCache(dat,hItem);
if (DBGetContactSettingTString(hItem,"CList","Group",&dbv)) return;
@@ -305,7 +303,7 @@ void DeleteItemFromTree(HWND hwnd,HANDLE hItem) if (group->cl.items[i]->type == CLCIT_GROUP) {
int len = lstrlen(group->cl.items[i]->szText);
- if (!_tcsncmp(group->cl.items[i]->szText,dbv.ptszVal+nameOffset,len) && (dbv.ptszVal[nameOffset+len] == '\\' || dbv.pszVal[nameOffset+len] == '\0')) {
+ if ( !_tcsncmp(group->cl.items[i]->szText,dbv.ptszVal+nameOffset,len) && (dbv.ptszVal[nameOffset+len] == '\\' || dbv.pszVal[nameOffset+len] == '\0')) {
group->totalMembers--;
if (dbv.pszVal[nameOffset+len] == '\0')
break;
@@ -357,7 +355,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat) hContact = db_find_first();
while(hContact) {
- pClcCacheEntry cacheEntry;
+ ClcCacheEntry *cacheEntry;
cont = NULL;
cacheEntry = GetContactFullCacheEntry(hContact);
//cacheEntry->ClcContact = NULL;
@@ -375,15 +373,13 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat) if (group != NULL) {
group->totalMembers++;
- if (!(style&CLS_NOHIDEOFFLINE) && (style&CLS_HIDEOFFLINE || group->hideOffline)) {
- //szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ if ( !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
if (cacheEntry->szProto == NULL) {
- if (!pcli->pfnIsHiddenMode(dat,ID_STATUS_OFFLINE)||cacheEntry->noHiddenOffline)
+ if ( !pcli->pfnIsHiddenMode(dat,ID_STATUS_OFFLINE)||cacheEntry->noHiddenOffline)
cont = AddContactToGroup(dat,group,cacheEntry);
}
- else
- if (!pcli->pfnIsHiddenMode(dat,cacheEntry->status)||cacheEntry->noHiddenOffline)
- cont = AddContactToGroup(dat,group,cacheEntry);
+ else if ( !pcli->pfnIsHiddenMode(dat,cacheEntry->status)||cacheEntry->noHiddenOffline)
+ cont = AddContactToGroup(dat,group,cacheEntry);
}
else cont = AddContactToGroup(dat,group,cacheEntry);
}
@@ -455,7 +451,7 @@ int GetNewSelection(ClcGroup *group, int selection, int direction) if ((group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) && (group->cl.items[group->scanIndex]->flags & CONTACTF_STATUSMSG)) {
count++;
}
- if (!direction) {
+ if ( !direction) {
if (count>selection) return lastcount;
}
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (group->cl.items[group->scanIndex]->group->expanded)) {
@@ -664,7 +660,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat) for (i = 0;i<savedInfoCount;i++) {
if (savedInfo[i].parentId == -1) group = &dat->list;
else {
- if (!FindItem(hwnd,dat,(HANDLE)(savedInfo[i].parentId|HCONTACT_ISGROUP),&contact,NULL,NULL)) continue;
+ if ( !FindItem(hwnd,dat,(HANDLE)(savedInfo[i].parentId|HCONTACT_ISGROUP),&contact,NULL,NULL)) continue;
group = contact->group;
}
j = AddInfoItemToGroup(group,savedInfo[i].contact.flags,_T(""));
diff --git a/plugins/Clist_mw/src/clcopts.cpp b/plugins/Clist_mw/src/clcopts.cpp index 6ef5e61634..981a03a27e 100644 --- a/plugins/Clist_mw/src/clcopts.cpp +++ b/plugins/Clist_mw/src/clcopts.cpp @@ -60,7 +60,7 @@ int ClcOptInit(WPARAM wParam,LPARAM lParam) odp.flags = ODPF_BOLDGROUPS;
Options_AddPage(wParam, &odp);
- if (!ServiceExists(MS_BACKGROUNDCONFIG_REGISTER)) {
+ if ( !ServiceExists(MS_BACKGROUNDCONFIG_REGISTER)) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLCBKG);
odp.pszTitle = LPGEN("List Background");
odp.pfnDlgProc = DlgProcClcBkgOpts;
@@ -73,7 +73,7 @@ int ClcOptInit(WPARAM wParam,LPARAM lParam) odp.pfnDlgProc = DlgProcClcMetaOpts;
Options_AddPage(wParam, &odp);
- if (!ServiceExists(MS_BACKGROUNDCONFIG_REGISTER)) {
+ if ( !ServiceExists(MS_BACKGROUNDCONFIG_REGISTER)) {
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLCBKG);
odp.pszTitle = LPGEN("StatusBar Background");
odp.pfnDlgProc = DlgProcStatusBarBkgOpts;
@@ -193,11 +193,11 @@ static INT_PTR CALLBACK DlgProcClcMetaOpts(HWND hwndDlg, UINT msg, WPARAM wParam switch (t->code)
{
case PSN_APPLY:
- DBWriteContactSettingByte(NULL,"CLC","Meta",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_META)); // by FYR
- DBWriteContactSettingByte(NULL,"CLC","MetaDoubleClick",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METADBLCLK)); // by FYR
- DBWriteContactSettingByte(NULL,"CLC","MetaHideExtra",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METASUBEXTRA)); // by FYR
- DBWriteContactSettingByte(NULL,"CLC","MetaIgnoreEmptyExtra",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METASUBEXTRA_IGN)); // by FYR
- DBWriteContactSettingByte(NULL,"CLC","MetaHideOfflineSub",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METASUB_HIDEOFFLINE)); // by FYR
+ db_set_b(NULL,"CLC","Meta",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_META)); // by FYR
+ db_set_b(NULL,"CLC","MetaDoubleClick",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METADBLCLK)); // by FYR
+ db_set_b(NULL,"CLC","MetaHideExtra",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METASUBEXTRA)); // by FYR
+ db_set_b(NULL,"CLC","MetaIgnoreEmptyExtra",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METASUBEXTRA_IGN)); // by FYR
+ db_set_b(NULL,"CLC","MetaHideOfflineSub",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METASUB_HIDEOFFLINE)); // by FYR
pcli->pfnClcOptionsChanged();
return TRUE;
}
@@ -223,7 +223,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam UDACCEL accel[2] = {{0,10},{2,50}};
SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETRANGE,0,MAKELONG(999,0));
SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETACCEL,SIZEOF(accel), (LPARAM)&accel );
- SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingWord(NULL,"CLC","ScrollTime",CLCDEFAULT_SCROLLTIME),0));
+ SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,"CLC","ScrollTime",CLCDEFAULT_SCROLLTIME),0));
}
CheckDlgButton(hwndDlg,IDC_IDLE,db_get_b(NULL,"CLC","ShowIdle",CLCDEFAULT_SHOWIDLE)?BST_CHECKED:BST_UNCHECKED);
@@ -292,12 +292,12 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam else
DBWriteContactSettingDword(NULL,"CLC","GreyoutFlags",0);
- DBWriteContactSettingByte(NULL,"CLC","ShowIdle",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_IDLE)?1:0));
+ db_set_b(NULL,"CLC","ShowIdle",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_IDLE)?1:0));
DBWriteContactSettingDword(NULL,"CLC","OfflineModes",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS)));
- DBWriteContactSettingByte(NULL,"CLC","LeftMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_GETPOS,0,0));
+ db_set_b(NULL,"CLC","LeftMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_GETPOS,0,0));
DBWriteContactSettingWord(NULL,"CLC","ScrollTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_GETPOS,0,0));
- DBWriteContactSettingByte(NULL,"CLC","GroupIndent",(BYTE)SendDlgItemMessage(hwndDlg,IDC_GROUPINDENTSPIN,UDM_GETPOS,0,0));
- DBWriteContactSettingByte(NULL,"CLC","NoVScrollBar",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_NOSCROLLBAR)?1: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));
pcli->pfnClcOptionsChanged();
return TRUE;
@@ -325,7 +325,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"StatusBar","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
+ if ( !DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
char szPath[MAX_PATH];
@@ -337,7 +337,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w mir_free(dbv.pszVal);
}
- WORD bmpUse = DBGetContactSettingWord(NULL,"StatusBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
+ WORD bmpUse = db_get_w(NULL,"StatusBar","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);
@@ -382,7 +382,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w ofn.nMaxFile = SIZEOF(str);
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = "bmp";
- if (!GetOpenFileNameA(&ofn)) break;
+ if ( !GetOpenFileNameA(&ofn)) break;
SetDlgItemTextA(hwndDlg,IDC_FILENAME,str);
}
else if (LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE) break;
@@ -396,7 +396,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- DBWriteContactSettingByte(NULL,"StatusBar","UseBitmap",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BITMAP));
+ db_set_b(NULL,"StatusBar","UseBitmap",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BITMAP));
{
COLORREF col;
col = SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_GETCOLOUR,0,0);
@@ -410,10 +410,10 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w GetDlgItemTextA(hwndDlg,IDC_FILENAME,str,SIZEOF(str));
if (ServiceExists(MS_UTILS_PATHTORELATIVE)) {
if (CallService(MS_UTILS_PATHTORELATIVE, (WPARAM)str, (LPARAM)strrel))
- DBWriteContactSettingString(NULL,"StatusBar","BkBitmap",strrel);
- else DBWriteContactSettingString(NULL,"StatusBar","BkBitmap",str);
+ db_set_s(NULL,"StatusBar","BkBitmap",strrel);
+ else db_set_s(NULL,"StatusBar","BkBitmap",str);
}
- else DBWriteContactSettingString(NULL,"StatusBar","BkBitmap",str);
+ else db_set_s(NULL,"StatusBar","BkBitmap",str);
WORD flags = 0;
if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHH)) flags |= CLB_STRETCHH;
@@ -450,7 +450,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETDEFAULTCOLOUR,0,CLCDEFAULT_SELBKCOLOUR);
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLC","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
{ DBVARIANT dbv;
- if (!DBGetContactSettingString(NULL,"CLC","BkBitmap",&dbv)) {
+ if ( !DBGetContactSettingString(NULL,"CLC","BkBitmap",&dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
char szPath[MAX_PATH];
@@ -462,7 +462,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, }
}
- { WORD bmpUse = DBGetContactSettingWord(NULL,"CLC","BkBmpUse",CLCDEFAULT_BKBMPUSE);
+ { WORD bmpUse = db_get_w(NULL,"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);
@@ -505,7 +505,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, ofn.nMaxFile = SIZEOF(str);
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = "bmp";
- if (!GetOpenFileNameA(&ofn)) break;
+ if ( !GetOpenFileNameA(&ofn)) break;
SetDlgItemTextA(hwndDlg,IDC_FILENAME,str);
}
else if (LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE) break;
@@ -518,7 +518,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- DBWriteContactSettingByte(NULL,"CLC","UseBitmap",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BITMAP));
+ db_set_b(NULL,"CLC","UseBitmap",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BITMAP));
{ COLORREF col;
col = SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_GETCOLOUR,0,0);
if (col == CLCDEFAULT_BKCOLOUR) DBDeleteContactSetting(NULL,"CLC","BkColour");
@@ -532,10 +532,10 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, GetDlgItemTextA(hwndDlg,IDC_FILENAME,str,SIZEOF(str));
if (ServiceExists(MS_UTILS_PATHTORELATIVE)) {
if (CallService(MS_UTILS_PATHTORELATIVE, (WPARAM)str, (LPARAM)strrel))
- DBWriteContactSettingString(NULL,"CLC","BkBitmap",strrel);
- else DBWriteContactSettingString(NULL,"CLC","BkBitmap",str);
+ db_set_s(NULL,"CLC","BkBitmap",strrel);
+ else db_set_s(NULL,"CLC","BkBitmap",str);
}
- else DBWriteContactSettingString(NULL,"CLC","BkBitmap",str);
+ else db_set_s(NULL,"CLC","BkBitmap",str);
}
{ WORD flags = 0;
if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHH)) flags |= CLB_STRETCHH;
diff --git a/plugins/Clist_mw/src/clcpaint.cpp b/plugins/Clist_mw/src/clcpaint.cpp index ae5e78ec02..529c0420cc 100644 --- a/plugins/Clist_mw/src/clcpaint.cpp +++ b/plugins/Clist_mw/src/clcpaint.cpp @@ -127,9 +127,9 @@ static int GetRealStatus(struct ClcContact * contact, int status) {
int i;
char *szProto = contact->proto;
- if (!szProto) return status;
+ if ( !szProto) return status;
for (i = 0;i<pcli->hClcProtoCount;i++) {
- if (!lstrcmpA(pcli->clcProto[i].szProto,szProto)) {
+ if ( !lstrcmpA(pcli->clcProto[i].szProto,szProto)) {
return pcli->clcProto[i].dwStatus;
}
}
@@ -386,7 +386,7 @@ void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint) // THEME
if (IsWinVerXPPlus()) {
- if (!themeAPIHandle) {
+ if ( !themeAPIHandle) {
themeAPIHandle = GetModuleHandleA("uxtheme");
if (themeAPIHandle) {
MyOpenThemeData = (HANDLE (WINAPI *)(HWND,LPCWSTR))MGPROC("OpenThemeData");
@@ -534,7 +534,7 @@ void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint) }
}
- if (!Drawing->isSubcontact || ( db_get_b(NULL,"CLC","MetaHideExtra",0) == 0)) {
+ if ( !Drawing->isSubcontact || ( db_get_b(NULL,"CLC","MetaHideExtra",0) == 0)) {
//extra icons
if ( !(style & CLS_EX_MULTICOLUMNALIGNLEFT)) {
@@ -558,7 +558,7 @@ void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint) testrc.top = (y+((dat->rowHeight-16)>>1));
testrc.right = testrc.left+16;
testrc.bottom = testrc.top+16;
- if (!PtInRect(&testrc,pt))
+ if ( !PtInRect(&testrc,pt))
mode = ILD_NORMAL;
ImageList_DrawEx(dat->himlExtraColumns,Drawing->iExtraImage[iImage],hdcMem,clRect.right-dat->extraColumnSpacing*(dat->extraColumnsCount-c),y+((dat->rowHeight-16)>>1),0,0,CLR_NONE,colourFg,mode);
@@ -642,7 +642,7 @@ void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint) SelectObject(hdcMem,hoBrush);
DeleteObject(hBrush);
}
- if (!grey)
+ if ( !grey)
BitBlt(hdc,rcPaint->left,rcPaint->top,rcPaint->right-rcPaint->left,rcPaint->bottom-rcPaint->top,hdcMem,rcPaint->left,rcPaint->top,SRCCOPY);
//DeleteDC(hdcMem);
if (hBrushAlternateGrey) DeleteObject(hBrushAlternateGrey);
diff --git a/plugins/Clist_mw/src/clcutils.cpp b/plugins/Clist_mw/src/clcutils.cpp index 21188e3ddf..9a655f7c74 100644 --- a/plugins/Clist_mw/src/clcutils.cpp +++ b/plugins/Clist_mw/src/clcutils.cpp @@ -169,9 +169,9 @@ void ScrollTo(HWND hwnd,struct ClcData *dat,int desty,int noSmooth) if (desty>maxy) desty = maxy;
if (desty<0) desty = 0;
if (abs(desty-dat->yScroll)<4) noSmooth = 1;
- if (!noSmooth && dat->exStyle&CLS_EX_NOSMOOTHSCROLLING) noSmooth = 1;
+ if ( !noSmooth && dat->exStyle&CLS_EX_NOSMOOTHSCROLLING) noSmooth = 1;
previousy = dat->yScroll;
- if (!noSmooth) {
+ if ( !noSmooth) {
startTick = GetTickCount();
for (;;) {
nowTick = GetTickCount();
@@ -227,7 +227,7 @@ void RecalcScrollBar(HWND hwnd,struct ClcData *dat) sbar = (dat->noVScrollbar == 1||(int)si.nPage>si.nMax);
ShowScrollBar(hwnd,SB_VERT,sbar? FALSE : TRUE);
- if (!sbar) {
+ if ( !sbar) {
if ( GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_CONTACTLIST ) {
if ( dat->noVScrollbar == 0 ) SetScrollInfo(hwnd,SB_VERT,&si,TRUE);
else SetScrollInfo(hwnd,SB_VERT,&si,FALSE);
diff --git a/plugins/Clist_mw/src/clist.h b/plugins/Clist_mw/src/clist.h index 56efca3218..2736a08f44 100644 --- a/plugins/Clist_mw/src/clist.h +++ b/plugins/Clist_mw/src/clist.h @@ -48,8 +48,6 @@ struct ClcCacheEntry : public ClcCacheEntryBase boolean isUnknown;
};
-typedef ClcCacheEntry *pClcCacheEntry;
-
-pClcCacheEntry GetContactFullCacheEntry(HANDLE hContact);
+ClcCacheEntry* GetContactFullCacheEntry(HANDLE hContact);
#endif
\ No newline at end of file diff --git a/plugins/Clist_mw/src/clistmod.cpp b/plugins/Clist_mw/src/clistmod.cpp index c03e073457..edf5ca68cd 100644 --- a/plugins/Clist_mw/src/clistmod.cpp +++ b/plugins/Clist_mw/src/clistmod.cpp @@ -48,12 +48,12 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact) char AdvancedService[255] = {0};
int nActStatus = nStatus;
HANDLE hActContact = hContact;
- if (!db_get_b(NULL,"CLC","Meta",0) && !strcmp(szActProto,"MetaContacts")) {
+ if ( !db_get_b(NULL,"CLC","Meta",0) && !strcmp(szActProto,"MetaContacts")) {
// substitute params by mostonline contact datas
HANDLE hMostOnlineContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hActContact,0);
if (hMostOnlineContact && hMostOnlineContact != (HANDLE)CALLSERVICE_NOTFOUND) {
- pClcCacheEntry cacheEntry;
- cacheEntry = (pClcCacheEntry)pcli->pfnGetCacheEntry(hMostOnlineContact);
+ ClcCacheEntry *cacheEntry;
+ cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hMostOnlineContact);
if (cacheEntry && cacheEntry->szProto) {
szActProto = cacheEntry->szProto;
nActStatus = cacheEntry->status;
@@ -86,7 +86,7 @@ int ExtIconFromStatusMode(HANDLE hContact, const char *szProto,int status) hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(UINT)hContact,0);
if ( hContact != 0 ) {
szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(UINT)hContact,0);
- status = DBGetContactSettingWord(hContact,szProto,"Status",ID_STATUS_OFFLINE);
+ status = db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE);
}
}
}*/
@@ -101,7 +101,7 @@ static int ProtocolAck(WPARAM wParam,LPARAM lParam) ACKDATA *ack = (ACKDATA*)lParam;
if (ack->type == ACKTYPE_AWAYMSG && ack->lParam) {
DBVARIANT dbv;
- if (!DBGetContactSettingTString(ack->hContact, "CList", "StatusMsg", &dbv)) {
+ if ( !DBGetContactSettingTString(ack->hContact, "CList", "StatusMsg", &dbv)) {
if ( !_tcscmp(dbv.ptszVal, (TCHAR *)ack->lParam)) {
DBFreeVariant(&dbv);
return 0;
@@ -131,7 +131,7 @@ int LoadContactListModule(void) {
HANDLE hContact = db_find_first();
while (hContact != NULL) {
- DBWriteContactSettingString(hContact, "CList", "StatusMsg", "");
+ db_set_s(hContact, "CList", "StatusMsg", "");
hContact = db_find_next(hContact);
}
diff --git a/plugins/Clist_mw/src/clistopts.cpp b/plugins/Clist_mw/src/clistopts.cpp index 0ce16ec41b..2a927efc75 100644 --- a/plugins/Clist_mw/src/clistopts.cpp +++ b/plugins/Clist_mw/src/clistopts.cpp @@ -97,8 +97,8 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
{
DWORD caps = CallService(MS_CLUI_GETCAPS,CLUICAPS_FLAGS1,0);
- if (!(caps&CLUIF_HIDEEMPTYGROUPS)) ShowWindow(GetDlgItem(hwndDlg,IDC_HIDEEMPTYGROUPS),SW_HIDE);
- if (!(caps&CLUIF_DISABLEGROUPS)) ShowWindow(GetDlgItem(hwndDlg,IDC_DISABLEGROUPS),SW_HIDE);
+ if ( !(caps&CLUIF_HIDEEMPTYGROUPS)) ShowWindow(GetDlgItem(hwndDlg,IDC_HIDEEMPTYGROUPS),SW_HIDE);
+ if ( !(caps&CLUIF_DISABLEGROUPS)) ShowWindow(GetDlgItem(hwndDlg,IDC_DISABLEGROUPS),SW_HIDE);
if (caps&CLUIF_HASONTOPOPTION) ShowWindow(GetDlgItem(hwndDlg,IDC_ONTOP),SW_HIDE);
if (caps&CLUIF_HASAUTOHIDEOPTION) {
ShowWindow(GetDlgItem(hwndDlg,IDC_AUTOHIDE),SW_HIDE);
@@ -108,7 +108,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
}
SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETRANGE,0,MAKELONG(900,1));
- SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingWord(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),0));
+ SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),0));
CheckDlgButton(hwndDlg, IDC_ONECLK, db_get_b(NULL,"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);
CheckDlgButton(hwndDlg, IDC_ALWAYSMULTI, !db_get_b(NULL,"CList","AlwaysMulti",SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
@@ -133,7 +133,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(DBGetContactSettingWord(NULL,"CList","CycleTime",SETTING_CYCLETIME_DEFAULT),0));
+ SendDlgItemMessage(hwndDlg,IDC_CYCLETIMESPIN,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,"CList","CycleTime",SETTING_CYCLETIME_DEFAULT),0));
{ int i,count,item;
PROTOACCOUNT **accs;
DBVARIANT dbv = {DBVT_DELETED};
@@ -155,7 +155,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(DBGetContactSettingWord(NULL,"CList","IconFlashTime",550),0));
+ SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,"CList","IconFlashTime",550),0));
return TRUE;
case WM_VSCROLL:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -190,42 +190,42 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- DBWriteContactSettingByte(NULL,"CList","HideOffline",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEOFFLINE));
+ db_set_b(NULL,"CList","HideOffline",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEOFFLINE));
{
DWORD caps = CallService(MS_CLUI_GETCAPS,CLUICAPS_FLAGS1,0);
- if (caps & CLUIF_HIDEEMPTYGROUPS) DBWriteContactSettingByte(NULL,"CList","HideEmptyGroups",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEEMPTYGROUPS));
- if (caps & CLUIF_DISABLEGROUPS) DBWriteContactSettingByte(NULL,"CList","UseGroups",(BYTE)!IsDlgButtonChecked(hwndDlg,IDC_DISABLEGROUPS));
+ if (caps & CLUIF_HIDEEMPTYGROUPS) db_set_b(NULL,"CList","HideEmptyGroups",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEEMPTYGROUPS));
+ if (caps & CLUIF_DISABLEGROUPS) db_set_b(NULL,"CList","UseGroups",(BYTE)!IsDlgButtonChecked(hwndDlg,IDC_DISABLEGROUPS));
if ( !(caps & CLUIF_HASONTOPOPTION)) {
- DBWriteContactSettingByte(NULL,"CList","OnTop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONTOP));
+ db_set_b(NULL,"CList","OnTop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONTOP));
SetWindowPos(pcli->hwndContactList,IsDlgButtonChecked(hwndDlg,IDC_ONTOP)?HWND_TOPMOST:HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
if ( !(caps & CLUIF_HASAUTOHIDEOPTION)) {
- DBWriteContactSettingByte(NULL,"CList","AutoHide",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
+ db_set_b(NULL,"CList","AutoHide",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
DBWriteContactSettingWord(NULL,"CList","HideTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_GETPOS,0,0));
}
}
- DBWriteContactSettingByte(NULL,"CList","SortByStatus",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SORTBYSTATUS));
- DBWriteContactSettingByte(NULL,"CList","SortByProto",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SORTBYPROTO));
- DBWriteContactSettingByte(NULL,"CList","NoOfflineBottom",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_NOOFFLINEMOVE));
- DBWriteContactSettingByte(NULL,"CLC","RowHeight",(BYTE)SendDlgItemMessage(hwndDlg,IDC_ROWHEIGHTSPIN,UDM_GETPOS,0,0));
- DBWriteContactSettingByte(NULL,"CLC","GammaCorrect",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_GAMMACORRECT));
-
- DBWriteContactSettingByte(NULL,"CList","ConfirmDelete",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_CONFIRMDELETE));
- DBWriteContactSettingByte(NULL,"CList","Tray1Click",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONECLK));
- DBWriteContactSettingByte(NULL,"CList","AlwaysStatus",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ALWAYSSTATUS));
- DBWriteContactSettingByte(NULL,"CList","AlwaysMulti",(BYTE)!IsDlgButtonChecked(hwndDlg,IDC_ALWAYSMULTI));
- DBWriteContactSettingByte(NULL,"CList","TrayIcon",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_DONTCYCLE)?SETTING_TRAYICON_SINGLE:(IsDlgButtonChecked(hwndDlg,IDC_CYCLE)?SETTING_TRAYICON_CYCLE:SETTING_TRAYICON_MULTI)));
+ db_set_b(NULL,"CList","SortByStatus",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SORTBYSTATUS));
+ db_set_b(NULL,"CList","SortByProto",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SORTBYPROTO));
+ db_set_b(NULL,"CList","NoOfflineBottom",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_NOOFFLINEMOVE));
+ 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(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",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_DONTCYCLE)?SETTING_TRAYICON_SINGLE:(IsDlgButtonChecked(hwndDlg,IDC_CYCLE)?SETTING_TRAYICON_CYCLE:SETTING_TRAYICON_MULTI)));
DBWriteContactSettingWord(NULL,"CList","CycleTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_CYCLETIMESPIN,UDM_GETPOS,0,0));
DBWriteContactSettingWord(NULL,"CList","IconFlashTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_GETPOS,0,0));
- DBWriteContactSettingByte(NULL,"CList","DisableTrayFlash",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DISABLEBLINK));
- DBWriteContactSettingByte(NULL,"CList","NoIconBlink", (BYTE)IsDlgButtonChecked(hwndDlg,IDC_ICONBLINK));
+ db_set_b(NULL,"CList","DisableTrayFlash",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DISABLEBLINK));
+ db_set_b(NULL,"CList","NoIconBlink", (BYTE)IsDlgButtonChecked(hwndDlg,IDC_ICONBLINK));
{
int cursel = SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETCURSEL,0,0);
PROTOACCOUNT* pa = (PROTOACCOUNT*)SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETITEMDATA,cursel,0);
if ( pa == NULL )
DBDeleteContactSetting(NULL, "CList","PrimaryStatus");
else
- DBWriteContactSettingString(NULL,"CList","PrimaryStatus", pa->szModuleName);
+ db_set_s(NULL,"CList","PrimaryStatus", pa->szModuleName);
}
pcli->pfnTrayIconIconsChanged();
LoadContactTree(); /* this won't do job properly since it only really works when changes happen */
diff --git a/plugins/Clist_mw/src/clistsettings.cpp b/plugins/Clist_mw/src/clistsettings.cpp index 90154389a1..fb0c14e989 100644 --- a/plugins/Clist_mw/src/clistsettings.cpp +++ b/plugins/Clist_mw/src/clistsettings.cpp @@ -30,7 +30,7 @@ char *GetProtoForContact(HANDLE hContact); int GetStatusForContact(HANDLE hContact,char *szProto);
TCHAR *UnknownConctactTranslatedName;
extern boolean OnModulesLoadedCalled;
-void InvalidateDisplayNameCacheEntryByPDNE(HANDLE hContact,pClcCacheEntry pdnce,int SettingType);
+void InvalidateDisplayNameCacheEntryByPDNE(HANDLE hContact,ClcCacheEntry *pdnce,int SettingType);
static int handleCompare( ClcCacheEntry* c1, ClcCacheEntry* c2 )
{
@@ -50,7 +50,7 @@ void InitDisplayNameCache(SortedList *list) i = 0;
while (hContact != 0)
{
- ClcCacheEntry *pdnce = (pClcCacheEntry)mir_calloc(sizeof(ClcCacheEntry));
+ ClcCacheEntry *pdnce = (ClcCacheEntry *)mir_calloc(sizeof(ClcCacheEntry));
pdnce->hContact = hContact;
InvalidateDisplayNameCacheEntryByPDNE(hContact,pdnce,0);
List_GetIndex(list,pdnce,&idx);
@@ -59,7 +59,7 @@ void InitDisplayNameCache(SortedList *list) i++;
} }
-void FreeDisplayNameCacheItem(pClcCacheEntry p)
+void FreeDisplayNameCacheItem(ClcCacheEntry *p)
{
if ( p->tszName) { mir_free(p->tszName); p->tszName = NULL; }
if ( p->szProto) { mir_free(p->szProto); p->szProto = NULL; }
@@ -78,7 +78,7 @@ void FreeDisplayNameCache(SortedList *list) void CheckPDNCE(ClcCacheEntry *_pdnce)
{
- pClcCacheEntry pdnce = (pClcCacheEntry)_pdnce;
+ ClcCacheEntry *pdnce = (ClcCacheEntry *)_pdnce;
if (pdnce == NULL)
return;
@@ -120,7 +120,7 @@ void CheckPDNCE(ClcCacheEntry *_pdnce) {
DBVARIANT dbv;
- if (!DBGetContactSettingTString(pdnce->hContact,"CList","Group",&dbv))
+ if ( !DBGetContactSettingTString(pdnce->hContact,"CList","Group",&dbv))
{
pdnce->tszGroup = mir_tstrdup(dbv.ptszVal);
mir_free(dbv.pszVal);
@@ -129,7 +129,7 @@ void CheckPDNCE(ClcCacheEntry *_pdnce) }
if (pdnce->bIsHidden == -1)
- pdnce->bIsHidden = db_get_b(pdnce->hContact,"CList","bIsHidden",0);
+ pdnce->bIsHidden = db_get_b(pdnce->hContact,"CList","Hidden",0);
if (pdnce->noHiddenOffline == -1)
pdnce->noHiddenOffline = db_get_b(pdnce->hContact,"CList","noOffline",0);
@@ -138,7 +138,7 @@ void CheckPDNCE(ClcCacheEntry *_pdnce) pdnce->IdleTS = DBGetContactSettingDword(pdnce->hContact,pdnce->szProto,"IdleTS",0);
if (pdnce->ApparentMode == -1)
- pdnce->ApparentMode = DBGetContactSettingWord(pdnce->hContact,pdnce->szProto,"ApparentMode",0);
+ pdnce->ApparentMode = db_get_w(pdnce->hContact,pdnce->szProto,"ApparentMode",0);
if (pdnce->NotOnList == -1)
pdnce->NotOnList = db_get_b(pdnce->hContact,"CList","NotOnList",0);
@@ -147,7 +147,7 @@ void CheckPDNCE(ClcCacheEntry *_pdnce) pdnce->IsExpanded = db_get_b(pdnce->hContact,"CList","Expanded",0);
}
-void InvalidateDisplayNameCacheEntryByPDNE(HANDLE hContact,pClcCacheEntry pdnce,int SettingType)
+void InvalidateDisplayNameCacheEntryByPDNE(HANDLE hContact,ClcCacheEntry *pdnce,int SettingType)
{
if ( hContact == NULL || pdnce == NULL )
return;
@@ -198,7 +198,7 @@ void InvalidateDisplayNameCacheEntryByPDNE(HANDLE hContact,pClcCacheEntry pdnce, char *GetContactCachedProtocol(HANDLE hContact)
{
- pClcCacheEntry cacheEntry = (pClcCacheEntry)pcli->pfnGetCacheEntry(hContact);
+ ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
if (cacheEntry&&cacheEntry->szProto)
return cacheEntry->szProto;
@@ -225,7 +225,7 @@ int GetStatusForContact(HANDLE hContact,char *szProto) {
int status = ID_STATUS_OFFLINE;
if (szProto)
- status = DBGetContactSettingWord((HANDLE)hContact,szProto,"Status",ID_STATUS_OFFLINE);
+ status = db_get_w((HANDLE)hContact,szProto,"Status",ID_STATUS_OFFLINE);
return (status);
}
@@ -244,9 +244,9 @@ TCHAR* GetNameForContact(HANDLE hContact,int flag,boolean *isUnknown) return result;
}
-pClcCacheEntry GetContactFullCacheEntry(HANDLE hContact)
+ClcCacheEntry *GetContactFullCacheEntry(HANDLE hContact)
{
- pClcCacheEntry cacheEntry = (pClcCacheEntry)pcli->pfnGetCacheEntry(hContact);
+ ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
if (cacheEntry != NULL)
return(cacheEntry);
@@ -255,7 +255,7 @@ pClcCacheEntry GetContactFullCacheEntry(HANDLE hContact) int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status)
{
- pClcCacheEntry cacheEntry = (pClcCacheEntry)pcli->pfnGetCacheEntry(hContact);
+ ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
if (cacheEntry != NULL)
{
if (Proto != NULL) *Proto = cacheEntry->szProto;
@@ -267,7 +267,7 @@ int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status int GetContactCachedStatus(HANDLE hContact)
{
- pClcCacheEntry cacheEntry = (pClcCacheEntry)pcli->pfnGetCacheEntry(hContact);
+ ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
if (cacheEntry&&cacheEntry->status != 0) return cacheEntry->status;
return 0;
}
@@ -275,91 +275,76 @@ int GetContactCachedStatus(HANDLE hContact) int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- pClcCacheEntry pdnce;
+ HANDLE hContact = (HANDLE)wParam;
// Early exit
- if ((HANDLE)wParam == NULL)
+ if (hContact == NULL)
return 0;
__try
{
- pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry((HANDLE)wParam);
- if (pdnce == NULL)
- {
+ ClcCacheEntry *pdnce = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hContact);
+ if (pdnce == NULL) {
OutputDebugStringA("!!! Very bad pdnce not found.");
return 0;
}
- if (pdnce && pdnce->protoNotExists == FALSE && pdnce->szProto)
- {
- if (!strcmp(cws->szModule,pdnce->szProto))
- {
- InvalidateDisplayNameCacheEntryByPDNE((HANDLE)wParam,pdnce,cws->value.type);
+ if (pdnce && pdnce->protoNotExists == FALSE && pdnce->szProto) {
+ if ( !strcmp(cws->szModule,pdnce->szProto)) {
+ InvalidateDisplayNameCacheEntryByPDNE(hContact,pdnce,cws->value.type);
- if (cws->value.type == DBVT_WORD&&!strcmp(cws->szSetting, "Status")) {
- if (!(pdnce->bIsHidden == 1)) {
+ if (cws->value.type == DBVT_WORD && !strcmp(cws->szSetting, "Status")) {
+ if ( !(pdnce->bIsHidden == 1)) {
- if ( db_get_b((HANDLE)NULL,"CList","ShowStatusMsg",0)||db_get_b((HANDLE)wParam,"CList","StatusMsgAuto",0))
- DBWriteContactSettingString((HANDLE)wParam, "CList", "StatusMsg", "");
+ if ( db_get_b((HANDLE)NULL,"CList","ShowStatusMsg",0)||db_get_b(hContact,"CList","StatusMsgAuto",0))
+ db_set_s(hContact, "CList", "StatusMsg", "");
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) {
- ChangeContactIcon((HANDLE)wParam, ExtIconFromStatusMode((HANDLE)wParam,cws->szModule, cws->value.wVal), 0); //by FYR
+ ChangeContactIcon(hContact, ExtIconFromStatusMode(hContact,cws->szModule, cws->value.wVal), 0); //by FYR
return 0;
}
- ChangeContactIcon((HANDLE)wParam, ExtIconFromStatusMode((HANDLE)wParam,cws->szModule, cws->value.wVal), 0); //by FYR
- }
- else
- {
- ChangeContactIcon((HANDLE)wParam, ExtIconFromStatusMode((HANDLE)wParam,cws->szModule, cws->value.wVal), 0); //by FYR
+ ChangeContactIcon(hContact, ExtIconFromStatusMode(hContact,cws->szModule, cws->value.wVal), 0); //by FYR
}
+ else ChangeContactIcon(hContact, ExtIconFromStatusMode(hContact,cws->szModule, cws->value.wVal), 0); //by FYR
}
}
- else if (!strcmp(cws->szModule,"MetaContacts"))
- {
+ else if ( !strcmp(cws->szModule,"MetaContacts")) {
PostMessage(pcli->hwndContactTree,CLM_AUTOREBUILD,0,0);
return 0;
}
else return 0;
SortContacts();
- } }
-
- if (!strcmp(cws->szModule,"CList")) {
- /*
- sprintf(buf,"CHANGE: module:CList setting:%s %s\r\n",cws->szSetting,cws->value.pszVal);
- OutputDebugStringA(buf);
- */
+ }
+ }
- //name is null or (setting is myhandle)
- if (pdnce->tszName == NULL||(!strcmp(cws->szSetting,"MyHandle")))
- InvalidateDisplayNameCacheEntryByPDNE((HANDLE)wParam,pdnce,cws->value.type);
+ if ( !strcmp(cws->szModule,"CList")) {
+ if (pdnce->tszName == NULL || !strcmp(cws->szSetting,"MyHandle"))
+ InvalidateDisplayNameCacheEntryByPDNE(hContact,pdnce,cws->value.type);
if ((!strcmp(cws->szSetting,"Group")))
- InvalidateDisplayNameCacheEntryByPDNE((HANDLE)wParam,pdnce,cws->value.type);
+ InvalidateDisplayNameCacheEntryByPDNE(hContact,pdnce,cws->value.type);
- if (!strcmp(cws->szSetting,"bIsHidden")) {
- InvalidateDisplayNameCacheEntryByPDNE((HANDLE)wParam,pdnce,cws->value.type);
+ if ( !strcmp(cws->szSetting,"Hidden")) {
+ InvalidateDisplayNameCacheEntryByPDNE(hContact,pdnce,cws->value.type);
if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0) {
char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0);
- ChangeContactIcon((HANDLE)wParam,ExtIconFromStatusMode((HANDLE)wParam,szProto,szProto == NULL?ID_STATUS_OFFLINE:DBGetContactSettingWord((HANDLE)wParam,szProto,"Status",ID_STATUS_OFFLINE)),1); //by FYR
- } }
+ ChangeContactIcon(hContact,ExtIconFromStatusMode(hContact, szProto, szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)), 1); //by FYR
+ }
+ }
- if (!strcmp(cws->szSetting,"noOffline"))
- InvalidateDisplayNameCacheEntryByPDNE((HANDLE)wParam,pdnce,cws->value.type);
+ if ( !strcmp(cws->szSetting, "noOffline"))
+ InvalidateDisplayNameCacheEntryByPDNE(hContact, pdnce, cws->value.type);
}
- if (!strcmp(cws->szModule,"Protocol")) {
- if (!strcmp(cws->szSetting,"p")) {
- char *szProto;
-
+ if ( !strcmp(cws->szModule, "Protocol")) {
+ if ( !strcmp(cws->szSetting,"p")) {
OutputDebugStringA("CHANGE: proto\r\n");
- InvalidateDisplayNameCacheEntryByPDNE((HANDLE)wParam,pdnce,cws->value.type);
- if (cws->value.type == DBVT_DELETED) szProto = NULL;
- else szProto = cws->value.pszVal;
- ChangeContactIcon((HANDLE)wParam,ExtIconFromStatusMode((HANDLE)wParam,szProto,szProto == NULL?ID_STATUS_OFFLINE:DBGetContactSettingWord((HANDLE)wParam,szProto,"Status",ID_STATUS_OFFLINE)),0); //by FYR
+ InvalidateDisplayNameCacheEntryByPDNE(hContact, pdnce, cws->value.type);
+ char *szProto = (cws->value.type == DBVT_DELETED) ? NULL : cws->value.pszVal;
+ ChangeContactIcon(hContact, ExtIconFromStatusMode(hContact, szProto, szProto == NULL?ID_STATUS_OFFLINE:db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE)),0); //by FYR
}
}
}
diff --git a/plugins/Clist_mw/src/clisttray.cpp b/plugins/Clist_mw/src/clisttray.cpp index 10fadb3c92..d18e90f443 100644 --- a/plugins/Clist_mw/src/clisttray.cpp +++ b/plugins/Clist_mw/src/clisttray.cpp @@ -163,7 +163,7 @@ INT_PTR TrayMenuExecService(WPARAM wParam,LPARAM lParam) { if (wParam != 0)
{
lpTrayMenuExecParam mmep = (lpTrayMenuExecParam)wParam;
- if (!strcmp(mmep->szServiceName,"Help/AboutCommand"))
+ if ( !strcmp(mmep->szServiceName,"Help/AboutCommand"))
{
//bug in help.c,it used wparam as parent window handle without reason.
mmep->Param1 = 0;
diff --git a/plugins/Clist_mw/src/clui.cpp b/plugins/Clist_mw/src/clui.cpp index 08fb0b97db..19abd6f0a4 100644 --- a/plugins/Clist_mw/src/clui.cpp +++ b/plugins/Clist_mw/src/clui.cpp @@ -193,7 +193,7 @@ HICON LoadIconFromExternalFile(char *filename,int i,boolean UseLibrary,boolean r _snprintf(szFullPath, SIZEOF(szFullPath), "%s\\Icons\\%s,%d", szPath, filename, i);
}
- if (!UseLibrary) {
+ if ( !UseLibrary) {
hIcon = ExtractIconFromPath(szFullPath);
if (hIcon) return hIcon;
}
@@ -266,7 +266,7 @@ HICON GetConnectingIconForProto_DLL(char *szProto,int b) }
#endif
- if (!strcmp(szProto,"ICQ"))
+ if ( !strcmp(szProto,"ICQ"))
{
#ifdef _DEBUG
@@ -303,7 +303,7 @@ INT_PTR GetConnectingIconService(WPARAM wParam,LPARAM lParam) HICON hIcon = NULL;
char *szProto = (char *)wParam;
- if (!szProto) return 0;
+ if ( !szProto) return 0;
pt = GetProtoTicksByProto(szProto);
@@ -321,8 +321,8 @@ int CreateTimerForConnectingIcon(WPARAM wParam,LPARAM lParam) {
int status = (int)wParam;
char *szProto = (char *)lParam;
- if (!szProto) return 0;
- if (!status) return 0;
+ if ( !szProto) return 0;
+ if ( !status) return 0;
if (( db_get_b(NULL,"CLUI","UseConnectingIcon",1) == 1) && status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES) {
ProtoTicks *pt = NULL;
@@ -337,7 +337,7 @@ int CreateTimerForConnectingIcon(WPARAM wParam,LPARAM lParam) cnt = 8;
if (cnt != 0) {
- DefaultStep = DBGetContactSettingWord(NULL,"CLUI","DefaultStepConnectingIcon",100);
+ DefaultStep = db_get_w(NULL,"CLUI","DefaultStepConnectingIcon",100);
pt->IconsCount = cnt;
SetTimer(pcli->hwndContactList,TM_STATUSBARUPDATE+pt->n,(int)(DefaultStep)/1,0);
pt->TimerCreated = 1;
@@ -357,7 +357,7 @@ int OnSettingChanging(WPARAM wParam,LPARAM lParam) DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING *)lParam;
if (wParam == 0) {
if ((dbcws->value.type == DBVT_BYTE)&&!strcmp(dbcws->szModule,"CLUI")) {
- if (!strcmp(dbcws->szSetting,"SBarShow")) {
+ if ( !strcmp(dbcws->szSetting,"SBarShow")) {
showOpts = dbcws->value.bVal;
return 0;
}
@@ -371,7 +371,7 @@ HWND PreCreateCLC(HWND parent) pcli->hwndContactTree = CreateWindow(CLISTCONTROL_CLASS,_T(""),
WS_CHILD|WS_CLIPCHILDREN|CLS_CONTACTLIST
|( db_get_b(NULL,"CList","UseGroups",SETTING_USEGROUPS_DEFAULT)?CLS_USEGROUPS:0)
- |CLS_HIDEOFFLINE
+ | CLS_HIDEOFFLINE
//|( db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CLS_HIDEOFFLINE:0)
|( db_get_b(NULL,"CList","HideEmptyGroups",SETTING_HIDEEMPTYGROUPS_DEFAULT)?CLS_HIDEEMPTYGROUPS:0)
|( db_get_b(NULL,"CList","ShowStatusMessages",1)?CLS_SHOWSTATUSMESSAGES:0)
@@ -422,7 +422,7 @@ int GetStatsuBarProtoRect(HWND hwnd,char *szProto,RECT *rc) ProtocolData *PD;
int startoffset = DBGetContactSettingDword(NULL,"StatusBar","FirstIconOffset",0);
- if (!UseOwnerDrawStatusBar) startoffset = 0;
+ if ( !UseOwnerDrawStatusBar) startoffset = 0;
nParts = SendMessage(hwnd,SB_GETPARTS,0,0);
FillMemory(rc,sizeof(RECT),0);
@@ -433,7 +433,7 @@ int GetStatsuBarProtoRect(HWND hwnd,char *szProto,RECT *rc) if ( PD == NULL )
return 0;
- if (!strcmp(szProto,PD->RealName))
+ if ( !strcmp(szProto,PD->RealName))
{
SendMessage(hwnd,SB_GETRECT,(WPARAM)nPanel,(LPARAM)rc);
rc->left += startoffset;
@@ -513,7 +513,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l CLUIFramesOnClistResize((WPARAM)hwnd,0);
GetWindowRect(hwnd, &rc);
- if (!CallService(MS_CLIST_DOCKINGISDOCKED,0,0)) {
+ 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);
@@ -524,9 +524,9 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l if ( wParam == SIZE_MINIMIZED ) {
if ( db_get_b(NULL,"CList","Min2Tray",SETTING_MIN2TRAY_DEFAULT )) {
ShowWindow(hwnd, SW_HIDE);
- DBWriteContactSettingByte(NULL,"CList","State",SETTING_STATE_HIDDEN);
+ db_set_b(NULL,"CList","State",SETTING_STATE_HIDDEN);
}
- else DBWriteContactSettingByte(NULL,"CList","State",SETTING_STATE_MINIMIZED);
+ else db_set_b(NULL,"CList","State",SETTING_STATE_MINIMIZED);
}
return 0;
}
@@ -550,7 +550,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l pt = &CycleStartTick[i];
if (pt->szProto != NULL&&pt->TimerCreated == 1) {
status = CallProtoService(pt->szProto,PS_GETSTATUS,0,0);
- if (!(status>=ID_STATUS_CONNECTING&&status<=ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES))
+ if ( !(status>=ID_STATUS_CONNECTING&&status<=ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES))
{
pt->CycleStartTick = 0;
KillTimer(hwnd,TM_STATUSBARUPDATE+pt->n);
@@ -728,7 +728,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l pcli->hwndContactList = NULL;
UnLoadCLUIFramesModule();
- DBWriteContactSettingByte(NULL, "CList", "State", (BYTE)state);
+ db_set_b(NULL, "CList", "State", (BYTE)state);
PostQuitMessage(0);
break;
}
diff --git a/plugins/Clist_mw/src/cluiopts.cpp b/plugins/Clist_mw/src/cluiopts.cpp index ac5faa798b..5a70db69b1 100644 --- a/plugins/Clist_mw/src/cluiopts.cpp +++ b/plugins/Clist_mw/src/cluiopts.cpp @@ -65,7 +65,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L 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);
- if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) {
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),FALSE);
@@ -79,11 +79,11 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, db_get_b(NULL,"CLUI","AutoSizeUpward",0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_AUTOHIDE, db_get_b(NULL,"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(DBGetContactSettingWord(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),0));
+ SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,"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));
- if (!IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE)) {
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC21),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC22),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_MAXSIZEHEIGHT),FALSE);
@@ -115,29 +115,29 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L wsprintfA(szUin,"%u",DBGetContactSettingDword(NULL,"ICQ","UIN",0));
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)szUin);
- if (!DBGetContactSettingString(NULL,"ICQ","Nick",&dbv)) {
+ if ( !DBGetContactSettingString(NULL,"ICQ","Nick",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
mir_free(dbv.pszVal);
dbv.pszVal = NULL;
}
- if (!DBGetContactSettingString(NULL,"ICQ","FirstName",&dbv)) {
+ if ( !DBGetContactSettingString(NULL,"ICQ","FirstName",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
mir_free(dbv.pszVal);
dbv.pszVal = NULL;
}
- if (!DBGetContactSettingString(NULL,"ICQ","e-mail",&dbv)) {
+ if ( !DBGetContactSettingString(NULL,"ICQ","e-mail",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
mir_free(dbv.pszVal);
dbv.pszVal = NULL;
}
}
- if (!IsWinVer2000Plus()) {
+ if ( !IsWinVer2000Plus()) {
EnableWindow(GetDlgItem(hwndDlg,IDC_FADEINOUT),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSPARENT),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_DROPSHADOW),FALSE);
}
else CheckDlgButton(hwndDlg,IDC_TRANSPARENT,db_get_b(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT)?BST_CHECKED:BST_UNCHECKED);
- if (!IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC11),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC12),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSACTIVE),FALSE);
@@ -203,11 +203,11 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L switch (((LPNMHDR)lParam)->code)
{
case PSN_APPLY:
- DBWriteContactSettingByte(NULL,"CList","OnTop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONTOP));
+ db_set_b(NULL,"CList","OnTop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONTOP));
SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg,IDC_ONTOP)?HWND_TOPMOST:HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- DBWriteContactSettingByte(NULL,"CList","ToolWindow",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_TOOLWND));
- DBWriteContactSettingByte(NULL,"CList","BringToFront",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BRINGTOFRONT));
+ db_set_b(NULL,"CList","ToolWindow",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_TOOLWND));
+ db_set_b(NULL,"CList","BringToFront",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BRINGTOFRONT));
if (IsDlgButtonChecked(hwndDlg,IDC_TOOLWND)) {
// Window must be hidden to dynamically remove the taskbar button.
// See http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp
@@ -228,22 +228,22 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L SetParent(pcli->hwndContactList,NULL);
}
- DBWriteContactSettingByte(NULL,"CLUI","ShowCaption",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION));
- DBWriteContactSettingByte(NULL,"CLUI","ShowMainMenu",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWMAINMENU));
- DBWriteContactSettingByte(NULL,"CLUI","ClientAreaDrag",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_CLIENTDRAG));
+ 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));
if (IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))
SetWindowLongPtr(pcli->hwndContactList,GWL_STYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_STYLE)|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX);
else
SetWindowLongPtr(pcli->hwndContactList,GWL_STYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_STYLE)&~(WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX));
- if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWMAINMENU)) SetMenu(pcli->hwndContactList,NULL);
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_SHOWMAINMENU)) SetMenu(pcli->hwndContactList,NULL);
else SetMenu(pcli->hwndContactList,hMenuMain);
SetWindowPos(pcli->hwndContactList,0,0,0,0,0,SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_FRAMECHANGED);
RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_FRAME|RDW_INVALIDATE);
- DBWriteContactSettingByte(NULL,"CList","Min2Tray",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_MIN2TRAY));
+ db_set_b(NULL,"CList","Min2Tray",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_MIN2TRAY));
if (IsIconic(pcli->hwndContactList) && !IsDlgButtonChecked(hwndDlg,IDC_TOOLWND))
ShowWindow(pcli->hwndContactList,IsDlgButtonChecked(hwndDlg,IDC_MIN2TRAY)?SW_HIDE:SW_SHOW);
@@ -252,18 +252,18 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L DBWriteContactSettingTString(NULL,"CList","TitleText",title);
SetWindowText(pcli->hwndContactList,title);
}
- DBWriteContactSettingByte(NULL,"CLUI","FadeInOut",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_FADEINOUT));
- DBWriteContactSettingByte(NULL,"CLUI","AutoSize",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
- DBWriteContactSettingByte(NULL,"CLUI","MaxSizeHeight",(BYTE)GetDlgItemInt(hwndDlg,IDC_MAXSIZEHEIGHT,NULL,FALSE));
- DBWriteContactSettingByte(NULL,"CLUI","AutoSizeUpward",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZEUPWARD));
- DBWriteContactSettingByte(NULL,"CList","AutoHide",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
+ 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,NULL,FALSE));
+ db_set_b(NULL,"CLUI","AutoSizeUpward",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZEUPWARD));
+ db_set_b(NULL,"CList","AutoHide",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
DBWriteContactSettingWord(NULL,"CList","HideTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_GETPOS,0,0));
- DBWriteContactSettingByte(NULL,"CList","Transparent",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
- DBWriteContactSettingByte(NULL,"CList","Alpha",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_GETPOS,0,0));
- DBWriteContactSettingByte(NULL,"CList","AutoAlpha",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_GETPOS,0,0));
- DBWriteContactSettingByte(NULL,"CList","WindowShadow",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DROPSHADOW));
- DBWriteContactSettingByte(NULL,"CList","OnDesktop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP));
+ 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));
if (IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
if (MySetLayeredWindowAttributes) MySetLayeredWindowAttributes(pcli->hwndContactList, RGB(0,0,0), (BYTE)db_get_b(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
@@ -300,7 +300,7 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLUI","SBarBKColor",CLR_DEFAULT));
- if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)) {
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWICON),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWPROTO),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWSTATUS),FALSE);
@@ -343,15 +343,15 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L COLORREF col = SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_GETCOLOUR,0,0);
DBWriteContactSettingDword(NULL,"CLUI","SBarBKColor",col);
- DBWriteContactSettingByte(NULL,"CLUI","ShowSBar",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
- DBWriteContactSettingByte(NULL,"CLUI","SBarShow",(BYTE)((IsDlgButtonChecked(hwndDlg,IDC_SHOWICON)?1:0)|(IsDlgButtonChecked(hwndDlg,IDC_SHOWPROTO)?2:0)|(IsDlgButtonChecked(hwndDlg,IDC_SHOWSTATUS)?4:0)));
- DBWriteContactSettingByte(NULL,"CLUI","SBarRightClk",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_RIGHTMIRANDA));
- DBWriteContactSettingByte(NULL,"CLUI","EqualSections",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EQUALSECTIONS));
- DBWriteContactSettingByte(NULL,"CLUI","SBarBevel",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SBPANELBEVEL));
- DBWriteContactSettingByte(NULL,"CLUI","SBarUseSizeGrip",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWSIZEGRIP));
+ db_set_b(NULL,"CLUI","ShowSBar",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ db_set_b(NULL,"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(NULL,"CLUI","SBarUseSizeGrip",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWSIZEGRIP));
- DBWriteContactSettingByte(NULL,"CLUI","UseConnectingIcon",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USECONNECTINGICON));
- DBWriteContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USEOWNERDRAW));
+ db_set_b(NULL,"CLUI","UseConnectingIcon",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USECONNECTINGICON));
+ db_set_b(NULL,"CLUI","UseOwnerDrawStatusBar",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USEOWNERDRAW));
UseOwnerDrawStatusBar = db_get_b(NULL,"CLUI","UseOwnerDrawStatusBar",0);
int frameopt = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),0);
diff --git a/plugins/Clist_mw/src/cluiservices.cpp b/plugins/Clist_mw/src/cluiservices.cpp index dadea72c01..d57ae77741 100644 --- a/plugins/Clist_mw/src/cluiservices.cpp +++ b/plugins/Clist_mw/src/cluiservices.cpp @@ -116,7 +116,7 @@ void CluiProtocolStatusChanged(int parStatus, const char* szProto) if (ind < 0)
continue;
- if (!pcli->pfnGetProtocolVisibility(accs[ind]->szModuleName))
+ if ( !pcli->pfnGetProtocolVisibility(accs[ind]->szModuleName))
continue;
x = 2;
@@ -130,7 +130,7 @@ void CluiProtocolStatusChanged(int parStatus, const char* szProto) if (showOpts & 4) {
int status = CallProtoService(accs[ind]->szModuleName, PS_GETSTATUS, 0, 0);
TCHAR *szStatus = pcli->pfnGetStatusModeDescription(status, 0);
- if (!szStatus)
+ if ( !szStatus)
szStatus = _T("");
GetTextExtentPoint32(hdc, szStatus, (int)_tcslen(szStatus), &textSize);
x += textSize.cx;
@@ -160,7 +160,7 @@ void CluiProtocolStatusChanged(int parStatus, const char* szProto) int ind = pcli->pfnGetAccountIndexByPos(i);
if (ind < 0) continue;
- if (!pcli->pfnGetProtocolVisibility(accs[ind]->szModuleName))
+ if ( !pcli->pfnGetProtocolVisibility(accs[ind]->szModuleName))
continue;
ProtocolData *PD = (ProtocolData*)mir_alloc(sizeof(ProtocolData));
diff --git a/plugins/Clist_mw/src/contact.cpp b/plugins/Clist_mw/src/contact.cpp index 6899374b7b..088e125d51 100644 --- a/plugins/Clist_mw/src/contact.cpp +++ b/plugins/Clist_mw/src/contact.cpp @@ -53,7 +53,7 @@ static int GetContactStatus(HANDLE hContact) szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
if (szProto == NULL) return ID_STATUS_OFFLINE;
- return DBGetContactSettingWord(hContact,szProto,"Status",ID_STATUS_OFFLINE);
+ return db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE);
*/
return (GetContactCachedStatus(hContact));
}
@@ -75,30 +75,22 @@ static int GetStatusModeOrdering(int statusMode) void LoadContactTree(void)
{
- HANDLE hContact;
- int i,hideOffline,status,tick;
- pClcCacheEntry cacheEntry;
-
-
-
- tick = GetTickCount();
+ int tick = GetTickCount();
CallService(MS_CLUI_LISTBEGINREBUILD,0,0);
- for (i = 1;;i++) {
- if ((char*)CallService(MS_CLIST_GROUPGETNAME2,i,(LPARAM)(int*)NULL) == NULL) break;
- CallService(MS_CLUI_GROUPADDED,i,0);
- }
+ for (int i=1;; i++)
+ if ((char*)CallService(MS_CLIST_GROUPGETNAME2, i, 0) != NULL)
+ CallService(MS_CLUI_GROUPADDED, i, 0);
- hideOffline = db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT);
- hContact = db_find_first();
+ int hideOffline = db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT);
+ HANDLE hContact = db_find_first();
while(hContact != NULL) {
- cacheEntry = GetContactFullCacheEntry(hContact);
- if (cacheEntry == NULL)
- {
+ ClcCacheEntry *cacheEntry = GetContactFullCacheEntry(hContact);
+ if (cacheEntry == NULL) {
MessageBoxA(0,"Fail To Get CacheEntry for hContact","!!!!!",0);
break;
}
- status = cacheEntry->status;
+ int status = cacheEntry->status;
if ((!hideOffline || status != ID_STATUS_OFFLINE) && !cacheEntry->bIsHidden)
ChangeContactIcon(hContact,ExtIconFromStatusMode(hContact,(char*)cacheEntry->szProto,status),1);
hContact = db_find_next(hContact);
@@ -111,13 +103,10 @@ void LoadContactTree(void) CallService(MS_CLUI_LISTENDREBUILD,0,0);
tick = GetTickCount()-tick;
- {
+
char buf[255];
- //sprintf(buf,"%s %s took %i ms",__FILE__,__LINE__,tick);
sprintf(buf,"LoadContactTree %d \r\n",tick);
-
OutputDebugStringA(buf);
- }
}
#define SAFESTRING(a) a?a:""
@@ -191,7 +180,7 @@ INT_PTR ContactChangeGroup(WPARAM wParam,LPARAM lParam) if ((HANDLE)lParam == NULL)
DBDeleteContactSetting((HANDLE)wParam,"CList","Group");
else
- DBWriteContactSettingString((HANDLE)wParam,"CList","Group",(char*)CallService(MS_CLIST_GROUPGETNAME2,lParam,(LPARAM)(int*)NULL));
+ db_set_s((HANDLE)wParam,"CList","Group",(char*)CallService(MS_CLIST_GROUPGETNAME2,lParam,(LPARAM)(int*)NULL));
CallService(MS_CLUI_CONTACTADDED,wParam,ExtIconFromStatusMode((HANDLE)wParam,(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0),GetContactStatus((HANDLE)wParam)));
return 0;
}
diff --git a/plugins/Clist_mw/src/groupmenu.cpp b/plugins/Clist_mw/src/groupmenu.cpp index 9f5f5846ae..ecf2c4aeeb 100644 --- a/plugins/Clist_mw/src/groupmenu.cpp +++ b/plugins/Clist_mw/src/groupmenu.cpp @@ -155,7 +155,7 @@ INT_PTR GroupMenuExecService(WPARAM wParam,LPARAM lParam) { if (wParam != 0)
{
lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)wParam;
- if (!strcmp(mmep->szServiceName,"Help/AboutCommand"))
+ if ( !strcmp(mmep->szServiceName,"Help/AboutCommand"))
{
//bug in help.c,it used wparam as parent window handle without reason.
mmep->Param1 = 0;
@@ -184,7 +184,7 @@ return 0; INT_PTR HideGroupsHelper(WPARAM wParam,LPARAM lParam)
{
int newVal = !(GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS);
- DBWriteContactSettingByte(NULL,"CList","HideEmptyGroups",(BYTE)newVal);
+ db_set_b(NULL,"CList","HideEmptyGroups",(BYTE)newVal);
SendMessage(pcli->hwndContactTree,CLM_SETHIDEEMPTYGROUPS,newVal,0);
return 0;
}
@@ -192,7 +192,7 @@ INT_PTR HideGroupsHelper(WPARAM wParam,LPARAM lParam) INT_PTR UseGroupsHelper(WPARAM wParam,LPARAM lParam)
{
int newVal = !(GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS);
- DBWriteContactSettingByte(NULL,"CList","UseGroups",(BYTE)newVal);
+ db_set_b(NULL,"CList","UseGroups",(BYTE)newVal);
SendMessage(pcli->hwndContactTree,CLM_SETUSEGROUPS,newVal,0);
return 0;
}
@@ -209,11 +209,7 @@ SendMessage( static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM mi;
-
-
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | ( db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CMIF_CHECKED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersMenuItem, (LPARAM)&mi);
@@ -530,7 +526,7 @@ INT_PTR SubGroupMenuExecService(WPARAM wParam,LPARAM lParam) {
if (wParam != 0) {
lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)wParam;
- if (!strcmp(mmep->szServiceName,"Help/AboutCommand")) {
+ if ( !strcmp(mmep->szServiceName,"Help/AboutCommand")) {
//bug in help.c,it used wparam as parent window handle without reason.
mmep->Param1 = 0;
CallService(mmep->szServiceName,mmep->Param1,lParam);
diff --git a/plugins/Clist_mw/src/init.cpp b/plugins/Clist_mw/src/init.cpp index 8224186ff0..cbb0c062ad 100644 --- a/plugins/Clist_mw/src/init.cpp +++ b/plugins/Clist_mw/src/init.cpp @@ -125,12 +125,12 @@ INT_PTR SetDrawer(WPARAM wParam,LPARAM lParam) if (DSS->cbSize != sizeof(*DSS)) return -1;
if (DSS->PluginName == NULL) return -1;
if (DSS->PluginName == NULL) return -1;
- if (!ServiceExists(DSS->GetDrawFuncsServiceName)) return -1;
+ if ( !ServiceExists(DSS->GetDrawFuncsServiceName)) return -1;
SED.cbSize = sizeof(SED);
SED.PaintClc = (void (__cdecl *)(HWND,struct ClcData *,HDC,RECT *,int ,ClcProtoStatus *,HIMAGELIST))CallService(DSS->GetDrawFuncsServiceName,CLUI_EXT_FUNC_PAINTCLC,0);
- if (!SED.PaintClc) return -1;
+ if ( !SED.PaintClc) return -1;
return 0;
}
@@ -139,9 +139,9 @@ static struct ClcContact* fnCreateClcContact( void ) return (struct ClcContact*)mir_calloc( sizeof( struct ClcContact ));
}
-static pClcCacheEntry fnCreateCacheItem( HANDLE hContact )
+static ClcCacheEntry *fnCreateCacheItem( HANDLE hContact )
{
- pClcCacheEntry p = (pClcCacheEntry)mir_calloc( sizeof( ClcCacheEntry ));
+ ClcCacheEntry *p = (ClcCacheEntry *)mir_calloc( sizeof( ClcCacheEntry ));
if ( p )
p->hContact = hContact;
return p;
diff --git a/plugins/Clist_mw/src/keyboard.cpp b/plugins/Clist_mw/src/keyboard.cpp index d099fab37c..140067eff5 100644 --- a/plugins/Clist_mw/src/keyboard.cpp +++ b/plugins/Clist_mw/src/keyboard.cpp @@ -31,7 +31,7 @@ INT_PTR hkCloseMiranda(WPARAM wParam,LPARAM lParam) INT_PTR hkRestoreStatus(WPARAM wParam,LPARAM lParam)
{
- int nStatus = DBGetContactSettingWord(NULL, "CList", "Status", ID_STATUS_OFFLINE);
+ int nStatus = db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE);
CallService(MS_CLIST_SETSTATUSMODE, nStatus, 0);
return 0;
diff --git a/plugins/TopToolBar/src/InternalButtons.cpp b/plugins/TopToolBar/src/InternalButtons.cpp index 7fcdc1cef8..0662c540bf 100644 --- a/plugins/TopToolBar/src/InternalButtons.cpp +++ b/plugins/TopToolBar/src/InternalButtons.cpp @@ -87,10 +87,9 @@ int InitInternalButtons(WPARAM, LPARAM) CreateServiceFunction(TTBI_SOUNDSONOFF, TTBInternalSoundsOnOff);
CreateServiceFunction(TTBI_MAINMENUBUTT, TTBInternalMainMenuButt);
- TTBButton ttb = { 0 };
- ttb.cbSize = sizeof(ttb);
-
for (int i=0; i < SIZEOF(stdButtons); i++) {
+ TTBButton ttb = { 0 };
+ ttb.cbSize = sizeof(ttb);
ttb.name = stdButtons[i].name;
ttb.pszService = stdButtons[i].pszService;
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_INTERNAL;
@@ -104,6 +103,9 @@ int InitInternalButtons(WPARAM, LPARAM) }
else ttb.hIconDn = NULL;
+ if (i == 0)
+ ttb.wParamUp = 1;
+
stdButtons[i].hButton = (HANDLE)TTBAddButton((WPARAM)&ttb, 0);
}
diff --git a/src/modules/clist/Docking.cpp b/src/modules/clist/Docking.cpp index c2aeafec93..cfcfc2a36d 100644 --- a/src/modules/clist/Docking.cpp +++ b/src/modules/clist/Docking.cpp @@ -149,7 +149,7 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) {
if (docked)
{
- DBWriteContactSettingByte(NULL, "CList", "Docked", (BYTE) docked);
+ db_set_b(NULL, "CList", "Docked", (BYTE) docked);
db_set_dw(NULL, "CList", "DockX", (DWORD) dockPos.x);
db_set_dw(NULL, "CList", "DockY", (DWORD) dockPos.y);
}
diff --git a/src/modules/clist/clcmsgs.cpp b/src/modules/clist/clcmsgs.cpp index 3492ef3438..b772f3bad0 100644 --- a/src/modules/clist/clcmsgs.cpp +++ b/src/modules/clist/clcmsgs.cpp @@ -419,7 +419,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR break;
case CLM_SETHIDEOFFLINEROOT:
- DBWriteContactSettingByte(NULL, "CLC", "HideOfflineRoot", (BYTE) wParam);
+ db_set_b(NULL, "CLC", "HideOfflineRoot", (BYTE) wParam);
SendMessage(hwnd, CLM_AUTOREBUILD, 0, 0);
break;
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp index 5e33c150ce..567fa0c1f2 100644 --- a/src/modules/clist/clistmenus.cpp +++ b/src/modules/clist/clistmenus.cpp @@ -577,7 +577,7 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM) char szHumanName[64] = {0};
PROTOACCOUNT * acc = Proto_GetAccount(smep->proto);
int i = (db_get_b(NULL, prot, "LockMainStatus", 0)?0:1);
- DBWriteContactSettingByte(NULL, prot, "LockMainStatus", (BYTE)i);
+ db_set_b(NULL, prot, "LockMainStatus", (BYTE)i);
CallProtoServiceInt(NULL,smep->proto, PS_GETNAME, (WPARAM)SIZEOF(szHumanName), (LPARAM)szHumanName);
pimi = MO_GetIntMenuItem((HGENMENU)smep->protoindex);
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp index 962b733987..cb14eb0c42 100644 --- a/src/modules/clist/clistmod.cpp +++ b/src/modules/clist/clistmod.cpp @@ -402,7 +402,7 @@ int fnShowHide(WPARAM, LPARAM) SetWindowPos(cli.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
SetForegroundWindow(cli.hwndContactList);
- DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_NORMAL);
+ db_set_b(NULL, "CList", "State", SETTING_STATE_NORMAL);
//this forces the window onto the visible screen
GetWindowRect(cli.hwndContactList, &rcWindow);
@@ -415,11 +415,11 @@ int fnShowHide(WPARAM, LPARAM) 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);
+ db_set_b(NULL, "CList", "State", SETTING_STATE_HIDDEN);
}
else {
ShowWindow(cli.hwndContactList, SW_MINIMIZE);
- DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_MINIMIZED);
+ db_set_b(NULL, "CList", "State", SETTING_STATE_MINIMIZED);
}
if (MySetProcessWorkingSetSize != NULL && db_get_b(NULL, "CList", "DisableWorkingSet", 1))
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index 1a0c9e9410..c51530f676 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -204,7 +204,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) status = CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0);
if (status == ID_STATUS_OFFLINE || (status >= ID_STATUS_CONNECTING && status < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)) {
// Set a flag so we remember to delete the contact when the protocol goes online the next time
- DBWriteContactSettingByte((HANDLE)wParam, "CList", "Delete", 1);
+ db_set_b((HANDLE)wParam, "CList", "Delete", 1);
MessageBox(NULL,
TranslateT("This contact is on an instant messaging system which stores its contact list on a central server. The contact will be removed from the server and from your contact list when you next connect to that network."),
TranslateT("Delete Contact"), MB_OK);
@@ -217,7 +217,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam) // Archive contact
case IDC_HIDE:
- DBWriteContactSettingByte((HANDLE)wParam, "CList", "Hidden", 1);
+ db_set_b((HANDLE)wParam, "CList", "Hidden", 1);
break;
}
@@ -570,9 +570,9 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM if (wParam == SIZE_MINIMIZED) {
if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) || db_get_b(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) {
ShowWindow(hwnd, SW_HIDE);
- DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_HIDDEN);
+ db_set_b(NULL, "CList", "State", SETTING_STATE_HIDDEN);
}
- else DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_MINIMIZED);
+ else db_set_b(NULL, "CList", "State", SETTING_STATE_MINIMIZED);
if (MySetProcessWorkingSetSize != NULL && db_get_b(NULL, "CList", "DisableWorkingSet", 1))
MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
@@ -723,7 +723,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM db_get_b(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT))
{
ShowWindow(hwnd, SW_HIDE);
- DBWriteContactSettingByte(NULL, "CList", "State", SETTING_STATE_HIDDEN);
+ db_set_b(NULL, "CList", "State", SETTING_STATE_HIDDEN);
if (MySetProcessWorkingSetSize != NULL && db_get_b(NULL, "CList", "DisableWorkingSet", 1))
MySetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
@@ -766,7 +766,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case POPUP_HIDEEMPTYGROUPS:
{
int newVal = !(GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
- DBWriteContactSettingByte(NULL, "CList", "HideEmptyGroups", (BYTE) newVal);
+ db_set_b(NULL, "CList", "HideEmptyGroups", (BYTE) newVal);
SendMessage(cli.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, newVal, 0);
}
break;
@@ -774,7 +774,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case POPUP_DISABLEGROUPS:
{
int newVal = !(GetWindowLongPtr(cli.hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
- DBWriteContactSettingByte(NULL, "CList", "UseGroups", (BYTE) newVal);
+ db_set_b(NULL, "CList", "UseGroups", (BYTE) newVal);
SendMessage(cli.hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
}
break;
diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp index becd06f2a3..76cb8960c7 100644 --- a/src/modules/clist/contact.cpp +++ b/src/modules/clist/contact.cpp @@ -178,14 +178,13 @@ int fnSetHideOffline(WPARAM wParam, LPARAM) {
switch((int)wParam) {
case 0:
- DBWriteContactSettingByte(NULL, "CList", "HideOffline", 0);
+ db_set_b(NULL, "CList", "HideOffline", 0);
break;
case 1:
- DBWriteContactSettingByte(NULL, "CList", "HideOffline", 1);
+ db_set_b(NULL, "CList", "HideOffline", 1);
break;
case -1:
- DBWriteContactSettingByte(NULL, "CList", "HideOffline",
- (BYTE) ! db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
+ db_set_b(NULL, "CList", "HideOffline", !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 02ffb598ed..e3b81c23e4 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -913,7 +913,7 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para // check if it visible
mir_snprintf(DBString, SIZEOF(DBString), "%s_visible", menuItemName);
if (db_get_b(NULL, MenuNameItems, DBString, -1) == -1)
- DBWriteContactSettingByte(NULL, MenuNameItems, DBString, 1);
+ db_set_b(NULL, MenuNameItems, DBString, 1);
pmi->OverrideShow = TRUE;
if ( !db_get_b(NULL, MenuNameItems, DBString, 1)) {
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index 40dc80a597..2d31c862c8 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -104,7 +104,7 @@ static int SaveTree(HWND hwndDlg) GetMenuItemName(iod->pimi, menuItemName, sizeof(menuItemName));
mir_snprintf(DBString, SIZEOF(DBString), "%s_visible", menuItemName);
- DBWriteContactSettingByte(NULL, MenuNameItems, DBString, iod->show);
+ db_set_b(NULL, MenuNameItems, DBString, iod->show);
mir_snprintf(DBString, SIZEOF(DBString), "%s_pos", menuItemName);
db_set_dw(NULL, MenuNameItems, DBString, runtimepos);
@@ -537,7 +537,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case 0:
if (hdr->code == PSN_APPLY) {
bIconsDisabled = IsDlgButtonChecked(hwndDlg, IDC_DISABLEMENUICONS) != 0;
- DBWriteContactSettingByte(NULL, "CList", "DisableMenuIcons", bIconsDisabled);
+ db_set_b(NULL, "CList", "DisableMenuIcons", bIconsDisabled);
SaveTree(hwndDlg);
int iNewMenuValue = IsDlgButtonChecked(hwndDlg, IDC_RADIO1) ? 0 : 1;
if (iNewMenuValue != dat->iInitMenuValue) {
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp index 775352cf99..f43e0ac733 100644 --- a/src/modules/database/dbini.cpp +++ b/src/modules/database/dbini.cpp @@ -310,7 +310,7 @@ static void ProcessIniFile(TCHAR* szIniPath, char *szSafeSections, char *szUnsaf switch(szValue[0]) {
case 'b':
case 'B':
- DBWriteContactSettingByte(NULL, szSection, szName, (BYTE)strtol(szValue+1, NULL, 0));
+ db_set_b(NULL, szSection, szName, (BYTE)strtol(szValue+1, NULL, 0));
break;
case 'w':
case 'W':
diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp index 8804df5b22..8393fbc4b6 100644 --- a/src/modules/findadd/searchresults.cpp +++ b/src/modules/findadd/searchresults.cpp @@ -47,13 +47,13 @@ void SaveColumnSizes(HWND hwndResults) ListView_GetColumnOrderArray(hwndResults, columnCount, columnOrder);
for (i=0; i < NUM_COLUMNID; i++) {
mir_snprintf(szSetting, SIZEOF(szSetting), "ColOrder%d", i);
- DBWriteContactSettingByte(NULL, "FindAdd", szSetting, (BYTE)columnOrder[i]);
+ db_set_b(NULL, "FindAdd", szSetting, (BYTE)columnOrder[i]);
if (i>=columnCount) continue;
mir_snprintf(szSetting, SIZEOF(szSetting), "ColWidth%d", i);
DBWriteContactSettingWord(NULL, "FindAdd", szSetting, (WORD)ListView_GetColumnWidth(hwndResults, i));
}
- DBWriteContactSettingByte(NULL, "FindAdd", "SortColumn", (BYTE)dat->iLastColumnSortIndex);
- DBWriteContactSettingByte(NULL, "FindAdd", "SortAscending", (BYTE)dat->bSortAscending);
+ db_set_b(NULL, "FindAdd", "SortColumn", (BYTE)dat->iLastColumnSortIndex);
+ db_set_b(NULL, "FindAdd", "SortAscending", (BYTE)dat->bSortAscending);
}
static const TCHAR *szColumnNames[] = { NULL, NULL, _T("Nick"), _T("First Name"), _T("Last Name"), _T("E-mail") };
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp index 3b1c218107..f95b590912 100644 --- a/src/modules/fonts/FontOptions.cpp +++ b/src/modules/fonts/FontOptions.cpp @@ -418,9 +418,9 @@ static void sttSaveCollapseState(HWND hwndTree) if (tvi.cChildren > 0) {
treeItem = (TreeItem *)tvi.lParam;
if (tvi.state & TVIS_EXPANDED)
- DBWriteContactSettingByte(NULL, "FontServiceUI", treeItem->paramName, TVIS_EXPANDED);
+ db_set_b(NULL, "FontServiceUI", treeItem->paramName, TVIS_EXPANDED);
else
- DBWriteContactSettingByte(NULL, "FontServiceUI", treeItem->paramName, 0);
+ db_set_b(NULL, "FontServiceUI", treeItem->paramName, 0);
}
ht = TreeView_GetChild(hwndTree, hti);
@@ -545,19 +545,19 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F) SelectObject(hdc, hOldFont);
DeleteObject(hFont);
- DBWriteContactSettingByte(NULL, F.dbSettingsGroup, str, (char)size.cy);
+ db_set_b(NULL, F.dbSettingsGroup, str, (char)size.cy);
}
else if (F.flags & FIDF_SAVEPOINTSIZE) {
HDC hdc = GetDC(hwndDlg);
- DBWriteContactSettingByte(NULL, F.dbSettingsGroup, str, (BYTE)-MulDiv(F.value.size, 72, GetDeviceCaps(hdc, LOGPIXELSY)));
+ db_set_b(NULL, F.dbSettingsGroup, str, (BYTE)-MulDiv(F.value.size, 72, GetDeviceCaps(hdc, LOGPIXELSY)));
ReleaseDC(hwndDlg, hdc);
}
- else DBWriteContactSettingByte(NULL, F.dbSettingsGroup, str, F.value.size);
+ else db_set_b(NULL, F.dbSettingsGroup, str, F.value.size);
mir_snprintf(str, SIZEOF(str), "%sSty", F.prefix);
- DBWriteContactSettingByte(NULL, F.dbSettingsGroup, str, F.value.style);
+ db_set_b(NULL, F.dbSettingsGroup, str, F.value.style);
mir_snprintf(str, SIZEOF(str), "%sSet", F.prefix);
- DBWriteContactSettingByte(NULL, F.dbSettingsGroup, str, F.value.charset);
+ db_set_b(NULL, F.dbSettingsGroup, str, F.value.charset);
mir_snprintf(str, SIZEOF(str), "%sCol", F.prefix);
db_set_dw(NULL, F.dbSettingsGroup, str, F.value.colour);
if (F.flags & FIDF_NOAS) {
@@ -1193,7 +1193,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, EffectInternal& E = effect_id_list_w2[i];
mir_snprintf(str, SIZEOF(str), "%sEffect", E.setting);
- DBWriteContactSettingByte(NULL, E.dbSettingsGroup, str, E.value.effectIndex);
+ db_set_b(NULL, E.dbSettingsGroup, str, E.value.effectIndex);
mir_snprintf(str, SIZEOF(str), "%sEffectCol1", E.setting);
db_set_dw(NULL, E.dbSettingsGroup, str, E.value.baseColour);
diff --git a/src/modules/icolib/skin2opts.cpp b/src/modules/icolib/skin2opts.cpp index f5bb3ffa06..9b2c341b64 100644 --- a/src/modules/icolib/skin2opts.cpp +++ b/src/modules/icolib/skin2opts.cpp @@ -623,9 +623,9 @@ static void SaveCollapseState(HWND hwndTree) if (tvi.cChildren > 0) {
TreeItem *treeItem = (TreeItem *)tvi.lParam;
if (tvi.state & TVIS_EXPANDED)
- DBWriteContactSettingByte(NULL, "SkinIconsUI", treeItem->paramName, TVIS_EXPANDED);
+ db_set_b(NULL, "SkinIconsUI", treeItem->paramName, TVIS_EXPANDED);
else
- DBWriteContactSettingByte(NULL, "SkinIconsUI", treeItem->paramName, 0);
+ db_set_b(NULL, "SkinIconsUI", treeItem->paramName, 0);
}
HTREEITEM ht = TreeView_GetChild(hwndTree, hti);
diff --git a/src/modules/ignore/ignore.cpp b/src/modules/ignore/ignore.cpp index 47a48a027c..080e83a7a7 100644 --- a/src/modules/ignore/ignore.cpp +++ b/src/modules/ignore/ignore.cpp @@ -305,7 +305,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM if (SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0))
DBDeleteContactSetting(hContact, "CList", "Hidden");
else
- DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
+ db_set_b(hContact, "CList", "Hidden", 1);
}
while (hContact = db_find_next(hContact));
SaveItemMask( GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemAll, "Default1");
diff --git a/src/modules/netlib/netliblog.cpp b/src/modules/netlib/netliblog.cpp index 4eac00a0c4..01f5855e10 100644 --- a/src/modules/netlib/netliblog.cpp +++ b/src/modules/netlib/netliblog.cpp @@ -211,7 +211,7 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa GetDlgItemText(hwndDlg, IDC_RUNATSTART, str, MAX_PATH);
db_set_ts(NULL, "Netlib", "RunAtStart", str);
- DBWriteContactSettingByte(NULL, "Netlib", "ShowLogOptsAtStart", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWTHISDLGATSTART));
+ db_set_b(NULL, "Netlib", "ShowLogOptsAtStart", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWTHISDLGATSTART));
mir_cslock lck(logOptions.cs);
@@ -264,16 +264,16 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa }
if (logOptions.save) {
- DBWriteContactSettingByte(NULL, "Netlib", "DumpRecv", (BYTE)logOptions.dumpRecv);
- DBWriteContactSettingByte(NULL, "Netlib", "DumpSent", (BYTE)logOptions.dumpSent);
- DBWriteContactSettingByte(NULL, "Netlib", "DumpProxy", (BYTE)logOptions.dumpProxy);
- DBWriteContactSettingByte(NULL, "Netlib", "DumpSsl", (BYTE)logOptions.dumpSsl);
- DBWriteContactSettingByte(NULL, "Netlib", "TextDumps", (BYTE)logOptions.textDumps);
- DBWriteContactSettingByte(NULL, "Netlib", "AutoDetectText", (BYTE)logOptions.autoDetectText);
- DBWriteContactSettingByte(NULL, "Netlib", "TimeFormat", (BYTE)logOptions.timeFormat);
- DBWriteContactSettingByte(NULL, "Netlib", "ShowUser", (BYTE)logOptions.showUser);
- DBWriteContactSettingByte(NULL, "Netlib", "ToOutputDebugString", (BYTE)logOptions.toOutputDebugString);
- DBWriteContactSettingByte(NULL, "Netlib", "ToFile", (BYTE)logOptions.toFile);
+ db_set_b(NULL, "Netlib", "DumpRecv", (BYTE)logOptions.dumpRecv);
+ db_set_b(NULL, "Netlib", "DumpSent", (BYTE)logOptions.dumpSent);
+ db_set_b(NULL, "Netlib", "DumpProxy", (BYTE)logOptions.dumpProxy);
+ db_set_b(NULL, "Netlib", "DumpSsl", (BYTE)logOptions.dumpSsl);
+ db_set_b(NULL, "Netlib", "TextDumps", (BYTE)logOptions.textDumps);
+ db_set_b(NULL, "Netlib", "AutoDetectText", (BYTE)logOptions.autoDetectText);
+ db_set_b(NULL, "Netlib", "TimeFormat", (BYTE)logOptions.timeFormat);
+ db_set_b(NULL, "Netlib", "ShowUser", (BYTE)logOptions.showUser);
+ db_set_b(NULL, "Netlib", "ToOutputDebugString", (BYTE)logOptions.toOutputDebugString);
+ db_set_b(NULL, "Netlib", "ToFile", (BYTE)logOptions.toFile);
db_set_ts(NULL, "Netlib", "File", logOptions.szFile ? logOptions.szUserFile: _T(""));
logOptions.save = 0;
}
diff --git a/src/modules/netlib/netlibopts.cpp b/src/modules/netlib/netlibopts.cpp index 19548210b5..1131980bc5 100644 --- a/src/modules/netlib/netlibopts.cpp +++ b/src/modules/netlib/netlibopts.cpp @@ -196,23 +196,23 @@ static void WriteSettingsStructToDb(const char *szSettingsModule, NETLIBUSERSETT {
if (flags & NUF_OUTGOING) {
char szEncodedPassword[512];
- DBWriteContactSettingByte(NULL, szSettingsModule, "NLValidateSSL", (BYTE)settings->validateSSL);
- DBWriteContactSettingByte(NULL, szSettingsModule, "NLUseProxy", (BYTE)settings->useProxy);
- DBWriteContactSettingByte(NULL, szSettingsModule, "NLProxyType", (BYTE)settings->proxyType);
+ db_set_b(NULL, szSettingsModule, "NLValidateSSL", (BYTE)settings->validateSSL);
+ db_set_b(NULL, szSettingsModule, "NLUseProxy", (BYTE)settings->useProxy);
+ db_set_b(NULL, szSettingsModule, "NLProxyType", (BYTE)settings->proxyType);
DBWriteContactSettingString(NULL, szSettingsModule, "NLProxyServer", settings->szProxyServer?settings->szProxyServer:"");
DBWriteContactSettingWord(NULL, szSettingsModule, "NLProxyPort", (WORD)settings->wProxyPort);
- DBWriteContactSettingByte(NULL, szSettingsModule, "NLUseProxyAuth", (BYTE)settings->useProxyAuth);
+ db_set_b(NULL, szSettingsModule, "NLUseProxyAuth", (BYTE)settings->useProxyAuth);
DBWriteContactSettingString(NULL, szSettingsModule, "NLProxyAuthUser", settings->szProxyAuthUser?settings->szProxyAuthUser:"");
lstrcpynA(szEncodedPassword, settings->szProxyAuthPassword?settings->szProxyAuthPassword:"", SIZEOF(szEncodedPassword));
CallService(MS_DB_CRYPT_ENCODESTRING, SIZEOF(szEncodedPassword), (LPARAM)szEncodedPassword);
DBWriteContactSettingString(NULL, szSettingsModule, "NLProxyAuthPassword", szEncodedPassword);
- DBWriteContactSettingByte(NULL, szSettingsModule, "NLDnsThroughProxy", (BYTE)settings->dnsThroughProxy);
- DBWriteContactSettingByte(NULL, szSettingsModule, "NLSpecifyOutgoingPorts", (BYTE)settings->specifyOutgoingPorts);
+ db_set_b(NULL, szSettingsModule, "NLDnsThroughProxy", (BYTE)settings->dnsThroughProxy);
+ db_set_b(NULL, szSettingsModule, "NLSpecifyOutgoingPorts", (BYTE)settings->specifyOutgoingPorts);
DBWriteContactSettingString(NULL, szSettingsModule, "NLOutgoingPorts", settings->szOutgoingPorts?settings->szOutgoingPorts:"");
}
if (flags & NUF_INCOMING) {
- DBWriteContactSettingByte(NULL, szSettingsModule, "NLEnableUPnP", (BYTE)settings->enableUPnP);
- DBWriteContactSettingByte(NULL, szSettingsModule, "NLSpecifyIncomingPorts", (BYTE)settings->specifyIncomingPorts);
+ db_set_b(NULL, szSettingsModule, "NLEnableUPnP", (BYTE)settings->enableUPnP);
+ db_set_b(NULL, szSettingsModule, "NLSpecifyIncomingPorts", (BYTE)settings->specifyIncomingPorts);
DBWriteContactSettingString(NULL, szSettingsModule, "NLIncomingPorts", settings->szIncomingPorts?settings->szIncomingPorts:"");
}
}
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index b1d5e2ac3b..56f15f7c86 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -191,7 +191,7 @@ static void SaveOptionsTreeState(HWND hdlg) while (tvi.hItem != NULL) {
if (SendMessageA( GetDlgItem(hdlg, IDC_PAGETREE), TVM_GETITEMA, 0, (LPARAM)&tvi)) {
mir_snprintf(buf, SIZEOF(buf), "%s%s", OPTSTATE_PREFIX, str);
- DBWriteContactSettingByte(NULL, "Options", buf, (BYTE)((tvi.state&TVIS_EXPANDED)?1:0));
+ db_set_b(NULL, "Options", buf, (BYTE)((tvi.state&TVIS_EXPANDED)?1:0));
}
tvi.hItem = TreeView_GetNextSibling( GetDlgItem(hdlg, IDC_PAGETREE), tvi.hItem);
} }
@@ -1132,7 +1132,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L break;
case IDC_MODERN:
- DBWriteContactSettingByte(NULL, "Options", "Expert", 0);
+ db_set_b(NULL, "Options", "Expert", 0);
SaveOptionsTreeState(hdlg);
PostMessage(hdlg, WM_CLOSE, 0, 0);
CallService(MS_MODERNOPT_SHOW, 0, 0);
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp index 4c971519c6..753720efb1 100644 --- a/src/modules/plugins/newplugins.cpp +++ b/src/modules/plugins/newplugins.cpp @@ -476,7 +476,7 @@ void SetPluginOnWhiteList(const TCHAR* pluginname, int allow) char plugName[MAX_PATH];
strncpy(plugName, StrConvA(pluginname), SIZEOF(plugName));
strlwr(plugName);
- DBWriteContactSettingByte(NULL, PLUGINDISABLELIST, plugName, allow == 0);
+ db_set_b(NULL, PLUGINDISABLELIST, plugName, allow == 0);
}
// returns 1 if the plugin should be enabled within this profile, filename is always lower case
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index b753f78963..fff20b30c2 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -234,7 +234,7 @@ static int InitializeStaticAccounts(WPARAM, LPARAM) BuildProtoMenus();
if (count == 0 && !db_get_b(NULL, "FirstRun", "AccManager", 0)) {
- DBWriteContactSettingByte(NULL, "FirstRun", "AccManager", 1);
+ db_set_b(NULL, "FirstRun", "AccManager", 1);
CallService(MS_PROTO_SHOWACCMGR, 0, 0);
}
return 0;
@@ -618,7 +618,7 @@ void BuildProtoMenus() void RebuildProtoMenus(int iNewValue)
{
- DBWriteContactSettingByte(NULL, "CList", "MoveProtoMenus", iNewValue);
+ db_set_b(NULL, "CList", "MoveProtoMenus", iNewValue);
RebuildMenuOrder();
BuildProtoMenus();
diff --git a/src/modules/skin/hotkey_opts.cpp b/src/modules/skin/hotkey_opts.cpp index 3e6a30c76c..03aa7bbd7b 100644 --- a/src/modules/skin/hotkey_opts.cpp +++ b/src/modules/skin/hotkey_opts.cpp @@ -326,9 +326,9 @@ static void sttOptionsSaveItem(THotkeyItem *item) item->Enabled = item->OptEnabled;
DBWriteContactSettingWord(NULL, DBMODULENAME, item->pszName, item->Hotkey);
- DBWriteContactSettingByte(NULL, DBMODULENAME "Off", item->pszName, (BYTE)!item->Enabled);
+ db_set_b(NULL, DBMODULENAME "Off", item->pszName, (BYTE)!item->Enabled);
if (item->type != HKT_MANUAL)
- DBWriteContactSettingByte(NULL, DBMODULENAME "Types", item->pszName, (BYTE)item->type);
+ db_set_b(NULL, DBMODULENAME "Types", item->pszName, (BYTE)item->type);
item->nSubHotkeys = 0;
for (i=0; i < hotkeys.getCount(); i++) {
@@ -340,7 +340,7 @@ static void sttOptionsSaveItem(THotkeyItem *item) mir_snprintf(buf, SIZEOF(buf), "%s$%d", item->pszName, item->nSubHotkeys);
DBWriteContactSettingWord(NULL, DBMODULENAME, buf, subItem->Hotkey);
if (subItem->type != HKT_MANUAL)
- DBWriteContactSettingByte(NULL, DBMODULENAME "Types", buf, (BYTE)subItem->type);
+ db_set_b(NULL, DBMODULENAME "Types", buf, (BYTE)subItem->type);
++item->nSubHotkeys;
} }
@@ -993,7 +993,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, lvi.iSubItem = 1;
ListView_GetItem(hwndHotkey, &lvi);
- DBWriteContactSettingByte(NULL, DBMODULENAME "UI", _T2A(lvi.pszText), ListView_GetCheckState(hwndHotkey, lvi.iItem));
+ db_set_b(NULL, DBMODULENAME "UI", _T2A(lvi.pszText), ListView_GetCheckState(hwndHotkey, lvi.iItem));
}
}
}
diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp index bafb4f5d42..96f1f7c268 100644 --- a/src/modules/skin/hotkeys.cpp +++ b/src/modules/skin/hotkeys.cpp @@ -382,7 +382,7 @@ int LoadSkinHotkeys(void) mir_snprintf(szSetting, SIZEOF(szSetting), "HKEn%s", oldSettings[i]);
if ((key = db_get_b(NULL, "Clist", szSetting, 0))) {
DBDeleteContactSetting(NULL, "Clist", szSetting);
- DBWriteContactSettingByte(NULL, DBMODULENAME "Off", newSettings[i], (BYTE)(key == 0));
+ db_set_b(NULL, DBMODULENAME "Off", newSettings[i], (BYTE)(key == 0));
}
}
diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp index 104229ab7d..42e51898ed 100644 --- a/src/modules/skin/sounds.cpp +++ b/src/modules/skin/sounds.cpp @@ -329,7 +329,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM switch(((LPNMHDR)lParam)->idFrom) {
case 0:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- DBWriteContactSettingByte(NULL, "Skin", "UseSound", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ENABLESOUNDS));
+ db_set_b(NULL, "Skin", "UseSound", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ENABLESOUNDS));
for (int i=0; i < arSounds.getCount(); i++)
if (arSounds[i].ptszTempFile)
@@ -351,7 +351,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM cgs.szSetting = arSounds[tvic.lParam].name;
CallService(MS_DB_CONTACT_DELETESETTING, (WPARAM)(HANDLE)NULL, (LPARAM)&cgs);
}
- else DBWriteContactSettingByte(NULL, "SkinSoundsOff", arSounds[tvic.lParam].name, 1);
+ else db_set_b(NULL, "SkinSoundsOff", arSounds[tvic.lParam].name, 1);
tvic.hItem = TreeView_GetNextSibling(hwndTree, tvic.hItem);
} }
diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp index 5342b82d5c..2f7153442b 100644 --- a/src/modules/utils/timezones.cpp +++ b/src/modules/utils/timezones.cpp @@ -249,7 +249,7 @@ static void timeapiSetInfoByContact(HANDLE hContact, HANDLE hTZ) if (tz)
{
db_set_ts(hContact, "UserInfo", "TzName", tz->tszName);
- DBWriteContactSettingByte(hContact, "UserInfo", "Timezone", (char)((tz->tzi.Bias + tz->tzi.StandardBias) / 30));
+ db_set_b(hContact, "UserInfo", "Timezone", (char)((tz->tzi.Bias + tz->tzi.StandardBias) / 30));
}
else
{
|