summaryrefslogtreecommitdiff
path: root/plugins/QuickMessages/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-05 22:27:16 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-05 22:27:16 +0000
commit007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (patch)
treeb1ee30b70c6e36d1a06aed6885cb80dc560a68ca /plugins/QuickMessages/src
parentf4a1bbc6ba4b8137cb868639ac146aa97e97e9df (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/QuickMessages/src')
-rw-r--r--plugins/QuickMessages/src/Utils.cpp40
-rw-r--r--plugins/QuickMessages/src/main.cpp8
-rw-r--r--plugins/QuickMessages/src/options.cpp22
3 files changed, 35 insertions, 35 deletions
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp
index 85a77e9de2..b0c40e1f7b 100644
--- a/plugins/QuickMessages/src/Utils.cpp
+++ b/plugins/QuickMessages/src/Utils.cpp
@@ -171,22 +171,22 @@ void SaveModuleSettings(int buttonnum,ButtonData* bd)
char szMEntry[256]={'\0'};
mir_snprintf(szMEntry,255,"EntryName_%u_%u",buttonnum,bd->dwPos);
- DBWriteContactSettingTString(NULL, PLGNAME,szMEntry,bd->pszName );
+ db_set_ts(NULL, PLGNAME,szMEntry,bd->pszName );
mir_snprintf(szMEntry,255,"EntryValue_%u_%u",buttonnum,bd->dwPos);
if(bd->pszValue)
- DBWriteContactSettingTString(NULL, PLGNAME,szMEntry,bd->pszValue );
+ db_set_ts(NULL, PLGNAME,szMEntry,bd->pszValue );
else
- DBDeleteContactSetting(NULL, PLGNAME,szMEntry);
+ db_unset(NULL, PLGNAME,szMEntry);
mir_snprintf(szMEntry,255,"EntryRel_%u_%u",buttonnum,bd->dwPos);
- DBWriteContactSettingByte(NULL, PLGNAME,szMEntry,bd->fEntryType );
+ db_set_b(NULL, PLGNAME,szMEntry,bd->fEntryType );
mir_snprintf(szMEntry,255,"EntryToQMenu_%u_%u",buttonnum,bd->dwPos);
- DBWriteContactSettingByte(NULL, PLGNAME,szMEntry,bd->bInQMenu);
+ db_set_b(NULL, PLGNAME,szMEntry,bd->bInQMenu);
mir_snprintf(szMEntry,255,"EntryIsServiceName_%u_%u",buttonnum,bd->dwPos);
- DBWriteContactSettingByte(NULL, PLGNAME,szMEntry,bd->bIsServName);
+ db_set_b(NULL, PLGNAME,szMEntry,bd->bIsServName);
}
void CleanSettings(int buttonnum,int from)
@@ -195,28 +195,28 @@ void CleanSettings(int buttonnum,int from)
DBVARIANT dbv = {0};
if(from==-1){
mir_snprintf(szMEntry,255,"ButtonName_%u",buttonnum);
- DBDeleteContactSetting(NULL, PLGNAME,szMEntry);
+ db_unset(NULL, PLGNAME,szMEntry);
mir_snprintf(szMEntry,255,"ButtonValue_%u",buttonnum);
- DBDeleteContactSetting(NULL, PLGNAME,szMEntry);
+ db_unset(NULL, PLGNAME,szMEntry);
mir_snprintf(szMEntry,255,"RCEntryIsServiceName_%u",buttonnum);
- DBDeleteContactSetting(NULL, PLGNAME,szMEntry);
+ db_unset(NULL, PLGNAME,szMEntry);
}
mir_snprintf(szMEntry,255,"EntryName_%u_%u",buttonnum,from);
- while(!DBGetContactSettingTString(NULL, PLGNAME,szMEntry,&dbv)) {
- DBDeleteContactSetting(NULL, PLGNAME,szMEntry);
+ while(!db_get_ts(NULL, PLGNAME,szMEntry,&dbv)) {
+ db_unset(NULL, PLGNAME,szMEntry);
mir_snprintf(szMEntry,255,"EntryValue_%u_%u",buttonnum,from);
- DBDeleteContactSetting(NULL, PLGNAME,szMEntry);
+ db_unset(NULL, PLGNAME,szMEntry);
mir_snprintf(szMEntry,255,"EntryRel_%u_%u",buttonnum,from);
- DBDeleteContactSetting(NULL, PLGNAME,szMEntry);
+ db_unset(NULL, PLGNAME,szMEntry);
mir_snprintf(szMEntry,255,"EntryToQMenu_%u_%u",buttonnum,from);
- DBDeleteContactSetting(NULL, PLGNAME,szMEntry);
+ db_unset(NULL, PLGNAME,szMEntry);
mir_snprintf(szMEntry,255,"EntryIsServiceName_%u_%u",buttonnum,from);
- DBDeleteContactSetting(NULL, PLGNAME,szMEntry);
+ db_unset(NULL, PLGNAME,szMEntry);
mir_snprintf(szMEntry,255,"EntryName_%u_%u",buttonnum,++from);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
BYTE getEntryByte(int buttonnum,int entrynum,BOOL mode)
@@ -230,7 +230,7 @@ BYTE getEntryByte(int buttonnum,int entrynum,BOOL mode)
mir_snprintf(szMEntry,255,"EntryIsServiceName_%u_%u",buttonnum,entrynum);
else if (mode==3)
mir_snprintf(szMEntry,255,"RCEntryIsServiceName_%u",buttonnum);
- return DBGetContactSettingByte(NULL, PLGNAME,szMEntry, 0);
+ return db_get_b(NULL, PLGNAME,szMEntry, 0);
}
static HANDLE AddIcon(char* szIcoName)
@@ -286,7 +286,7 @@ void InitButtonsList()
ListData* ld=NULL;
if (!(pszBName=getMenuEntry(i,0,3))) {
g_iButtonsCount=i;
- DBWriteContactSettingByte(NULL, PLGNAME,"ButtonsCount", (BYTE)g_iButtonsCount);
+ db_set_b(NULL, PLGNAME,"ButtonsCount", (BYTE)g_iButtonsCount);
break;}
ld = (ListData *)mir_alloc(sizeof(ListData));
@@ -362,12 +362,12 @@ TCHAR* getMenuEntry(int buttonnum,int entrynum,BYTE mode)
mir_snprintf(szMEntry,255,"ButtonName_%u",buttonnum);
- DBGetContactSettingTString(NULL, PLGNAME,szMEntry, &dbv);
+ db_get_ts(NULL, PLGNAME,szMEntry, &dbv);
if(dbv.ptszVal&&_tcslen(dbv.ptszVal))
{
buffer=mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return buffer;
diff --git a/plugins/QuickMessages/src/main.cpp b/plugins/QuickMessages/src/main.cpp
index 45777de3f7..c8aded16da 100644
--- a/plugins/QuickMessages/src/main.cpp
+++ b/plugins/QuickMessages/src/main.cpp
@@ -294,10 +294,10 @@ static int PluginInit(WPARAM wparam,LPARAM lparam)
HookEvent(ME_MSG_TOOLBARLOADED, RegisterCustomButton);
HookEvent(ME_MSG_WINDOWPOPUP, InputMenuPopup);
- g_bRClickAuto = DBGetContactSettingByte(NULL,PLGNAME,"RClickAuto",0);
- g_bLClickAuto = DBGetContactSettingByte(NULL,PLGNAME,"LClickAuto",0);
- g_iButtonsCount = DBGetContactSettingByte(NULL, PLGNAME,"ButtonsCount", 0);
- g_bQuickMenu = DBGetContactSettingByte(NULL, PLGNAME,"QuickMenu", 1);
+ g_bRClickAuto = db_get_b(NULL,PLGNAME,"RClickAuto",0);
+ g_bLClickAuto = db_get_b(NULL,PLGNAME,"LClickAuto",0);
+ g_iButtonsCount = db_get_b(NULL, PLGNAME,"ButtonsCount", 0);
+ g_bQuickMenu = db_get_b(NULL, PLGNAME,"QuickMenu", 1);
InitButtonsList();
diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp
index 7b53dfc933..8d0ea49efb 100644
--- a/plugins/QuickMessages/src/options.cpp
+++ b/plugins/QuickMessages/src/options.cpp
@@ -261,7 +261,7 @@ void SaveMenuTree(HWND hdlg)
if(ld->ptszQValue)
{
mir_snprintf(szMEntry,255,"ButtonValue_%u",iBl);
- DBWriteContactSettingTString(NULL, PLGNAME,szMEntry,ld->ptszQValue);
+ db_set_ts(NULL, PLGNAME,szMEntry,ld->ptszQValue);
}
@@ -277,13 +277,13 @@ void SaveMenuTree(HWND hdlg)
mir_snprintf(szMEntry,255,"ButtonName_%u",iBl);
- DBWriteContactSettingTString(NULL, PLGNAME,szMEntry,ld->ptszButtonName);
+ db_set_ts(NULL, PLGNAME,szMEntry,ld->ptszButtonName);
ld->dwOPFlags=0;
ld->dwPos=iBl;
ld->bIsServName=ld->bIsOpServName;
mir_snprintf(szMEntry,255,"RCEntryIsServiceName_%u",iBl);
- DBWriteContactSettingByte(NULL, PLGNAME,szMEntry,ld->bIsServName);
+ db_set_b(NULL, PLGNAME,szMEntry,ld->bIsServName);
bDeleted=FALSE;
@@ -333,7 +333,7 @@ void SaveMenuTree(HWND hdlg)
iBl++;
}
- DBWriteContactSettingByte(NULL, PLGNAME,"ButtonsCount", (BYTE)g_iButtonsCount);
+ db_set_b(NULL, PLGNAME,"ButtonsCount", (BYTE)g_iButtonsCount);
}
void RestoreModuleData(HWND hdlg)
@@ -533,7 +533,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
g_opHdlg=hdlg;
bOptionsInit=TRUE;
TranslateDialogDefault(hdlg);
- if(g_iButtonsCount!=DBGetContactSettingByte(NULL, PLGNAME,"ButtonsCount", 0))
+ if(g_iButtonsCount!=db_get_b(NULL, PLGNAME,"ButtonsCount", 0))
{
LOGFONT logFont;
HFONT hFont;
@@ -583,9 +583,9 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),FALSE);
EnableWindow(GetDlgItem(hdlg,IDC_INQMENU),FALSE);
EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),FALSE);
- CheckDlgButton(hdlg,IDC_RAUTOSEND,(g_bRClickAuto=DBGetContactSettingByte(NULL,PLGNAME,"RClickAuto",0)));
- CheckDlgButton(hdlg,IDC_LAUTOSEND,(g_bLClickAuto=DBGetContactSettingByte(NULL,PLGNAME,"LClickAuto",0)));
- CheckDlgButton(hdlg,IDC_ENABLEQUICKMENU,(g_bQuickMenu=DBGetContactSettingByte(NULL, PLGNAME,"QuickMenu", 1)));
+ CheckDlgButton(hdlg,IDC_RAUTOSEND,(g_bRClickAuto=db_get_b(NULL,PLGNAME,"RClickAuto",0)));
+ CheckDlgButton(hdlg,IDC_LAUTOSEND,(g_bLClickAuto=db_get_b(NULL,PLGNAME,"LClickAuto",0)));
+ CheckDlgButton(hdlg,IDC_ENABLEQUICKMENU,(g_bQuickMenu=db_get_b(NULL, PLGNAME,"QuickMenu", 1)));
bOptionsInit=FALSE;
}break;
@@ -731,9 +731,9 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
SetMenuEntryProperties(hdlg);
SaveMenuTree(hdlg);
}
- DBWriteContactSettingByte(NULL,PLGNAME,"RClickAuto",(BYTE)(g_bRClickAuto=IsDlgButtonChecked(hdlg,IDC_RAUTOSEND)));
- DBWriteContactSettingByte(NULL,PLGNAME,"LClickAuto",(BYTE)(g_bLClickAuto=IsDlgButtonChecked(hdlg,IDC_LAUTOSEND)));
- DBWriteContactSettingByte(NULL,PLGNAME,"QuickMenu",(BYTE)(g_bQuickMenu=IsDlgButtonChecked(hdlg,IDC_ENABLEQUICKMENU)));
+ db_set_b(NULL,PLGNAME,"RClickAuto",(BYTE)(g_bRClickAuto=IsDlgButtonChecked(hdlg,IDC_RAUTOSEND)));
+ db_set_b(NULL,PLGNAME,"LClickAuto",(BYTE)(g_bLClickAuto=IsDlgButtonChecked(hdlg,IDC_LAUTOSEND)));
+ db_set_b(NULL,PLGNAME,"QuickMenu",(BYTE)(g_bQuickMenu=IsDlgButtonChecked(hdlg,IDC_ENABLEQUICKMENU)));
return 1;
}
else if (((LPNMHDR)lparam)->code == PSN_RESET ) {