From 007b4c7301f0d26a72f89f74e9929f42e24eb3e6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 5 Apr 2013 22:27:16 +0000 Subject: - rest of menus cleared; - old database macroses wiped out from all plugins (left in m_database.h for compatibility) git-svn-id: http://svn.miranda-ng.org/main/trunk@4324 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SimpleAR/src/Main.cpp | 54 ++++++++++++++++++++-------------------- plugins/SimpleAR/src/Options.cpp | 24 +++++++++--------- 2 files changed, 39 insertions(+), 39 deletions(-) (limited to 'plugins/SimpleAR') diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 5888a54353..c3f4337efb 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -79,8 +79,8 @@ INT_PTR Toggle(WPARAM w, LPARAM l) { HANDLE hContact = (HANDLE)w; BOOL on = 0; - on = !DBGetContactSettingByte(hContact, protocolname, "TurnedOn", 0); - DBWriteContactSettingByte(hContact, protocolname, "TurnedOn", on ? 1 : 0); + on = !db_get_b(hContact, protocolname, "TurnedOn", 0); + db_set_b(hContact, protocolname, "TurnedOn", on ? 1 : 0); on = on?0:1; CLISTMENUITEM mi = { sizeof(mi) }; @@ -97,7 +97,7 @@ INT OnPreBuildContactMenu(WPARAM w, LPARAM l) CLISTMENUITEM mi = { sizeof(mi) }; mi.flags = CMIM_NAME | CMIM_ICON | CMIF_TCHAR; - BOOL on = !DBGetContactSettingByte(hContact, protocolname, "TurnedOn", 0); + BOOL on = !db_get_b(hContact, protocolname, "TurnedOn", 0); mi.ptszName = on ? LPGENT("Turn off Autoanswer") : LPGENT("Turn on Autoanswer"); mi.hIcon = on?LoadIcon(hinstance, MAKEINTRESOURCE(IDI_OFF)):LoadIcon(hinstance, MAKEINTRESOURCE(IDI_ON)); CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hToggle, (LPARAM)&mi); @@ -112,14 +112,14 @@ INT CheckDefaults(WPARAM, LPARAM) UnhookEvent(hCheckDefHook); - fEnabled=!DBGetContactSettingByte(NULL,protocolname,KEY_ENABLED,1)==1; - interval=DBGetContactSettingWord(NULL,protocolname,KEY_REPEATINTERVAL,300); + fEnabled=!db_get_b(NULL,protocolname,KEY_ENABLED,1)==1; + interval=db_get_w(NULL,protocolname,KEY_REPEATINTERVAL,300); - if (DBGetContactSettingTString(NULL,protocolname,KEY_HEADING,&dbv)) + if (db_get_ts(NULL,protocolname,KEY_HEADING,&dbv)) // Heading not set - DBWriteContactSettingTString(NULL,protocolname,KEY_HEADING,TranslateT("Dear %user%, the owner left the following message:")); + db_set_ts(NULL,protocolname,KEY_HEADING,TranslateT("Dear %user%, the owner left the following message:")); else - DBFreeVariant(&dbv); + db_free(&dbv); for (int c=ID_STATUS_ONLINE; c 40078) ptszDefault=ptszDefaultMsg[c-ID_STATUS_ONLINE-3]; if (ptszDefault) - DBWriteContactSettingTString(NULL,protocolname,szStatus,ptszDefault); + db_set_ts(NULL,protocolname,szStatus,ptszDefault); } else - DBFreeVariant(&dbv); + db_free(&dbv); } } hPreBuildHook = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnPreBuildContactMenu); @@ -209,46 +209,46 @@ INT addEvent(WPARAM wParam, LPARAM lParam) if (!dbei.cbBlob) /// invalid size return FALSE; - if (DBGetContactSettingTString(hContact,"Protocol","p",&dbv)) + if (db_get_ts(hContact,"Protocol","p",&dbv)) // Contact with no protocol ?!! return FALSE; else - DBFreeVariant(&dbv); + db_free(&dbv); - if(DBGetContactSettingByte(hContact, "CList", "NotOnList", 0)) + if(db_get_b(hContact, "CList", "NotOnList", 0)) return FALSE; - if(DBGetContactSettingByte(hContact, protocolname, "TurnedOn", 0)) + if(db_get_b(hContact, protocolname, "TurnedOn", 0)) return FALSE; if (!( dbei.flags & DBEF_SENT)) { - int timeBetween=time(NULL)-DBGetContactSettingDword(hContact,protocolname,"LastReplyTS",0); - if (timeBetween>interval || DBGetContactSettingWord(hContact,protocolname,"LastStatus",0)!=status) + int timeBetween=time(NULL)-db_get_dw(hContact,protocolname,"LastReplyTS",0); + if (timeBetween>interval || db_get_w(hContact,protocolname,"LastStatus",0)!=status) { char szStatus[6]={0}; int msgLen=1; - int isQun=DBGetContactSettingByte(hContact,pszProto,"IsQun",0); + int isQun=db_get_b(hContact,pszProto,"IsQun",0); if (isQun) return FALSE; mir_snprintf(szStatus,SIZEOF(szStatus),"%d",status); - if (!DBGetContactSettingTString(NULL,protocolname,szStatus,&dbv)) + if (!db_get_ts(NULL,protocolname,szStatus,&dbv)) { if (*dbv.ptszVal) { DBVARIANT dbvHead={0}, dbvNick={0}; TCHAR *ptszTemp, *ptszTemp2; - DBGetContactSettingTString(hContact,pszProto,"Nick",&dbvNick); + db_get_ts(hContact,pszProto,"Nick",&dbvNick); if (lstrcmp(dbvNick.ptszVal, NULL) == 0) { - DBFreeVariant(&dbvNick); + db_free(&dbvNick); return FALSE; } msgLen += (int)_tcslen(dbv.ptszVal); - if (!DBGetContactSettingTString(NULL,protocolname,KEY_HEADING,&dbvHead)) + if (!db_get_ts(NULL,protocolname,KEY_HEADING,&dbvHead)) { ptszTemp = (TCHAR*)mir_alloc(sizeof(TCHAR) * (_tcslen(dbvHead.ptszVal)+1)); _tcscpy(ptszTemp, dbvHead.ptszVal); @@ -284,17 +284,17 @@ INT addEvent(WPARAM wParam, LPARAM lParam) mir_free(ptszTemp2); mir_free(pszUtf); if (dbvNick.ptszVal) - DBFreeVariant(&dbvNick); + db_free(&dbvNick); if (dbvHead.ptszVal) - DBFreeVariant(&dbvHead); + db_free(&dbvHead); } - DBFreeVariant(&dbv); + db_free(&dbv); } } } - DBWriteContactSettingDword(hContact,protocolname,"LastReplyTS",time(NULL)); - DBWriteContactSettingWord(hContact,protocolname,"LastStatus",status); + db_set_dw(hContact,protocolname,"LastReplyTS",time(NULL)); + db_set_w(hContact,protocolname,"LastStatus",status); } return 0; } diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp index e53236d22c..41a0a5f1f0 100644 --- a/plugins/SimpleAR/src/Options.cpp +++ b/plugins/SimpleAR/src/Options.cpp @@ -14,13 +14,13 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara TCHAR* pszStatus; char tszStatus[6]={0}; - CheckDlgButton(hwndDlg,IDC_ENABLEREPLIER,DBGetContactSettingByte(NULL,protocolname,KEY_ENABLED,1)==1); - SetDlgItemInt(hwndDlg,IDC_INTERVAL,DBGetContactSettingWord(NULL,protocolname,KEY_REPEATINTERVAL,300)/60,FALSE); + CheckDlgButton(hwndDlg,IDC_ENABLEREPLIER,db_get_b(NULL,protocolname,KEY_ENABLED,1)==1); + SetDlgItemInt(hwndDlg,IDC_INTERVAL,db_get_w(NULL,protocolname,KEY_REPEATINTERVAL,300)/60,FALSE); - if (!DBGetContactSettingTString(NULL,protocolname,KEY_HEADING,&dbv)) + if (!db_get_ts(NULL,protocolname,KEY_HEADING,&dbv)) { SetDlgItemText(hwndDlg,IDC_HEADING,dbv.ptszVal); - DBFreeVariant(&dbv); + db_free(&dbv); } for (INT c = ID_STATUS_ONLINE; c < ID_STATUS_IDLE; c++) @@ -33,13 +33,13 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara { SendDlgItemMessage(hwndDlg,IDC_STATUSMODE,CB_ADDSTRING,0,(LPARAM)pszStatus); - if (!DBGetContactSettingTString(NULL, protocolname, tszStatus, &dbv)) + if (!db_get_ts(NULL, protocolname, tszStatus, &dbv)) { if (c < 40077) ptszMessage[c-ID_STATUS_ONLINE-1] = _tcsdup(dbv.ptszVal); else if (c > 40078) ptszMessage[c-ID_STATUS_ONLINE-3] = _tcsdup(dbv.ptszVal); - DBFreeVariant(&dbv); + db_free(&dbv); } } } @@ -93,15 +93,15 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara BOOL translated; fEnabled=IsDlgButtonChecked(hwndDlg,IDC_ENABLEREPLIER)==1; - DBWriteContactSettingByte(NULL,protocolname,KEY_ENABLED,(BYTE)fEnabled); + db_set_b(NULL,protocolname,KEY_ENABLED,(BYTE)fEnabled); GetDlgItemText(hwndDlg,IDC_HEADING,ptszText,SIZEOF(ptszText)); - DBWriteContactSettingTString(NULL,protocolname,KEY_HEADING,ptszText); + db_set_ts(NULL,protocolname,KEY_HEADING,ptszText); size=GetDlgItemInt(hwndDlg,IDC_INTERVAL,&translated,FALSE); if (translated) interval=size*60; - DBWriteContactSettingWord(NULL,protocolname,KEY_REPEATINTERVAL,interval); + db_set_w(NULL,protocolname,KEY_REPEATINTERVAL,interval); size=SendDlgItemMessage(hwndDlg,IDC_MESSAGE,WM_GETTEXTLENGTH,0,0)+1; GetDlgItemText(hwndDlg,IDC_MESSAGE,ptszMessage[lastIndex],size); @@ -115,11 +115,11 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara mir_snprintf(szStatus,SIZEOF(szStatus),"%d",c); if (c<40077 && ptszMessage[c-ID_STATUS_ONLINE-1]) - DBWriteContactSettingTString(NULL,protocolname,szStatus,ptszMessage[c-ID_STATUS_ONLINE-1]); + db_set_ts(NULL,protocolname,szStatus,ptszMessage[c-ID_STATUS_ONLINE-1]); else if (c>40078 && ptszMessage[c-ID_STATUS_ONLINE-3]) - DBWriteContactSettingTString(NULL,protocolname,szStatus,ptszMessage[c-ID_STATUS_ONLINE-3]); + db_set_ts(NULL,protocolname,szStatus,ptszMessage[c-ID_STATUS_ONLINE-3]); else - DBDeleteContactSetting(NULL,protocolname,szStatus); + db_unset(NULL,protocolname,szStatus); } } return TRUE; -- cgit v1.2.3