diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
commit | 007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (patch) | |
tree | b1ee30b70c6e36d1a06aed6885cb80dc560a68ca /plugins/YAMN/src | |
parent | f4a1bbc6ba4b8137cb868639ac146aa97e97e9df (diff) |
- 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
Diffstat (limited to 'plugins/YAMN/src')
-rw-r--r-- | plugins/YAMN/src/browser/mailbrowser.cpp | 36 | ||||
-rw-r--r-- | plugins/YAMN/src/main.cpp | 33 | ||||
-rw-r--r-- | plugins/YAMN/src/proto/pop3/pop3comm.cpp | 22 | ||||
-rw-r--r-- | plugins/YAMN/src/proto/pop3/pop3opt.cpp | 18 | ||||
-rw-r--r-- | plugins/YAMN/src/services.cpp | 40 | ||||
-rw-r--r-- | plugins/YAMN/src/yamn.cpp | 4 | ||||
-rw-r--r-- | plugins/YAMN/src/yamn.h | 2 |
7 files changed, 75 insertions, 80 deletions
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index 09afbb815d..45691b407a 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -666,11 +666,11 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR cEvent.flags = 0;
CallServiceSync(MS_CLIST_ADDEVENT, 0,(LPARAM)&cEvent);
}
- DBWriteContactSettingString(ActualAccount->hContact, "CList", "StatusMsg", sMsg);
+ db_set_s(ActualAccount->hContact, "CList", "StatusMsg", sMsg);
if (nflags & YAMN_ACC_CONTNICK)
{
- DBWriteContactSettingString(ActualAccount->hContact, YAMN_DBMODULE, "Nick",sMsg);
+ db_set_s(ActualAccount->hContact, YAMN_DBMODULE, "Nick",sMsg);
}
}
@@ -808,12 +808,12 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR {
char tmp[255];
sprintf(tmp,Translate("%d new mail message(s), %d total"),MN->Real.PopUpNC+MN->Virtual.PopUpNC,MN->Real.PopUpTC+MN->Virtual.PopUpTC);
- DBWriteContactSettingString(ActualAccount->hContact, "CList", "StatusMsg", tmp);
+ db_set_s(ActualAccount->hContact, "CList", "StatusMsg", tmp);
}
- else DBWriteContactSettingString(ActualAccount->hContact, "CList", "StatusMsg", Translate("No new mail message"));
+ else db_set_s(ActualAccount->hContact, "CList", "StatusMsg", Translate("No new mail message"));
if (nflags & YAMN_ACC_CONTNICK)
- DBWriteContactSettingString(ActualAccount->hContact, YAMN_DBMODULE, "Nick", ActualAccount->Name);
+ db_set_s(ActualAccount->hContact, YAMN_DBMODULE, "Nick", ActualAccount->Name);
}
}
return;
@@ -850,10 +850,10 @@ LRESULT CALLBACK NewMailPopUpProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam hContact=(HANDLE)CallService(MS_POPUP_GETCONTACT,(WPARAM)hWnd,0);
- if (!DBGetContactSetting((HANDLE) hContact,YAMN_DBMODULE,"Id",&dbv))
+ if (!db_get((HANDLE) hContact,YAMN_DBMODULE,"Id",&dbv))
{
Account=(HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
Account = (HACCOUNT) hContact; //????
@@ -918,10 +918,10 @@ LRESULT CALLBACK NewMailPopUpProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam hContact=(HANDLE)CallService(MS_POPUP_GETCONTACT,(WPARAM)hWnd,0);
- if (!DBGetContactSetting((HANDLE) hContact,YAMN_DBMODULE,"Id",&dbv))
+ if (!db_get((HANDLE) hContact,YAMN_DBMODULE,"Id",&dbv))
{
ActualAccount=(HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
ActualAccount = (HACCOUNT) hContact;
@@ -951,10 +951,10 @@ LRESULT CALLBACK NoNewMailPopUpProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lPar hContact=(HANDLE)CallService(MS_POPUP_GETCONTACT,(WPARAM)hWnd,0);
- if (!DBGetContactSetting((HANDLE) hContact,YAMN_DBMODULE,"Id",&dbv))
+ if (!db_get((HANDLE) hContact,YAMN_DBMODULE,"Id",&dbv))
{
ActualAccount=(HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
ActualAccount = (HACCOUNT) hContact;
@@ -1018,10 +1018,10 @@ LRESULT CALLBACK NoNewMailPopUpProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lPar hContact=(HANDLE)CallService(MS_POPUP_GETCONTACT,(WPARAM)hWnd,0);
- if (!DBGetContactSetting((HANDLE) hContact,YAMN_DBMODULE,"Id",&dbv))
+ if (!db_get((HANDLE) hContact,YAMN_DBMODULE,"Id",&dbv))
{
ActualAccount=(HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME,(WPARAM)POP3Plugin,(LPARAM)dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
ActualAccount = (HACCOUNT) hContact;
@@ -1778,10 +1778,10 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM SizeX=coord.right-coord.left;
PosY=coord.top;
SizeY=coord.bottom-coord.top;
- DBWriteContactSettingDword(NULL,YAMN_DBMODULE,YAMN_DBPOSX,PosX);
- DBWriteContactSettingDword(NULL,YAMN_DBMODULE,YAMN_DBPOSY,PosY);
- DBWriteContactSettingDword(NULL,YAMN_DBMODULE,YAMN_DBSIZEX,SizeX);
- DBWriteContactSettingDword(NULL,YAMN_DBMODULE,YAMN_DBSIZEY,SizeY);
+ db_set_dw(NULL,YAMN_DBMODULE,YAMN_DBPOSX,PosX);
+ db_set_dw(NULL,YAMN_DBMODULE,YAMN_DBPOSY,PosY);
+ db_set_dw(NULL,YAMN_DBMODULE,YAMN_DBSIZEX,SizeX);
+ db_set_dw(NULL,YAMN_DBMODULE,YAMN_DBSIZEY,SizeY);
}
KillTimer(hDlg,TIMER_FLASHING);
@@ -2188,7 +2188,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM }
}
CloseHandle(ThreadRunningEV);
- if (DBGetContactSettingByte(NULL, YAMN_DBMODULE, YAMN_CLOSEDELETE, 0))
+ if (db_get_b(NULL, YAMN_DBMODULE, YAMN_CLOSEDELETE, 0))
DestroyWindow(hDlg);
}
diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index ea1a33e870..ccb7598853 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -52,9 +52,9 @@ HANDLE hTTButton; UINT SecTimer;
-HANDLE hMenuItemMain = 0;
-HANDLE hMenuItemCont = 0;
-HANDLE hMenuItemContApp = 0;
+HGENMENU hMenuItemMain = 0;
+HGENMENU hMenuItemCont = 0;
+HGENMENU hMenuItemContApp = 0;
HMODULE hUxTheme = 0;
BOOL (WINAPI *MyEnableThemeDialogTexture)(HANDLE, DWORD) = 0;
@@ -188,12 +188,7 @@ BOOL CALLBACK EnumSystemCodePagesProc(LPTSTR cpStr) void CheckMenuItems()
{
- CLISTMENUITEM clmi = { sizeof(clmi) };
- clmi.flags = CMIM_FLAGS;
- if ( !DBGetContactSettingByte(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, 1))
- clmi.flags |= CMIF_HIDDEN;
-
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hMenuItemMain, ( LPARAM )&clmi );
+ Menu_ShowItem(hMenuItemMain, db_get_b(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, 1) != 0);
}
int SystemModulesLoaded(WPARAM, LPARAM)
@@ -363,18 +358,18 @@ extern "C" int __declspec(dllexport) Load(void) if (NULL == (ExitEV = CreateEvent(NULL, TRUE, FALSE, NULL)))
return 1;
- PosX = DBGetContactSettingDword(NULL, YAMN_DBMODULE, YAMN_DBPOSX, 0);
- PosY = DBGetContactSettingDword(NULL, YAMN_DBMODULE, YAMN_DBPOSY, 0);
- SizeX = DBGetContactSettingDword(NULL, YAMN_DBMODULE, YAMN_DBSIZEX, 800);
- SizeY = DBGetContactSettingDword(NULL, YAMN_DBMODULE, YAMN_DBSIZEY, 200);
+ PosX = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBPOSX, 0);
+ PosY = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBPOSY, 0);
+ SizeX = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBSIZEX, 800);
+ SizeY = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBSIZEY, 200);
- HeadPosX = DBGetContactSettingDword(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSX, 0);
- HeadPosY = DBGetContactSettingDword(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSY, 0);
- HeadSizeX = DBGetContactSettingDword(NULL, YAMN_DBMODULE, YAMN_DBMSGSIZEX, 690);
- HeadSizeY = DBGetContactSettingDword(NULL, YAMN_DBMODULE, YAMN_DBMSGSIZEY, 300);
- HeadSplitPos = DBGetContactSettingWord(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSSPLIT, 250);
+ HeadPosX = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSX, 0);
+ HeadPosY = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSY, 0);
+ HeadSizeX = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGSIZEX, 690);
+ HeadSizeY = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGSIZEY, 300);
+ HeadSplitPos = db_get_w(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSSPLIT, 250);
- optDateTime = DBGetContactSettingByte(NULL, YAMN_DBMODULE, YAMN_DBTIMEOPTIONS, optDateTime);
+ optDateTime = db_get_b(NULL, YAMN_DBMODULE, YAMN_DBTIMEOPTIONS, optDateTime);
// Create new window queues for broadcast messages
YAMNVar.MessageWnds = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index 9514293cf3..d973548e74 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -285,18 +285,18 @@ int RegisterPOP3Plugin(WPARAM,LPARAM) szProto = GetContactProto(hContact);
if (szProto != NULL && strcmp(szProto, YAMN_DBMODULE)==0)
{
- if (!DBGetContactSettingString(hContact,YAMN_DBMODULE,"Id",&dbv)) {
+ if (!db_get_s(hContact,YAMN_DBMODULE,"Id",&dbv)) {
if ( strcmp( dbv.pszVal, Finder->Name) == 0) {
Finder->hContact = hContact;
- DBWriteContactSettingWord(Finder->hContact, YAMN_DBMODULE, "Status", ID_STATUS_ONLINE);
- DBWriteContactSettingString(Finder->hContact, "CList", "StatusMsg", Translate("No new mail message"));
+ db_set_w(Finder->hContact, YAMN_DBMODULE, "Status", ID_STATUS_ONLINE);
+ db_set_s(Finder->hContact, "CList", "StatusMsg", Translate("No new mail message"));
if ((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT))
- DBDeleteContactSetting(Finder->hContact, "CList", "Hidden");
+ db_unset(Finder->hContact, "CList", "Hidden");
if (!(Finder->Flags & YAMN_ACC_ENA) || !(Finder->NewMailN.Flags & YAMN_ACC_CONT))
- DBWriteContactSettingByte(Finder->hContact, "CList", "Hidden", 1);
+ db_set_b(Finder->hContact, "CList", "Hidden", 1);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
hContact = db_find_next(hContact);
@@ -306,10 +306,10 @@ int RegisterPOP3Plugin(WPARAM,LPARAM) //No account contact found, have to create one
Finder->hContact =(HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)Finder->hContact,(LPARAM)YAMN_DBMODULE);
- DBWriteContactSettingString(Finder->hContact,YAMN_DBMODULE,"Id",Finder->Name);
- DBWriteContactSettingString(Finder->hContact,YAMN_DBMODULE,"Nick",Finder->Name);
- DBWriteContactSettingString(Finder->hContact,"Protocol","p",YAMN_DBMODULE);
- DBWriteContactSettingWord(Finder->hContact, YAMN_DBMODULE, "Status", YAMN_STATUS);
+ db_set_s(Finder->hContact,YAMN_DBMODULE,"Id",Finder->Name);
+ db_set_s(Finder->hContact,YAMN_DBMODULE,"Nick",Finder->Name);
+ db_set_s(Finder->hContact,"Protocol","p",YAMN_DBMODULE);
+ db_set_w(Finder->hContact, YAMN_DBMODULE, "Status", YAMN_STATUS);
}
}
@@ -407,7 +407,7 @@ HYAMNMAIL WINAPI CreatePOP3Mail(HACCOUNT Account,DWORD MailDataVersion) static void SetContactStatus(HACCOUNT account, int status) {
if ((account->hContact) && (account->NewMailN.Flags & YAMN_ACC_CONT)) {
- DBWriteContactSettingWord(account->hContact, YAMN_DBMODULE, "Status", status);
+ db_set_w(account->hContact, YAMN_DBMODULE, "Status", status);
}
}
diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp index 72696430ab..698ce1f9fa 100644 --- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp @@ -20,13 +20,13 @@ INT_PTR CALLBACK DlgProcYAMNOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lParam) switch(msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hDlg);
- CheckDlgButton(hDlg,IDC_CHECKTTB,DBGetContactSettingByte(NULL,YAMN_DBMODULE,YAMN_TTBFCHECK,1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg,IDC_CHECKTTB,db_get_b(NULL,YAMN_DBMODULE,YAMN_TTBFCHECK,1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_LONGDATE,(optDateTime&SHOWDATELONG) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_SMARTDATE,(optDateTime&SHOWDATENOTODAY) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg,IDC_NOSECONDS,(optDateTime&SHOWDATENOSECONDS) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg,IDC_MAINMENU,DBGetContactSettingByte(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, 1));
- CheckDlgButton(hDlg,IDC_YAMNASPROTO,DBGetContactSettingByte(NULL, YAMN_DBMODULE, YAMN_SHOWASPROTO, 1));
- CheckDlgButton(hDlg,IDC_CLOSEONDELETE,DBGetContactSettingByte(NULL, YAMN_DBMODULE, YAMN_CLOSEDELETE, 0));
+ CheckDlgButton(hDlg,IDC_MAINMENU,db_get_b(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, 1));
+ CheckDlgButton(hDlg,IDC_YAMNASPROTO,db_get_b(NULL, YAMN_DBMODULE, YAMN_SHOWASPROTO, 1));
+ CheckDlgButton(hDlg,IDC_CLOSEONDELETE,db_get_b(NULL, YAMN_DBMODULE, YAMN_CLOSEDELETE, 0));
break;
case WM_COMMAND:
@@ -48,10 +48,10 @@ INT_PTR CALLBACK DlgProcYAMNOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lParam) case 0:
switch(((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- DBWriteContactSettingByte(NULL, YAMN_DBMODULE, YAMN_SHOWASPROTO, IsDlgButtonChecked(hDlg,IDC_YAMNASPROTO));
- DBWriteContactSettingByte(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, IsDlgButtonChecked(hDlg,IDC_MAINMENU));
- DBWriteContactSettingByte(NULL, YAMN_DBMODULE, YAMN_CLOSEDELETE, IsDlgButtonChecked(hDlg,IDC_CLOSEONDELETE));
- DBWriteContactSettingByte(NULL, YAMN_DBMODULE, YAMN_TTBFCHECK, IsDlgButtonChecked(hDlg,IDC_CHECKTTB));
+ db_set_b(NULL, YAMN_DBMODULE, YAMN_SHOWASPROTO, IsDlgButtonChecked(hDlg,IDC_YAMNASPROTO));
+ db_set_b(NULL, YAMN_DBMODULE, YAMN_SHOWMAINMENU, IsDlgButtonChecked(hDlg,IDC_MAINMENU));
+ db_set_b(NULL, YAMN_DBMODULE, YAMN_CLOSEDELETE, IsDlgButtonChecked(hDlg,IDC_CLOSEONDELETE));
+ db_set_b(NULL, YAMN_DBMODULE, YAMN_TTBFCHECK, IsDlgButtonChecked(hDlg,IDC_CHECKTTB));
AddTopToolbarIcon(0, 0);
CheckMenuItems();
@@ -60,7 +60,7 @@ INT_PTR CALLBACK DlgProcYAMNOpt(HWND hDlg,UINT msg,WPARAM wParam,LPARAM lParam) if (IsDlgButtonChecked(hDlg,IDC_LONGDATE))optDateTime |= SHOWDATELONG;
if (IsDlgButtonChecked(hDlg,IDC_SMARTDATE))optDateTime |= SHOWDATENOTODAY;
if (IsDlgButtonChecked(hDlg,IDC_NOSECONDS))optDateTime |= SHOWDATENOSECONDS;
- DBWriteContactSettingByte(NULL,YAMN_DBMODULE,YAMN_DBTIMEOPTIONS,optDateTime);
+ db_set_b(NULL,YAMN_DBMODULE,YAMN_DBTIMEOPTIONS,optDateTime);
}
}
break;
diff --git a/plugins/YAMN/src/services.cpp b/plugins/YAMN/src/services.cpp index 759d998285..6147b69979 100644 --- a/plugins/YAMN/src/services.cpp +++ b/plugins/YAMN/src/services.cpp @@ -13,7 +13,7 @@ static INT_PTR Service_GetCaps(WPARAM wParam, LPARAM lParam) if (wParam == PFLAGNUM_2)
return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND;
if (wParam == PFLAGNUM_5) {
- if (DBGetContactSettingByte(NULL, YAMN_DBMODULE, YAMN_SHOWASPROTO, 1))
+ if (db_get_b(NULL, YAMN_DBMODULE, YAMN_SHOWASPROTO, 1))
return PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND;
return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND;
}
@@ -70,7 +70,7 @@ static INT_PTR ContactApplication(WPARAM wParam, LPARAM lParam) return 0;
DBVARIANT dbv;
- if ( DBGetContactSetting((HANDLE) wParam, YAMN_DBMODULE, "Id", &dbv))
+ if ( db_get((HANDLE) wParam, YAMN_DBMODULE, "Id", &dbv))
return 0;
HACCOUNT ActualAccount = (HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal);
@@ -115,7 +115,7 @@ static INT_PTR ContactApplication(WPARAM wParam, LPARAM lParam) DebugLog(SynchroFile, "ContactApplication:ActualAccountSO-read enter failed\n");
#endif
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 0;
}
@@ -173,7 +173,7 @@ static INT_PTR ContactMailCheck(WPARAM wParam, LPARAM lParam) return 0;
DBVARIANT dbv;
- if ( DBGetContactSetting((HANDLE) wParam, YAMN_DBMODULE, "Id", &dbv))
+ if ( db_get((HANDLE) wParam, YAMN_DBMODULE, "Id", &dbv))
return 0;
HACCOUNT ActualAccount = (HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal);
@@ -217,7 +217,7 @@ static INT_PTR ContactMailCheck(WPARAM wParam, LPARAM lParam) LeaveCriticalSection(&PluginRegCS);
CloseHandle(ThreadRunningEV);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 0;
}
@@ -232,7 +232,7 @@ void MainMenuAccountClicked(WPARAM wParam, LPARAM lParam) return;
DBVARIANT dbv;
- if ( DBGetContactSetting(( HANDLE )wParam, YAMN_DBMODULE, "Id", &dbv))
+ if ( db_get(( HANDLE )wParam, YAMN_DBMODULE, "Id", &dbv))
return;
HACCOUNT ActualAccount = (HACCOUNT) CallService(MS_YAMN_FINDACCOUNTBYNAME, (WPARAM)POP3Plugin, (LPARAM)dbv.pszVal);
@@ -265,7 +265,7 @@ void MainMenuAccountClicked(WPARAM wParam, LPARAM lParam) #endif
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -304,7 +304,7 @@ HBITMAP LoadBmpFromIcon(HICON hIcon) int AddTopToolbarIcon(WPARAM,LPARAM)
{
- if ( DBGetContactSettingByte(NULL, YAMN_DBMODULE, YAMN_TTBFCHECK, 1)) {
+ if ( db_get_b(NULL, YAMN_DBMODULE, YAMN_TTBFCHECK, 1)) {
if ( ServiceExists(MS_TTB_REMOVEBUTTON) && hTTButton == NULL) {
TTBButton btn = {0};
btn.cbSize = sizeof(btn);
@@ -331,11 +331,11 @@ int Shutdown(WPARAM, LPARAM) {
CallService(MS_TTB_REMOVEBUTTON, (WPARAM)hTTButton, 0);
- DBWriteContactSettingDword(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSX, HeadPosX);
- DBWriteContactSettingDword(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSY, HeadPosY);
- DBWriteContactSettingDword(NULL, YAMN_DBMODULE, YAMN_DBMSGSIZEX, HeadSizeX);
- DBWriteContactSettingDword(NULL, YAMN_DBMODULE, YAMN_DBMSGSIZEY, HeadSizeY);
- DBWriteContactSettingWord(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSSPLIT, HeadSplitPos);
+ db_set_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSX, HeadPosX);
+ db_set_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSY, HeadPosY);
+ db_set_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGSIZEX, HeadSizeX);
+ db_set_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGSIZEY, HeadSizeY);
+ db_set_w(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSSPLIT, HeadSplitPos);
YAMNVar.Shutdown = TRUE;
KillTimer(NULL, SecTimer);
@@ -478,16 +478,16 @@ void RefreshContact(void) for (Finder = POP3Plugin->FirstAccount;Finder != NULL;Finder = Finder->Next) {
if (Finder->hContact != NULL) {
if ((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT))
- DBDeleteContactSetting(Finder->hContact, "CList", "Hidden");
+ db_unset(Finder->hContact, "CList", "Hidden");
else
- DBWriteContactSettingByte(Finder->hContact, "CList", "Hidden", 1);
+ db_set_b(Finder->hContact, "CList", "Hidden", 1);
}
else if ((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT)) {
Finder->hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)Finder->hContact, (LPARAM)YAMN_DBMODULE);
- DBWriteContactSettingString(Finder->hContact, YAMN_DBMODULE, "Id", Finder->Name);
- DBWriteContactSettingString(Finder->hContact, YAMN_DBMODULE, "Nick", Finder->Name);
- DBWriteContactSettingString(Finder->hContact, "Protocol", "p", YAMN_DBMODULE);
- DBWriteContactSettingWord(Finder->hContact, YAMN_DBMODULE, "Status", ID_STATUS_ONLINE);
- DBWriteContactSettingString(Finder->hContact, "CList", "StatusMsg", Translate("No new mail message"));
+ db_set_s(Finder->hContact, YAMN_DBMODULE, "Id", Finder->Name);
+ db_set_s(Finder->hContact, YAMN_DBMODULE, "Nick", Finder->Name);
+ db_set_s(Finder->hContact, "Protocol", "p", YAMN_DBMODULE);
+ db_set_w(Finder->hContact, YAMN_DBMODULE, "Status", ID_STATUS_ONLINE);
+ db_set_s(Finder->hContact, "CList", "StatusMsg", Translate("No new mail message"));
} } }
diff --git a/plugins/YAMN/src/yamn.cpp b/plugins/YAMN/src/yamn.cpp index 98d8feaab8..adc552555e 100644 --- a/plugins/YAMN/src/yamn.cpp +++ b/plugins/YAMN/src/yamn.cpp @@ -235,11 +235,11 @@ ChangeIsCountingStatusLabel: #endif
if (((ActualAccount->isCounting) != 0) != isAccountCounting) {
ActualAccount->isCounting=isAccountCounting;
- WORD cStatus = DBGetContactSettingWord(ActualAccount->hContact, YAMN_DBMODULE, "Status", 0);
+ WORD cStatus = db_get_w(ActualAccount->hContact, YAMN_DBMODULE, "Status", 0);
switch (cStatus) {
case ID_STATUS_ONLINE:
case ID_STATUS_OFFLINE:
- DBWriteContactSettingWord(ActualAccount->hContact, YAMN_DBMODULE, "Status", isAccountCounting?ID_STATUS_ONLINE:ID_STATUS_OFFLINE);
+ db_set_w(ActualAccount->hContact, YAMN_DBMODULE, "Status", isAccountCounting?ID_STATUS_ONLINE:ID_STATUS_OFFLINE);
default: break;
}
}
diff --git a/plugins/YAMN/src/yamn.h b/plugins/YAMN/src/yamn.h index a0b5ab7eee..b7785d1651 100644 --- a/plugins/YAMN/src/yamn.h +++ b/plugins/YAMN/src/yamn.h @@ -265,7 +265,7 @@ extern DWORD WINAPI BadConnection(LPVOID Param); extern PVOID TLSCtx;
extern PVOID SSLCtx;
-extern HANDLE hMenuItemMain, hMenuItemCont, hMenuItemContApp;
+extern HGENMENU hMenuItemMain, hMenuItemCont, hMenuItemContApp;
extern PYAMN_VARIABLES pYAMNVar;
#endif
|