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 | |
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')
406 files changed, 4504 insertions, 4846 deletions
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index beff99167f..7cee95c5ff 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -248,7 +248,7 @@ static void NotifyMetaAware(HANDLE hContact, struct CacheNode *node = NULL, AVAT char *szProto = GetContactProto(hContact);
if (szProto != NULL) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingString(hContact, szProto, "AvatarHash", &dbv)) {
+ if ( !db_get_s(hContact, szProto, "AvatarHash", &dbv)) {
if (dbv.type == DBVT_TCHAR) {
_tcsncpy(cacn.hash, dbv.ptszVal, SIZEOF(cacn.hash));
} else if (dbv.type == DBVT_BLOB) {
@@ -372,7 +372,7 @@ void MakePathRelative(HANDLE hContact, TCHAR *path) static void MakePathRelative(HANDLE hContact)
{
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(hContact, "ContactPhoto", "File", &dbv)) {
+ if ( !db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
MakePathRelative(hContact, dbv.ptszVal);
db_free(&dbv);
}
@@ -390,10 +390,10 @@ static TCHAR *getJGMailID(char *szProto) static TCHAR szJID[MAX_PATH+1]; szJID[0] = '\0';
DBVARIANT dbva, dbvb;
- if ( DBGetContactSettingTString(NULL, szProto, "LoginName", &dbva))
+ if ( db_get_ts(NULL, szProto, "LoginName", &dbva))
return szJID;
- if ( DBGetContactSettingTString(NULL, szProto, "LoginServer", &dbvb)) {
+ if ( db_get_ts(NULL, szProto, "LoginServer", &dbvb)) {
db_free(&dbva);
return szJID;
}
@@ -430,15 +430,15 @@ int CreateAvatarInCache(HANDLE hContact, avatarCacheEntry *ace, char *szProto) }
if (db_get_b(hContact, "ContactPhoto", "Locked", 0)
- && !DBGetContactSettingTString(hContact, "ContactPhoto", "Backup", &dbv)) {
+ && !db_get_ts(hContact, "ContactPhoto", "Backup", &dbv)) {
AVS_pathToAbsolute(dbv.ptszVal, tszFilename);
db_free(&dbv);
}
- else if ( !DBGetContactSettingTString(hContact, "ContactPhoto", "RFile", &dbv)) {
+ else if ( !db_get_ts(hContact, "ContactPhoto", "RFile", &dbv)) {
AVS_pathToAbsolute(dbv.ptszVal, tszFilename);
db_free(&dbv);
}
- else if ( !DBGetContactSettingTString(hContact, "ContactPhoto", "File", &dbv)) {
+ else if ( !db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
AVS_pathToAbsolute(dbv.ptszVal, tszFilename);
db_free(&dbv);
}
@@ -448,13 +448,13 @@ int CreateAvatarInCache(HANDLE hContact, avatarCacheEntry *ace, char *szProto) }
else {
if (hContact == 0) { // create a protocol picture in the proto picture cache
- if ( !DBGetContactSettingTString(NULL, PPICT_MODULE, szProto, &dbv)) {
+ if ( !db_get_ts(NULL, PPICT_MODULE, szProto, &dbv)) {
AVS_pathToAbsolute(dbv.ptszVal, tszFilename);
db_free(&dbv);
}
else {
if (lstrcmpA(szProto, AVS_DEFAULT)) {
- if ( !DBGetContactSettingTString(NULL, PPICT_MODULE, AVS_DEFAULT, &dbv)) {
+ if ( !db_get_ts(NULL, PPICT_MODULE, AVS_DEFAULT, &dbv)) {
AVS_pathToAbsolute(dbv.ptszVal, tszFilename);
db_free(&dbv);
}
@@ -465,7 +465,7 @@ int CreateAvatarInCache(HANDLE hContact, avatarCacheEntry *ace, char *szProto) return -1;
char key[MAX_PATH];
mir_snprintf(key, SIZEOF(key), "Global avatar for %s accounts", pdescr->szProtoName);
- if ( !DBGetContactSettingTString(NULL, PPICT_MODULE, key, &dbv)) {
+ if ( !db_get_ts(NULL, PPICT_MODULE, key, &dbv)) {
AVS_pathToAbsolute(dbv.ptszVal, tszFilename);
db_free(&dbv);
}
@@ -477,7 +477,7 @@ int CreateAvatarInCache(HANDLE hContact, avatarCacheEntry *ace, char *szProto) // startup and everytime they are changed.
if (szProto[0] == '\0') {
// Global avatar
- if ( DBGetContactSettingTString(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv))
+ if ( db_get_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv))
return -10;
AVS_pathToAbsolute(dbv.ptszVal, tszFilename);
@@ -494,7 +494,7 @@ int CreateAvatarInCache(HANDLE hContact, avatarCacheEntry *ace, char *szProto) else
MultiByteToWideChar( CP_ACP, 0, szFileName, -1, tszFilename, SIZEOF(tszFilename));
}
- else if ( !DBGetContactSettingTString(NULL, szProto, "AvatarFile", &dbv)) {
+ else if ( !db_get_ts(NULL, szProto, "AvatarFile", &dbv)) {
AVS_pathToAbsolute(dbv.ptszVal, tszFilename);
db_free(&dbv);
}
@@ -546,7 +546,7 @@ int CreateAvatarInCache(HANDLE hContact, avatarCacheEntry *ace, char *szProto) if (imgHash != db_get_dw(hContact, "ContactPhoto", "ImageHash", 0))
{
ResetTranspSettings(hContact);
- DBWriteContactSettingDword(hContact, "ContactPhoto", "ImageHash", imgHash);
+ db_set_dw(hContact, "ContactPhoto", "ImageHash", imgHash);
}
// Make transparent?
@@ -1095,7 +1095,7 @@ static void FilterGetStrings(TCHAR *filter, int bytesLeft, BOOL xml, BOOL swf) static void DeleteGlobalUserAvatar()
{
DBVARIANT dbv = {0};
- if (DBGetContactSettingTString(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv))
+ if (db_get_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv))
return;
TCHAR szFilename[MAX_PATH];
@@ -1135,7 +1135,7 @@ static int InternalRemoveMyAvatar(char *protocol) {
// Has global avatar?
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv)) {
+ if ( !db_get_ts(NULL, AVS_MODULE, "GlobalUserAvatarFile", &dbv)) {
db_free(&dbv);
db_set_b(NULL, AVS_MODULE, "GlobalUserAvatarNotConsistent", 1);
DeleteGlobalUserAvatar();
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index b720b900fc..46908870fa 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -400,7 +400,7 @@ INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wParam, LPA g_selectedProto = GetProtoFromList(hwndDlg, iItem);
if ( g_selectedProto ) {
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, PPICT_MODULE, g_selectedProto, &dbv)) {
+ if ( !db_get_ts(NULL, PPICT_MODULE, g_selectedProto, &dbv)) {
if ( !AVS_pathIsAbsolute(dbv.ptszVal)) {
TCHAR szFinalPath[MAX_PATH];
mir_sntprintf(szFinalPath, SIZEOF(szFinalPath), _T("%%miranda_path%%\\%s"), dbv.ptszVal);
@@ -616,7 +616,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA ProtectAvatar((WPARAM)hContact, 0);
if (MessageBox(0, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) {
- if ( !DBGetContactSettingTString(hContact, "ContactPhoto", "File", &dbv)) {
+ if ( !db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
DeleteFile(dbv.ptszVal);
db_free(&dbv);
}
@@ -641,7 +641,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA DBVARIANT dbv = {0};
ProtectAvatar((WPARAM)hContact, 0);
if (MessageBox(0, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) {
- if ( !DBGetContactSettingTString(hContact, "ContactPhoto", "File", &dbv)) {
+ if ( !db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
DeleteFile(dbv.ptszVal);
db_free(&dbv);
}
@@ -708,15 +708,15 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA szFinalName[0] = 0;
- if (is_locked && !DBGetContactSettingTString(hContact, "ContactPhoto", "Backup", &dbv)) {
+ if (is_locked && !db_get_ts(hContact, "ContactPhoto", "Backup", &dbv)) {
AVS_pathToAbsolute(dbv.ptszVal, szFinalName);
db_free(&dbv);
}
- else if ( !DBGetContactSettingTString(hContact, "ContactPhoto", "RFile", &dbv)) {
+ else if ( !db_get_ts(hContact, "ContactPhoto", "RFile", &dbv)) {
AVS_pathToAbsolute(dbv.ptszVal, szFinalName);
db_free(&dbv);
}
- else if ( !DBGetContactSettingTString(hContact, "ContactPhoto", "File", &dbv)) {
+ else if ( !db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
AVS_pathToAbsolute(dbv.ptszVal, szFinalName);
db_free(&dbv);
}
@@ -847,7 +847,7 @@ INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wParam, LP ProtectAvatar((WPARAM)hContact, 0);
if (MessageBox(0, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) {
- if ( !DBGetContactSettingTString(hContact, "ContactPhoto", "File", &dbv)) {
+ if ( !db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
DeleteFile(dbv.ptszVal);
db_free(&dbv);
}
@@ -870,7 +870,7 @@ INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wParam, LP ProtectAvatar((WPARAM)hContact, 0);
if (MessageBox(0, TranslateT("Delete picture file from disk (may be necessary to force a reload, but will delete local pictures)?"), TranslateT("Reset contact picture"), MB_YESNO) == IDYES) {
- if ( !DBGetContactSettingTString(hContact, "ContactPhoto", "File", &dbv)) {
+ if ( !db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
DeleteFile(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp index 814e5658ef..15de673f7d 100644 --- a/plugins/AddContactPlus/src/addcontact.cpp +++ b/plugins/AddContactPlus/src/addcontact.cpp @@ -203,10 +203,10 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp DBVARIANT dbv;
char idstr[4];
_itoa(groupId, idstr, 10);
- if (DBGetContactSettingTString(NULL, "CListGroups", idstr, &dbv)) break;
+ if (db_get_ts(NULL, "CListGroups", idstr, &dbv)) break;
int id = SendDlgItemMessage(hdlg, IDC_GROUP, CB_ADDSTRING, 0, (LPARAM)(dbv.ptszVal + 1));
SendDlgItemMessage(hdlg, IDC_GROUP, CB_SETITEMDATA, (WPARAM)id, (LPARAM)groupId + 1);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
SendDlgItemMessage(hdlg, IDC_GROUP, CB_INSERTSTRING, 0, (LPARAM)TranslateT("None"));
@@ -214,10 +214,10 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp {
DBVARIANT dbv = {0};
- if(!DBGetContactSettingString(NULL,"AddContact","LastProto",&dbv))
+ if(!db_get_s(NULL,"AddContact","LastProto",&dbv))
{
acs->szProto = dbv.pszVal;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
if(AddContactDlgAccounts(hdlg, acs))
@@ -348,7 +348,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp TCHAR szHandle[256];
if (GetDlgItemText(hdlg, IDC_MYHANDLE, szHandle, SIZEOF(szHandle)))
- DBWriteContactSettingTString(hContact, "CList", "MyHandle", szHandle);
+ db_set_ts(hContact, "CList", "MyHandle", szHandle);
int item = SendDlgItemMessage(hdlg, IDC_GROUP, CB_GETCURSEL, 0, 0);
if (item > 0)
@@ -359,7 +359,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp if (!IsDlgButtonChecked(hdlg, IDC_ADDTEMP))
{
- DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ db_unset(hContact, "CList", "NotOnList");
if (IsDlgButtonChecked(hdlg, IDC_ADDED))
CallContactService(hContact, PSS_ADDED, 0, 0);
@@ -420,7 +420,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp if (acs)
{
if(acs->szProto)
- DBWriteContactSettingString(NULL,"AddContact","LastProto",acs->szProto);
+ db_set_s(NULL,"AddContact","LastProto",acs->szProto);
if (acs->psr)
{
mir_free(acs->psr->nick);
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp index 1e550be85d..15956ca62d 100644 --- a/plugins/Alarms/src/alarmlist.cpp +++ b/plugins/Alarms/src/alarmlist.cpp @@ -192,12 +192,12 @@ void LoadAlarms() { memset(&alarm, 0, sizeof(ALARM));
sprintf(buff, "Title%d", i);
- if (!DBGetContactSettingTString(0, MODULE, buff, &dbv)) {
+ if (!db_get_ts(0, MODULE, buff, &dbv)) {
alarm.szTitle = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
sprintf(buff, "Desc%d", i);
- if (!DBGetContactSettingTString(0, MODULE, buff, &dbv)) {
+ if (!db_get_ts(0, MODULE, buff, &dbv)) {
alarm.szDesc = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -249,11 +249,11 @@ void LoadAlarms() { alarm.action = (unsigned short)db_get_dw(0, MODULE, buff, AAF_POPUP | AAF_SOUND);
if (alarm.action & AAF_COMMAND) {
sprintf(buff, "ActionCommand%d", i);
- if (!DBGetContactSettingTString(0, MODULE, buff, &dbv)) {
+ if (!db_get_ts(0, MODULE, buff, &dbv)) {
alarm.szCommand = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
sprintf(buff, "ActionParams%d", i);
- if (!DBGetContactSettingTString(0, MODULE, buff, &dbv)) {
+ if (!db_get_ts(0, MODULE, buff, &dbv)) {
alarm.szCommandParams = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -308,14 +308,14 @@ void SaveAlarms() { sprintf(buff, "Desc%d", index);
db_set_ts(0, MODULE, buff, i->szDesc);
sprintf(buff, "Occ%d", index);
- DBWriteContactSettingWord(0, MODULE, buff, i->occurrence);
+ db_set_w(0, MODULE, buff, i->occurrence);
sprintf(buff, "STHour%d", index);
- DBWriteContactSettingWord(0, MODULE, buff, i->time.wHour);
+ db_set_w(0, MODULE, buff, i->time.wHour);
sprintf(buff, "STMinute%d", index);
- DBWriteContactSettingWord(0, MODULE, buff, i->time.wMinute);
+ db_set_w(0, MODULE, buff, i->time.wMinute);
sprintf(buff, "STSecond%d", index);
- DBWriteContactSettingWord(0, MODULE, buff, i->time.wSecond);
+ db_set_w(0, MODULE, buff, i->time.wSecond);
switch(i->occurrence) {
case OC_DAILY:
@@ -324,22 +324,22 @@ void SaveAlarms() { break;
case OC_WEEKLY:
sprintf(buff, "STDayOfWeek%d", index);
- DBWriteContactSettingWord(0, MODULE, buff, i->time.wDayOfWeek);
+ db_set_w(0, MODULE, buff, i->time.wDayOfWeek);
break;
case OC_ONCE:
sprintf(buff, "STYear%d", index);
- DBWriteContactSettingWord(0, MODULE, buff, i->time.wYear);
+ db_set_w(0, MODULE, buff, i->time.wYear);
case OC_YEARLY:
sprintf(buff, "STMonth%d", index);
- DBWriteContactSettingWord(0, MODULE, buff, i->time.wMonth);
+ db_set_w(0, MODULE, buff, i->time.wMonth);
case OC_MONTHLY:
sprintf(buff, "STDay%d", index);
- DBWriteContactSettingWord(0, MODULE, buff, i->time.wDay);
+ db_set_w(0, MODULE, buff, i->time.wDay);
break;
}
sprintf(buff, "ActionFlags%d", index);
- DBWriteContactSettingDword(0, MODULE, buff, i->action);
+ db_set_dw(0, MODULE, buff, i->action);
if (i->action & AAF_COMMAND) {
if (_tcslen(i->szCommand)) {
sprintf(buff, "ActionCommand%d", index);
@@ -358,12 +358,12 @@ void SaveAlarms() { db_set_b(0, MODULE, buff, i->snoozer ? 1 : 0);
sprintf(buff, "Flags%d", index);
- DBWriteContactSettingDword(0, MODULE, buff, i->flags);
+ db_set_dw(0, MODULE, buff, i->flags);
sprintf(buff, "TriggerID%d", index);
- DBWriteContactSettingDword(0, MODULE, buff, i->trigger_id);
+ db_set_dw(0, MODULE, buff, i->trigger_id);
}
- DBWriteContactSettingWord(0, MODULE, "Count", index);
+ db_set_w(0, MODULE, "Count", index);
LeaveCriticalSection(&alarm_cs);
}
diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp index 3a263d4188..39c4713838 100644 --- a/plugins/Alarms/src/options.cpp +++ b/plugins/Alarms/src/options.cpp @@ -1176,9 +1176,9 @@ void LoadOptions() void SaveOptions()
{
db_set_b(0, MODULE, "UsePopupModule", options.use_popup_module ? 1 : 0);
- DBWriteContactSettingDword(0, MODULE, "SnoozeMinutes", options.snooze_minutes);
- DBWriteContactSettingDword(0, MODULE, "RowHeight", options.row_height);
- DBWriteContactSettingDword(0, MODULE, "Indent", options.indent);
+ db_set_dw(0, MODULE, "SnoozeMinutes", options.snooze_minutes);
+ db_set_dw(0, MODULE, "RowHeight", options.row_height);
+ db_set_dw(0, MODULE, "Indent", options.indent);
db_set_b(0, MODULE, "Transparency", options.aw_trans);
db_set_b(0, MODULE, "RoundCorners", options.aw_roundcorners ? 1 : 0);
db_set_b(0, MODULE, "DontStealFocus", options.aw_dontstealfocus ? 1 : 0);
@@ -1186,7 +1186,7 @@ void SaveOptions() db_set_b(0, MODULE, "HideWithClist", options.hide_with_clist ? 1 : 0);
db_set_b(0, MODULE, "LoopSound", options.loop_sound ? 1 : 0);
db_set_b(0, MODULE, "AutoSize", options.auto_size_vert ? 1 : 0);
- DBWriteContactSettingDword(0, MODULE, "ReminderPeriod", options.reminder_period);
+ db_set_dw(0, MODULE, "ReminderPeriod", options.reminder_period);
}
INT_PTR NewAlarmMenuFunc(WPARAM wParam, LPARAM lParam)
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index cc2a58828a..4124b493f4 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -51,7 +51,7 @@ static BOOL IsAssocEnabled(const ASSOCDATA *assoc) {
char szSetting[MAXMODULELABELLENGTH];
mir_snprintf(szSetting, sizeof(szSetting), "enabled_%s", assoc->pszClassName);
- return DBGetContactSettingByte(NULL, "AssocMgr", szSetting, (BYTE)!(assoc->flags&FTDF_DEFAULTDISABLED))!= 0;
+ return db_get_b(NULL, "AssocMgr", szSetting, (BYTE)!(assoc->flags&FTDF_DEFAULTDISABLED))!= 0;
}
static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled)
@@ -59,13 +59,13 @@ static void SetAssocEnabled(const ASSOCDATA *assoc, BOOL fEnabled) char szSetting[MAXMODULELABELLENGTH];
TCHAR szDLL[MAX_PATH], szBuf[MAX_PATH];
mir_snprintf(szSetting, sizeof(szSetting), "enabled_%s", assoc->pszClassName);
- DBWriteContactSettingByte(NULL, "AssocMgr", szSetting, (BYTE)fEnabled);
+ db_set_b(NULL, "AssocMgr", szSetting, (BYTE)fEnabled);
/* dll name for uninstall */
if(assoc->hInstance!= NULL && assoc->hInstance!= hInst && assoc->hInstance!= GetModuleHandle(NULL))
if( GetModuleFileName(assoc->hInstance, szBuf, SIZEOF(szBuf)))
if( PathToRelativeT(szBuf, szDLL)) {
mir_snprintf(szSetting, sizeof(szSetting), "module_%s", assoc->pszClassName);
- DBWriteContactSettingTString(NULL, "AssocMgr", szSetting, szDLL);
+ db_set_ts(NULL, "AssocMgr", szSetting, szDLL);
}
}
@@ -73,10 +73,10 @@ static void DeleteAssocEnabledSetting(const ASSOCDATA *assoc) {
char szSetting[MAXMODULELABELLENGTH];
mir_snprintf(szSetting, sizeof(szSetting), "enabled_%s", assoc->pszClassName);
- DBDeleteContactSetting(NULL, "AssocMgr", szSetting);
+ db_unset(NULL, "AssocMgr", szSetting);
/* dll name for uninstall */
mir_snprintf(szSetting, sizeof(szSetting), "module_%s", assoc->pszClassName);
- DBDeleteContactSetting(NULL, "AssocMgr", szSetting);
+ db_unset(NULL, "AssocMgr", szSetting);
}
void CleanupAssocEnabledSettings(void)
@@ -95,13 +95,13 @@ void CleanupAssocEnabledSettings(void) for(i = 0;i<nSettingsCount;++i) {
pszSuffix = &ppszSettings[i][8];
mir_snprintf(szSetting, sizeof(szSetting), "module_%s", pszSuffix);
- if (!DBGetContactSettingTString(NULL, "AssocMgr", szSetting, &dbv)) {
+ if (!db_get_ts(NULL, "AssocMgr", szSetting, &dbv)) {
if( PathToAbsoluteT(dbv.ptszVal, szDLL)) {
/* file still exists? */
hFile = CreateFile(szDLL, 0, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
if(hFile == INVALID_HANDLE_VALUE) {
- DBDeleteContactSetting(NULL, "AssocMgr", ppszSettings[i]);
- DBDeleteContactSetting(NULL, "AssocMgr", szSetting);
+ db_unset(NULL, "AssocMgr", ppszSettings[i]);
+ db_unset(NULL, "AssocMgr", szSetting);
} else CloseHandle(hFile);
}
mir_free(dbv.ptszVal);
@@ -119,8 +119,8 @@ static __inline void RememberMimeTypeAdded(const char *pszMimeType, const char * {
char szSetting[MAXMODULELABELLENGTH];
mir_snprintf(szSetting, sizeof(szSetting), "mime_%s", pszMimeType);
- if(fAdded) DBWriteContactSettingString(NULL, "AssocMgr", szSetting, pszFileExt);
- else DBDeleteContactSetting(NULL, "AssocMgr", szSetting);
+ if(fAdded) db_set_s(NULL, "AssocMgr", szSetting, pszFileExt);
+ else db_unset(NULL, "AssocMgr", szSetting);
}
static __inline BOOL WasMimeTypeAdded(const char *pszMimeType)
@@ -129,8 +129,8 @@ static __inline BOOL WasMimeTypeAdded(const char *pszMimeType) DBVARIANT dbv;
BOOL fAdded = FALSE;
mir_snprintf(szSetting, sizeof(szSetting), "mime_%s", pszMimeType);
- if (!DBGetContactSetting(NULL, "AssocMgr", szSetting, &dbv)) fAdded = TRUE;
- else DBFreeVariant(&dbv);
+ if (!db_get(NULL, "AssocMgr", szSetting, &dbv)) fAdded = TRUE;
+ else db_free(&dbv);
return fAdded;
}
@@ -150,12 +150,12 @@ void CleanupMimeTypeAddedSettings(void) if (!lstrcmpA(pszSuffix, pAssocList[j].pszMimeType))
break; /* mime type in current list */
if(j == nAssocListCount) { /* mime type not in current list */
- if (!DBGetContactSetting(NULL, "AssocMgr", ppszSettings[i], &dbv)) {
+ if (!db_get(NULL, "AssocMgr", ppszSettings[i], &dbv)) {
if(dbv.type == DBVT_ASCIIZ)
RemoveRegMimeType(pszSuffix, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- DBDeleteContactSetting(NULL, "AssocMgr", ppszSettings[i]);
+ db_unset(NULL, "AssocMgr", ppszSettings[i]);
}
mir_free(ppszSettings[i]);
}
@@ -769,7 +769,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara ListView_SetItemState(hwndList, lvi.iItem, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED);
ListView_SetColumnWidth(hwndList, 1, LVSCW_AUTOSIZE_USEHEADER); /* size to fit window */
/* only while running */
- CheckDlgButton(hwndDlg, IDC_ONLYWHILERUNNING, (BOOL)DBGetContactSettingByte(NULL, "AssocMgr", "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT));
+ CheckDlgButton(hwndDlg, IDC_ONLYWHILERUNNING, (BOOL)db_get_b(NULL, "AssocMgr", "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT));
/* autostart */
{ TCHAR *pszRunCmd;
pszRunCmd = MakeRunCommand(TRUE, TRUE);
@@ -915,7 +915,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara ASSOCDATA *assoc;
/* only while running */
- DBWriteContactSettingByte(NULL, "AssocMgr", "OnlyWhileRunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONLYWHILERUNNING)!= 0));
+ db_set_b(NULL, "AssocMgr", "OnlyWhileRunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONLYWHILERUNNING)!= 0));
/* save enabled assoc items */
hwndList = GetDlgItem(hwndDlg, IDC_ASSOCLIST);
@@ -1063,7 +1063,7 @@ void UninitAssocList(void) DestroyServiceFunction(hServiceRemoveUrl);
/* Assoc List */
- fOnlyWhileRunning = DBGetContactSettingByte(NULL, "AssocMgr", "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT);
+ fOnlyWhileRunning = db_get_b(NULL, "AssocMgr", "OnlyWhileRunning", SETTING_ONLYWHILERUNNING_DEFAULT);
for(i = 0;i<nAssocListCount;++i) {
assoc = &pAssocList[i];
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp index 41e724025d..a34b02918a 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -509,7 +509,7 @@ static LONG RestoreRegTree(HKEY hKey,const char *pszSubKey,const char *pszDbPref mir_free(pData);
} else res=ERROR_INVALID_DATA;
if (res) break;
- DBDeleteContactSetting(NULL,"AssocMgr",ppszSettings[i]);
+ db_unset(NULL,"AssocMgr",ppszSettings[i]);
if (hSubKey!=hKey) RegCloseKey(hSubKey);
}
mir_free(ppszSettings[i]);
@@ -532,7 +532,7 @@ static void DeleteRegTreeBackup(const char *pszSubKey,const char *pszDbPrefix) if (pszPrefixWithSubKey!=NULL) {
if (EnumDbPrefixSettings("AssocMgr",pszPrefixWithSubKey,&ppszSettings,&nSettingsCount)) {
for(i=0;i<nSettingsCount;++i) {
- DBDeleteContactSetting(NULL,"AssocMgr",ppszSettings[i]);
+ db_unset(NULL,"AssocMgr",ppszSettings[i]);
mir_free(ppszSettings[i]);
}
mir_free(ppszSettings);
diff --git a/plugins/AssocMgr/src/test.cpp b/plugins/AssocMgr/src/test.cpp index 2bf0149d52..db07567c82 100644 --- a/plugins/AssocMgr/src/test.cpp +++ b/plugins/AssocMgr/src/test.cpp @@ -143,7 +143,7 @@ static int ServiceParseAimLink(WPARAM wParam,LPARAM lParam) if(hContact==NULL) {
hContact=add_contact(sn); /* does not yet check if sn is current user */
if(hContact!=NULL)
- DBWriteContactSettingByte(hContact,MOD_KEY_CL,AIM_KEY_NL,1);
+ db_set_b(hContact,MOD_KEY_CL,AIM_KEY_NL,1);
}
if(hContact!=NULL)
CallService(MS_MSG_SENDMESSAGE,(WPARAM)hContact,(LPARAM)msg);
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp index 6627dd9219..14e3159a1d 100644 --- a/plugins/AuthState/src/main.cpp +++ b/plugins/AuthState/src/main.cpp @@ -119,7 +119,7 @@ int onContactSettingChanged(WPARAM wParam,LPARAM lParam) int onDBContactAdded(WPARAM wParam, LPARAM lParam)
{
// A new contact added, mark it as recent
- DBWriteContactSettingByte((HANDLE)wParam, MODULENAME, "ShowIcons", 1);
+ db_set_b((HANDLE)wParam, MODULENAME, "ShowIcons", 1);
onExtraImageApplying(wParam, 0);
return 0;
@@ -128,7 +128,7 @@ int onDBContactAdded(WPARAM wParam, LPARAM lParam) INT_PTR onAuthMenuSelected(WPARAM wParam, LPARAM lParam)
{
byte enabled = db_get_b((HANDLE)wParam,"AuthState","ShowIcons",1);
- DBWriteContactSettingByte((HANDLE)wParam, MODULENAME, "ShowIcons", !enabled);
+ db_set_b((HANDLE)wParam, MODULENAME, "ShowIcons", !enabled);
onExtraImageApplying(wParam, 0);
return 0;
diff --git a/plugins/AuthState/src/options.cpp b/plugins/AuthState/src/options.cpp index 823269e648..43f6118658 100644 --- a/plugins/AuthState/src/options.cpp +++ b/plugins/AuthState/src/options.cpp @@ -63,10 +63,10 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
//Store options values to DB
- DBWriteContactSettingByte(NULL, MODULENAME, "EnableAuthIcon", bUseAuthIcon);
- DBWriteContactSettingByte(NULL, MODULENAME, "EnableGrantIcon", bUseGrantIcon);
- DBWriteContactSettingByte(NULL, MODULENAME, "MenuItem", bContactMenuItem);
- DBWriteContactSettingByte(NULL, MODULENAME, "EnableOnlyForRecent", bIconsForRecentContacts);
+ db_set_b(NULL, MODULENAME, "EnableAuthIcon", bUseAuthIcon);
+ db_set_b(NULL, MODULENAME, "EnableGrantIcon", bUseGrantIcon);
+ db_set_b(NULL, MODULENAME, "MenuItem", bContactMenuItem);
+ db_set_b(NULL, MODULENAME, "EnableOnlyForRecent", bIconsForRecentContacts);
return TRUE;
}
}
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp index 7e4f7ad155..20662698a5 100644 --- a/plugins/AutoShutdown/src/frame.cpp +++ b/plugins/AutoShutdown/src/frame.cpp @@ -39,7 +39,7 @@ static COLORREF GetDefaultColor(BYTE id) case FRAMEELEMENT_BAR:
return RGB(250,0,0); /* same color as used on header icon */
case FRAMEELEMENT_BKGRND:
- return (COLORREF)DBGetContactSettingDword(NULL,"CLC","BkColour",CLCDEFAULT_BKCOLOUR);
+ return (COLORREF)db_get_dw(NULL,"CLC","BkColour",CLCDEFAULT_BKCOLOUR);
case FRAMEELEMENT_TEXT:
return GetSysColor(COLOR_WINDOWTEXT);
}
@@ -332,14 +332,14 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA }
case M_SET_COUNTDOWN:
if(dat->fTimeFlags&SDWTF_ST_TIME) {
- dat->settingLastTime=(time_t)DBGetContactSettingDword(NULL,"AutoShutdown","TimeStamp",SETTING_TIMESTAMP_DEFAULT);
+ dat->settingLastTime=(time_t)db_get_dw(NULL,"AutoShutdown","TimeStamp",SETTING_TIMESTAMP_DEFAULT);
dat->countdown=time(NULL);
if(dat->settingLastTime>dat->countdown) dat->countdown=dat->settingLastTime-dat->countdown;
else dat->countdown=0;
}
else if(dat->flags&FWPDF_COUNTDOWNINVALID) {
- dat->countdown=(time_t)DBGetContactSettingDword(NULL,"AutoShutdown","Countdown",SETTING_COUNTDOWN_DEFAULT);
- dat->countdown*=(time_t)DBGetContactSettingDword(NULL,"AutoShutdown","CountdownUnit",SETTING_COUNTDOWNUNIT_DEFAULT);
+ dat->countdown=(time_t)db_get_dw(NULL,"AutoShutdown","Countdown",SETTING_COUNTDOWN_DEFAULT);
+ dat->countdown*=(time_t)db_get_dw(NULL,"AutoShutdown","CountdownUnit",SETTING_COUNTDOWNUNIT_DEFAULT);
}
dat->flags&=~FWPDF_COUNTDOWNINVALID;
/* commctl 4.70+, Win95: 1-100 will work fine (wrap around) */
diff --git a/plugins/AutoShutdown/src/options.cpp b/plugins/AutoShutdown/src/options.cpp index 0db48e2a6f..6b6fb3039b 100644 --- a/plugins/AutoShutdown/src/options.cpp +++ b/plugins/AutoShutdown/src/options.cpp @@ -36,25 +36,25 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L switch(msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- { WORD setting=DBGetContactSettingWord(NULL,"AutoShutdown","ConfirmDlgCountdown",SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT);
+ { WORD setting=db_get_w(NULL,"AutoShutdown","ConfirmDlgCountdown",SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT);
if(setting<3) setting=SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT;
SendDlgItemMessage(hwndDlg,IDC_SPIN_CONFIRMDLGCOUNTDOWN,UDM_SETRANGE,0,MAKELPARAM(999,3));
SendDlgItemMessage(hwndDlg,IDC_EDIT_CONFIRMDLGCOUNTDOWN,EM_SETLIMITTEXT,3,0);
SendDlgItemMessage(hwndDlg,IDC_SPIN_CONFIRMDLGCOUNTDOWN,UDM_SETPOS,0,MAKELPARAM(setting,0));
SetDlgItemInt(hwndDlg,IDC_EDIT_CONFIRMDLGCOUNTDOWN,setting,FALSE);
}
- CheckDlgButton(hwndDlg,IDC_CHECK_SMARTOFFLINECHECK,DBGetContactSettingByte(NULL,"AutoShutdown","SmartOfflineCheck",SETTING_SMARTOFFLINECHECK_DEFAULT)!=0);
- CheckDlgButton(hwndDlg,IDC_CHECK_REMEMBERONRESTART,DBGetContactSettingByte(NULL,"AutoShutdown","RememberOnRestart",SETTING_REMEMBERONRESTART_DEFAULT)!=0);
- CheckDlgButton(hwndDlg,IDC_CHECK_SHOWCONFIRMDLG,DBGetContactSettingByte(NULL,"AutoShutdown","ShowConfirmDlg",SETTING_SHOWCONFIRMDLG_DEFAULT)!=0);
+ CheckDlgButton(hwndDlg,IDC_CHECK_SMARTOFFLINECHECK,db_get_b(NULL,"AutoShutdown","SmartOfflineCheck",SETTING_SMARTOFFLINECHECK_DEFAULT)!=0);
+ CheckDlgButton(hwndDlg,IDC_CHECK_REMEMBERONRESTART,db_get_b(NULL,"AutoShutdown","RememberOnRestart",SETTING_REMEMBERONRESTART_DEFAULT)!=0);
+ CheckDlgButton(hwndDlg,IDC_CHECK_SHOWCONFIRMDLG,db_get_b(NULL,"AutoShutdown","ShowConfirmDlg",SETTING_SHOWCONFIRMDLG_DEFAULT)!=0);
{ BOOL enabled=ServiceIsTypeEnabled(SDSDT_SHUTDOWN,0);
if(enabled) {
if(ServiceExists(MS_SYSINFO_HDDTEMP)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_CHECK_HDDOVERHEAT),TRUE);
- CheckDlgButton(hwndDlg,IDC_CHECK_HDDOVERHEAT,DBGetContactSettingByte(NULL,"AutoShutdown","HddOverheatShutdown",SETTING_HDDOVERHEATSHUTDOWN_DEFAULT)!=0);
+ CheckDlgButton(hwndDlg,IDC_CHECK_HDDOVERHEAT,db_get_b(NULL,"AutoShutdown","HddOverheatShutdown",SETTING_HDDOVERHEATSHUTDOWN_DEFAULT)!=0);
}
if(ServiceExists(MS_WEATHER_UPDATE)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_CHECK_WEATHER),TRUE);
- CheckDlgButton(hwndDlg,IDC_CHECK_WEATHER,DBGetContactSettingByte(NULL,"AutoShutdown","WeatherShutdown",SETTING_WEATHERSHUTDOWN_DEFAULT)!=0);
+ CheckDlgButton(hwndDlg,IDC_CHECK_WEATHER,db_get_b(NULL,"AutoShutdown","WeatherShutdown",SETTING_WEATHERSHUTDOWN_DEFAULT)!=0);
}
}
}
@@ -88,14 +88,14 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L case WM_NOTIFY:
switch(((NMHDR*)lParam)->code) {
case PSN_APPLY:
- DBWriteContactSettingByte(NULL,"AutoShutdown","ShowConfirmDlg",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_SHOWCONFIRMDLG)!=0));
- DBWriteContactSettingWord(NULL,"AutoShutdown","ConfirmDlgCountdown",(WORD)GetDlgItemInt(hwndDlg,IDC_EDIT_CONFIRMDLGCOUNTDOWN,NULL,FALSE));
- DBWriteContactSettingByte(NULL,"AutoShutdown","RememberOnRestart",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_REMEMBERONRESTART)!=0));
- DBWriteContactSettingByte(NULL,"AutoShutdown","SmartOfflineCheck",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_SMARTOFFLINECHECK)!=0));
+ db_set_b(NULL,"AutoShutdown","ShowConfirmDlg",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_SHOWCONFIRMDLG)!=0));
+ db_set_w(NULL,"AutoShutdown","ConfirmDlgCountdown",(WORD)GetDlgItemInt(hwndDlg,IDC_EDIT_CONFIRMDLGCOUNTDOWN,NULL,FALSE));
+ db_set_b(NULL,"AutoShutdown","RememberOnRestart",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_REMEMBERONRESTART)!=0));
+ db_set_b(NULL,"AutoShutdown","SmartOfflineCheck",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_SMARTOFFLINECHECK)!=0));
if(IsWindowEnabled(GetDlgItem(hwndDlg,IDC_CHECK_WEATHER)))
- DBWriteContactSettingByte(NULL,"AutoShutdown","WeatherShutdown",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_WEATHER)!=0));
+ db_set_b(NULL,"AutoShutdown","WeatherShutdown",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_WEATHER)!=0));
if(IsWindowEnabled(GetDlgItem(hwndDlg,IDC_CHECK_HDDOVERHEAT)))
- DBWriteContactSettingByte(NULL,"AutoShutdown","HddOverheatShutdown",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_HDDOVERHEAT)!=0));
+ db_set_b(NULL,"AutoShutdown","HddOverheatShutdown",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_HDDOVERHEAT)!=0));
return TRUE;
}
break;
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 84fa86b5e4..c26d570aa0 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -80,7 +80,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR }
/* read-in watcher flags */
{ WORD watcherType;
- watcherType=DBGetContactSettingWord(NULL,"AutoShutdown","WatcherFlags",SETTING_WATCHERFLAGS_DEFAULT);
+ watcherType=db_get_w(NULL,"AutoShutdown","WatcherFlags",SETTING_WATCHERFLAGS_DEFAULT);
CheckRadioButton(hwndDlg,IDC_RADIO_STTIME,IDC_RADIO_STCOUNTDOWN,(watcherType&SDWTF_ST_TIME)?IDC_RADIO_STTIME:IDC_RADIO_STCOUNTDOWN);
CheckDlgButton(hwndDlg,IDC_CHECK_SPECIFICTIME,(watcherType&SDWTF_SPECIFICTIME)!=0);
CheckDlgButton(hwndDlg,IDC_CHECK_MESSAGE,(watcherType&SDWTF_MESSAGE)!=0);
@@ -91,14 +91,14 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR }
/* read-in countdown val */
{ SYSTEMTIME st;
- if(!TimeStampToSystemTime((time_t)DBGetContactSettingDword(NULL,"AutoShutdown","TimeStamp",SETTING_TIMESTAMP_DEFAULT),&st))
+ if(!TimeStampToSystemTime((time_t)db_get_dw(NULL,"AutoShutdown","TimeStamp",SETTING_TIMESTAMP_DEFAULT),&st))
GetLocalTime(&st);
DateTime_SetSystemtime(GetDlgItem(hwndDlg,IDC_TIME_TIMESTAMP),GDT_VALID,&st);
DateTime_SetSystemtime(GetDlgItem(hwndDlg,IDC_DATE_TIMESTAMP),GDT_VALID,&st);
SendMessage(hwndDlg,M_CHECK_DATETIME,0,0);
}
{ DWORD setting;
- setting=DBGetContactSettingDword(NULL,"AutoShutdown","Countdown",SETTING_COUNTDOWN_DEFAULT);
+ setting=db_get_dw(NULL,"AutoShutdown","Countdown",SETTING_COUNTDOWN_DEFAULT);
if(setting<1) setting=SETTING_COUNTDOWN_DEFAULT;
SendDlgItemMessage(hwndDlg,IDC_SPIN_COUNTDOWN,UDM_SETRANGE,0,MAKELPARAM(UD_MAXVAL,1));
SendDlgItemMessage(hwndDlg,IDC_EDIT_COUNTDOWN,EM_SETLIMITTEXT,(WPARAM)10,0);
@@ -112,7 +112,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR const TCHAR *unitNames[]={TranslateT("Second(s)"), TranslateT("Minute(s)"), TranslateT("Hour(s)"),
TranslateT("Day(s)"), TranslateT("Week(s)"), TranslateT("Month(s)")};
hwndCombo=GetDlgItem(hwndDlg,IDC_COMBO_COUNTDOWNUNIT);
- lastUnit=DBGetContactSettingDword(NULL,"AutoShutdown","CountdownUnit",SETTING_COUNTDOWNUNIT_DEFAULT);
+ lastUnit=db_get_dw(NULL,"AutoShutdown","CountdownUnit",SETTING_COUNTDOWNUNIT_DEFAULT);
SendMessage(hwndCombo,CB_SETLOCALE,(WPARAM)locale,0); /* sort order */
SendMessage(hwndCombo,CB_INITSTORAGE,SIZEOF(unitNames),SIZEOF(unitNames)*16); /* approx. */
for(i=0;i<SIZEOF(unitNames);++i) {
@@ -124,7 +124,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR }
}
{ DBVARIANT dbv;
- if(!DBGetContactSettingTString(NULL,"AutoShutdown","Message",&dbv)) {
+ if(!db_get_ts(NULL,"AutoShutdown","Message",&dbv)) {
SetDlgItemText(hwndDlg,IDC_EDIT_MESSAGE,dbv.ptszVal);
mir_free(dbv.ptszVal);
}
@@ -146,7 +146,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR int index;
TCHAR *pszText;
hwndCombo=GetDlgItem(hwndDlg,IDC_COMBO_SHUTDOWNTYPE);
- lastShutdownType=DBGetContactSettingByte(NULL,"AutoShutdown","ShutdownType",SETTING_SHUTDOWNTYPE_DEFAULT);
+ lastShutdownType=db_get_b(NULL,"AutoShutdown","ShutdownType",SETTING_SHUTDOWNTYPE_DEFAULT);
SendMessage(hwndCombo,CB_SETLOCALE,(WPARAM)locale,0); /* sort order */
SendMessage(hwndCombo,CB_SETEXTENDEDUI,TRUE,0);
SendMessage(hwndCombo,CB_INITSTORAGE,SDSDT_MAX,SDSDT_MAX*32);
@@ -344,7 +344,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR TCHAR *pszText=(TCHAR*)mir_alloc(len*sizeof(TCHAR));
if(pszText!=NULL && GetWindowText(hwndEdit,pszText,len+1)) {
TrimString(pszText);
- DBWriteContactSettingTString(NULL,"AutoShutdown","Message",pszText);
+ db_set_ts(NULL,"AutoShutdown","Message",pszText);
}
mir_free(pszText); /* does NULL check */
}
@@ -354,16 +354,16 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR DateTime_GetSystemtime(GetDlgItem(hwndDlg,IDC_TIME_TIMESTAMP),&st); /* time gets synchronized */
if(!SystemTimeToTimeStamp(&st,×tamp))
timestamp=time(NULL);
- DBWriteContactSettingDword(NULL,"AutoShutdown","TimeStamp",(DWORD)timestamp);
+ db_set_dw(NULL,"AutoShutdown","TimeStamp",(DWORD)timestamp);
}
/* shutdown type */
{ int index;
index=SendDlgItemMessage(hwndDlg,IDC_COMBO_SHUTDOWNTYPE,CB_GETCURSEL,0,0);
- if(index!=LB_ERR) DBWriteContactSettingByte(NULL,"AutoShutdown","ShutdownType",(BYTE)SendDlgItemMessage(hwndDlg,IDC_COMBO_SHUTDOWNTYPE,CB_GETITEMDATA,(WPARAM)index,0));
+ if(index!=LB_ERR) db_set_b(NULL,"AutoShutdown","ShutdownType",(BYTE)SendDlgItemMessage(hwndDlg,IDC_COMBO_SHUTDOWNTYPE,CB_GETITEMDATA,(WPARAM)index,0));
index=SendDlgItemMessage(hwndDlg,IDC_COMBO_COUNTDOWNUNIT,CB_GETCURSEL,0,0);
- if(index!=LB_ERR) DBWriteContactSettingDword(NULL,"AutoShutdown","CountdownUnit",(DWORD)SendDlgItemMessage(hwndDlg,IDC_COMBO_COUNTDOWNUNIT,CB_GETITEMDATA,(WPARAM)index,0));
- DBWriteContactSettingDword(NULL,"AutoShutdown","Countdown",(DWORD)GetDlgItemInt(hwndDlg,IDC_EDIT_COUNTDOWN,NULL,FALSE));
- DBWriteContactSettingByte(NULL,"AutoShutdown","CpuUsageThreshold",(BYTE)GetDlgItemInt(hwndDlg,IDC_EDIT_CPUUSAGE,NULL,FALSE));
+ if(index!=LB_ERR) db_set_dw(NULL,"AutoShutdown","CountdownUnit",(DWORD)SendDlgItemMessage(hwndDlg,IDC_COMBO_COUNTDOWNUNIT,CB_GETITEMDATA,(WPARAM)index,0));
+ db_set_dw(NULL,"AutoShutdown","Countdown",(DWORD)GetDlgItemInt(hwndDlg,IDC_EDIT_COUNTDOWN,NULL,FALSE));
+ db_set_b(NULL,"AutoShutdown","CpuUsageThreshold",(BYTE)GetDlgItemInt(hwndDlg,IDC_EDIT_CPUUSAGE,NULL,FALSE));
}
/* watcher type */
{ WORD watcherType;
@@ -374,7 +374,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR if(IsDlgButtonChecked(hwndDlg,IDC_CHECK_IDLE)) watcherType|=SDWTF_IDLE;
if(IsDlgButtonChecked(hwndDlg,IDC_CHECK_STATUS)) watcherType|=SDWTF_STATUS;
if(IsDlgButtonChecked(hwndDlg,IDC_CHECK_CPUUSAGE)) watcherType|=SDWTF_CPUUSAGE;
- DBWriteContactSettingWord(NULL,"AutoShutdown","WatcherFlags",watcherType);
+ db_set_w(NULL,"AutoShutdown","WatcherFlags",watcherType);
ServiceStartWatcher(0,watcherType);
}
/* fall through */
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index 889040cc03..b5e57da955 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -379,7 +379,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR SendDlgItemMessage(hwndDlg,IDC_TEXT_HEADER,WM_SETFONT,(WPARAM)hBoldFont,FALSE);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TEXT_HEADER), GWLP_USERDATA, (LONG)hBoldFont);
}
- { WORD countdown=DBGetContactSettingWord(NULL,"AutoShutdown","ConfirmDlgCountdown",SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT);
+ { WORD countdown=db_get_w(NULL,"AutoShutdown","ConfirmDlgCountdown",SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT);
if(countdown<3) countdown=SETTING_CONFIRMDLGCOUNTDOWN_DEFAULT;
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TEXT_HEADER), GWLP_USERDATA, countdown);
SendMessage(hwndDlg,M_UPDATE_COUNTDOWN,0,countdown);
@@ -480,7 +480,7 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR INT_PTR ServiceShutdown(WPARAM wParam,LPARAM lParam)
{
/* passing 0 as wParam is only to be used internally, undocumented */
- if(!wParam) wParam=DBGetContactSettingByte(NULL,"AutoShutdown","ShutdownType",SETTING_SHUTDOWNTYPE_DEFAULT);
+ if(!wParam) wParam=db_get_b(NULL,"AutoShutdown","ShutdownType",SETTING_SHUTDOWNTYPE_DEFAULT);
if(!IsShutdownTypeEnabled((BYTE)wParam)) return 1; /* does shutdownType range check */
if((BOOL)lParam && hwndShutdownDlg!=NULL) return 2;
@@ -492,7 +492,7 @@ INT_PTR ServiceShutdown(WPARAM wParam,LPARAM lParam) /* tell others */
NotifyEventHooks(hEventShutdown,wParam,lParam);
/* show dialog */
- if(lParam && DBGetContactSettingByte(NULL,"AutoShutdown","ShowConfirmDlg",SETTING_SHOWCONFIRMDLG_DEFAULT))
+ if(lParam && db_get_b(NULL,"AutoShutdown","ShowConfirmDlg",SETTING_SHOWCONFIRMDLG_DEFAULT))
if(CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SHUTDOWNNOW), NULL, ShutdownDlgProc, (LPARAM)(BYTE)wParam) != NULL)
return 0;
/* show error */
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index 10323614d6..acbd8c31ad 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -102,7 +102,7 @@ static int MsgEventAdded(WPARAM wParam,LPARAM lParam) if (!db_event_get(hDbEvent, &dbe))
if(dbe.eventType == EVENTTYPE_MESSAGE && !(dbe.flags & DBEF_SENT)) {
DBVARIANT dbv;
- if(!DBGetContactSettingTString(NULL,"AutoShutdown","Message",&dbv)) {
+ if(!db_get_ts(NULL,"AutoShutdown","Message",&dbv)) {
TrimString(dbv.ptszVal);
TCHAR *pszMsg = GetMessageText(&dbe.pBlob,&dbe.cbBlob);
if(pszMsg!=NULL && _tcsstr(pszMsg,dbv.ptszVal)!=NULL)
@@ -178,16 +178,16 @@ static int IdleChanged(WPARAM wParam,LPARAM lParam) static BOOL CheckAllContactsOffline(void)
{
BOOL fSmartCheck,fAllOffline=TRUE; /* tentatively */
- fSmartCheck=DBGetContactSettingByte(NULL,"AutoShutdown","SmartOfflineCheck",SETTING_SMARTOFFLINECHECK_DEFAULT);
+ fSmartCheck=db_get_b(NULL,"AutoShutdown","SmartOfflineCheck",SETTING_SMARTOFFLINECHECK_DEFAULT);
HANDLE hContact = db_find_first();
while(hContact != NULL) {
char *pszProto = GetContactProto(hContact);
if(pszProto != NULL && CallProtoService(pszProto,PS_GETSTATUS,0,0)!=ID_STATUS_OFFLINE)
- if(DBGetContactSettingByte(hContact,pszProto,"ChatRoom",0)) continue;
- if(DBGetContactSettingWord(hContact,pszProto,"Status",0)!=ID_STATUS_OFFLINE) {
+ if(db_get_b(hContact,pszProto,"ChatRoom",0)) continue;
+ if(db_get_w(hContact,pszProto,"Status",0)!=ID_STATUS_OFFLINE) {
if(fSmartCheck) {
- if(DBGetContactSettingByte(hContact,"CList","Hidden",0)) continue;
- if(DBGetContactSettingByte(hContact,"CList","NotOnList",0)) continue;
+ if(db_get_b(hContact,"CList","Hidden",0)) continue;
+ if(db_get_b(hContact,"CList","NotOnList",0)) continue;
}
fAllOffline=FALSE;
break;
@@ -240,7 +240,7 @@ static int WeatherUpdated(WPARAM wParam,LPARAM lParam) {
char *pszProto = GetContactProto((HANDLE)wParam);
if((BOOL)lParam && pszProto!=NULL && CallProtoService(pszProto,PS_GETSTATUS,0,0)==THUNDER)
- if(DBGetContactSettingByte(NULL,"AutoShutdown","WeatherShutdown",SETTING_WEATHERSHUTDOWN_DEFAULT))
+ if(db_get_b(NULL,"AutoShutdown","WeatherShutdown",SETTING_WEATHERSHUTDOWN_DEFAULT))
ServiceShutdown(SDSDT_SHUTDOWN,TRUE);
return 0;
}
@@ -249,7 +249,7 @@ static int WeatherUpdated(WPARAM wParam,LPARAM lParam) static int HddOverheat(WPARAM wParam,LPARAM lParam)
{
- if(DBGetContactSettingByte(NULL,"AutoShutdown","HddOverheatShutdown",SETTING_HDDOVERHEATSHUTDOWN_DEFAULT))
+ if(db_get_b(NULL,"AutoShutdown","HddOverheatShutdown",SETTING_HDDOVERHEATSHUTDOWN_DEFAULT))
ServiceShutdown(SDSDT_SHUTDOWN,TRUE);
return 0;
}
@@ -259,7 +259,7 @@ static int HddOverheat(WPARAM wParam,LPARAM lParam) INT_PTR ServiceStartWatcher(WPARAM wParam,LPARAM lParam)
{
/* passing watcherType as lParam is only to be used internally, undocumented */
- if(lParam==0) lParam=(LPARAM)DBGetContactSettingWord(NULL,"AutoShutdown","WatcherFlags",0);
+ if(lParam==0) lParam=(LPARAM)db_get_w(NULL,"AutoShutdown","WatcherFlags",0);
if(!(lParam&SDWTF_MASK)) return 1; /* invalid flags or empty? */
if(lParam&SDWTF_SPECIFICTIME && !(lParam&SDWTF_ST_MASK)) return 2; /* no specific time choice? */
@@ -325,8 +325,8 @@ static int WatcherModulesLoaded(WPARAM wParam,LPARAM lParam) hHookHddOverheat=HookEvent(ME_SYSINFO_HDDOVERHEAT,HddOverheat);
/* restore watcher if it was running on last exit */
- if(DBGetContactSettingByte(NULL,"AutoShutdown","RememberOnRestart",0)==SDROR_RUNNING) {
- DBWriteContactSettingByte(NULL,"AutoShutdown","RememberOnRestart",1);
+ if(db_get_b(NULL,"AutoShutdown","RememberOnRestart",0)==SDROR_RUNNING) {
+ db_set_b(NULL,"AutoShutdown","RememberOnRestart",1);
ServiceStartWatcher(0,0); /* after modules loaded */
}
return 0;
@@ -363,8 +363,8 @@ void UninitWatcher(void) {
/* remember watcher if running */
if(!ServiceStopWatcher(0,0))
- if(DBGetContactSettingByte(NULL,"AutoShutdown","RememberOnRestart",SETTING_REMEMBERONRESTART_DEFAULT))
- DBWriteContactSettingByte(NULL,"AutoShutdown","RememberOnRestart",SDROR_RUNNING);
+ if(db_get_b(NULL,"AutoShutdown","RememberOnRestart",SETTING_REMEMBERONRESTART_DEFAULT))
+ db_set_b(NULL,"AutoShutdown","RememberOnRestart",SDROR_RUNNING);
/* Message Shutdown */
UnhookEvent(hHookEventAdded);
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index d4d5bdcb32..ffe177923d 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -20,7 +20,7 @@ Avatar History Plugin #include "AvatarHistory.h"
-HANDLE hMenu = NULL;
+HGENMENU hMenu = NULL;
DWORD WINAPI AvatarDialogThread(LPVOID param);
static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
int ShowSaveDialog(HWND hwnd, TCHAR* fn,HANDLE hContact = NULL);
@@ -524,15 +524,8 @@ int CleanupAvatarPic(HWND hwnd) int PreBuildContactMenu(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM clmi = { sizeof(clmi) };
- clmi.flags = CMIM_FLAGS;
-
char *proto = GetContactProto((HANDLE)wParam);
- if (!ProtocolEnabled(proto))
- clmi.flags |= CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenu, (LPARAM)&clmi);
-
+ Menu_ShowItem(hMenu, ProtocolEnabled(proto));
return 0;
}
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index 2c4e8e1ee2..eb77df785a 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -117,7 +117,7 @@ static int AvatarChanged(WPARAM wParam, LPARAM lParam) return 0;
DBVARIANT dbvOldHash = {0};
- bool ret = (DBGetContactSettingTString(hContact,MODULE_NAME,"AvatarHash",&dbvOldHash) == 0);
+ bool ret = (db_get_ts(hContact,MODULE_NAME,"AvatarHash",&dbvOldHash) == 0);
CONTACTAVATARCHANGEDNOTIFICATION* avatar = (CONTACTAVATARCHANGEDNOTIFICATION*)lParam;
if (avatar == NULL) {
@@ -125,13 +125,13 @@ static int AvatarChanged(WPARAM wParam, LPARAM lParam) //avoid duplicate "removed avatar" notifications
//do not notify on an empty profile
ShowDebugPopup(hContact, TranslateT("AVH Debug"), TranslateT("Removed avatar, no avatar before...skipping"));
- DBFreeVariant(&dbvOldHash);
+ db_free(&dbvOldHash);
return 0;
}
SkinPlaySound("avatar_removed");
// Is a flash avatar or avs could not load it
- DBWriteContactSettingTString(hContact, MODULE_NAME, "AvatarHash", _T("-"));
+ db_set_ts(hContact, MODULE_NAME, "AvatarHash", _T("-"));
if (ContactEnabled(hContact, "AvatarPopups", AVH_DEF_AVPOPUPS) && opts.popup_show_removed)
ShowPopup(hContact, NULL, opts.popup_removed);
@@ -140,11 +140,11 @@ static int AvatarChanged(WPARAM wParam, LPARAM lParam) if (ret && !_tcscmp(dbvOldHash.ptszVal, avatar->hash)) {
// same avatar hash, skipping
ShowDebugPopup(hContact, TranslateT("AVH Debug"), TranslateT("Hashes are the same... skipping"));
- DBFreeVariant(&dbvOldHash);
+ db_free(&dbvOldHash);
return 0;
}
SkinPlaySound("avatar_changed");
- DBWriteContactSettingTString(hContact, "AvatarHistory", "AvatarHash", avatar->hash);
+ db_set_ts(hContact, "AvatarHistory", "AvatarHash", avatar->hash);
TCHAR history_filename[MAX_PATH] = _T("");
diff --git a/plugins/AvatarHistory/src/AvatarHistory.h b/plugins/AvatarHistory/src/AvatarHistory.h index af3986890a..70ac3dfd1e 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.h +++ b/plugins/AvatarHistory/src/AvatarHistory.h @@ -32,7 +32,7 @@ // Globals
extern HINSTANCE hInst;
-extern HANDLE hMenu;
+extern HGENMENU hMenu;
extern DWORD mirVer;
extern HANDLE hAvatarWindowsList;
extern Options opts;
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index afe581386d..56dcb80d01 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -185,7 +185,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara if ( !lstrcmp(dbv.ptszVal, _A2T(info.name)))
SendDlgItemMessage(hwndDlg, IDC_OUTDEVICE, CB_SETCURSEL, i, 0);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
return TRUE;
@@ -503,7 +503,7 @@ void LoadBassLibrary(TCHAR CurrBassPath[MAX_PATH]) if ( !lstrcmp(dbv.ptszVal, _A2T(info.name)))
device = i;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
sndLimSnd = db_get_b(NULL, ModuleName, OPT_MAXCHAN, MAXCHAN);
if (sndLimSnd > MAXCHAN)
@@ -560,7 +560,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) }
else {
lstrcpy(CurrBassPath, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp index 7083ac7e4a..1a4c589d4e 100644 --- a/plugins/BasicHistory/src/BasicHistory.cpp +++ b/plugins/BasicHistory/src/BasicHistory.cpp @@ -79,18 +79,8 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) int count = EventList::GetContactMessageNumber((HANDLE)wParam);
bool isInList = HistoryWindow::IsInList(GetForegroundWindow());
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS;
-
- if (!count) mi.flags |= CMIF_HIDDEN;
- else mi.flags &= ~CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenu, (LPARAM)&mi);
-
- mi.flags = CMIM_FLAGS;
- if (!count || !isInList) mi.flags |= CMIF_HIDDEN;
- else mi.flags &= ~CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hDeleteContactMenu, (LPARAM)&mi);
-
+ Menu_ShowItem(hContactMenu, count != 0);
+ Menu_ShowItem(hDeleteContactMenu, count != 0 && isInList);
return 0;
}
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index ea2e1edc69..e5cd9c7384 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -1776,7 +1776,7 @@ void HistoryWindow::ReloadContacts() HANDLE _hContact = db_find_first();
while(_hContact)
{
- if(EventList::GetContactMessageNumber(_hContact) && (metaContactProto == NULL || DBGetContactSettingByte(_hContact, metaContactProto, "IsSubcontact", 0) == 0))
+ if(EventList::GetContactMessageNumber(_hContact) && (metaContactProto == NULL || db_get_b(_hContact, metaContactProto, "IsSubcontact", 0) == 0))
{
HANDLE hItem = (HANDLE)SendMessage(contactList, CLM_FINDCONTACT, (WPARAM)_hContact, 0);
if(hItem == NULL)
@@ -1921,18 +1921,18 @@ void HistoryWindow::RestorePos() Utils_RestoreWindowPosition(hWnd,NULL,MODULE,"history_");
contactToLoad = NULL;
}
- if(DBGetContactSettingByte(contactToLoad, MODULE, "history_ismax", 0))
+ if(db_get_b(contactToLoad, MODULE, "history_ismax", 0))
{
ShowWindow(hWnd, SW_SHOWMAXIMIZED);
}
- LONG pos = DBGetContactSettingDword(contactToLoad, MODULE, "history_splitterv", 0);
+ LONG pos = db_get_dw(contactToLoad, MODULE, "history_splitterv", 0);
if(pos > 0)
{
SplitterMoved(splitterYhWnd, pos, false);
}
- pos = DBGetContactSettingDword(contactToLoad, MODULE, "history_splitter", 0);
+ pos = db_get_dw(contactToLoad, MODULE, "history_splitter", 0);
if(pos > 0)
{
SplitterMoved(splitterXhWnd, pos, false);
@@ -1947,13 +1947,13 @@ void HistoryWindow::SavePos(bool all) HANDLE _hContact = db_find_first();
while(_hContact)
{
- DBDeleteContactSetting(_hContact, MODULE, "history_x");
- DBDeleteContactSetting(_hContact, MODULE, "history_y");
- DBDeleteContactSetting(_hContact, MODULE, "history_width");
- DBDeleteContactSetting(_hContact, MODULE, "history_height");
- DBDeleteContactSetting(_hContact, MODULE, "history_ismax");
- DBDeleteContactSetting(_hContact, MODULE, "history_splitterv");
- DBDeleteContactSetting(_hContact, MODULE, "history_splitter");
+ db_unset(_hContact, MODULE, "history_x");
+ db_unset(_hContact, MODULE, "history_y");
+ db_unset(_hContact, MODULE, "history_width");
+ db_unset(_hContact, MODULE, "history_height");
+ db_unset(_hContact, MODULE, "history_ismax");
+ db_unset(_hContact, MODULE, "history_splitterv");
+ db_unset(_hContact, MODULE, "history_splitter");
_hContact = db_find_next(_hContact);
}
@@ -1964,9 +1964,9 @@ void HistoryWindow::SavePos(bool all) WINDOWPLACEMENT wp;
wp.length=sizeof(wp);
GetWindowPlacement(hWnd,&wp);
- DBWriteContactSettingByte(contactToSave, MODULE, "history_ismax", wp.showCmd == SW_MAXIMIZE ? 1 : 0);
- DBWriteContactSettingDword(contactToSave, MODULE, "history_splitterv", splitterX);
- DBWriteContactSettingDword(contactToSave, MODULE, "history_splitter", splitterY);
+ db_set_b(contactToSave, MODULE, "history_ismax", wp.showCmd == SW_MAXIMIZE ? 1 : 0);
+ db_set_dw(contactToSave, MODULE, "history_splitterv", splitterX);
+ db_set_dw(contactToSave, MODULE, "history_splitter", splitterY);
}
#define DEF_FILTERS_START 50000
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index 4d8b759d7e..3e9283df10 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -288,60 +288,60 @@ void Options::Load(void) Hotkey_Register(&hid);
}
- showContacts = DBGetContactSettingByte(0, MODULE, "showContacts", 0) ? true : false;
- showContactGroups = DBGetContactSettingByte(0, MODULE, "showContactGroups", 1) ? true : false;
- noFindBorder = DBGetContactSettingByte(0, MODULE, "noFindBorder", 0) ? true : false;
- groupNewOnTop = DBGetContactSettingByte(0, MODULE, "groupNewOnTop", 1) ? true : false;
- groupShowEvents = DBGetContactSettingByte(0, MODULE, "groupShowEvents", 1) ? true : false;
- groupShowTime = DBGetContactSettingByte(0, MODULE, "groupShowTime", 1) ? true : false;
- groupShowName = DBGetContactSettingByte(0, MODULE, "groupShowName", 0) ? true : false;
- groupShowMessage = DBGetContactSettingByte(0, MODULE, "groupShowMessage", 1) ? true : false;
- groupMessageLen = DBGetContactSettingDword(0, MODULE, "groupMessageLen", 43);
+ showContacts = db_get_b(0, MODULE, "showContacts", 0) ? true : false;
+ showContactGroups = db_get_b(0, MODULE, "showContactGroups", 1) ? true : false;
+ noFindBorder = db_get_b(0, MODULE, "noFindBorder", 0) ? true : false;
+ groupNewOnTop = db_get_b(0, MODULE, "groupNewOnTop", 1) ? true : false;
+ groupShowEvents = db_get_b(0, MODULE, "groupShowEvents", 1) ? true : false;
+ groupShowTime = db_get_b(0, MODULE, "groupShowTime", 1) ? true : false;
+ groupShowName = db_get_b(0, MODULE, "groupShowName", 0) ? true : false;
+ groupShowMessage = db_get_b(0, MODULE, "groupShowMessage", 1) ? true : false;
+ groupMessageLen = db_get_dw(0, MODULE, "groupMessageLen", 43);
if(groupMessageLen < 5) groupMessageLen = 5;
- groupTime = DBGetContactSettingDword(0, MODULE, "groupTime", 5);
+ groupTime = db_get_dw(0, MODULE, "groupTime", 5);
if(groupTime < 1) groupTime = 1;
- groupMessagesNumber = DBGetContactSettingDword(0, MODULE, "groupMessagesNumber", 100);
+ groupMessagesNumber = db_get_dw(0, MODULE, "groupMessagesNumber", 100);
if(groupMessagesNumber < 1) groupMessagesNumber = 1;
- messagesNewOnTop = DBGetContactSettingByte(0, MODULE, "messagesNewOnTop", 0) ? true : false;
- messagesShowDate = DBGetContactSettingByte(0, MODULE, "messagesShowDate", 0) ? true : false;
- messagesShowSec = DBGetContactSettingByte(0, MODULE, "messagesShowSec", 0) ? true : false;
- messagesShowName = DBGetContactSettingByte(0, MODULE, "messagesShowName", 1) ? true : false;
- messagesShowEvents = DBGetContactSettingByte(0, MODULE, "messagesShowEvents", 0) ? true : false;
- messagesUseSmileys = DBGetContactSettingByte(0, MODULE, "messagesUseSmileys", 1) ? true : false;
- searchForInList = DBGetContactSettingByte(0, MODULE, "searchForInList", 1) ? true : false;
- searchForInMess = DBGetContactSettingByte(0, MODULE, "searchForInMess", 1) ? true : false;
- searchMatchCase = DBGetContactSettingByte(0, MODULE, "searchMatchCase", 0) ? true : false;
- searchMatchWhole = DBGetContactSettingByte(0, MODULE, "searchMatchWhole", 0) ? true : false;
- searchOnlyIn = DBGetContactSettingByte(0, MODULE, "searchOnlyIn", 0) ? true : false;
- searchOnlyOut = DBGetContactSettingByte(0, MODULE, "searchOnlyOut", 0) ? true : false;
- searchOnlyGroup = DBGetContactSettingByte(0, MODULE, "searchOnlyGroup", 0) ? true : false;
- searchAllContacts = DBGetContactSettingByte(0, MODULE, "searchAllContacts", 0) ? true : false;
- schedulerAlerts = DBGetContactSettingByte(0, MODULE, "schedulerAlerts", 1) ? true : false;
- schedulerHistoryAlerts = DBGetContactSettingByte(0, MODULE, "schedulerHistoryAlerts", 1) ? true : false;
-
- defFilter = DBGetContactSettingByte(0, MODULE, "defFilter", defFilter);
- int filtersCount = DBGetContactSettingDword(0, MODULE, "customFiltersCount", 0);
+ messagesNewOnTop = db_get_b(0, MODULE, "messagesNewOnTop", 0) ? true : false;
+ messagesShowDate = db_get_b(0, MODULE, "messagesShowDate", 0) ? true : false;
+ messagesShowSec = db_get_b(0, MODULE, "messagesShowSec", 0) ? true : false;
+ messagesShowName = db_get_b(0, MODULE, "messagesShowName", 1) ? true : false;
+ messagesShowEvents = db_get_b(0, MODULE, "messagesShowEvents", 0) ? true : false;
+ messagesUseSmileys = db_get_b(0, MODULE, "messagesUseSmileys", 1) ? true : false;
+ searchForInList = db_get_b(0, MODULE, "searchForInList", 1) ? true : false;
+ searchForInMess = db_get_b(0, MODULE, "searchForInMess", 1) ? true : false;
+ searchMatchCase = db_get_b(0, MODULE, "searchMatchCase", 0) ? true : false;
+ searchMatchWhole = db_get_b(0, MODULE, "searchMatchWhole", 0) ? true : false;
+ searchOnlyIn = db_get_b(0, MODULE, "searchOnlyIn", 0) ? true : false;
+ searchOnlyOut = db_get_b(0, MODULE, "searchOnlyOut", 0) ? true : false;
+ searchOnlyGroup = db_get_b(0, MODULE, "searchOnlyGroup", 0) ? true : false;
+ searchAllContacts = db_get_b(0, MODULE, "searchAllContacts", 0) ? true : false;
+ schedulerAlerts = db_get_b(0, MODULE, "schedulerAlerts", 1) ? true : false;
+ schedulerHistoryAlerts = db_get_b(0, MODULE, "schedulerHistoryAlerts", 1) ? true : false;
+
+ defFilter = db_get_b(0, MODULE, "defFilter", defFilter);
+ int filtersCount = db_get_dw(0, MODULE, "customFiltersCount", 0);
for(int i = 0; i < filtersCount; ++i)
{
char buf[256];
FilterOptions fo;
sprintf_s(buf, "filterName_%d", i);
DBVARIANT nameV;
- if(!DBGetContactSettingWString(0, MODULE, buf, &nameV))
+ if(!db_get_ws(0, MODULE, buf, &nameV))
{
fo.name = nameV.pwszVal;
- DBFreeVariant(&nameV);
+ db_free(&nameV);
}
else break;
sprintf_s(buf, "filterInOut_%d", i);
- int inOut = DBGetContactSettingByte(0, MODULE, buf, 0);
+ int inOut = db_get_b(0, MODULE, buf, 0);
if(inOut == 1)
fo.onlyIncomming = true;
else if(inOut == 2)
fo.onlyOutgoing = true;
sprintf_s(buf, "filterEvents_%d", i);
DBVARIANT eventsV;
- if(!DBGetContactSettingString(0, MODULE, buf, &eventsV))
+ if(!db_get_s(0, MODULE, buf, &eventsV))
{
int k = 0;
char* id = eventsV.pszVal;
@@ -356,7 +356,7 @@ void Options::Load(void) ++k;
}
- DBFreeVariant(&eventsV);
+ db_free(&eventsV);
}
else break;
@@ -368,7 +368,7 @@ void Options::Load(void) defFilter = 0;
DBVARIANT defFilterStrV;
- if(!DBGetContactSettingWString(0, MODULE, "defFilterStr", &defFilterStrV))
+ if(!db_get_ws(0, MODULE, "defFilterStr", &defFilterStrV))
{
std::wstring filterName = defFilterStrV.pwszVal;
for(int i = 0; i < (int)customFilters.size(); ++i)
@@ -379,65 +379,65 @@ void Options::Load(void) break;
}
}
- DBFreeVariant(&defFilterStrV);
+ db_free(&defFilterStrV);
}
}
- codepageTxt = DBGetContactSettingDword(0, MODULE, "codepageTxt", CP_UTF8);
- codepageHtml1 = DBGetContactSettingDword(0, MODULE, "codepageHtml1", CP_UTF8);
- codepageHtml2 = DBGetContactSettingDword(0, MODULE, "codepageHtml2", CP_UTF8);
+ codepageTxt = db_get_dw(0, MODULE, "codepageTxt", CP_UTF8);
+ codepageHtml1 = db_get_dw(0, MODULE, "codepageHtml1", CP_UTF8);
+ codepageHtml2 = db_get_dw(0, MODULE, "codepageHtml2", CP_UTF8);
DBVARIANT encodingV;
- if(!DBGetContactSettingWString(0, MODULE, "encodingTxt", &encodingV))
+ if(!db_get_ws(0, MODULE, "encodingTxt", &encodingV))
{
encodingTxt = encodingV.pwszVal;
- DBFreeVariant(&encodingV);
+ db_free(&encodingV);
}
else
{
encodingTxt = _T("UTF-8");
}
- if(!DBGetContactSettingWString(0, MODULE, "encodingHtml1", &encodingV))
+ if(!db_get_ws(0, MODULE, "encodingHtml1", &encodingV))
{
encodingHtml1 = encodingV.pwszVal;
- DBFreeVariant(&encodingV);
+ db_free(&encodingV);
}
else
{
encodingHtml1 = _T("UTF-8");
}
- if(!DBGetContactSettingWString(0, MODULE, "encodingHtml2", &encodingV))
+ if(!db_get_ws(0, MODULE, "encodingHtml2", &encodingV))
{
encodingHtml2 = encodingV.pwszVal;
- DBFreeVariant(&encodingV);
+ db_free(&encodingV);
}
else
{
encodingHtml2 = _T("UTF-8");
}
- exportHtml1ShowDate = DBGetContactSettingByte(0, MODULE, "exportHtml1ShowDate", 1) ? true : false;
- exportHtml2ShowDate = DBGetContactSettingByte(0, MODULE, "exportHtml2ShowDate", 0) ? true : false;
- exportHtml2UseSmileys = DBGetContactSettingByte(0, MODULE, "exportHtml2UseSmileys", 1) ? true : false;
- if(!DBGetContactSettingWString(0, MODULE, "extCssHtml2", &encodingV))
+ exportHtml1ShowDate = db_get_b(0, MODULE, "exportHtml1ShowDate", 1) ? true : false;
+ exportHtml2ShowDate = db_get_b(0, MODULE, "exportHtml2ShowDate", 0) ? true : false;
+ exportHtml2UseSmileys = db_get_b(0, MODULE, "exportHtml2UseSmileys", 1) ? true : false;
+ if(!db_get_ws(0, MODULE, "extCssHtml2", &encodingV))
{
extCssHtml2 = encodingV.pwszVal;
- DBFreeVariant(&encodingV);
+ db_free(&encodingV);
}
else
{
extCssHtml2 = _T("");
}
- if(!DBGetContactSettingWString(0, MODULE, "ftpLogPath", &encodingV))
+ if(!db_get_ws(0, MODULE, "ftpLogPath", &encodingV))
{
ftpLogPath = encodingV.pwszVal;
- DBFreeVariant(&encodingV);
+ db_free(&encodingV);
}
- if(!DBGetContactSettingWString(0, MODULE, "ftpExePath", &encodingV))
+ if(!db_get_ws(0, MODULE, "ftpExePath", &encodingV))
{
ftpExePath = encodingV.pwszVal;
- DBFreeVariant(&encodingV);
+ db_free(&encodingV);
}
else
{
@@ -467,48 +467,48 @@ COLORREF Options::GetColor(Colors colorId) void Options::Save()
{
- DBWriteContactSettingByte(0, MODULE, "showContacts", showContacts ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "showContactGroups", showContactGroups ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "noFindBorder", noFindBorder ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "groupNewOnTop", groupNewOnTop ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "groupShowEvents", groupShowEvents ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "groupShowTime", groupShowTime ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "groupShowName", groupShowName ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "groupShowMessage", groupShowMessage ? 1 : 0);
+ db_set_b(0, MODULE, "showContacts", showContacts ? 1 : 0);
+ db_set_b(0, MODULE, "showContactGroups", showContactGroups ? 1 : 0);
+ db_set_b(0, MODULE, "noFindBorder", noFindBorder ? 1 : 0);
+ db_set_b(0, MODULE, "groupNewOnTop", groupNewOnTop ? 1 : 0);
+ db_set_b(0, MODULE, "groupShowEvents", groupShowEvents ? 1 : 0);
+ db_set_b(0, MODULE, "groupShowTime", groupShowTime ? 1 : 0);
+ db_set_b(0, MODULE, "groupShowName", groupShowName ? 1 : 0);
+ db_set_b(0, MODULE, "groupShowMessage", groupShowMessage ? 1 : 0);
if(groupMessageLen < 5) groupMessageLen = 5;
- DBWriteContactSettingDword(0, MODULE, "groupMessageLen", groupMessageLen);
+ db_set_dw(0, MODULE, "groupMessageLen", groupMessageLen);
if(groupTime < 1) groupTime = 1;
- DBWriteContactSettingDword(0, MODULE, "groupTime", groupTime);
+ db_set_dw(0, MODULE, "groupTime", groupTime);
if(groupMessagesNumber < 1) groupMessagesNumber = 1;
- DBWriteContactSettingDword(0, MODULE, "groupMessagesNumber", groupMessagesNumber);
- DBWriteContactSettingByte(0, MODULE, "messagesNewOnTop", messagesNewOnTop ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "messagesShowDate", messagesShowDate ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "messagesShowSec", messagesShowSec ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "messagesShowName", messagesShowName ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "messagesShowEvents", messagesShowEvents ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "messagesUseSmileys", messagesUseSmileys ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "searchForInList", searchForInList ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "searchForInMess", searchForInMess ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "searchMatchCase", searchMatchCase ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "searchMatchWhole", searchMatchWhole ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "searchOnlyIn", searchOnlyIn ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "searchOnlyOut", searchOnlyOut ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "searchOnlyGroup", searchOnlyGroup ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "searchAllContacts", searchAllContacts ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "schedulerAlerts", schedulerAlerts ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "schedulerHistoryAlerts", schedulerHistoryAlerts ? 1 : 0);
+ db_set_dw(0, MODULE, "groupMessagesNumber", groupMessagesNumber);
+ db_set_b(0, MODULE, "messagesNewOnTop", messagesNewOnTop ? 1 : 0);
+ db_set_b(0, MODULE, "messagesShowDate", messagesShowDate ? 1 : 0);
+ db_set_b(0, MODULE, "messagesShowSec", messagesShowSec ? 1 : 0);
+ db_set_b(0, MODULE, "messagesShowName", messagesShowName ? 1 : 0);
+ db_set_b(0, MODULE, "messagesShowEvents", messagesShowEvents ? 1 : 0);
+ db_set_b(0, MODULE, "messagesUseSmileys", messagesUseSmileys ? 1 : 0);
+ db_set_b(0, MODULE, "searchForInList", searchForInList ? 1 : 0);
+ db_set_b(0, MODULE, "searchForInMess", searchForInMess ? 1 : 0);
+ db_set_b(0, MODULE, "searchMatchCase", searchMatchCase ? 1 : 0);
+ db_set_b(0, MODULE, "searchMatchWhole", searchMatchWhole ? 1 : 0);
+ db_set_b(0, MODULE, "searchOnlyIn", searchOnlyIn ? 1 : 0);
+ db_set_b(0, MODULE, "searchOnlyOut", searchOnlyOut ? 1 : 0);
+ db_set_b(0, MODULE, "searchOnlyGroup", searchOnlyGroup ? 1 : 0);
+ db_set_b(0, MODULE, "searchAllContacts", searchAllContacts ? 1 : 0);
+ db_set_b(0, MODULE, "schedulerAlerts", schedulerAlerts ? 1 : 0);
+ db_set_b(0, MODULE, "schedulerHistoryAlerts", schedulerHistoryAlerts ? 1 : 0);
if(defFilter < 0 || defFilter - 2 >= (int)customFilters.size()) defFilter = 0;
- DBWriteContactSettingByte(0, MODULE, "defFilter", defFilter < 2 ? defFilter : 2);
+ db_set_b(0, MODULE, "defFilter", defFilter < 2 ? defFilter : 2);
if(defFilter >= 2)
- DBWriteContactSettingWString(0, MODULE, "defFilterStr", customFilters[defFilter - 2].name.c_str());
- DBWriteContactSettingDword(0, MODULE, "customFiltersCount", (DWORD)customFilters.size());
+ db_set_ws(0, MODULE, "defFilterStr", customFilters[defFilter - 2].name.c_str());
+ db_set_dw(0, MODULE, "customFiltersCount", (DWORD)customFilters.size());
for(int i = 0 ; i < (int)customFilters.size(); ++i)
{
char buf[256];
sprintf_s(buf, "filterName_%d", i);
- DBWriteContactSettingWString(0, MODULE, buf, customFilters[i].name.c_str());
+ db_set_ws(0, MODULE, buf, customFilters[i].name.c_str());
sprintf_s(buf, "filterInOut_%d", i);
- DBWriteContactSettingByte(0, MODULE, buf, customFilters[i].onlyIncomming ? 1 : (customFilters[i].onlyOutgoing ? 2 : 0));
+ db_set_b(0, MODULE, buf, customFilters[i].onlyIncomming ? 1 : (customFilters[i].onlyOutgoing ? 2 : 0));
std::string events;
for(std::vector<int>::iterator it = customFilters[i].events.begin(); it != customFilters[i].events.end(); ++it)
{
@@ -518,27 +518,27 @@ void Options::Save() }
sprintf_s(buf, "filterEvents_%d", i);
- DBWriteContactSettingString(0, MODULE, buf, events.c_str());
+ db_set_s(0, MODULE, buf, events.c_str());
}
- DBWriteContactSettingDword(0, MODULE, "codepageTxt", codepageTxt);
- DBWriteContactSettingDword(0, MODULE, "codepageHtml1", codepageHtml1);
- DBWriteContactSettingDword(0, MODULE, "codepageHtml2", codepageHtml2);
- DBWriteContactSettingWString(0, MODULE, "encodingTxt", encodingTxt.c_str());
- DBWriteContactSettingWString(0, MODULE, "encodingHtml1", encodingHtml1.c_str());
- DBWriteContactSettingWString(0, MODULE, "encodingHtml2", encodingHtml2.c_str());
- DBWriteContactSettingByte(0, MODULE, "exportHtml1ShowDate", exportHtml1ShowDate ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "exportHtml2ShowDate", exportHtml2ShowDate ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "exportHtml2UseSmileys", exportHtml2UseSmileys ? 1 : 0);
- DBWriteContactSettingWString(0, MODULE, "extCssHtml2", extCssHtml2.c_str());
- DBWriteContactSettingWString(0, MODULE, "ftpLogPath", ftpLogPath.c_str());
+ db_set_dw(0, MODULE, "codepageTxt", codepageTxt);
+ db_set_dw(0, MODULE, "codepageHtml1", codepageHtml1);
+ db_set_dw(0, MODULE, "codepageHtml2", codepageHtml2);
+ db_set_ws(0, MODULE, "encodingTxt", encodingTxt.c_str());
+ db_set_ws(0, MODULE, "encodingHtml1", encodingHtml1.c_str());
+ db_set_ws(0, MODULE, "encodingHtml2", encodingHtml2.c_str());
+ db_set_b(0, MODULE, "exportHtml1ShowDate", exportHtml1ShowDate ? 1 : 0);
+ db_set_b(0, MODULE, "exportHtml2ShowDate", exportHtml2ShowDate ? 1 : 0);
+ db_set_b(0, MODULE, "exportHtml2UseSmileys", exportHtml2UseSmileys ? 1 : 0);
+ db_set_ws(0, MODULE, "extCssHtml2", extCssHtml2.c_str());
+ db_set_ws(0, MODULE, "ftpLogPath", ftpLogPath.c_str());
if(ftpExePath != ftpExePathDef)
{
- DBWriteContactSettingWString(0, MODULE, "ftpExePath", ftpExePath.c_str());
+ db_set_ws(0, MODULE, "ftpExePath", ftpExePath.c_str());
}
else
{
- DBDeleteContactSetting(0, MODULE, "ftpExePath");
+ db_unset(0, MODULE, "ftpExePath");
}
}
@@ -552,119 +552,119 @@ void Options::SaveTasks(std::list<TaskOptions>* tasks) for(std::list<TaskOptions>::iterator it = tasks->begin(); it != tasks->end(); ++it)
{
sprintf_s(buf, "Task_compress_%d", i);
- DBWriteContactSettingByte(0, MODULE, buf, it->compress);
+ db_set_b(0, MODULE, buf, it->compress);
sprintf_s(buf, "Task_useFtp_%d", i);
- DBWriteContactSettingByte(0, MODULE, buf, it->useFtp);
+ db_set_b(0, MODULE, buf, it->useFtp);
sprintf_s(buf, "Task_isSystem_%d", i);
- DBWriteContactSettingByte(0, MODULE, buf, it->isSystem);
+ db_set_b(0, MODULE, buf, it->isSystem);
sprintf_s(buf, "Task_active_%d", i);
- DBWriteContactSettingByte(0, MODULE, buf, it->active);
+ db_set_b(0, MODULE, buf, it->active);
sprintf_s(buf, "Task_exportImported_%d", i);
- DBWriteContactSettingByte(0, MODULE, buf, it->exportImported);
+ db_set_b(0, MODULE, buf, it->exportImported);
sprintf_s(buf, "Task_type_%d", i);
- DBWriteContactSettingByte(0, MODULE, buf, it->type);
+ db_set_b(0, MODULE, buf, it->type);
sprintf_s(buf, "Task_eventUnit_%d", i);
- DBWriteContactSettingByte(0, MODULE, buf, it->eventUnit);
+ db_set_b(0, MODULE, buf, it->eventUnit);
sprintf_s(buf, "Task_trigerType_%d", i);
- DBWriteContactSettingByte(0, MODULE, buf, it->trigerType);
+ db_set_b(0, MODULE, buf, it->trigerType);
sprintf_s(buf, "Task_exportType_%d", i);
- DBWriteContactSettingByte(0, MODULE, buf, it->exportType);
+ db_set_b(0, MODULE, buf, it->exportType);
sprintf_s(buf, "Task_importType_%d", i);
- DBWriteContactSettingByte(0, MODULE, buf, it->importType);
+ db_set_b(0, MODULE, buf, it->importType);
sprintf_s(buf, "Task_eventDeltaTime_%d", i);
- DBWriteContactSettingDword(0, MODULE, buf, it->eventDeltaTime);
+ db_set_dw(0, MODULE, buf, it->eventDeltaTime);
sprintf_s(buf, "Task_filterId_%d", i);
- DBWriteContactSettingDword(0, MODULE, buf, it->filterId);
+ db_set_dw(0, MODULE, buf, it->filterId);
sprintf_s(buf, "Task_dayTime_%d", i);
- DBWriteContactSettingDword(0, MODULE, buf, it->dayTime);
+ db_set_dw(0, MODULE, buf, it->dayTime);
sprintf_s(buf, "Task_dayOfWeek_%d", i);
- DBWriteContactSettingDword(0, MODULE, buf, it->dayOfWeek);
+ db_set_dw(0, MODULE, buf, it->dayOfWeek);
sprintf_s(buf, "Task_dayOfMonth_%d", i);
- DBWriteContactSettingDword(0, MODULE, buf, it->dayOfMonth);
+ db_set_dw(0, MODULE, buf, it->dayOfMonth);
sprintf_s(buf, "Task_deltaTime_%d", i);
- DBWriteContactSettingDword(0, MODULE, buf, it->deltaTime);
+ db_set_dw(0, MODULE, buf, it->deltaTime);
sprintf_s(buf, "Task_lastExport_low_%d", i);
- DBWriteContactSettingDword(0, MODULE, buf, (int)it->lastExport);
+ db_set_dw(0, MODULE, buf, (int)it->lastExport);
sprintf_s(buf, "Task_lastExport_hi_%d", i);
- DBWriteContactSettingDword(0, MODULE, buf, ((unsigned long long int)it->lastExport) >> 32);
+ db_set_dw(0, MODULE, buf, ((unsigned long long int)it->lastExport) >> 32);
sprintf_s(buf, "Task_ftpName_%d", i);
- DBWriteContactSettingWString(0, MODULE, buf, it->ftpName.c_str());
+ db_set_ws(0, MODULE, buf, it->ftpName.c_str());
sprintf_s(buf, "Task_filterName_%d", i);
- DBWriteContactSettingWString(0, MODULE, buf, it->filterName.c_str());
+ db_set_ws(0, MODULE, buf, it->filterName.c_str());
sprintf_s(buf, "Task_filePath_%d", i);
- DBWriteContactSettingWString(0, MODULE, buf, it->filePath.c_str());
+ db_set_ws(0, MODULE, buf, it->filePath.c_str());
sprintf_s(buf, "Task_taskName_%d", i);
- DBWriteContactSettingWString(0, MODULE, buf, it->taskName.c_str());
+ db_set_ws(0, MODULE, buf, it->taskName.c_str());
sprintf_s(buf, "Task_zipPassword_%d", i);
- DBWriteContactSettingString(0, MODULE, buf, it->zipPassword.c_str());
+ db_set_s(0, MODULE, buf, it->zipPassword.c_str());
HANDLE _hContact = db_find_first();
sprintf_s(buf, "IsInTask_%d", i);
while(_hContact)
{
- DBDeleteContactSetting(_hContact, MODULE, buf);
+ db_unset(_hContact, MODULE, buf);
_hContact = db_find_next(_hContact);
}
for(size_t j = 0; j < it->contacts.size(); ++j)
{
- DBWriteContactSettingByte(it->contacts[j], MODULE, buf, 1);
+ db_set_b(it->contacts[j], MODULE, buf, 1);
}
it->orderNr = i++;
taskOptions.push_back(*it);
}
- DBWriteContactSettingDword(0, MODULE, "Task_count", i);
+ db_set_dw(0, MODULE, "Task_count", i);
for(i = (int)tasks->size(); i < oldTaskNr; ++i)
{
sprintf_s(buf, "Task_compress_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_useFtp_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_isSystem_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_active_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_type_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_eventUnit_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_trigerType_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_exportType_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_eventDeltaTime_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_filterId_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_dayTime_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_dayOfWeek_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_dayOfMonth_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_deltaTime_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_lastExport_low_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_lastExport_hi_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_ftpName_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_filterName_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_filePath_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
sprintf_s(buf, "Task_taskName_%d", i);
- DBDeleteContactSetting(NULL, MODULE, buf);
+ db_unset(NULL, MODULE, buf);
HANDLE _hContact = db_find_first();
sprintf_s(buf, "IsInTask_%d", i);
while(_hContact)
{
- DBDeleteContactSetting(_hContact, MODULE, buf);
+ db_unset(_hContact, MODULE, buf);
_hContact = db_find_next(_hContact);
}
}
@@ -677,92 +677,92 @@ void Options::SaveTaskTime(TaskOptions& to) int i = to.orderNr;
char buf[256];
sprintf_s(buf, "Task_lastExport_low_%d", i);
- DBWriteContactSettingDword(0, MODULE, buf, (int)to.lastExport);
+ db_set_dw(0, MODULE, buf, (int)to.lastExport);
sprintf_s(buf, "Task_lastExport_hi_%d", i);
- DBWriteContactSettingDword(0, MODULE, buf, ((unsigned long long int)to.lastExport) >> 32);
+ db_set_dw(0, MODULE, buf, ((unsigned long long int)to.lastExport) >> 32);
}
void Options::LoadTasks()
{
- int taskCount = DBGetContactSettingDword(0, MODULE, "Task_count", 0);
+ int taskCount = db_get_dw(0, MODULE, "Task_count", 0);
char buf[256];
for(int i = 0; i < taskCount; ++i)
{
TaskOptions to;
sprintf_s(buf, "Task_compress_%d", i);
- to.compress = DBGetContactSettingByte(0, MODULE, buf, to.compress) != 0;
+ to.compress = db_get_b(0, MODULE, buf, to.compress) != 0;
sprintf_s(buf, "Task_useFtp_%d", i);
- to.useFtp = DBGetContactSettingByte(0, MODULE, buf, to.useFtp) != 0;
+ to.useFtp = db_get_b(0, MODULE, buf, to.useFtp) != 0;
sprintf_s(buf, "Task_isSystem_%d", i);
- to.isSystem = DBGetContactSettingByte(0, MODULE, buf, to.isSystem) != 0;
+ to.isSystem = db_get_b(0, MODULE, buf, to.isSystem) != 0;
sprintf_s(buf, "Task_active_%d", i);
- to.active = DBGetContactSettingByte(0, MODULE, buf, to.active) != 0;
+ to.active = db_get_b(0, MODULE, buf, to.active) != 0;
sprintf_s(buf, "Task_exportImported_%d", i);
- to.exportImported = DBGetContactSettingByte(0, MODULE, buf, to.exportImported) != 0;
+ to.exportImported = db_get_b(0, MODULE, buf, to.exportImported) != 0;
sprintf_s(buf, "Task_type_%d", i);
- to.type = (TaskOptions::TaskType)DBGetContactSettingByte(0, MODULE, buf, to.type);
+ to.type = (TaskOptions::TaskType)db_get_b(0, MODULE, buf, to.type);
sprintf_s(buf, "Task_eventUnit_%d", i);
- to.eventUnit = (TaskOptions::EventUnit)DBGetContactSettingByte(0, MODULE, buf, to.eventUnit);
+ to.eventUnit = (TaskOptions::EventUnit)db_get_b(0, MODULE, buf, to.eventUnit);
sprintf_s(buf, "Task_trigerType_%d", i);
- to.trigerType = (TaskOptions::TrigerType)DBGetContactSettingByte(0, MODULE, buf, to.trigerType);
+ to.trigerType = (TaskOptions::TrigerType)db_get_b(0, MODULE, buf, to.trigerType);
sprintf_s(buf, "Task_exportType_%d", i);
- to.exportType = (IExport::ExportType)DBGetContactSettingByte(0, MODULE, buf, to.exportType);
+ to.exportType = (IExport::ExportType)db_get_b(0, MODULE, buf, to.exportType);
sprintf_s(buf, "Task_importType_%d", i);
- to.importType = (IImport::ImportType)DBGetContactSettingByte(0, MODULE, buf, to.importType);
+ to.importType = (IImport::ImportType)db_get_b(0, MODULE, buf, to.importType);
sprintf_s(buf, "Task_eventDeltaTime_%d", i);
- to.eventDeltaTime = DBGetContactSettingDword(0, MODULE, buf, to.eventDeltaTime);
+ to.eventDeltaTime = db_get_dw(0, MODULE, buf, to.eventDeltaTime);
sprintf_s(buf, "Task_filterId_%d", i);
- to.filterId = DBGetContactSettingDword(0, MODULE, buf, to.filterId);
+ to.filterId = db_get_dw(0, MODULE, buf, to.filterId);
sprintf_s(buf, "Task_dayTime_%d", i);
- to.dayTime = DBGetContactSettingDword(0, MODULE, buf, to.dayTime);
+ to.dayTime = db_get_dw(0, MODULE, buf, to.dayTime);
sprintf_s(buf, "Task_dayOfWeek_%d", i);
- to.dayOfWeek = DBGetContactSettingDword(0, MODULE, buf, to.dayOfWeek);
+ to.dayOfWeek = db_get_dw(0, MODULE, buf, to.dayOfWeek);
sprintf_s(buf, "Task_dayOfMonth_%d", i);
- to.dayOfMonth = DBGetContactSettingDword(0, MODULE, buf, to.dayOfMonth);
+ to.dayOfMonth = db_get_dw(0, MODULE, buf, to.dayOfMonth);
sprintf_s(buf, "Task_deltaTime_%d", i);
- to.deltaTime = DBGetContactSettingDword(0, MODULE, buf, to.deltaTime);
+ to.deltaTime = db_get_dw(0, MODULE, buf, to.deltaTime);
unsigned long long int le = to.lastExport;
sprintf_s(buf, "Task_lastExport_low_%d", i);
- to.lastExport = DBGetContactSettingDword(0, MODULE, buf, (int)le) & 0xffffffff;
+ to.lastExport = db_get_dw(0, MODULE, buf, (int)le) & 0xffffffff;
sprintf_s(buf, "Task_lastExport_hi_%d", i);
- to.lastExport |= ((unsigned long long int)DBGetContactSettingDword(0, MODULE, buf, le >> 32)) << 32;
+ to.lastExport |= ((unsigned long long int)db_get_dw(0, MODULE, buf, le >> 32)) << 32;
sprintf_s(buf, "Task_ftpName_%d", i);
DBVARIANT var;
- if(!DBGetContactSettingWString(0, MODULE, buf, &var))
+ if(!db_get_ws(0, MODULE, buf, &var))
{
to.ftpName = var.ptszVal;
- DBFreeVariant(&var);
+ db_free(&var);
}
sprintf_s(buf, "Task_filterName_%d", i);
- if(!DBGetContactSettingWString(0, MODULE, buf, &var))
+ if(!db_get_ws(0, MODULE, buf, &var))
{
to.filterName = var.ptszVal;
- DBFreeVariant(&var);
+ db_free(&var);
}
sprintf_s(buf, "Task_filePath_%d", i);
- if(!DBGetContactSettingWString(0, MODULE, buf, &var))
+ if(!db_get_ws(0, MODULE, buf, &var))
{
to.filePath = var.ptszVal;
- DBFreeVariant(&var);
+ db_free(&var);
}
sprintf_s(buf, "Task_taskName_%d", i);
- if(!DBGetContactSettingWString(0, MODULE, buf, &var))
+ if(!db_get_ws(0, MODULE, buf, &var))
{
to.taskName = var.ptszVal;
- DBFreeVariant(&var);
+ db_free(&var);
}
sprintf_s(buf, "Task_zipPassword_%d", i);
- if(!DBGetContactSettingString(0, MODULE, buf, &var))
+ if(!db_get_s(0, MODULE, buf, &var))
{
to.zipPassword = var.pszVal;
- DBFreeVariant(&var);
+ db_free(&var);
}
HANDLE _hContact = db_find_first();
sprintf_s(buf, "IsInTask_%d", i);
while(_hContact)
{
- if(DBGetContactSettingByte(_hContact, MODULE, buf, 0) == 1)
+ if(db_get_b(_hContact, MODULE, buf, 0) == 1)
{
to.contacts.push_back(_hContact);
}
diff --git a/plugins/Boltun/src/actionQueue.cpp b/plugins/Boltun/src/actionQueue.cpp index e652ce8061..a3915bf255 100644 --- a/plugins/Boltun/src/actionQueue.cpp +++ b/plugins/Boltun/src/actionQueue.cpp @@ -75,9 +75,9 @@ void UpdateTimer() static bool NotifyTyping(HANDLE hContact)
{
- int res = DBGetContactSettingByte(hContact, "SRMsg", "SupportTyping", 2);
+ int res = db_get_b(hContact, "SRMsg", "SupportTyping", 2);
if (res == 2)
- res = DBGetContactSettingByte(NULL, "SRMsg", "DefaultTyping", 1);
+ res = db_get_b(NULL, "SRMsg", "DefaultTyping", 1);
return res != 0;
}
@@ -226,11 +226,11 @@ void DoAnswer(HANDLE hContact, const TalkBot::MessageInfo *info, bool sticky = f void AnswerToContact(HANDLE hContact, const TCHAR* messageToAnswer)
{
- if (Config.TalkWarnContacts && DBGetContactSettingByte(hContact, BOLTUN_KEY,
+ if (Config.TalkWarnContacts && db_get_b(hContact, BOLTUN_KEY,
DB_CONTACT_WARNED, FALSE) == FALSE)
{
DoAnswer(hContact, new TalkBot::MessageInfo((const TCHAR*)Config.WarnText), true);
- DBWriteContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_WARNED, TRUE);
+ db_set_b(hContact, BOLTUN_KEY, DB_CONTACT_WARNED, TRUE);
}
else
DoAnswer(hContact, bot->Reply(hContact, messageToAnswer, false));
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index fdf9fbf78c..69cc4f0055 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -188,7 +188,7 @@ static bool LoadMind(const TCHAR* filename, int &line) static bool BoltunAutoChat(HANDLE hContact)
{
- if (DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT
+ if (db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT
, FALSE) == TRUE)
return false;
@@ -207,11 +207,11 @@ static bool BoltunAutoChat(HANDLE hContact) return true;
}
- if ((DBGetContactSettingByte(hContact,"CList","NotOnList",0) == 1) &&
+ if ((db_get_b(hContact,"CList","NotOnList",0) == 1) &&
Config.TalkWithNotInList)
return true;
- if (DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT,
+ if (db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT,
FALSE) == TRUE)
return true;
@@ -512,8 +512,8 @@ static int ContactClick(WPARAM wParam, LPARAM lParam, BOOL clickNotToChat) {
HANDLE hContact = (HANDLE)wParam;
- BOOL boltunautochat = DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
- BOOL boltunnottochat = DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
+ BOOL boltunautochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
+ BOOL boltunnottochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
if (clickNotToChat)
{
@@ -532,12 +532,12 @@ static int ContactClick(WPARAM wParam, LPARAM lParam, BOOL clickNotToChat) }
else
{
- DBWriteContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_WARNED, FALSE);
+ db_set_b(hContact, BOLTUN_KEY, DB_CONTACT_WARNED, FALSE);
}
}
- DBWriteContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, (BYTE)boltunautochat);
- DBWriteContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, (BYTE)boltunnottochat);
+ db_set_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, (BYTE)boltunautochat);
+ db_set_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, (BYTE)boltunnottochat);
return 0;
}
@@ -564,7 +564,7 @@ static int MessagePrebuild(WPARAM wParam, LPARAM lParam) CLISTMENUITEM clmi = { sizeof(clmi) };
HANDLE hContact = (HANDLE)wParam;
- if (!blInit || (DBGetContactSettingByte(hContact,"CList","NotOnList",0) == 1))
+ if (!blInit || (db_get_b(hContact,"CList","NotOnList",0) == 1))
{
clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
@@ -573,8 +573,8 @@ static int MessagePrebuild(WPARAM wParam, LPARAM lParam) }
else
{
- BOOL boltunautochat = DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
- BOOL boltunnottochat = DBGetContactSettingByte(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
+ BOOL boltunautochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE);
+ BOOL boltunnottochat = db_get_b(hContact, BOLTUN_KEY, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE);
clmi.flags = CMIM_FLAGS | CMIM_ICON | (boltunautochat ? CMIF_CHECKED : 0);
clmi.hIcon = LoadIcon( GetModuleHandle(NULL), MAKEINTRESOURCE((boltunautochat ? IDI_TICK : IDI_NOTICK)));
@@ -649,7 +649,7 @@ extern "C" int __declspec(dllexport) Load(void) MessageBox(NULL, path, TranslateTS(BOLTUN_ERROR), MB_ICONERROR|MB_TASKMODAL|MB_OK);
}
/*record for Uninstall plugin*/
- DBWriteContactSettingString(NULL, "Uninstall", BOLTUN_NAME, BOLTUN_KEY);
+ db_set_s(NULL, "Uninstall", BOLTUN_NAME, BOLTUN_KEY);
return 0;
}
diff --git a/plugins/Boltun/src/config.cpp b/plugins/Boltun/src/config.cpp index b2dcf3849f..b05a560b2b 100644 --- a/plugins/Boltun/src/config.cpp +++ b/plugins/Boltun/src/config.cpp @@ -40,12 +40,12 @@ inline TCHAR* GetString(char* key, const TCHAR* def) {
DBVARIANT dbv;
TCHAR* val;
- if (!DBGetContactSettingTString(NULL, BOLTUN_KEY, key, &dbv))
+ if (!db_get_ts(NULL, BOLTUN_KEY, key, &dbv))
{
size_t len = wcslen(dbv.ptszVal) + 1;
val = new TCHAR[len];
_tcscpy_s(val, len, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
{
@@ -61,22 +61,22 @@ inline const TCHAR* SetString(char* key, const TCHAR* value) size_t len = _tcslen(value) + 1;
TCHAR* val = new TCHAR[len];
_tcscpy_s(val, len, value);
- DBWriteContactSettingTString(NULL, BOLTUN_KEY, key, val);
+ db_set_ts(NULL, BOLTUN_KEY, key, val);
return val;
}
#define BUILDETTERS(x, str, def) \
const bool BoltunConfig::Get##x() { \
- return DBGetContactSettingDword(NULL, BOLTUN_KEY, str, def) != 0; } \
+ return db_get_dw(NULL, BOLTUN_KEY, str, def) != 0; } \
const bool BoltunConfig::Set##x(const bool value) { \
- DBWriteContactSettingDword(NULL, BOLTUN_KEY, str, value); \
+ db_set_dw(NULL, BOLTUN_KEY, str, value); \
return value; }
#define BUILDINTETTERS(x, str, def) \
const int BoltunConfig::Get##x() { \
- return DBGetContactSettingDword(NULL, BOLTUN_KEY, str, def); } \
+ return db_get_dw(NULL, BOLTUN_KEY, str, def); } \
const int BoltunConfig::Set##x(const int value) { \
- DBWriteContactSettingDword(NULL, BOLTUN_KEY, str, value); \
+ db_set_dw(NULL, BOLTUN_KEY, str, value); \
return value; }
#define BUILDSTRETTERS(x, str, def) \
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 4802db7834..f760da383e 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -309,10 +309,10 @@ static void CreateTrayIcon(bool create) {
NOTIFYICONDATA nim;
DBVARIANT dbVar;
- if (!DBGetContactSettingTString(NULL,MOD_NAME,"ToolTipText",&dbVar))
+ if (!db_get_ts(NULL,MOD_NAME,"ToolTipText",&dbVar))
{
mir_sntprintf(nim.szTip, 64, _T("%s"), dbVar.ptszVal);
- DBFreeVariant(&dbVar);
+ db_free(&dbVar);
}
else
lstrcpy(nim.szTip, _T("Miranda NG"));
@@ -333,14 +333,14 @@ static void RestoreOldSettings(void) CallService(MS_POPUP_QUERY, PUQS_ENABLEPOPUPS, 0);
if (g_bOldSetting & OLD_SOUND)
- DBWriteContactSettingByte(NULL,"Skin","UseSound", 1);
+ db_set_b(NULL,"Skin","UseSound", 1);
if (g_bOldSetting & OLD_FLTCONT) // show Floating contacts if needed
{
if(ServiceExists("FloatingContacts/MainHideAllThumbs"))
CallService("FloatingContacts/MainHideAllThumbs",0,0);
else
- DBWriteContactSettingByte(NULL,"FloatingContacts","HideAll", 0);
+ db_set_b(NULL,"FloatingContacts","HideAll", 0);
}
g_bOldSetting = 0;
}
@@ -381,10 +381,10 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) if (g_wMask & OPT_CHANGESTATUS) // is this even needed?
{
- BYTE bReqMode = DBGetContactSettingByte(NULL, MOD_NAME, "stattype", 2);
+ BYTE bReqMode = db_get_b(NULL, MOD_NAME, "stattype", 2);
unsigned uMode = (STATUS_ARR_TO_ID[bReqMode]);
DBVARIANT dbVar;
- if (g_wMask & OPT_USEDEFMSG || DBGetContactSettingTString(NULL,MOD_NAME,"statmsg",&dbVar))
+ if (g_wMask & OPT_USEDEFMSG || db_get_ts(NULL,MOD_NAME,"statmsg",&dbVar))
{
TCHAR *ptszDefMsg = GetDefStatusMsg(uMode, 0);
ChangeAllProtoStatuses(uMode, ptszDefMsg);
@@ -408,7 +408,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) mir_free(ptszParsed);
}else
ChangeAllProtoStatuses(uMode, dbVar.ptszVal);
- DBFreeVariant(&dbVar);
+ db_free(&dbVar);
}
}
@@ -427,17 +427,17 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) }
// disable sounds
- if ((g_wMask & OPT_DISABLESNDS) && DBGetContactSettingByte(NULL,"Skin","UseSound",1))
+ if ((g_wMask & OPT_DISABLESNDS) && db_get_b(NULL,"Skin","UseSound",1))
{
// save current
g_bOldSetting |= OLD_SOUND;
- DBWriteContactSettingByte(NULL,"Skin","UseSound",0);
+ db_set_b(NULL,"Skin","UseSound",0);
}
g_bWindowHidden = true;
g_bOldSetting |= OLD_WASHIDDEN;
- DBWriteContactSettingByte(NULL, MOD_NAME, "OldSetting", g_bOldSetting);
+ db_set_b(NULL, MOD_NAME, "OldSetting", g_bOldSetting);
return(0);
} break;
case WM_USER+52: // back
@@ -447,12 +447,12 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) if (g_wMask & OPT_REQPASS){ //password request
DBVARIANT dbVar = {0};
- if (!DBGetContactSettingString(NULL,MOD_NAME,"password",&dbVar))
+ if (!db_get_s(NULL,MOD_NAME,"password",&dbVar))
{
g_fPassRequested = true;
strncpy(g_password, dbVar.pszVal, MAXPASSLEN);
- DBFreeVariant(&dbVar);
+ db_free(&dbVar);
CallService( MS_DB_CRYPT_DECODESTRING, MAXPASSLEN+1, ( LPARAM )g_password );
int res = DialogBox(g_hInstance,(MAKEINTRESOURCE(IDD_PASSDIALOGNEW)),GetForegroundWindow(),(DLGPROC)DlgStdInProc);
@@ -508,7 +508,7 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) PostMessage(hWnd, WM_MOUSEMOVE, 0, (LPARAM)MAKELONG(2, 2)); // reset core's IDLE
g_bWindowHidden = false;
- DBWriteContactSettingByte(NULL, MOD_NAME, "OldSetting", 0);
+ db_set_b(NULL, MOD_NAME, "OldSetting", 0);
return(0);
} break;
default:break;
@@ -579,7 +579,7 @@ static TCHAR *HokeyVkToName(WORD vkKey) static TCHAR *GetBossKeyText(void)
{
- WORD wHotKey = DBGetContactSettingWord(NULL,"SkinHotKeys","Hide/Show Miranda",HOTKEYCODE(HOTKEYF_CONTROL, VK_F12));
+ WORD wHotKey = db_get_w(NULL,"SkinHotKeys","Hide/Show Miranda",HOTKEYCODE(HOTKEYF_CONTROL, VK_F12));
BYTE key = LOBYTE(wHotKey);
BYTE shift = HIBYTE(wHotKey);
@@ -715,7 +715,7 @@ static int EnumProtos(WPARAM wParam, LPARAM lParam) int MirandaLoaded(WPARAM wParam,LPARAM lParam)
{
- g_wMask = DBGetContactSettingWord(NULL,MOD_NAME,"optsmask",DEFAULTSETTING);
+ g_wMask = db_get_w(NULL,MOD_NAME,"optsmask",DEFAULTSETTING);
RegisterCoreHotKeys();
@@ -809,20 +809,20 @@ extern "C" int __declspec(dllexport) Load(void) {
mir_getLP(&pluginInfo);
- g_wMaskAdv = DBGetContactSettingWord(NULL,MOD_NAME,"optsmaskadv",0);
- g_bOldSetting = DBGetContactSettingByte(NULL, MOD_NAME, "OldSetting", 0);
+ g_wMaskAdv = db_get_w(NULL,MOD_NAME,"optsmaskadv",0);
+ g_bOldSetting = db_get_b(NULL, MOD_NAME, "OldSetting", 0);
if ((g_bOldSetting & OLD_POPUP) && !(g_wMaskAdv & OPT_RESTORE)) // Restore popup settings if Miranda was crushed or killed in hidden mode and "Restore hiding on startup after failure" option is disabled
{
- if (DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1) == 0)
- DBWriteContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1);
- if (DBGetContactSettingByte(NULL, "YAPP", "Enabled", 1) == 0)
- DBWriteContactSettingByte(NULL, "YAPP", "Enabled", 1);
+ if (db_get_b(NULL, "PopUp", "ModuleIsEnabled", 1) == 0)
+ db_set_b(NULL, "PopUp", "ModuleIsEnabled", 1);
+ if (db_get_b(NULL, "YAPP", "Enabled", 1) == 0)
+ db_set_b(NULL, "YAPP", "Enabled", 1);
}
- if (g_wMaskAdv & OPT_HIDEONSTART && DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 0)) // hack for disabling popup on startup if "Hide Miranda on startup" is enabled
+ if (g_wMaskAdv & OPT_HIDEONSTART && db_get_b(NULL, "PopUp", "ModuleIsEnabled", 0)) // hack for disabling popup on startup if "Hide Miranda on startup" is enabled
{
g_bOldSetting |= OLD_POPUP;
- DBWriteContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 0);
+ db_set_b(NULL, "PopUp", "ModuleIsEnabled", 0);
}
Icon_Register(g_hInstance, "BossKey", iconList, SIZEOF(iconList));
diff --git a/plugins/BossKeyPlus/src/BossKeyIdle.cpp b/plugins/BossKeyPlus/src/BossKeyIdle.cpp index eba26fd29e..a71bd2200c 100644 --- a/plugins/BossKeyPlus/src/BossKeyIdle.cpp +++ b/plugins/BossKeyPlus/src/BossKeyIdle.cpp @@ -80,7 +80,7 @@ VOID CALLBACK IdleTimer(HWND hwnd, UINT umsg, UINT_PTR idEvent, DWORD dwTime) void InitIdleTimer()
{
- minutes = DBGetContactSettingByte(NULL,MOD_NAME,"time",10);
+ minutes = db_get_b(NULL,MOD_NAME,"time",10);
MyGetLastInputInfo=(BOOL (WINAPI *)(LASTINPUTINFO*))GetProcAddress(GetModuleHandleA("user32"), "GetLastInputInfo");
hTimer=SetTimer(NULL, 0, 2000, IdleTimer);
}
diff --git a/plugins/BossKeyPlus/src/Options.cpp b/plugins/BossKeyPlus/src/Options.cpp index 9947eb3073..01b0b073ae 100644 --- a/plugins/BossKeyPlus/src/Options.cpp +++ b/plugins/BossKeyPlus/src/Options.cpp @@ -69,12 +69,12 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) DBVARIANT dbVar;
- if (!DBGetContactSettingString(NULL,MOD_NAME,"password",&dbVar))
+ if (!db_get_s(NULL,MOD_NAME,"password",&dbVar))
{
CallService( MS_DB_CRYPT_DECODESTRING, strlen( dbVar.pszVal )+1, ( LPARAM )dbVar.pszVal );
SetDlgItemTextA(hwndDlg,IDC_MAINOPT_PASS,dbVar.pszVal);
- DBFreeVariant(&dbVar);
+ db_free(&dbVar);
}
CheckDlgButton(hwndDlg,IDC_MAINOPT_SETONLINEBACK,(g_wMask & OPT_SETONLINEBACK) ? (BST_CHECKED) : (BST_UNCHECKED));
@@ -90,7 +90,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) for (BYTE i = 0;i < 8; i++)
SendDlgItemMessage(hwndDlg,IDC_MAINOPT_CHGSTS,CB_INSERTSTRING,-1,(LPARAM)TranslateTS(STATUS_ARR_TO_NAME[i]));
- SendDlgItemMessage(hwndDlg, IDC_MAINOPT_CHGSTS, CB_SETCURSEL, DBGetContactSettingByte(NULL, MOD_NAME, "stattype", 2), 0);
+ SendDlgItemMessage(hwndDlg, IDC_MAINOPT_CHGSTS, CB_SETCURSEL, db_get_b(NULL, MOD_NAME, "stattype", 2), 0);
SendMessage(hwndDlg,WM_USER + 60,0,0);
SendMessage(hwndDlg,WM_USER + 50,0,0);
@@ -112,7 +112,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) // write down status type
if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_CHANGESTATUSBOX) == BST_CHECKED)
{
- DBWriteContactSettingByte(NULL,MOD_NAME,"stattype",(BYTE)SendDlgItemMessage(hwndDlg,IDC_MAINOPT_CHGSTS,CB_GETCURSEL,0,0));
+ db_set_b(NULL,MOD_NAME,"stattype",(BYTE)SendDlgItemMessage(hwndDlg,IDC_MAINOPT_CHGSTS,CB_GETCURSEL,0,0));
// status msg, if needed
if (IsWindowEnabled(GetDlgItem(hwndDlg,IDC_MAINOPT_STATMSG))) // meaning we should save it
@@ -120,9 +120,9 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) TCHAR tszMsg[1025];
GetDlgItemText(hwndDlg,IDC_MAINOPT_STATMSG,tszMsg,1024);
if (lstrlen(tszMsg) != 0)
- DBWriteContactSettingTString(NULL,MOD_NAME,"statmsg",tszMsg);
+ db_set_ts(NULL,MOD_NAME,"statmsg",tszMsg);
else // delete current setting
- DBDeleteContactSetting(NULL,MOD_NAME,"statmsg");
+ db_unset(NULL,MOD_NAME,"statmsg");
}
wMask |= OPT_CHANGESTATUS;
}
@@ -134,7 +134,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) GetDlgItemTextA(hwndDlg,IDC_MAINOPT_PASS,szPass,MAXPASSLEN+1);
if (strlen(szPass) != 0){
CallService( MS_DB_CRYPT_ENCODESTRING, MAXPASSLEN+1, ( LPARAM )szPass );
- DBWriteContactSettingString(NULL,MOD_NAME,"password",szPass);
+ db_set_s(NULL,MOD_NAME,"password",szPass);
wMask |= OPT_REQPASS;
}
}
@@ -144,7 +144,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_USEDEFMSG) == BST_CHECKED) wMask |= OPT_USEDEFMSG;
if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_TRAYICON) == BST_CHECKED) wMask |= OPT_TRAYICON;
- DBWriteContactSettingWord(NULL,MOD_NAME,"optsmask",wMask);
+ db_set_w(NULL,MOD_NAME,"optsmask",wMask);
g_wMask = wMask;
return(true);
@@ -166,10 +166,10 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) {
DBVARIANT dbVar;
SendDlgItemMessage(hwndDlg,IDC_MAINOPT_STATMSG,EM_LIMITTEXT,1024,0);
- if (!DBGetContactSettingTString(NULL,MOD_NAME,"statmsg",&dbVar))
+ if (!db_get_ts(NULL,MOD_NAME,"statmsg",&dbVar))
{
SetDlgItemText(hwndDlg,IDC_MAINOPT_STATMSG,dbVar.ptszVal);
- DBFreeVariant(&dbVar);
+ db_free(&dbVar);
}
}
EnableWindow(GetDlgItem(hwndDlg,IDC_MAINOPT_STATMSG),(IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_CHANGESTATUSBOX) == BST_CHECKED) && (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_USEDEFMSG) != BST_CHECKED));
@@ -283,7 +283,7 @@ INT_PTR CALLBACK AdvOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) g_fOptionsOpen = true;
- minutes = DBGetContactSettingByte(NULL,MOD_NAME,"time",10);
+ minutes = db_get_b(NULL,MOD_NAME,"time",10);
char szMinutes[4] = {0};
_itoa(minutes, szMinutes, 10);
SendDlgItemMessage(hwndDlg,IDC_MAINOPT_TIME,EM_LIMITTEXT,2,0);
@@ -324,8 +324,8 @@ INT_PTR CALLBACK AdvOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) char szMinutes[4] = {0};
GetDlgItemTextA(hwndDlg,IDC_MAINOPT_TIME,szMinutes,3);
(atoi(szMinutes) > 0) ? minutes = atoi(szMinutes) : minutes = 1;
- DBWriteContactSettingByte(NULL,MOD_NAME,"time",minutes);
- DBWriteContactSettingWord(NULL,MOD_NAME,"optsmaskadv",wMaskAdv);
+ db_set_b(NULL,MOD_NAME,"time",minutes);
+ db_set_w(NULL,MOD_NAME,"optsmaskadv",wMaskAdv);
g_wMaskAdv = wMaskAdv;
return(true);
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index d3a55b4afa..13a6303ee3 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -447,24 +447,17 @@ int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam) return 0;
CLISTMENUITEM mi = { sizeof(mi) };
-
- if (db_get_b((HANDLE)wParam, proto, "ChatRoom", 0) || !(CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND))
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- else
- mi.flags = CMIM_FLAGS;
-
+ mi.flags = CMIM_ICON | CMIM_NAME | CMIF_ICONFROMICOLIB | CMIF_TCHAR;
if (db_get_b((HANDLE)wParam, MODULE_NAME, "MissYou", 0)) {
- mi.flags |= CMIM_ICON | CMIM_NAME | CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.ptszName = LPGENT("Disable Miss You");
mi.icolibItem = iconList[1].hIcolib;
}
else {
- mi.flags |= CMIM_ICON | CMIM_NAME | CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.ptszName = LPGENT("Enable Miss You");
mi.icolibItem = iconList[2].hIcolib;
}
Menu_ModifyItem(hContactMenu, &mi);
-
+ Menu_ShowItem(hContactMenu, !db_get_b((HANDLE)wParam, proto, "ChatRoom", 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND));
return 0;
}
@@ -496,7 +489,7 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) return 0;
int currentStatus = inf->value.wVal;
- int prevStatus = DBGetContactSettingWord(hContact, "UserOnline", "OldStatus", ID_STATUS_OFFLINE);
+ int prevStatus = db_get_w(hContact, "UserOnline", "OldStatus", ID_STATUS_OFFLINE);
if (currentStatus == prevStatus)
return 0;
@@ -722,8 +715,8 @@ extern "C" int __declspec(dllexport) Load(void) HANDLE hContact = db_find_first();
DWORD current_time = (DWORD)time(0);
while (hContact != 0) {
- if ( !DBGetContactSetting(hContact, MODULE_NAME, "CreationTime", &dbv))
- DBFreeVariant(&dbv);
+ if ( !db_get(hContact, MODULE_NAME, "CreationTime", &dbv))
+ db_free(&dbv);
else
db_set_dw(hContact, MODULE_NAME, "CreationTime", current_time);
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index 202d83d2ff..3cd321b1d7 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -469,7 +469,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar else
{
/*
- int status = DBGetContactSettingWord((HANDLE)lparam, MODULE_NAME, "LastStatus", ID_STATUS_OFFLINE);
+ int status = db_get_w((HANDLE)lparam, MODULE_NAME, "LastStatus", ID_STATUS_OFFLINE);
char *strptr = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)status, 0);
*/
_tcsftime(tmpBuf, 50, _T("%#x"), gmtime(&tmpTime));
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp index a3ff2cb3f0..7730653313 100644 --- a/plugins/BuddyPounce/src/dialog.cpp +++ b/plugins/BuddyPounce/src/dialog.cpp @@ -76,11 +76,11 @@ void getDefaultMessage(HWND hwnd, UINT control, HANDLE hContact) DBVARIANT dbv;
if (!db_get_ts(hContact, modname, "PounceMsg", &dbv)) {
SetDlgItemText(hwnd, control, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else if (!db_get_ts(NULL, modname, "PounceMsg", &dbv)) {
SetDlgItemText(hwnd, control, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
INT_PTR CALLBACK StatusModesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -333,7 +333,7 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l db_set_w(hContact, modname, "SendIfTheirStatusIsFLAG", (WORD)db_get_w(NULL, modname, "SendIfTheirStatusIsFLAG",0));
db_set_b(hContact, modname, "Reuse",(BYTE)db_get_b(NULL, modname, "Reuse",0));
db_set_b(hContact, modname, "GiveUpDays", (BYTE)db_get_b(NULL, modname, "GiveUpDays",0));
- db_set_dw(hContact, modname, "GiveUpDate", (DWORD)DBGetContactSettingDword(NULL, modname, "GiveUpDate",0));
+ db_set_dw(hContact, modname, "GiveUpDate", (DWORD)db_get_dw(NULL, modname, "GiveUpDate",0));
db_set_w(hContact, modname, "ConfirmTimeout", (WORD)db_get_w(NULL, modname, "ConfirmTimeout",0));
}
break;
@@ -536,7 +536,7 @@ INT_PTR CALLBACK SendPounceDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP SetWindowLongPtr(hwnd, GWLP_USERDATA, (WPARAM)spdps);
if (db_get_ts(spdps->hContact, modname, "PounceMsg", &dbv)) DestroyWindow(hwnd);
SetDlgItemText(hwnd,IDC_MESSAGE, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
SetTimer(hwnd,1,1000,NULL);
SendMessage(hwnd,WM_TIMER,0,0);
}
@@ -587,7 +587,7 @@ INT_PTR CALLBACK PounceSentDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (db_get_ts(hContact, modname, "PounceMsg", &dbv))
DestroyWindow(hwnd);
SetDlgItemText(hwnd, IDC_MESSAGE, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
break;
case WM_COMMAND:
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index f95b995798..1b92532deb 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -186,7 +186,7 @@ int UserOnlineSettingChanged(WPARAM wParam,LPARAM lParam) else SendPounce(dbv.ptszVal, hContact);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -228,7 +228,7 @@ INT_PTR AddToPounce(WPARAM wParam, LPARAM lParam) _tcscat(newPounce, message);
db_set_ws(hContact, modname, "PounceMsg", newPounce);
mir_free(newPounce);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else AddSimpleMessage((WPARAM)hContact, (LPARAM)message);
return 0;
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index bf2f093749..4fe55e4279 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -270,14 +270,14 @@ void importCustomStatuses(CSWindow* csw, int result) si->m_iIcon = i-1;
mir_snprintf(bufTitle, 32, "XStatus%dName", i);
- if ( !DBGetContactSettingTString( NULL, protoName, bufTitle, &dbv )) {
+ if ( !db_get_ts( NULL, protoName, bufTitle, &dbv )) {
lstrcpy(si->m_tszTitle, dbv.ptszVal);
db_free(&dbv);
}
else si->m_tszTitle[0] = 0;
mir_snprintf(bufMessage, 32, "XStatus%dMsg", i);
- if ( !DBGetContactSettingTString( NULL, protoName, bufMessage, &dbv )) {
+ if ( !db_get_ts( NULL, protoName, bufMessage, &dbv )) {
lstrcpy(si->m_tszMessage, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/ChangeKeyboardLayout/src/hook_events.cpp b/plugins/ChangeKeyboardLayout/src/hook_events.cpp index ea788fb912..61da136140 100644 --- a/plugins/ChangeKeyboardLayout/src/hook_events.cpp +++ b/plugins/ChangeKeyboardLayout/src/hook_events.cpp @@ -27,55 +27,55 @@ INT_PTR APIChangeTextLayout(WPARAM wParam, LPARAM lParam) void ReadMainOptions()
{
- moOptions.dwHotkey_Layout = DBGetContactSettingDword(NULL, ModuleName, "HotkeyLayout", 119);
- moOptions.dwHotkey_Layout2 = DBGetContactSettingDword(NULL, ModuleName, "HotkeyLayout2", 120);
- moOptions.dwHotkey_Case = DBGetContactSettingDword(NULL, ModuleName, "HotkeyCase", 121);
- moOptions.CurrentWordLayout = DBGetContactSettingByte(NULL, ModuleName, "CurrentWordLayout", 0);
- moOptions.CurrentWordLayout2 = DBGetContactSettingByte(NULL, ModuleName, "CurrentWordLayout2", 1);
- moOptions.CurrentWordCase = DBGetContactSettingByte(NULL, ModuleName, "CurrentWordCase", 0);
- moOptions.TwoWay = DBGetContactSettingByte(NULL, ModuleName, "TwoWay", 1);
- moOptions.ChangeSystemLayout = DBGetContactSettingByte(NULL, ModuleName, "ChangeSystemLayout", 1);
- moOptions.CopyToClipboard = DBGetContactSettingByte(NULL, ModuleName, "CopyToClipboard", 0);
- moOptions.ShowPopup = DBGetContactSettingByte(NULL, ModuleName, "ShowPopup", 1);
- moOptions.bCaseOperations = DBGetContactSettingByte(NULL, ModuleName, "CaseOperations", 0);
+ moOptions.dwHotkey_Layout = db_get_dw(NULL, ModuleName, "HotkeyLayout", 119);
+ moOptions.dwHotkey_Layout2 = db_get_dw(NULL, ModuleName, "HotkeyLayout2", 120);
+ moOptions.dwHotkey_Case = db_get_dw(NULL, ModuleName, "HotkeyCase", 121);
+ moOptions.CurrentWordLayout = db_get_b(NULL, ModuleName, "CurrentWordLayout", 0);
+ moOptions.CurrentWordLayout2 = db_get_b(NULL, ModuleName, "CurrentWordLayout2", 1);
+ moOptions.CurrentWordCase = db_get_b(NULL, ModuleName, "CurrentWordCase", 0);
+ moOptions.TwoWay = db_get_b(NULL, ModuleName, "TwoWay", 1);
+ moOptions.ChangeSystemLayout = db_get_b(NULL, ModuleName, "ChangeSystemLayout", 1);
+ moOptions.CopyToClipboard = db_get_b(NULL, ModuleName, "CopyToClipboard", 0);
+ moOptions.ShowPopup = db_get_b(NULL, ModuleName, "ShowPopup", 1);
+ moOptions.bCaseOperations = db_get_b(NULL, ModuleName, "CaseOperations", 0);
}
void WriteMainOptions()
{
- DBWriteContactSettingDword(NULL, ModuleName, "HotkeyLayout", moOptions.dwHotkey_Layout);
- DBWriteContactSettingDword(NULL, ModuleName, "HotkeyLayout2", moOptions.dwHotkey_Layout2);
- DBWriteContactSettingDword(NULL, ModuleName, "HotkeyCase", moOptions.dwHotkey_Case);
- DBWriteContactSettingByte(NULL, ModuleName, "CurrentWordLayout", moOptions.CurrentWordLayout);
- DBWriteContactSettingByte(NULL, ModuleName, "CurrentWordLayout2", moOptions.CurrentWordLayout2);
- DBWriteContactSettingByte(NULL, ModuleName, "CurrentWordCase", moOptions.CurrentWordCase);
- DBWriteContactSettingByte(NULL, ModuleName, "TwoWay", moOptions.TwoWay);
- DBWriteContactSettingByte(NULL, ModuleName, "ChangeSystemLayout", moOptions.ChangeSystemLayout);
- DBWriteContactSettingByte(NULL, ModuleName, "CopyToClipboard", moOptions.CopyToClipboard);
- DBWriteContactSettingByte(NULL, ModuleName, "ShowPopup", moOptions.ShowPopup);
- DBWriteContactSettingByte(NULL, ModuleName, "CaseOperations", moOptions.bCaseOperations);
+ db_set_dw(NULL, ModuleName, "HotkeyLayout", moOptions.dwHotkey_Layout);
+ db_set_dw(NULL, ModuleName, "HotkeyLayout2", moOptions.dwHotkey_Layout2);
+ db_set_dw(NULL, ModuleName, "HotkeyCase", moOptions.dwHotkey_Case);
+ db_set_b(NULL, ModuleName, "CurrentWordLayout", moOptions.CurrentWordLayout);
+ db_set_b(NULL, ModuleName, "CurrentWordLayout2", moOptions.CurrentWordLayout2);
+ db_set_b(NULL, ModuleName, "CurrentWordCase", moOptions.CurrentWordCase);
+ db_set_b(NULL, ModuleName, "TwoWay", moOptions.TwoWay);
+ db_set_b(NULL, ModuleName, "ChangeSystemLayout", moOptions.ChangeSystemLayout);
+ db_set_b(NULL, ModuleName, "CopyToClipboard", moOptions.CopyToClipboard);
+ db_set_b(NULL, ModuleName, "ShowPopup", moOptions.ShowPopup);
+ db_set_b(NULL, ModuleName, "CaseOperations", moOptions.bCaseOperations);
}
void ReadPopupOptions()
{
- poOptions.bColourType = DBGetContactSettingByte(NULL, ModuleName, "ColourType", 0);
- poOptions.crBackColour = (COLORREF)DBGetContactSettingDword(NULL, ModuleName, "BackColor", 0xD2CABF);
- poOptions.crTextColour = (COLORREF)DBGetContactSettingDword(NULL, ModuleName, "TextColor", 0x000000);
- poOptions.bTimeoutType = DBGetContactSettingByte(NULL, ModuleName, "TimeoutType", 0);
- poOptions.bTimeout = DBGetContactSettingByte(NULL, ModuleName, "Timeout", 10);
- poOptions.bLeftClick = DBGetContactSettingByte(NULL, ModuleName, "LeftClick", 0);
- poOptions.bRightClick = DBGetContactSettingByte(NULL, ModuleName, "RightClick", 1);
+ poOptions.bColourType = db_get_b(NULL, ModuleName, "ColourType", 0);
+ poOptions.crBackColour = (COLORREF)db_get_dw(NULL, ModuleName, "BackColor", 0xD2CABF);
+ poOptions.crTextColour = (COLORREF)db_get_dw(NULL, ModuleName, "TextColor", 0x000000);
+ poOptions.bTimeoutType = db_get_b(NULL, ModuleName, "TimeoutType", 0);
+ poOptions.bTimeout = db_get_b(NULL, ModuleName, "Timeout", 10);
+ poOptions.bLeftClick = db_get_b(NULL, ModuleName, "LeftClick", 0);
+ poOptions.bRightClick = db_get_b(NULL, ModuleName, "RightClick", 1);
}
void WritePopupOptions()
{
- DBWriteContactSettingByte(NULL, ModuleName, "ColourType", poOptions.bColourType);
- DBWriteContactSettingDword(NULL, ModuleName, "BackColor", poOptions.crBackColour);
- DBWriteContactSettingDword(NULL, ModuleName, "TextColor", poOptions.crTextColour);
- DBWriteContactSettingByte(NULL, ModuleName, "TimeoutType", poOptions.bTimeoutType);
- DBWriteContactSettingByte(NULL, ModuleName, "Timeout", poOptions.bTimeout);
- DBWriteContactSettingByte(NULL, ModuleName, "LeftClick", poOptions.bLeftClick);
- DBWriteContactSettingByte(NULL, ModuleName, "RightClick", poOptions.bRightClick);
+ db_set_b(NULL, ModuleName, "ColourType", poOptions.bColourType);
+ db_set_dw(NULL, ModuleName, "BackColor", poOptions.crBackColour);
+ db_set_dw(NULL, ModuleName, "TextColor", poOptions.crTextColour);
+ db_set_b(NULL, ModuleName, "TimeoutType", poOptions.bTimeoutType);
+ db_set_b(NULL, ModuleName, "Timeout", poOptions.bTimeout);
+ db_set_b(NULL, ModuleName, "LeftClick", poOptions.bLeftClick);
+ db_set_b(NULL, ModuleName, "RightClick", poOptions.bRightClick);
}
void RegPopupActions()
@@ -117,7 +117,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) for (i = 0; i < bLayNum; i++) {
ptszCurrLayout = GenerateLayoutString(hklLayouts[i]);
ptszTemp = GetNameOfLayout(hklLayouts[i]);
- iRes = DBGetContactSettingTString(NULL, ModuleName, ptszTemp, &dbv);
+ iRes = db_get_ts(NULL, ModuleName, ptszTemp, &dbv);
if (iRes != 0)
ptszLayStrings[i] = ptszCurrLayout;
else
@@ -129,7 +129,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
ptszLayStrings[i] = dbv.ptszVal;
if(_tcscmp(ptszCurrLayout, ptszLayStrings[i]) == 0)
- DBDeleteContactSetting(NULL, ModuleName, ptszTemp);
+ db_unset(NULL, ModuleName, ptszTemp);
mir_free(ptszCurrLayout);
}
mir_free(ptszTemp);
@@ -161,7 +161,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) OnIconsChanged(0, 0);
RegPopupActions();
- DBWriteContactSettingDword(NULL, ModuleName, "CurrentVer", PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM));
+ db_set_dw(NULL, ModuleName, "CurrentVer", PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM));
return 0;
}
diff --git a/plugins/ChangeKeyboardLayout/src/options.cpp b/plugins/ChangeKeyboardLayout/src/options.cpp index 1136e4b15a..3eaab6917f 100644 --- a/plugins/ChangeKeyboardLayout/src/options.cpp +++ b/plugins/ChangeKeyboardLayout/src/options.cpp @@ -211,9 +211,9 @@ INT_PTR CALLBACK DlgMainProcOptions(HWND hWnd, UINT uiMessage, WPARAM wParam, LP pszNameLay = GetNameOfLayout(hklLayouts[i]);
if(_tcscmp(ptszMemLay, ptszGenLay) != 0)
- DBWriteContactSettingTString(NULL, ModuleName, pszNameLay, ptszMemLay);
+ db_set_ts(NULL, ModuleName, pszNameLay, ptszMemLay);
else
- DBDeleteContactSetting(NULL, ModuleName, pszNameLay);
+ db_unset(NULL, ModuleName, pszNameLay);
mir_free(pszNameLay);
mir_free(ptszGenLay);
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index b57836ab78..dac4399850 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -184,7 +184,7 @@ void ShowPopup(SHOWPOPUP_DATA *sd) _ASSERT(ppd.lchIcon);
if (!ppd.lchIcon || (DWORD)ppd.lchIcon == CALLSERVICE_NOTFOUND) {
// if we didn't succeed retrieving client icon, show the usual status icon instead
- ppd.lchIcon = LoadSkinnedProtoIcon(szProto, DBGetContactSettingWord(sd->hContact, szProto, "Status", ID_STATUS_OFFLINE));
+ ppd.lchIcon = LoadSkinnedProtoIcon(szProto, db_get_w(sd->hContact, szProto, "Status", ID_STATUS_OFFLINE));
pdata->hIcon = NULL;
}
_tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)sd->hContact, GCDNF_TCHAR), lengthof(ppd.lptzContactName) - 1);
@@ -216,12 +216,12 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) if (bMetaContactsExists && !strcmp(szProto, (char*)CallService(MS_MC_GETPROTOCOLNAME, 0, 0))) // workaround for metacontacts
return 0;
- sd.MirVer = DBGetContactSettingString(hContact, szProto, DB_MIRVER, _T(""));
+ sd.MirVer = db_get_s(hContact, szProto, DB_MIRVER, _T(""));
if (sd.MirVer.IsEmpty())
return 0;
}
- sd.OldMirVer = DBGetContactSettingString(hContact, MOD_NAME, DB_OLDMIRVER, _T(""));
- DBWriteContactSettingTString(hContact, MOD_NAME, DB_OLDMIRVER, sd.MirVer); // we have to write it here, because we modify sd.OldMirVer and sd.MirVer to conform our settings later
+ sd.OldMirVer = db_get_s(hContact, MOD_NAME, DB_OLDMIRVER, _T(""));
+ db_set_ts(hContact, MOD_NAME, DB_OLDMIRVER, sd.MirVer); // we have to write it here, because we modify sd.OldMirVer and sd.MirVer to conform our settings later
if (sd.OldMirVer.IsEmpty()) // looks like it's the right way to do
return 0;
@@ -237,14 +237,14 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) if (!hContactOrMeta)
hContactOrMeta = hContact;
- if (hContact && DBGetContactSettingByte(hContactOrMeta, "CList", "Hidden", 0))
+ if (hContact && db_get_b(hContactOrMeta, "CList", "Hidden", 0))
return 0;
- int PerContactSetting = hContact ? DBGetContactSettingByte(hContact, MOD_NAME, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL) : NOTIFY_ALWAYS; // NOTIFY_ALWAYS for preview
+ int PerContactSetting = hContact ? db_get_b(hContact, MOD_NAME, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL) : NOTIFY_ALWAYS; // NOTIFY_ALWAYS for preview
if (PerContactSetting == NOTIFY_USEGLOBAL && hContactOrMeta != hContact) // subcontact setting has a priority over a metacontact setting
- PerContactSetting = DBGetContactSettingByte(hContactOrMeta, MOD_NAME, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL);
+ PerContactSetting = db_get_b(hContactOrMeta, MOD_NAME, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL);
- if (PerContactSetting && (PerContactSetting == NOTIFY_ALMOST_ALWAYS || PerContactSetting == NOTIFY_ALWAYS || !PopupOptPage.GetValue(IDC_POPUPOPTDLG_USESTATUSNOTIFYFLAG) || !(DBGetContactSettingDword(hContactOrMeta, "Ignore", "Mask1", 0) & 0x8))) { // check if we need to notify at all
+ if (PerContactSetting && (PerContactSetting == NOTIFY_ALMOST_ALWAYS || PerContactSetting == NOTIFY_ALWAYS || !PopupOptPage.GetValue(IDC_POPUPOPTDLG_USESTATUSNOTIFYFLAG) || !(db_get_dw(hContactOrMeta, "Ignore", "Mask1", 0) & 0x8))) { // check if we need to notify at all
sd.hContact = hContact;
sd.PopupOptPage = &PopupOptPage;
if (!PopupOptPage.GetValue(IDC_POPUPOPTDLG_VERCHGNOTIFY) || !PopupOptPage.GetValue(IDC_POPUPOPTDLG_SHOWVER)) {
@@ -365,7 +365,7 @@ INT_PTR CALLBACK CCNErrorDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM case WM_DESTROY:
if (IsDlgButtonChecked(hwndDlg, IDC_DONTREMIND))
- DBWriteContactSettingByte(NULL, MOD_NAME, DB_NO_FINGERPRINT_ERROR, 1);
+ db_set_b(NULL, MOD_NAME, DB_NO_FINGERPRINT_ERROR, 1);
break;
}
return 0;
@@ -411,7 +411,7 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam) }
// seems that Fingerprint is not installed
- if (!bFingerprintExists && !DBGetContactSettingByte(NULL, MOD_NAME, DB_NO_FINGERPRINT_ERROR, 0))
+ if (!bFingerprintExists && !db_get_b(NULL, MOD_NAME, DB_NO_FINGERPRINT_ERROR, 0))
CreateDialog(g_hInstance, MAKEINTRESOURCE(IDD_CCN_ERROR), NULL, CCNErrorDlgProc);
logservice_register(LOG_ID, LPGENT("ClientChangeNotify"), _T("ClientChangeNotify?puts(p,?dbsetting(%subject%,Protocol,p))?if2(_?dbsetting(,?get(p),?pinfo(?get(p),uidsetting)),).log"), TranslateT("`[`!cdate()-!ctime()`]` ?cinfo(%subject%,display) (?cinfo(%subject%,id)) changed client to %extratext%"));
@@ -425,16 +425,16 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded);
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &g_hMainThread, THREAD_SET_CONTEXT, false, 0);
InitOptions();
- if (DBGetContactSettingString(NULL, "KnownModules", MOD_NAME, (char*)NULL) == NULL)
- DBWriteContactSettingString(NULL, "KnownModules", MOD_NAME, MOD_NAME);
+ if (db_get_s(NULL, "KnownModules", MOD_NAME, (char*)NULL) == NULL)
+ db_set_s(NULL, "KnownModules", MOD_NAME, MOD_NAME);
- if (DBGetContactSettingByte(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 1) {
+ if (db_get_b(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 1) {
TCString Str;
- Str = DBGetContactSettingString(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, _T(""));
+ Str = db_get_s(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, _T(""));
if (Str.GetLen()) // fix incorrect regexp from v0.1.1.0
- DBWriteContactSettingTString(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, Str.Replace(_T("/Miranda[0-9A-F]{8}/"), _T("/[0-9A-F]{8}(\\W|$)/")));
+ db_set_ts(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, Str.Replace(_T("/Miranda[0-9A-F]{8}/"), _T("/[0-9A-F]{8}(\\W|$)/")));
- DBWriteContactSettingByte(NULL, MOD_NAME, DB_SETTINGSVER, 1);
+ db_set_b(NULL, MOD_NAME, DB_SETTINGSVER, 1);
}
return 0;
}
diff --git a/plugins/ClientChangeNotify/src/OptDlg.cpp b/plugins/ClientChangeNotify/src/OptDlg.cpp index d86c6a473e..7edc46a53c 100644 --- a/plugins/ClientChangeNotify/src/OptDlg.cpp +++ b/plugins/ClientChangeNotify/src/OptDlg.cpp @@ -140,7 +140,7 @@ INT_PTR CALLBACK PopupOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara DBCONTACTWRITESETTING cws = {0};
cws.szModule = "ICQ";
cws.szSetting = DB_MIRVER;
- DBWriteContactSettingString(NULL, MOD_NAME, DB_OLDMIRVER, "ICQ Lite v5");
+ db_set_s(NULL, MOD_NAME, DB_OLDMIRVER, "ICQ Lite v5");
ContactSettingChanged(NULL, (LPARAM)&cws); // simulate a version change
delete g_PreviewOptPage;
g_PreviewOptPage = NULL;
diff --git a/plugins/Clist_blind/src/clcopts.cpp b/plugins/Clist_blind/src/clcopts.cpp index 462fc9d5e7..f81e31abe0 100644 --- a/plugins/Clist_blind/src/clcopts.cpp +++ b/plugins/Clist_blind/src/clcopts.cpp @@ -131,7 +131,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam GetWindowLong(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
{
int i;
- DWORD exStyle = DBGetContactSettingDword(NULL, "CLC", "ExStyle", pcli->pfnGetDefaultExStyle());
+ DWORD exStyle = db_get_dw(NULL, "CLC", "ExStyle", pcli->pfnGetDefaultExStyle());
for (i = 0; i < SIZEOF(checkBoxToStyleEx); i++)
CheckDlgButton(hwndDlg, checkBoxToStyleEx[i].id,
(exStyle & checkBoxToStyleEx[i].flag) ^ (checkBoxToStyleEx[i].flag *
@@ -142,24 +142,24 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam 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));
+ MAKELONG(db_get_w(NULL, "CLC", "ScrollTime", CLCDEFAULT_SCROLLTIME), 0));
}
- CheckDlgButton(hwndDlg, IDC_IDLE, DBGetContactSettingByte(NULL, "CLC", "ShowIdle", CLCDEFAULT_SHOWIDLE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_IDLE, db_get_b(NULL, "CLC", "ShowIdle", CLCDEFAULT_SHOWIDLE) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_SETRANGE, 0, MAKELONG(64, 0));
SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_SETPOS, 0,
- MAKELONG(DBGetContactSettingByte(NULL, "CLC", "LeftMargin", CLCDEFAULT_LEFTMARGIN), 0));
+ MAKELONG(db_get_b(NULL, "CLC", "LeftMargin", CLCDEFAULT_LEFTMARGIN), 0));
SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_SETRANGE, 0, MAKELONG(50, 0));
SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_SETPOS, 0,
- MAKELONG(DBGetContactSettingByte(NULL, "CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT), 0));
+ MAKELONG(db_get_b(NULL, "CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT), 0));
CheckDlgButton(hwndDlg, IDC_GREYOUT,
- DBGetContactSettingDword(NULL, "CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_dw(NULL, "CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS) ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_SMOOTHTIME), IsDlgButtonChecked(hwndDlg, IDC_NOTNOSMOOTHSCROLLING));
EnableWindow(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), IsDlgButtonChecked(hwndDlg, IDC_GREYOUT));
FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), greyoutValues, SIZEOF(greyoutValues),
- DBGetContactSettingDword(NULL, "CLC", "FullGreyoutFlags", CLCDEFAULT_FULLGREYOUTFLAGS));
+ db_get_dw(NULL, "CLC", "FullGreyoutFlags", CLCDEFAULT_FULLGREYOUTFLAGS));
FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), offlineValues, SIZEOF(offlineValues),
- DBGetContactSettingDword(NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES));
- CheckDlgButton(hwndDlg, IDC_NOSCROLLBAR, DBGetContactSettingByte(NULL, "CLC", "NoVScrollBar", 0) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_dw(NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES));
+ CheckDlgButton(hwndDlg, IDC_NOSCROLLBAR, db_get_b(NULL, "CLC", "NoVScrollBar", 0) ? BST_CHECKED : BST_UNCHECKED);
SetDlgItemText(hwndDlg, IDC_T_CONTACT, MyDBGetContactSettingTString(NULL, "CLC", "TemplateContact", tmp, 1024, TranslateT("%name% [%status% %protocol%] %status_message%")));
SendDlgItemMessage(hwndDlg, IDC_T_CONTACT, EM_LIMITTEXT, 256, 0);
@@ -212,33 +212,33 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam if ((IsDlgButtonChecked(hwndDlg, checkBoxToStyleEx[i].id) == 0) == checkBoxToStyleEx[i].not)
exStyle |= checkBoxToStyleEx[i].flag;
- DBWriteContactSettingDword(NULL, "CLC", "ExStyle", exStyle);
+ db_set_dw(NULL, "CLC", "ExStyle", exStyle);
{
DWORD fullGreyoutFlags = MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS));
- DBWriteContactSettingDword(NULL, "CLC", "FullGreyoutFlags", fullGreyoutFlags);
+ db_set_dw(NULL, "CLC", "FullGreyoutFlags", fullGreyoutFlags);
if (IsDlgButtonChecked(hwndDlg, IDC_GREYOUT))
- DBWriteContactSettingDword(NULL, "CLC", "GreyoutFlags", fullGreyoutFlags);
+ db_set_dw(NULL, "CLC", "GreyoutFlags", fullGreyoutFlags);
else
- DBWriteContactSettingDword(NULL, "CLC", "GreyoutFlags", 0);
+ db_set_dw(NULL, "CLC", "GreyoutFlags", 0);
}
- DBWriteContactSettingByte(NULL, "CLC", "ShowIdle", (BYTE) (IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0));
- DBWriteContactSettingDword(NULL, "CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS)));
- DBWriteContactSettingByte(NULL, "CLC", "LeftMargin",
+ db_set_b(NULL, "CLC", "ShowIdle", (BYTE) (IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0));
+ db_set_dw(NULL, "CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS)));
+ db_set_b(NULL, "CLC", "LeftMargin",
(BYTE) SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
- DBWriteContactSettingWord(NULL, "CLC", "ScrollTime",
+ db_set_w(NULL, "CLC", "ScrollTime",
(WORD) SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0));
- DBWriteContactSettingByte(NULL, "CLC", "GroupIndent",
+ db_set_b(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", "NoVScrollBar", (BYTE) (IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0));
GetDlgItemText(hwndDlg, IDC_T_CONTACT, tmp, 1024);
- DBWriteContactSettingTString(NULL, "CLC", "TemplateContact", tmp);
+ db_set_ts(NULL, "CLC", "TemplateContact", tmp);
GetDlgItemText(hwndDlg, IDC_T_GROUP, tmp, 1024);
- DBWriteContactSettingTString(NULL, "CLC", "TemplateGroup", tmp);
+ db_set_ts(NULL, "CLC", "TemplateGroup", tmp);
GetDlgItemText(hwndDlg, IDC_T_DIVIDER, tmp, 1024);
- DBWriteContactSettingTString(NULL, "CLC", "TemplateDivider", tmp);
+ db_set_ts(NULL, "CLC", "TemplateDivider", tmp);
GetDlgItemText(hwndDlg, IDC_T_INFO, tmp, 1024);
- DBWriteContactSettingTString(NULL, "CLC", "TemplateInfo", tmp);
+ db_set_ts(NULL, "CLC", "TemplateInfo", tmp);
pcli->pfnClcOptionsChanged();
return TRUE;
diff --git a/plugins/Clist_blind/src/clistopts.cpp b/plugins/Clist_blind/src/clistopts.cpp index e5ad505615..d7811cb19b 100644 --- a/plugins/Clist_blind/src/clistopts.cpp +++ b/plugins/Clist_blind/src/clistopts.cpp @@ -43,23 +43,23 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) HookEventMessage(ME_DB_CONTACT_SETTINGCHANGED, hwndDlg, WM_USER + 1));
- CheckDlgButton(hwndDlg, IDC_ONTOP, DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONTOP, db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE,
- DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS,
- DBGetContactSettingByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS,
- DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_SORTBYNAME, !DBGetContactSettingByte(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT)
- && !DBGetContactSettingByte(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_SORTBYNAME, !db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT)
+ && !db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SORTBYSTATUS,
- DBGetContactSettingByte(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SORTBYPROTO,
- DBGetContactSettingByte(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE,
- DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_AUTOHIDE,
- DBGetContactSettingByte(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
{
@@ -79,24 +79,24 @@ 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));
+ MAKELONG(db_get_w(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), 0));
CheckDlgButton(hwndDlg, IDC_ONECLK,
- DBGetContactSettingByte(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS,
- DBGetContactSettingByte(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_ALWAYSMULTI,
- !DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ !db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DONTCYCLE,
- DBGetContactSettingByte(NULL, "CList", "TrayIcon",
+ db_get_b(NULL, "CList", "TrayIcon",
SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CYCLE,
- DBGetContactSettingByte(NULL, "CList", "TrayIcon",
+ db_get_b(NULL, "CList", "TrayIcon",
SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_CYCLE ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_MULTITRAY,
- DBGetContactSettingByte(NULL, "CList", "TrayIcon",
+ db_get_b(NULL, "CList", "TrayIcon",
SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DISABLEBLINK,
- DBGetContactSettingByte(NULL, "CList", "DisableTrayFlash", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CList", "DisableTrayFlash", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKTIME), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKSPIN), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
EnableWindow(GetDlgItem(hwndDlg, IDC_STMSDELAY), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
@@ -116,13 +116,13 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
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));
+ MAKELONG(db_get_w(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT), 0));
{
int i, count, item;
PROTOACCOUNT **accs;
char szName[64];
DBVARIANT dbv = { DBVT_DELETED };
- DBGetContactSetting(NULL, "CList", "PrimaryStatus", &dbv);
+ db_get(NULL, "CList", "PrimaryStatus", &dbv);
CallService( MS_PROTO_ENUMACCOUNTS, (WPARAM)&count, (LPARAM)&accs);
item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM) TranslateT("Global"));
SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETITEMDATA, item, (LPARAM) 0);
@@ -135,13 +135,13 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (dbv.type == DBVT_ASCIIZ && !lstrcmpA(dbv.pszVal, accs[i]->szModuleName))
SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETCURSEL, item, 0);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (-1 == (int) SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0))
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_COMMAND:
if (LOWORD(wParam) == IDC_AUTOHIDE) {
@@ -174,48 +174,48 @@ 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",
+ db_set_b(NULL, "CList", "HideEmptyGroups",
(BYTE) IsDlgButtonChecked(hwndDlg, IDC_HIDEEMPTYGROUPS));
if (caps & CLUIF_DISABLEGROUPS)
- DBWriteContactSettingByte(NULL, "CList", "UseGroups", (BYTE) ! IsDlgButtonChecked(hwndDlg, IDC_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));
- DBWriteContactSettingWord(NULL, "CList", "HideTime",
+ db_set_b(NULL, "CList", "AutoHide", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ db_set_w(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", "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",
+ 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", "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",
+ db_set_w(NULL, "CList", "CycleTime",
(WORD) SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_GETPOS, 0, 0));
- DBWriteContactSettingWord(NULL, "CList", "IconFlashTime",
+ db_set_w(NULL, "CList", "IconFlashTime",
(WORD) SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
- DBWriteContactSettingByte(NULL, "CList", "DisableTrayFlash", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
+ db_set_b(NULL, "CList", "DisableTrayFlash", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
{
int cur = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0);
PROTOACCOUNT* pa = ( PROTOACCOUNT* )SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETITEMDATA, cur, 0 );
if ( pa == NULL )
- DBDeleteContactSetting(NULL, "CList", "PrimaryStatus");
+ db_unset(NULL, "CList", "PrimaryStatus");
else
- DBWriteContactSettingString(NULL, "CList", "PrimaryStatus", pa->szModuleName );
+ db_set_s(NULL, "CList", "PrimaryStatus", pa->szModuleName );
}
pcli->pfnTrayIconIconsChanged();
diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp index 937645a848..4c71790871 100644 --- a/plugins/Clist_blind/src/cluiopts.cpp +++ b/plugins/Clist_blind/src/cluiopts.cpp @@ -30,37 +30,37 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT,
- DBGetContactSettingByte(NULL, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONTOP, DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONTOP, db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_TOOLWND,
- DBGetContactSettingByte(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_MIN2TRAY,
- DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
if (IsDlgButtonChecked(hwndDlg, IDC_TOOLWND))
EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), FALSE);
CheckDlgButton(hwndDlg, IDC_SHOWCAPTION,
- DBGetContactSettingByte(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU,
- DBGetContactSettingByte(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CLIENTDRAG,
- DBGetContactSettingByte(NULL, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
if (!IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_TOOLWND), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_TITLETEXT), FALSE);
}
- CheckDlgButton(hwndDlg, IDC_FADEINOUT, DBGetContactSettingByte(NULL, "CLUI", "FadeInOut", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOSIZE, DBGetContactSettingByte(NULL, "CLUI", "AutoSize", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DROPSHADOW, DBGetContactSettingByte(NULL, "CList", "WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONDESKTOP, DBGetContactSettingByte(NULL, "CList", "OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_FADEINOUT, db_get_b(NULL, "CLUI", "FadeInOut", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOSIZE, db_get_b(NULL, "CLUI", "AutoSize", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DROPSHADOW, db_get_b(NULL, "CList", "WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONDESKTOP, db_get_b(NULL, "CList", "OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETRANGE, 0, MAKELONG(100, 0));
- SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETPOS, 0, DBGetContactSettingByte(NULL, "CLUI", "MaxSizeHeight", 75));
- CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, DBGetContactSettingByte(NULL, "CLUI", "AutoSizeUpward", 0) ? BST_CHECKED : BST_UNCHECKED);
+ SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLUI", "MaxSizeHeight", 75));
+ CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, db_get_b(NULL, "CLUI", "AutoSizeUpward", 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_AUTOHIDE,
- DBGetContactSettingByte(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ 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));
+ 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));
@@ -73,9 +73,9 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L }
{ DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, "CList", "TitleText", &dbv)) {
+ if ( !db_get_ts(NULL, "CList", "TitleText", &dbv)) {
SetDlgItemText(hwndDlg, IDC_TITLETEXT, dbv.ptszVal);
- DBFreeVariant( &dbv );
+ db_free( &dbv );
}
else SetDlgItemTextA(hwndDlg, IDC_TITLETEXT, MIRANDANAME);
}
@@ -86,7 +86,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L }
else
CheckDlgButton(hwndDlg, IDC_TRANSPARENT,
- DBGetContactSettingByte(NULL, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ db_get_b(NULL, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
if (!IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC11), FALSE);
@@ -98,9 +98,9 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L }
SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
- SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETPOS, TRUE, DBGetContactSettingByte(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT));
+ SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETPOS, TRUE, db_get_b(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT));
SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETPOS, TRUE,
- DBGetContactSettingByte(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT));
+ db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT));
SendMessage(hwndDlg, WM_HSCROLL, 0x12345678, 0);
return TRUE;
@@ -156,28 +156,28 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
case WM_NOTIFY:
if (((LPNMHDR) lParam)->code == PSN_APPLY) {
- DBWriteContactSettingByte(NULL, "CList", "OnTop", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
- DBWriteContactSettingByte(NULL, "CList", "ToolWindow", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
- DBWriteContactSettingByte(NULL, "CList", "BringToFront", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
- 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));
- 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));
- 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));
- DBWriteContactSettingByte(NULL, "CList", "Min2Tray", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
+ db_set_b(NULL, "CList", "OnTop", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
+ db_set_b(NULL, "CList", "ToolWindow", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
+ db_set_b(NULL, "CList", "BringToFront", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
+ 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));
+ db_set_w(NULL, "CList", "HideTime", (WORD) SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
+ 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));
+ 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));
+ db_set_b(NULL, "CList", "Min2Tray", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
{
TCHAR title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, SIZEOF(title));
- DBWriteContactSettingTString(NULL, "CList", "TitleText", title);
+ db_set_ts(NULL, "CList", "TitleText", title);
SetWindowText(pcli->hwndContactList, title);
}
pcli->pfnLoadCluiGlobalOpts();
@@ -221,7 +221,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L SetWindowLong(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLong(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
if (MySetLayeredWindowAttributes)
MySetLayeredWindowAttributes(pcli->hwndContactList, RGB(0, 0, 0),
- (BYTE) DBGetContactSettingByte(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT),
+ (BYTE) db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT),
LWA_ALPHA);
}
else SetWindowLong(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLong(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
@@ -239,18 +239,18 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_SHOWSBAR, DBGetContactSettingByte(NULL, "CLUI", "ShowSBar", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWSBAR, db_get_b(NULL, "CLUI", "ShowSBar", 1) ? BST_CHECKED : BST_UNCHECKED);
{
- BYTE showOpts = DBGetContactSettingByte(NULL, "CLUI", "SBarShow", 1);
+ BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1);
CheckDlgButton(hwndDlg, IDC_SHOWICON, showOpts & 1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWPROTO, showOpts & 2 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWSTATUS, showOpts & 4 ? BST_CHECKED : BST_UNCHECKED);
}
- CheckDlgButton(hwndDlg, IDC_RIGHTSTATUS, DBGetContactSettingByte(NULL, "CLUI", "SBarRightClk", 0) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_RIGHTSTATUS, db_get_b(NULL, "CLUI", "SBarRightClk", 0) ? BST_UNCHECKED : BST_CHECKED);
CheckDlgButton(hwndDlg, IDC_RIGHTMIRANDA, !IsDlgButtonChecked(hwndDlg, IDC_RIGHTSTATUS) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EQUALSECTIONS, DBGetContactSettingByte(NULL, "CLUI", "EqualSections", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SBPANELBEVEL, DBGetContactSettingByte(NULL, "CLUI", "SBarBevel", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWGRIP, DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_EQUALSECTIONS, db_get_b(NULL, "CLUI", "EqualSections", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SBPANELBEVEL, db_get_b(NULL, "CLUI", "SBarBevel", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWGRIP, db_get_b(NULL, "CLUI", "ShowGrip", 1) ? BST_CHECKED : BST_UNCHECKED);
if (!IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWICON), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWPROTO), FALSE);
@@ -277,23 +277,23 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L break;
case WM_NOTIFY:
if (((LPNMHDR) lParam)->code == PSN_APPLY ) {
- DBWriteContactSettingByte(NULL, "CLUI", "ShowSBar", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
- DBWriteContactSettingByte(NULL, "CLUI", "SBarShow",
+ 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)));
- 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));
+ 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));
pcli->pfnLoadCluiGlobalOpts();
- if (DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) != (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) {
+ if (db_get_b(NULL, "CLUI", "ShowGrip", 1) != (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) {
HWND parent = GetParent(pcli->hwndStatus);
int flags = WS_CHILD | CCS_BOTTOM;
- DBWriteContactSettingByte(NULL, "CLUI", "ShowGrip", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
+ db_set_b(NULL, "CLUI", "ShowGrip", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
ShowWindow(pcli->hwndStatus, SW_HIDE);
DestroyWindow(pcli->hwndStatus);
- flags |= DBGetContactSettingByte(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
- flags |= DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
+ flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
+ flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, NULL, flags, 0, 0, 0, 0, parent, NULL, g_hInst, NULL);
}
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR))
diff --git a/plugins/Clist_blind/src/commonheaders.h b/plugins/Clist_blind/src/commonheaders.h index 7fe4329c30..0dbece6987 100644 --- a/plugins/Clist_blind/src/commonheaders.h +++ b/plugins/Clist_blind/src/commonheaders.h @@ -54,7 +54,7 @@ extern HINSTANCE g_hInst; all the bad free()'s to good ones, however it's still incorrect code. The reasons for not
changing them include:
- * DBFreeVariant has a CallService() lookup
+ * db_free has a CallService() lookup
* free() is executed in some large loops to do with clist creation of group data
* easy search and replace
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index 70fb9e2865..445591c950 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -194,7 +194,7 @@ TCHAR* MyDBGetContactSettingTString(HANDLE hContact, char* module, char* setting out[0] = _T('\0');
- if (!DBGetContactSettingTString(hContact, module, setting, &dbv)) {
+ if (!db_get_ts(hContact, module, setting, &dbv)) {
if (dbv.type == DBVT_ASCIIZ)
MultiByteToWideChar(CP_ACP, 0, dbv.pszVal, -1, out, (int)len);
else if (dbv.type == DBVT_UTF8)
@@ -204,7 +204,7 @@ TCHAR* MyDBGetContactSettingTString(HANDLE hContact, char* module, char* setting else if (def != NULL)
lstrcpyn(out, def, (int)len);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else {
if (def != NULL)
@@ -462,7 +462,7 @@ TCHAR *GetStatusName(struct ClcContact *item) return status_name;
// Get status name
- status = DBGetContactSettingWord(item->hContact, item->proto, "Status", ID_STATUS_OFFLINE);
+ status = db_get_w(item->hContact, item->proto, "Status", ID_STATUS_OFFLINE);
lstrcpyn(status_name, pcli->pfnGetStatusModeDescription(status, GSMDF_TCHAR), MAX_REGS(status_name));
return status_name;
diff --git a/plugins/Clist_modern/src/hdr/modern_static_clui.h b/plugins/Clist_modern/src/hdr/modern_static_clui.h index fb15b1e25a..ec4e3acc01 100644 --- a/plugins/Clist_modern/src/hdr/modern_static_clui.h +++ b/plugins/Clist_modern/src/hdr/modern_static_clui.h @@ -165,9 +165,7 @@ static BOOL bTransparentFocus=TRUE, bNeedFixSizingRect=FALSE, bShowEventStarted=FALSE; -static HANDLE hRenameMenuItem, - hShowAvatarMenuItem, - hHideAvatarMenuItem; +static HGENMENU hRenameMenuItem, hShowAvatarMenuItem, hHideAvatarMenuItem; static UINT uMsgGetProfile=0; diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 0c4e280d8d..14c460ed7a 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -299,7 +299,7 @@ int GetStatusName(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus // Get XStatusName
if ( !noAwayMsg && !noXstatus && xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -321,7 +321,7 @@ int GetStatusName(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xstatus // Get XStatusName
if ( !noAwayMsg && !noXstatus && !xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -347,7 +347,7 @@ void GetListeningTo(TCHAR *text, int text_size, ClcCacheEntry *pdnce) if (wStatus == ID_STATUS_OFFLINE || wStatus == 0)
return;
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "ListeningTo", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "ListeningTo", &dbv)) {
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
}
@@ -370,7 +370,7 @@ int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xst // Get XStatusMsg
if ( !noAwayMsg && xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto) {
// Try to get XStatusMsg
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -382,7 +382,7 @@ int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xst // Get StatusMsg
if (pdnce->hContact && text[0] == '\0') {
- if ( !DBGetContactSettingTString(pdnce->hContact, "CList", "StatusMsg", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, "CList", "StatusMsg", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -395,7 +395,7 @@ int GetStatusMessage(TCHAR *text, int text_size, ClcCacheEntry *pdnce, BOOL xst // Get XStatusMsg
if ( !noAwayMsg && !xstatus_has_priority && pdnce->hContact && pdnce->m_cache_cszProto && text[0] == '\0') {
// Try to get XStatusMsg
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -424,7 +424,7 @@ int Cache_GetLineText( DBVARIANT dbv = {0};
// Try to get XStatusMsg
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
if (dbv.ptszVal != NULL && dbv.ptszVal[0] != 0) {
TCHAR *tmp = NEWTSTR_ALLOCA(text);
mir_sntprintf(text, text_size, _T("%s: %s"), tmp, dbv.ptszVal);
@@ -439,7 +439,7 @@ int Cache_GetLineText( case TEXT_NICKNAME:
if (pdnce->hContact && pdnce->m_cache_cszProto) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
lstrcpyn(text, dbv.ptszVal, text_size);
db_free(&dbv);
CopySkipUnprintableChars(text, text, text_size-1);
@@ -453,7 +453,7 @@ int Cache_GetLineText( DBVARIANT dbv = {0};
// Try to get XStatusName
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
if (dbv.pszVal != NULL && dbv.pszVal[0] != 0) {
TCHAR *tmp = NEWTSTR_ALLOCA(text);
mir_sntprintf(text, text_size, _T("%s: %s"), dbv.pszVal, tmp);
@@ -465,7 +465,7 @@ int Cache_GetLineText( else if (use_name_and_message_for_xstatus && xstatus_has_priority) {
DBVARIANT dbv = {0};
// Try to get XStatusName
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
if (dbv.pszVal != NULL && dbv.pszVal[0] != 0)
mir_sntprintf(text, text_size, _T("%s"), dbv.pszVal);
CopySkipUnprintableChars(text, text, text_size-1);
@@ -525,7 +525,7 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact) TCHAR *name = pcli->pfnGetContactDisplayName(contact->hContact,0);
if (dat->first_line_append_nick && (!dat->force_in_dialog)) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
+ if ( !db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
TCHAR nick[SIZEOF(contact->szText)];
lstrcpyn(nick, dbv.ptszVal, SIZEOF(contact->szText));
db_free(&dbv);
@@ -856,7 +856,7 @@ void Cache_GetAvatar(ClcData *dat, ClcContact *contact) contact->avatar_pos = AVATAR_POS_DONT_HAVE;
if (dat->avatars_show && !db_get_b(contact->hContact, "CList", "HideContactAvatar", 0)) {
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(contact->hContact, "ContactPhoto", "File", &dbv)) {
+ if ( !db_get_ts(contact->hContact, "ContactPhoto", "File", &dbv)) {
HBITMAP hBmp = (HBITMAP) CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)dbv.ptszVal);
if (hBmp != NULL) {
// Make bounds
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index fc2edc9c7a..e01d9be1bc 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1842,7 +1842,7 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack) }
else
{
- //DBDeleteContactSetting(ack->hContact,"CList","StatusMsg");
+ //db_unset(ack->hContact,"CList","StatusMsg");
//char a = '\0';
{//Do not change DB if it is IRC protocol
if (ack->szModule != NULL)
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp index 08ced8922c..753a8f0682 100644 --- a/plugins/Clist_modern/src/modern_clcitems.cpp +++ b/plugins/Clist_modern/src/modern_clcitems.cpp @@ -735,7 +735,7 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, ClcDa filterResult = strstr(g_CluiData.protoFilter, szTemp) ? 1 : 0;
}
if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) {
- if ( !DBGetContactSettingTString(hContact, "CList", "Group", &dbv)) {
+ if ( !db_get_ts(hContact, "CList", "Group", &dbv)) {
mir_sntprintf(szGroupMask, SIZEOF(szGroupMask), _T("%s|"), &dbv.ptszVal[0]);
filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0));
mir_free(dbv.ptszVal);
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 4dd2d44ec8..7cf0c32840 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -583,12 +583,12 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w CheckDlgButton(hwndDlg,IDC_BITMAP,db_get_b(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)?BST_CHECKED:BST_UNCHECKED);
SendMessage(hwndDlg,WM_USER+10, 0, 0);
SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_BKCOLOUR);
- // SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL,"StatusBar","BkColour",CLCDEFAULT_BKCOLOUR));
+ // SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR, 0, db_get_dw(NULL,"StatusBar","BkColour",CLCDEFAULT_BKCOLOUR));
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_SELBKCOLOUR);
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR, 0, db_get_dw(NULL,"StatusBar","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
{
DBVARIANT dbv;
- if ( !DBGetContactSettingString(NULL, "StatusBar", "BkBitmap", &dbv)) {
+ if ( !db_get_s(NULL, "StatusBar", "BkBitmap", &dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
char szPath[MAX_PATH];
@@ -1211,7 +1211,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP {
DBVARIANT dbv = {0};
TCHAR *s;
- if ( !DBGetContactSettingTString(NULL,"CList","TitleText",&dbv))
+ if ( !db_get_ts(NULL,"CList","TitleText",&dbv))
s = dbv.ptszVal;
else
s = _T(MIRANDANAME);
@@ -1224,17 +1224,17 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP sprintf(szUin,"%u",db_get_dw(NULL,"ICQ","UIN",0));
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING, 0, (LPARAM)szUin);
- if ( !DBGetContactSettingString(NULL,"ICQ","Nick",&dbv)) {
+ if ( !db_get_s(NULL,"ICQ","Nick",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
dbv.pszVal = NULL;
}
- if ( !DBGetContactSettingString(NULL,"ICQ","FirstName",&dbv)) {
+ if ( !db_get_s(NULL,"ICQ","FirstName",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
dbv.pszVal = NULL;
}
- if ( !DBGetContactSettingString(NULL,"ICQ","e-mail",&dbv)) {
+ if ( !db_get_s(NULL,"ICQ","e-mail",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
dbv.pszVal = NULL;
@@ -1494,7 +1494,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, dat->item[indx].useWinColours = db_get_b(NULL,module, "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
{
DBVARIANT dbv;
- if ( !DBGetContactSettingString(NULL,module,"BkBitmap",&dbv))
+ if ( !db_get_s(NULL,module,"BkBitmap",&dbv))
{
int retval = PathToAbsolute(dbv.pszVal, dat->item[indx].filename);
if ( !retval || retval == CALLSERVICE_NOTFOUND)
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp index 63a30b58de..037143b7d6 100644 --- a/plugins/Clist_modern/src/modern_clcutils.cpp +++ b/plugins/Clist_modern/src/modern_clcutils.cpp @@ -629,7 +629,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat ) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(NULL, "CList","SecondLineText", &dbv))
+ if ( !db_get_ts(NULL, "CList","SecondLineText", &dbv))
{
lstrcpyn(dat->second_line_text, dbv.ptszVal, SIZEOF(dat->second_line_text)-1);
dat->second_line_text[SIZEOF(dat->second_line_text)-1] = _T('\0');
@@ -667,7 +667,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat ) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(NULL, "CList","ThirdLineText", &dbv))
+ if ( !db_get_ts(NULL, "CList","ThirdLineText", &dbv))
{
lstrcpyn(dat->third_line_text, dbv.ptszVal, SIZEOF(dat->third_line_text)-1);
dat->third_line_text[SIZEOF(dat->third_line_text)-1] = _T('\0');
@@ -721,7 +721,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat ) {
if ( db_get_b(NULL,"CLC","UseBitmap",CLCDEFAULT_USEBITMAP))
{
- if ( !DBGetContactSettingString(NULL,"CLC","BkBitmap",&dbv))
+ if ( !db_get_s(NULL,"CLC","BkBitmap",&dbv))
{
dat->hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
@@ -737,7 +737,7 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat ) dat->MenuTextHiColor = sttGetColor("Menu","SelTextColour",CLCDEFAULT_MODERN_SELTEXTCOLOUR);
if ( db_get_b(NULL,"Menu","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if ( !DBGetContactSettingString(NULL,"Menu","BkBitmap",&dbv)) {
+ if ( !db_get_s(NULL,"Menu","BkBitmap",&dbv)) {
dat->hMenuBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
}
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index c335c32bbc..7778b24724 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -278,7 +278,7 @@ static int ehhEventAreaBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
event_area.bkColour = sttGetColor("EventArea","BkColour",CLCDEFAULT_BKCOLOUR);
if ( db_get_b(NULL,"EventArea","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if ( !DBGetContactSettingString(NULL,"EventArea","BkBitmap",&dbv)) {
+ if ( !db_get_s(NULL,"EventArea","BkBitmap",&dbv)) {
event_area.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
}
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index 7d18bd4c34..ec7a3bdb85 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -529,7 +529,7 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg, IDC_RTL, db_get_b(NULL,"CList","TextRTL",SETTING_TEXT_RTL_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
- //TODO: init IDC_ALIGNGROUPCOMBO from DBGetContactSettingByte(NULL,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
+ //TODO: init IDC_ALIGNGROUPCOMBO from db_get_b(NULL,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
{
int item;
TCHAR *align[] = {LPGENT("Left align group names"), LPGENT("Center group names"), LPGENT("Right align group names")};
@@ -575,7 +575,7 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
db_set_b(NULL,"CList","TextRTL", (BYTE)IsDlgButtonChecked(hwndDlg,IDC_RTL));
- //TODO: Store IDC_ALIGNGROUPCOMBO at DBGetContactSettingByte(NULL,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
+ //TODO: Store IDC_ALIGNGROUPCOMBO at db_get_b(NULL,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
db_set_b(NULL,"CList","AlignGroupCaptions",(BYTE)SendDlgItemMessage(hwndDlg,IDC_ALIGNGROUPCOMBO,CB_GETCURSEL, 0, 0));
db_set_b(NULL,"CList","TextAlignToRight", (BYTE)IsDlgButtonChecked(hwndDlg,IDC_ALIGN_RIGHT));
db_set_b(NULL,"CList","TextReplaceSmileys", (BYTE)IsDlgButtonChecked(hwndDlg,IDC_REPLACE_SMILEYS));
@@ -610,7 +610,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, db_get_b(NULL,"CList","SecondLineDrawSmileys",SETTING_SECONDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
{
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, "CList","SecondLineText", &dbv)) {
+ if ( !db_get_ts(NULL, "CList","SecondLineText", &dbv)) {
SetWindowText(GetDlgItem(hwndDlg,IDC_VARIABLE_TEXT), dbv.ptszVal);
db_free(&dbv);
}
@@ -786,7 +786,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, db_get_b(NULL,"CList","ThirdLineDrawSmileys",SETTING_THIRDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
{
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, "CList","ThirdLineText", &dbv)) {
+ if ( !db_get_ts(NULL, "CList","ThirdLineText", &dbv)) {
SetWindowText(GetDlgItem(hwndDlg,IDC_VARIABLE_TEXT), dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp index dd241971ee..7d2c965705 100644 --- a/plugins/Clist_modern/src/modern_clistsettings.cpp +++ b/plugins/Clist_modern/src/modern_clistsettings.cpp @@ -251,7 +251,7 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce) if (pdnce->tszGroup == NULL) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(pdnce->hContact,"CList","Group",&dbv)) {
+ if ( !db_get_ts(pdnce->hContact,"CList","Group",&dbv)) {
pdnce->tszGroup = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 9a4525ad1f..b4339c7720 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -196,7 +196,7 @@ void cliTrayIconUpdateBase(const char *szChangedProto) if ( db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE &&
db_get_b(NULL,"CList","AlwaysPrimary",SETTING_ALWAYSPRIMARY_DEFAULT))
{
- if ( !DBGetContactSettingString(NULL,"CList","PrimaryStatus",&dbv)) {
+ if ( !db_get_s(NULL,"CList","PrimaryStatus",&dbv)) {
szProto = NEWSTR_ALLOCA(dbv.pszVal);
db_free(&dbv);
}
@@ -209,7 +209,7 @@ void cliTrayIconUpdateBase(const char *szChangedProto) switch( db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT)) {
case SETTING_TRAYICON_SINGLE:
{
- if ( !DBGetContactSettingString(NULL,"CList","PrimaryStatus",&dbv)) {
+ if ( !db_get_s(NULL,"CList","PrimaryStatus",&dbv)) {
szProto = NEWSTR_ALLOCA(dbv.pszVal);
db_free(&dbv);
}
@@ -330,7 +330,7 @@ void cliTrayIconUpdateBase(const char *szChangedProto) }
else if (status >= ID_STATUS_OFFLINE && status <= ID_STATUS_IDLE)
{
- if (DBGetContactSettingString(NULL,"CList","PrimaryStatus",&dbv))
+ if (db_get_s(NULL,"CList","PrimaryStatus",&dbv))
szProto = NULL;
else
szProto = dbv.pszVal;
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 012fea9575..3ab3bafa9e 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -107,18 +107,12 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam) if ( lstrcmp( _T(CLISTCONTROL_CLASS), cls))
hwndClist = pcli->hwndContactList;
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS;
HANDLE hItem = (HANDLE)SendMessage(hwndClist, CLM_GETSELECTION, 0, 0);
- if ( !hItem)
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hRenameMenuItem, (LPARAM)&mi);
+ Menu_ShowItem(hRenameMenuItem, hItem != 0);
if ( !hItem || !IsHContactContact(hItem) || !db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT)) {
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowAvatarMenuItem, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideAvatarMenuItem, (LPARAM)&mi);
+ Menu_ShowItem(hShowAvatarMenuItem, false);
+ Menu_ShowItem(hHideAvatarMenuItem, false);
}
else {
int has_avatar;
@@ -126,8 +120,8 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam) if ( ServiceExists(MS_AV_GETAVATARBITMAP))
has_avatar = CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hItem, 0);
else {
- DBVARIANT dbv = {0};
- if ( DBGetContactSettingTString(hItem, "ContactPhoto", "File", &dbv))
+ DBVARIANT dbv;
+ if ( db_get_ts(hItem, "ContactPhoto", "File", &dbv))
has_avatar = 0;
else {
has_avatar = 1;
@@ -135,18 +129,9 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam) }
}
- if ( db_get_b(hItem, "CList", "HideContactAvatar", 0)) {
- mi.flags = CMIM_FLAGS | (has_avatar ? 0 : CMIF_GRAYED);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowAvatarMenuItem, (LPARAM)&mi);
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideAvatarMenuItem, (LPARAM)&mi);
- }
- else {
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowAvatarMenuItem, (LPARAM)&mi);
- mi.flags = CMIM_FLAGS | (has_avatar ? 0 : CMIF_GRAYED);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideAvatarMenuItem, (LPARAM)&mi);
- }
+ bool bHideAvatar = db_get_b(hItem, "CList", "HideContactAvatar", 0) != 0;
+ Menu_ShowItem(hShowAvatarMenuItem, bHideAvatar);
+ Menu_ShowItem(hHideAvatarMenuItem, !bHideAvatar);
}
return 0;
@@ -641,7 +626,7 @@ void CLUI_ChangeWindowMode() //4- Set Title
TCHAR titleText[255] = {0};
DBVARIANT dbv;
- if ( DBGetContactSettingTString(NULL, "CList", "TitleText", &dbv))
+ if ( db_get_ts(NULL, "CList", "TitleText", &dbv))
lstrcpyn(titleText,_T(MIRANDANAME),SIZEOF(titleText));
else {
lstrcpyn(titleText,dbv.ptszVal,SIZEOF(titleText));
@@ -1003,7 +988,7 @@ static int CLUI_CreateTimerForConnectingIcon(WPARAM wParam,LPARAM lParam) KillTimer(pcli->hwndContactList,TM_STATUSBARUPDATE+pt->nIndex);
int cnt = CLUI_GetConnectingIconForProtoCount(szProto);
if (cnt != 0) {
- nAnimatedIconStep = 100;/*DBGetContactSettingWord(NULL,"CLUI","DefaultStepConnectingIcon",100);*/
+ nAnimatedIconStep = 100;/*db_get_w(NULL,"CLUI","DefaultStepConnectingIcon",100);*/
pt->nIconsCount = cnt;
if (pt->himlIconList)
ImageList_Destroy(pt->himlIconList);
@@ -1296,7 +1281,7 @@ int CLUI_TestCursorOnBorders() if (g_bTransparentFlag) {
if ( !bTransparentFocus && gf != hwnd) {
CLUI_SmoothAlphaTransition(hwnd, db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), 1);
- //g_proc_SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)DBGetContactSettingByte(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
+ //g_proc_SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
bTransparentFocus = 1;
CLUI_SafeSetTimer(hwnd, TM_AUTOALPHA,250, NULL);
}
diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp index 56357fb542..ff162fc7f7 100644 --- a/plugins/Clist_modern/src/modern_cluiframes.cpp +++ b/plugins/Clist_modern/src/modern_cluiframes.cpp @@ -672,7 +672,7 @@ static int DBLoadFrameSettingsAtPos(int pos,int Frameid) _itoa(pos,sadd,10);
- //DBWriteContactSettingString(0, CLUIFrameModule,strcat("Name",sadd),Frames[Frameid].name);
+ //db_set_s(0, CLUIFrameModule,strcat("Name",sadd),Frames[Frameid].name);
//bool
g_pfwFrames[Frameid].collapsed = db_get_b(0, CLUIFrameModule,AS(buf,"Collapse",sadd),g_pfwFrames[Frameid].collapsed);
@@ -735,7 +735,7 @@ static int LocateStorePosition(int Frameid,int maxstored) for (int i=0; i < maxstored; i++) {
mir_snprintf(settingname,SIZEOF(settingname),"Name%d",i);
DBVARIANT dbv = {0};
- if ( DBGetContactSettingTString( NULL, CLUIFrameModule, settingname, &dbv ))
+ if ( db_get_ts( NULL, CLUIFrameModule, settingname, &dbv ))
continue;
if ( lstrcmpi(dbv.ptszVal, g_pfwFrames[Frameid].Name) == 0) {
@@ -2600,7 +2600,7 @@ int CLUIFramesOnClistResize(WPARAM wParam,LPARAM lParam) }
- //if (DBGetContactSettingByte(NULL,"CLUI","ShowSBar",SETTING_SHOWSBAR_DEFAULT))GetWindowRect(pcli->hwndStatus,&rcStatus);
+ //if (db_get_b(NULL,"CLUI","ShowSBar",SETTING_SHOWSBAR_DEFAULT))GetWindowRect(pcli->hwndStatus,&rcStatus);
//else rcStatus.top = rcStatus.bottom = 0;
// nRect.top--;
/* $$$ rcStatus.top = rcStatus.bottom = 0;
@@ -2663,7 +2663,7 @@ int OnFrameTitleBarBackgroundChange(WPARAM wParam,LPARAM lParam) if (g_CluiData.fDisableSkinEngine)
{
if ( db_get_b(NULL,"FrameTitleBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if ( !DBGetContactSettingString(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
+ if ( !db_get_s(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
}
diff --git a/plugins/Clist_modern/src/modern_newrowopts.cpp b/plugins/Clist_modern/src/modern_newrowopts.cpp index 3cbb3fc197..7e5d9533cc 100644 --- a/plugins/Clist_modern/src/modern_newrowopts.cpp +++ b/plugins/Clist_modern/src/modern_newrowopts.cpp @@ -173,7 +173,7 @@ BOOL CALLBACK DlgProcItemNewRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (RemoveNode(res1)) res1 = 0;
TRACE("*********** Nodes DUMP 2 ***********\n");
TraceTreeLevel(RootNode);
- //CheckDlgButton(hwndDlg, IDC_HIDE_ICON_ON_AVATAR, DBGetContactSettingByte(NULL,"CList","IconHideOnAvatar",SETTING_HIDEICONONAVATAR_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
+ //CheckDlgButton(hwndDlg, IDC_HIDE_ICON_ON_AVATAR, db_get_b(NULL,"CList","IconHideOnAvatar",SETTING_HIDEICONONAVATAR_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
MessageBox(hwndDlg,_T("Init NewRow Dialog"),_T("Notify"),MB_OK);
break;
}
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 8cf08c44d8..496c18ffd4 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -119,7 +119,7 @@ int LoadStatusBarData() DBVARIANT dbv;
g_StatusBarData.bkColour = sttGetColor("StatusBar","BkColour",CLCDEFAULT_BKCOLOUR);
if ( db_get_b(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if ( !DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
+ if ( !db_get_s(NULL,"StatusBar","BkBitmap",&dbv)) {
g_StatusBarData.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
}
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 8b7598c66e..592320f7c9 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -261,7 +261,7 @@ static int FillDialog(HWND hwnd) for (i=0;;i++)
{
mir_snprintf(buf, 20, "%d", i);
- if (DBGetContactSettingTString(NULL, "CListGroups", buf, &dbv))
+ if (db_get_ts(NULL, "CListGroups", buf, &dbv))
break;
item.pszText = &dbv.ptszVal[1];
@@ -557,10 +557,10 @@ static void UpdateFilters() mir_sntprintf(szTemp, 100, TranslateT("Configuring view mode: %s"), szTempBuf);
SetDlgItemText(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
mir_snprintf(szSetting, 128, "%c%s_PF", 246, szBuf);
- if (DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv_pf))
+ if (db_get_s(NULL, CLVM_MODULE, szSetting, &dbv_pf))
goto cleanup;
mir_snprintf(szSetting, 128, "%c%s_GF", 246, szBuf);
- if (DBGetContactSettingTString(NULL, CLVM_MODULE, szSetting, &dbv_gf))
+ if (db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv_gf))
goto cleanup;
mir_snprintf(szSetting, 128, "%c%s_OPT", 246, szBuf);
if ((opt = db_get_dw(NULL, CLVM_MODULE, szSetting, -1)) != -1)
@@ -1275,7 +1275,7 @@ static int ehhViewModeBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
view_mode.bkColour = sttGetColor("ViewMode","BkColour",CLCDEFAULT_BKCOLOUR);
if ( db_get_b(NULL,"ViewMode","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if ( !DBGetContactSettingString(NULL,"ViewMode","BkBitmap",&dbv)) {
+ if ( !db_get_s(NULL,"ViewMode","BkBitmap",&dbv)) {
view_mode.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
}
@@ -1341,7 +1341,7 @@ void ApplyViewMode(const char *Name, bool onlySelector ) if ( !name) // Name is null - apply last stored view mode
{
- if ( !DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv))
+ if ( !db_get_s(NULL, CLVM_MODULE, szSetting, &dbv))
{
name = (char*)_alloca(strlen(dbv.pszVal)+1);
strcpy(name,dbv.pszVal);
@@ -1378,7 +1378,7 @@ void ApplyViewMode(const char *Name, bool onlySelector ) if ( !onlySelector )
{
mir_snprintf(szSetting, 256, "%c%s_PF", 246, name);
- if ( !DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ if ( !db_get_s(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (lstrlenA(dbv.pszVal) >= 2)
{
strncpy(g_CluiData.protoFilter, dbv.pszVal, SIZEOF(g_CluiData.protoFilter));
@@ -1388,7 +1388,7 @@ void ApplyViewMode(const char *Name, bool onlySelector ) mir_free(dbv.pszVal);
}
mir_snprintf(szSetting, 256, "%c%s_GF", 246, name);
- if ( !DBGetContactSettingTString(NULL, CLVM_MODULE, szSetting, &dbv))
+ if ( !db_get_ts(NULL, CLVM_MODULE, szSetting, &dbv))
{
if (lstrlen(dbv.ptszVal) >= 2)
{
diff --git a/plugins/Clist_mw/src/BkgrCfg.cpp b/plugins/Clist_mw/src/BkgrCfg.cpp index 5dced4e4db..237cd6317c 100644 --- a/plugins/Clist_mw/src/BkgrCfg.cpp +++ b/plugins/Clist_mw/src/BkgrCfg.cpp @@ -65,11 +65,11 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP dat->item[indx].changed = FALSE;
dat->item[indx].useBitmap = db_get_b(NULL,module, "UseBitmap", DEFAULT_USEBITMAP);
- dat->item[indx].bkColor = DBGetContactSettingDword(NULL,module, "BkColour", DEFAULT_BKCOLOUR);
- dat->item[indx].selColor = DBGetContactSettingDword(NULL,module, "SelBkColour", DEFAULT_SELBKCOLOUR);
+ dat->item[indx].bkColor = db_get_dw(NULL,module, "BkColour", DEFAULT_BKCOLOUR);
+ dat->item[indx].selColor = db_get_dw(NULL,module, "SelBkColour", DEFAULT_SELBKCOLOUR);
{
DBVARIANT dbv;
- if ( !DBGetContactSettingString(NULL,module,"BkBitmap",&dbv))
+ if ( !db_get_s(NULL,module,"BkBitmap",&dbv))
{
int retval = PathToAbsolute(dbv.pszVal, dat->item[indx].filename);
if ( !retval || retval == CALLSERVICE_NOTFOUND)
@@ -221,14 +221,14 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP COLORREF col;
if ((col = dat->item[indx].bkColor) == DEFAULT_BKCOLOUR)
- DBDeleteContactSetting(NULL, module, "BkColour");
+ db_unset(NULL, module, "BkColour");
else
- DBWriteContactSettingDword(NULL, module, "BkColour", col);
+ db_set_dw(NULL, module, "BkColour", col);
if ((col = dat->item[indx].selColor) == DEFAULT_SELBKCOLOUR)
- DBDeleteContactSetting(NULL, module, "SelBkColour");
+ db_unset(NULL, module, "SelBkColour");
else
- DBWriteContactSettingDword(NULL, module, "SelBkColour", col);
+ db_set_dw(NULL, module, "SelBkColour", col);
}
{
char str[MAX_PATH];
@@ -238,7 +238,7 @@ static INT_PTR CALLBACK DlgProcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP else
db_set_s(NULL, module, "BkBitmap", str);
}
- DBWriteContactSettingWord(NULL, module, "BkBmpUse", dat->item[indx].flags);
+ db_set_w(NULL, module, "BkBmpUse", dat->item[indx].flags);
dat->item[indx].changed = FALSE;
NotifyEventHooks(hEventBkgrChanged, (WPARAM)module, 0);
}
diff --git a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp index b504a96f0e..498dc2e896 100644 --- a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp @@ -516,25 +516,25 @@ int DBStoreFrameSettingsAtPos(int pos,int Frameid) _itoa(pos,sadd,10);
- DBWriteContactSettingTString(0,CLUIFrameModule,AS(buf,"Name",sadd),Frames[Frameid].name);
+ db_set_ts(0,CLUIFrameModule,AS(buf,"Name",sadd),Frames[Frameid].name);
//boolean
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);
- DBWriteContactSettingWord(0,CLUIFrameModule,AS(buf,"Align",sadd),(WORD)Frames[Frameid].align);
+ db_set_w(0,CLUIFrameModule,AS(buf,"Height",sadd),(WORD)Frames[Frameid].height);
+ db_set_w(0,CLUIFrameModule,AS(buf,"HeightCollapsed",sadd),(WORD)Frames[Frameid].HeightWhenCollapsed);
+ db_set_w(0,CLUIFrameModule,AS(buf,"Align",sadd),(WORD)Frames[Frameid].align);
//FloatingPos
- DBWriteContactSettingWord(0,CLUIFrameModule,AS(buf,"FloatX",sadd),(WORD)Frames[Frameid].FloatingPos.x);
- DBWriteContactSettingWord(0,CLUIFrameModule,AS(buf,"FloatY",sadd),(WORD)Frames[Frameid].FloatingPos.y);
- DBWriteContactSettingWord(0,CLUIFrameModule,AS(buf,"FloatW",sadd),(WORD)Frames[Frameid].FloatingSize.x);
- DBWriteContactSettingWord(0,CLUIFrameModule,AS(buf,"FloatH",sadd),(WORD)Frames[Frameid].FloatingSize.y);
+ db_set_w(0,CLUIFrameModule,AS(buf,"FloatX",sadd),(WORD)Frames[Frameid].FloatingPos.x);
+ db_set_w(0,CLUIFrameModule,AS(buf,"FloatY",sadd),(WORD)Frames[Frameid].FloatingPos.y);
+ db_set_w(0,CLUIFrameModule,AS(buf,"FloatW",sadd),(WORD)Frames[Frameid].FloatingSize.x);
+ db_set_w(0,CLUIFrameModule,AS(buf,"FloatH",sadd),(WORD)Frames[Frameid].FloatingSize.y);
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);
+ db_set_w(0,CLUIFrameModule,AS(buf,"Order",sadd),(WORD)Frames[Frameid].order);
//db_set_s(0,CLUIFrameModule,AS(buf,"TBName",sadd),Frames[Frameid].TitleBar.tbname);
return 0;
}
@@ -593,7 +593,7 @@ int CLUIFramesStoreFrameSettings(int Frameid) }
DBStoreFrameSettingsAtPos(storpos,Frameid);
- DBWriteContactSettingWord(0,CLUIFrameModule,"StoredFrames",(WORD)maxstored);
+ db_set_w(0,CLUIFrameModule,"StoredFrames",(WORD)maxstored);
//ulockfrm();
return 0;
}
@@ -1739,9 +1739,9 @@ int CLUIFramesResize(const RECT newsize) int sepw = GapBetweenFrames;
SortData *sdarray;
- GapBetweenTitlebar = (int)DBGetContactSettingDword(NULL,"CLUIFrames","GapBetweenTitleBar",1);
- GapBetweenFrames = DBGetContactSettingDword(NULL,"CLUIFrames","GapBetweenFrames",1);
- TitleBarH = DBGetContactSettingDword(NULL,"CLUIFrames","TitleBarH",DEFAULT_TITLEBAR_HEIGHT);
+ GapBetweenTitlebar = (int)db_get_dw(NULL,"CLUIFrames","GapBetweenTitleBar",1);
+ GapBetweenFrames = db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",1);
+ TitleBarH = db_get_dw(NULL,"CLUIFrames","TitleBarH",DEFAULT_TITLEBAR_HEIGHT);
sepw = GapBetweenFrames;
if (nFramescount < 1)
@@ -1941,12 +1941,12 @@ int OnFrameTitleBarBackgroundChange(WPARAM wParam,LPARAM lParam) AlignCOLLIconToLeft = db_get_b(NULL,"FrameTitleBar","AlignCOLLIconToLeft",0);
- bkColour = DBGetContactSettingDword(NULL,"FrameTitleBar","BkColour",CLCDEFAULT_BKCOLOUR);
- //SelBkColour = DBGetContactSettingDword(NULL,"FrameTitleBar","SelBkColour",0);
+ bkColour = db_get_dw(NULL,"FrameTitleBar","BkColour",CLCDEFAULT_BKCOLOUR);
+ //SelBkColour = db_get_dw(NULL,"FrameTitleBar","SelBkColour",0);
if (hBmpBackground) {DeleteObject(hBmpBackground); hBmpBackground = NULL;}
if ( db_get_b(NULL,"FrameTitleBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if ( !DBGetContactSetting(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
+ if ( !db_get(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
mir_free(dbv.pszVal);
}
@@ -2108,7 +2108,7 @@ static int DrawTitleBar(HDC dc,RECT rect,int Frameid) DrawBackGroundTTB(Frames[pos].TitleBar.hwnd,hdcMem);
//hFront = CreateSolidPe (SelBkColour);
//SelectObject(hdcMem,hFront);
- SelBkColour = DBGetContactSettingDword(NULL,"CLUIFrames","FramesTitleBarFontCol",0);
+ SelBkColour = db_get_dw(NULL,"CLUIFrames","FramesTitleBarFontCol",0);
if (SelBkColour) SetTextColor(hdcMem,SelBkColour);
if ( !AlignCOLLIconToLeft) {
@@ -2871,7 +2871,7 @@ int LoadCLUIFramesModule(void) RegisterClass(&cntclass);
//end container helper
- GapBetweenFrames = DBGetContactSettingDword(NULL,"CLUIFrames","GapBetweenFrames",1);
+ GapBetweenFrames = db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",1);
nFramescount = 0;
InitializeCriticalSection(&csFrameHook);
diff --git a/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp b/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp index f5d577d70c..10a0ad3b4b 100644 --- a/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp +++ b/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp @@ -30,20 +30,20 @@ int extraspace; int OnStatusBarBackgroundChange()
{
showOpts = db_get_b(NULL,"CLUI","SBarShow",1);
- bkColour = DBGetContactSettingDword(NULL,"StatusBar","BkColour",CLCDEFAULT_BKCOLOUR);
+ bkColour = db_get_dw(NULL,"StatusBar","BkColour",CLCDEFAULT_BKCOLOUR);
if (hBmpBackground)
DeleteObject(hBmpBackground), hBmpBackground = NULL;
if ( db_get_b(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, "StatusBar", "BkBitmap", &dbv)) {
+ if ( !db_get_ts(NULL, "StatusBar", "BkBitmap", &dbv)) {
hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
}
backgroundBmpUse = db_get_w(NULL,"StatusBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
- extraspace = DBGetContactSettingDword(NULL,"StatusBar","BkExtraSpace",0);
+ extraspace = db_get_dw(NULL,"StatusBar","BkExtraSpace",0);
RecreateStatusBar(pcli->hwndContactList);
if (pcli->hwndStatus) InvalidateRect(pcli->hwndStatus,NULL,TRUE);
@@ -228,8 +228,8 @@ void DrawBackGround(HWND hwnd,HDC mhdc) ds.hwndItem = hwnd;
ds.hDC = hdcMem;
- int startoffset = DBGetContactSettingDword(NULL,"StatusBar","FirstIconOffset",0);
- int extraspace = DBGetContactSettingDword(NULL,"StatusBar","BkExtraSpace",0);
+ int startoffset = db_get_dw(NULL,"StatusBar","FirstIconOffset",0);
+ int extraspace = db_get_dw(NULL,"StatusBar","BkExtraSpace",0);
int nParts = SendMessage(hwnd,SB_GETPARTS,0,0);
RECT rc = { 0 }, clrc;
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp index dce9541b22..26924d1f8c 100644 --- a/plugins/Clist_mw/src/clc.cpp +++ b/plugins/Clist_mw/src/clc.cpp @@ -219,7 +219,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L 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 ( !db_get_ts((HANDLE)wParam, "CList", "StatusMsg", &dbv)) {
int j;
if (dbv.ptszVal == NULL||_tcslen(dbv.ptszVal) == 0) break;
lstrcpyn(contact->szStatusMsg, dbv.ptszVal, SIZEOF(contact->szStatusMsg));
@@ -228,7 +228,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L contact->szStatusMsg[j] = ' ';
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (_tcslen(contact->szStatusMsg)>0) {
contact->flags |= CONTACTF_STATUSMSG;
dat->needsResort = TRUE;
diff --git a/plugins/Clist_mw/src/clcitems.cpp b/plugins/Clist_mw/src/clcitems.cpp index bea0430653..245afe3048 100644 --- a/plugins/Clist_mw/src/clcitems.cpp +++ b/plugins/Clist_mw/src/clcitems.cpp @@ -166,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 ( !db_get_ts(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--) {
@@ -174,7 +174,7 @@ static struct ClcContact * AddContactToGroup(struct ClcData *dat,ClcGroup *group group->cl.items[i]->szStatusMsg[j] = ' ';
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (_tcslen(group->cl.items[i]->szStatusMsg)>0) {
group->cl.items[i]->flags |= CONTACTF_STATUSMSG;
}
@@ -292,7 +292,7 @@ void DeleteItemFromTree(HWND hwnd,HANDLE hItem) if ( !IsHContactContact(hItem)) return;
ClearClcContactCache(dat,hItem);
- if (DBGetContactSettingTString(hItem,"CList","Group",&dbv)) return;
+ if (db_get_ts(hItem,"CList","Group",&dbv)) return;
//decrease member counts of all parent groups too
group = &dat->list;
@@ -423,7 +423,7 @@ void RebuildEntireList(HWND hwnd,struct ClcData *dat) sprintf(buf,"RebuildEntireList %d \r\n",tick);
OutputDebugStringA(buf);
- DBWriteContactSettingDword((HANDLE)0,"CLUI","PF:Last RebuildEntireList Time:",tick);
+ db_set_dw((HANDLE)0,"CLUI","PF:Last RebuildEntireList Time:",tick);
}
}
@@ -512,7 +512,7 @@ void SortCLC(HWND hwnd,struct ClcData *dat,int useInsertionSort) if (tick > 5) {
sprintf(buf,"SortCLC %d \r\n",tick);
OutputDebugStringA(buf);
- DBWriteContactSettingDword((HANDLE)0,"CLUI","PF:Last SortCLC Time:",tick);
+ db_set_dw((HANDLE)0,"CLUI","PF:Last SortCLC Time:",tick);
}
}
#endif
diff --git a/plugins/Clist_mw/src/clcopts.cpp b/plugins/Clist_mw/src/clcopts.cpp index 63ee91a856..845e3d104d 100644 --- a/plugins/Clist_mw/src/clcopts.cpp +++ b/plugins/Clist_mw/src/clcopts.cpp @@ -216,7 +216,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
{
- DWORD exStyle = DBGetContactSettingDword(NULL,"CLC","ExStyle",pcli->pfnGetDefaultExStyle());
+ DWORD exStyle = db_get_dw(NULL,"CLC","ExStyle",pcli->pfnGetDefaultExStyle());
for (int i = 0;i < SIZEOF(checkBoxToStyleEx); i++)
CheckDlgButton(hwndDlg,checkBoxToStyleEx[i].id,(exStyle&checkBoxToStyleEx[i].flag)^(checkBoxToStyleEx[i].flag*checkBoxToStyleEx[i].not)?BST_CHECKED:BST_UNCHECKED);
@@ -231,13 +231,13 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_SETPOS,0,MAKELONG( db_get_b(NULL,"CLC","LeftMargin",CLCDEFAULT_LEFTMARGIN),0));
SendDlgItemMessage(hwndDlg,IDC_GROUPINDENTSPIN,UDM_SETRANGE,0,MAKELONG(50,0));
SendDlgItemMessage(hwndDlg,IDC_GROUPINDENTSPIN,UDM_SETPOS,0,MAKELONG( db_get_b(NULL,"CLC","GroupIndent",CLCDEFAULT_GROUPINDENT),0));
- CheckDlgButton(hwndDlg,IDC_GREYOUT,DBGetContactSettingDword(NULL,"CLC","GreyoutFlags",CLCDEFAULT_GREYOUTFLAGS)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_GREYOUT,db_get_dw(NULL,"CLC","GreyoutFlags",CLCDEFAULT_GREYOUTFLAGS)?BST_CHECKED:BST_UNCHECKED);
EnableWindow(GetDlgItem(hwndDlg,IDC_SMOOTHTIME),IsDlgButtonChecked(hwndDlg,IDC_NOTNOSMOOTHSCROLLING));
EnableWindow(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),IsDlgButtonChecked(hwndDlg,IDC_GREYOUT));
- FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),greyoutValues,SIZEOF(greyoutValues),DBGetContactSettingDword(NULL,"CLC","FullGreyoutFlags",CLCDEFAULT_FULLGREYOUTFLAGS));
- FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),offlineValues,SIZEOF(offlineValues),DBGetContactSettingDword(NULL,"CLC","OfflineModes",CLCDEFAULT_OFFLINEMODES));
+ FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),greyoutValues,SIZEOF(greyoutValues),db_get_dw(NULL,"CLC","FullGreyoutFlags",CLCDEFAULT_FULLGREYOUTFLAGS));
+ FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),offlineValues,SIZEOF(offlineValues),db_get_dw(NULL,"CLC","OfflineModes",CLCDEFAULT_OFFLINEMODES));
CheckDlgButton(hwndDlg,IDC_NOSCROLLBAR,db_get_b(NULL,"CLC","NoVScrollBar",0)?BST_CHECKED:BST_UNCHECKED);
return TRUE;
@@ -283,19 +283,19 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam for (i = 0;i < SIZEOF(checkBoxToStyleEx);i++)
if ((IsDlgButtonChecked(hwndDlg,checkBoxToStyleEx[i].id) == 0) == checkBoxToStyleEx[i].not)
exStyle |= checkBoxToStyleEx[i].flag;
- DBWriteContactSettingDword(NULL,"CLC","ExStyle",exStyle);
+ db_set_dw(NULL,"CLC","ExStyle",exStyle);
DWORD fullGreyoutFlags = MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS));
- DBWriteContactSettingDword(NULL,"CLC","FullGreyoutFlags",fullGreyoutFlags);
+ db_set_dw(NULL,"CLC","FullGreyoutFlags",fullGreyoutFlags);
if (IsDlgButtonChecked(hwndDlg,IDC_GREYOUT))
- DBWriteContactSettingDword(NULL,"CLC","GreyoutFlags",fullGreyoutFlags);
+ db_set_dw(NULL,"CLC","GreyoutFlags",fullGreyoutFlags);
else
- DBWriteContactSettingDword(NULL,"CLC","GreyoutFlags",0);
+ db_set_dw(NULL,"CLC","GreyoutFlags",0);
db_set_b(NULL,"CLC","ShowIdle",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_IDLE)?1:0));
- DBWriteContactSettingDword(NULL,"CLC","OfflineModes",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS)));
+ db_set_dw(NULL,"CLC","OfflineModes",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS)));
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));
+ db_set_w(NULL,"CLC","ScrollTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_GETPOS,0,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));
@@ -320,12 +320,12 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w CheckDlgButton(hwndDlg,IDC_BITMAP,db_get_b(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)?BST_CHECKED:BST_UNCHECKED);
SendMessage(hwndDlg,WM_USER+10,0,0);
SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETDEFAULTCOLOUR,0,CLCDEFAULT_BKCOLOUR);
- SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"StatusBar","BkColour",CLCDEFAULT_BKCOLOUR));
+ SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,db_get_dw(NULL,"StatusBar","BkColour",CLCDEFAULT_BKCOLOUR));
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETDEFAULTCOLOUR,0,CLCDEFAULT_SELBKCOLOUR);
- SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"StatusBar","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
+ SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR,0,db_get_dw(NULL,"StatusBar","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
{
DBVARIANT dbv;
- if ( !DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
+ if ( !db_get_s(NULL,"StatusBar","BkBitmap",&dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
char szPath[MAX_PATH];
@@ -398,11 +398,11 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w {
COLORREF col;
col = SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_GETCOLOUR,0,0);
- if (col == CLCDEFAULT_BKCOLOUR) DBDeleteContactSetting(NULL,"StatusBar","BkColour");
- else DBWriteContactSettingDword(NULL,"StatusBar","BkColour",col);
+ if (col == CLCDEFAULT_BKCOLOUR) db_unset(NULL,"StatusBar","BkColour");
+ else db_set_dw(NULL,"StatusBar","BkColour",col);
col = SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_GETCOLOUR,0,0);
- if (col == CLCDEFAULT_SELBKCOLOUR) DBDeleteContactSetting(NULL,"StatusBar","SelBkColour");
- else DBWriteContactSettingDword(NULL,"StatusBar","SelBkColour",col);
+ if (col == CLCDEFAULT_SELBKCOLOUR) db_unset(NULL,"StatusBar","SelBkColour");
+ else db_set_dw(NULL,"StatusBar","SelBkColour",col);
char str[MAX_PATH],strrel[MAX_PATH];
GetDlgItemTextA(hwndDlg,IDC_FILENAME,str,SIZEOF(str));
@@ -420,7 +420,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w if (IsDlgButtonChecked(hwndDlg,IDC_PROPORTIONAL)) flags |= CLBF_PROPORTIONAL;
if (IsDlgButtonChecked(hwndDlg,IDC_TILEVROWH)) flags |= CLBF_TILEVTOROWHEIGHT;
- DBWriteContactSettingWord(NULL,"StatusBar","BkBmpUse",flags);
+ db_set_w(NULL,"StatusBar","BkBmpUse",flags);
}
pcli->pfnClcOptionsChanged();
@@ -442,12 +442,12 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, CheckDlgButton(hwndDlg,IDC_BITMAP,db_get_b(NULL,"CLC","UseBitmap",CLCDEFAULT_USEBITMAP)?BST_CHECKED:BST_UNCHECKED);
SendMessage(hwndDlg,WM_USER+10,0,0);
SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETDEFAULTCOLOUR,0,CLCDEFAULT_BKCOLOUR);
- SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLC","BkColour",CLCDEFAULT_BKCOLOUR));
+ SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,db_get_dw(NULL,"CLC","BkColour",CLCDEFAULT_BKCOLOUR));
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETDEFAULTCOLOUR,0,CLCDEFAULT_SELBKCOLOUR);
- SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLC","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
+ SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR,0,db_get_dw(NULL,"CLC","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
{
DBVARIANT dbv;
- if ( !DBGetContactSettingString(NULL,"CLC","BkBitmap",&dbv)) {
+ if ( !db_get_s(NULL,"CLC","BkBitmap",&dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
char szPath[MAX_PATH];
@@ -517,11 +517,11 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, 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");
- else DBWriteContactSettingDword(NULL,"CLC","BkColour",col);
+ if (col == CLCDEFAULT_BKCOLOUR) db_unset(NULL,"CLC","BkColour");
+ else db_set_dw(NULL,"CLC","BkColour",col);
col = SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_GETCOLOUR,0,0);
- if (col == CLCDEFAULT_SELBKCOLOUR) DBDeleteContactSetting(NULL,"CLC","SelBkColour");
- else DBWriteContactSettingDword(NULL,"CLC","SelBkColour",col);
+ if (col == CLCDEFAULT_SELBKCOLOUR) db_unset(NULL,"CLC","SelBkColour");
+ else db_set_dw(NULL,"CLC","SelBkColour",col);
}
{
char str[MAX_PATH],strrel[MAX_PATH];
@@ -540,7 +540,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if (IsDlgButtonChecked(hwndDlg,IDC_PROPORTIONAL)) flags |= CLBF_PROPORTIONAL;
if (IsDlgButtonChecked(hwndDlg,IDC_TILEVROWH)) flags |= CLBF_TILEVTOROWHEIGHT;
- DBWriteContactSettingWord(NULL,"CLC","BkBmpUse",flags);
+ db_set_w(NULL,"CLC","BkBmpUse",flags);
}
pcli->pfnClcOptionsChanged();
diff --git a/plugins/Clist_mw/src/clistmod.cpp b/plugins/Clist_mw/src/clistmod.cpp index dda20b767f..41a73e0041 100644 --- a/plugins/Clist_mw/src/clistmod.cpp +++ b/plugins/Clist_mw/src/clistmod.cpp @@ -101,15 +101,15 @@ 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 ( !db_get_ts(ack->hContact, "CList", "StatusMsg", &dbv)) {
if ( !_tcscmp(dbv.ptszVal, (TCHAR *)ack->lParam)) {
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 0;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if ( db_get_b(NULL,"CList","ShowStatusMsg",0) || db_get_b(ack->hContact,"CList","StatusMsgAuto",0))
- DBWriteContactSettingTString(ack->hContact, "CList", "StatusMsg", (TCHAR *)ack->lParam);
+ db_set_ts(ack->hContact, "CList", "StatusMsg", (TCHAR *)ack->lParam);
}
return 0;
@@ -136,7 +136,7 @@ int LoadContactListModule(void) }
hCListImages = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
- DefaultImageListColorDepth = DBGetContactSettingDword(NULL,"CList","DefaultImageListColorDepth",ILC_COLOR32);
+ DefaultImageListColorDepth = db_get_dw(NULL,"CList","DefaultImageListColorDepth",ILC_COLOR32);
hProtoAckHook = (HANDLE) HookEvent(ME_PROTO_ACK, ProtocolAck);
HookEvent(ME_OPT_INITIALISE,CListOptInit);
diff --git a/plugins/Clist_mw/src/clistopts.cpp b/plugins/Clist_mw/src/clistopts.cpp index 2a927efc75..85a79385ae 100644 --- a/plugins/Clist_mw/src/clistopts.cpp +++ b/plugins/Clist_mw/src/clistopts.cpp @@ -137,7 +137,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP { int i,count,item;
PROTOACCOUNT **accs;
DBVARIANT dbv = {DBVT_DELETED};
- DBGetContactSettingString(NULL,"CList","PrimaryStatus",&dbv);
+ db_get_s(NULL,"CList","PrimaryStatus",&dbv);
ProtoEnumAccounts( &count, &accs );
item = SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_ADDSTRING,0,(LPARAM)TranslateT("Global"));
SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETITEMDATA,item,0);
@@ -201,7 +201,7 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
if ( !(caps & CLUIF_HASAUTOHIDEOPTION)) {
db_set_b(NULL,"CList","AutoHide",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
- DBWriteContactSettingWord(NULL,"CList","HideTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_GETPOS,0,0));
+ db_set_w(NULL,"CList","HideTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_GETPOS,0,0));
}
}
db_set_b(NULL,"CList","SortByStatus",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SORTBYSTATUS));
@@ -215,15 +215,15 @@ static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP 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));
+ db_set_w(NULL,"CList","CycleTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_CYCLETIMESPIN,UDM_GETPOS,0,0));
+ db_set_w(NULL,"CList","IconFlashTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_GETPOS,0,0));
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");
+ db_unset(NULL, "CList","PrimaryStatus");
else
db_set_s(NULL,"CList","PrimaryStatus", pa->szModuleName);
}
diff --git a/plugins/Clist_mw/src/clistsettings.cpp b/plugins/Clist_mw/src/clistsettings.cpp index c0dd11b077..28b69254ca 100644 --- a/plugins/Clist_mw/src/clistsettings.cpp +++ b/plugins/Clist_mw/src/clistsettings.cpp @@ -120,7 +120,7 @@ void CheckPDNCE(ClcCacheEntry *_pdnce) {
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(pdnce->hContact,"CList","Group",&dbv))
+ if ( !db_get_ts(pdnce->hContact,"CList","Group",&dbv))
{
pdnce->tszGroup = mir_tstrdup(dbv.ptszVal);
mir_free(dbv.pszVal);
@@ -135,7 +135,7 @@ void CheckPDNCE(ClcCacheEntry *_pdnce) pdnce->noHiddenOffline = db_get_b(pdnce->hContact,"CList","noOffline",0);
if ( pdnce->IdleTS == -1 )
- pdnce->IdleTS = DBGetContactSettingDword(pdnce->hContact,pdnce->szProto,"IdleTS",0);
+ pdnce->IdleTS = db_get_dw(pdnce->hContact,pdnce->szProto,"IdleTS",0);
if (pdnce->ApparentMode == -1)
pdnce->ApparentMode = db_get_w(pdnce->hContact,pdnce->szProto,"ApparentMode",0);
diff --git a/plugins/Clist_mw/src/clui.cpp b/plugins/Clist_mw/src/clui.cpp index 3e63f9ceff..f96a3a0697 100644 --- a/plugins/Clist_mw/src/clui.cpp +++ b/plugins/Clist_mw/src/clui.cpp @@ -419,7 +419,7 @@ int GetStatsuBarProtoRect(HWND hwnd,char *szProto,RECT *rc) {
int nParts,nPanel;
ProtocolData *PD;
- int startoffset = DBGetContactSettingDword(NULL,"StatusBar","FirstIconOffset",0);
+ int startoffset = db_get_dw(NULL,"StatusBar","FirstIconOffset",0);
if ( !UseOwnerDrawStatusBar) startoffset = 0;
@@ -514,11 +514,11 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l GetWindowRect(hwnd, &rc);
if ( !CallService(MS_CLIST_DOCKINGISDOCKED,0,0)) {
//if docked, dont remember pos (except for width)
- DBWriteContactSettingDword(NULL,"CList","Height",(DWORD)(rc.bottom - rc.top));
- DBWriteContactSettingDword(NULL,"CList","x",(DWORD)rc.left);
- DBWriteContactSettingDword(NULL,"CList","y",(DWORD)rc.top);
+ db_set_dw(NULL,"CList","Height",(DWORD)(rc.bottom - rc.top));
+ db_set_dw(NULL,"CList","x",(DWORD)rc.left);
+ db_set_dw(NULL,"CList","y",(DWORD)rc.top);
}
- DBWriteContactSettingDword(NULL,"CList","Width",(DWORD)(rc.right - rc.left));
+ db_set_dw(NULL,"CList","Width",(DWORD)(rc.right - rc.left));
}
if ( wParam == SIZE_MINIMIZED ) {
if ( db_get_b(NULL,"CList","Min2Tray",SETTING_MIN2TRAY_DEFAULT )) {
@@ -648,8 +648,8 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l int totcount;
ProtocolData *PD;
int menuid;
- int startoffset = DBGetContactSettingDword(NULL,"StatusBar","FirstIconOffset",0);
- int extraspace = DBGetContactSettingDword(NULL,"StatusBar","BkExtraSpace",0);
+ int startoffset = db_get_dw(NULL,"StatusBar","FirstIconOffset",0);
+ int extraspace = db_get_dw(NULL,"StatusBar","BkExtraSpace",0);
boolean UseOwnerDrawStatusBar = db_get_b(NULL,"CLUI","UseOwnerDrawStatusBar",0);
hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
@@ -686,7 +686,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l break;
} } }
- totcount = DBGetContactSettingDword(0,"Protocols","ProtoCount",0);
+ totcount = db_get_dw(0,"Protocols","ProtoCount",0);
PD = (ProtocolData *)SendMessage(pcli->hwndStatus,SB_GETTEXT,(WPARAM)nPanel,0);
if (PD == NULL){return 0;}
menuid = nPanel;
@@ -756,11 +756,11 @@ int LoadCLUIModule(void) CreateServiceFunction("CLUI/GetConnectingIconForProtocol",GetConnectingIconService);
- if (DBGetContactSettingTString(NULL,"CList","TitleText",&dbv))
+ if (db_get_ts(NULL,"CList","TitleText",&dbv))
lstrcpyn(titleText,_T(MIRANDANAME),SIZEOF(titleText));
else {
lstrcpyn(titleText,dbv.ptszVal,SIZEOF(titleText));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
oldhideoffline = db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT);
diff --git a/plugins/Clist_mw/src/cluiopts.cpp b/plugins/Clist_mw/src/cluiopts.cpp index 5a70db69b1..3838380564 100644 --- a/plugins/Clist_mw/src/cluiopts.cpp +++ b/plugins/Clist_mw/src/cluiopts.cpp @@ -95,7 +95,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L char *s;
char szUin[20];
- if (DBGetContactSettingString(NULL,"CList","TitleText",&dbv) == 0&&(dbv.pszVal))
+ if (db_get_s(NULL,"CList","TitleText",&dbv) == 0&&(dbv.pszVal))
{
s = mir_strdup(dbv.pszVal);
mir_free(dbv.pszVal);
@@ -112,20 +112,20 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L }
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)MIRANDANAME);
- wsprintfA(szUin,"%u",DBGetContactSettingDword(NULL,"ICQ","UIN",0));
+ wsprintfA(szUin,"%u",db_get_dw(NULL,"ICQ","UIN",0));
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)szUin);
- if ( !DBGetContactSettingString(NULL,"ICQ","Nick",&dbv)) {
+ if ( !db_get_s(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 ( !db_get_s(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 ( !db_get_s(NULL,"ICQ","e-mail",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
mir_free(dbv.pszVal);
dbv.pszVal = NULL;
@@ -249,7 +249,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L { TCHAR title[256];
GetDlgItemText(hwndDlg,IDC_TITLETEXT,title,SIZEOF(title));
- DBWriteContactSettingTString(NULL,"CList","TitleText",title);
+ db_set_ts(NULL,"CList","TitleText",title);
SetWindowText(pcli->hwndContactList,title);
}
db_set_b(NULL,"CLUI","FadeInOut",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_FADEINOUT));
@@ -257,7 +257,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L 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));
+ db_set_w(NULL,"CList","HideTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_GETPOS,0,0));
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));
@@ -298,7 +298,7 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L CheckDlgButton(hwndDlg, IDC_USEOWNERDRAW, db_get_b(NULL,"CLUI","UseOwnerDrawStatusBar",1) ? BST_CHECKED : BST_UNCHECKED);
- SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLUI","SBarBKColor",CLR_DEFAULT));
+ SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,db_get_dw(NULL,"CLUI","SBarBKColor",CLR_DEFAULT));
if ( !IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWICON),FALSE);
@@ -341,7 +341,7 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case PSN_APPLY:
{
COLORREF col = SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_GETCOLOUR,0,0);
- DBWriteContactSettingDword(NULL,"CLUI","SBarBKColor",col);
+ db_set_dw(NULL,"CLUI","SBarBKColor",col);
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)));
diff --git a/plugins/Clist_mw/src/cluiservices.cpp b/plugins/Clist_mw/src/cluiservices.cpp index d57ae77741..095576878c 100644 --- a/plugins/Clist_mw/src/cluiservices.cpp +++ b/plugins/Clist_mw/src/cluiservices.cpp @@ -53,7 +53,7 @@ void CluiProtocolStatusChanged(int parStatus, const char* szProto) if ( pcli->hwndStatus == 0 )
return;
- FirstIconOffset = DBGetContactSettingDword(NULL,"CLUI","FirstIconOffset",0);
+ FirstIconOffset = db_get_dw(NULL,"CLUI","FirstIconOffset",0);
ProtoEnumAccounts( &protoCount, &accs );
if ( protoCount == 0 )
@@ -65,7 +65,7 @@ void CluiProtocolStatusChanged(int parStatus, const char* szProto) SendMessage(pcli->hwndStatus,SB_GETBORDERS,0,(LPARAM)&borders);
- SendMessage(pcli->hwndStatus,SB_SETBKCOLOR,0,DBGetContactSettingDword(0,"CLUI","SBarBKColor",CLR_DEFAULT));
+ SendMessage(pcli->hwndStatus,SB_SETBKCOLOR,0,db_get_dw(0,"CLUI","SBarBKColor",CLR_DEFAULT));
partWidths = (int*)alloca((protoCount+1)*sizeof(int));
//partWidths[0] = FirstIconOffset;
if ( db_get_b(NULL,"CLUI","UseOwnerDrawStatusBar",0)||db_get_b(NULL,"CLUI","EqualSections",1))
@@ -105,8 +105,8 @@ void CluiProtocolStatusChanged(int parStatus, const char* szProto) HDC hdc;
SIZE textSize;
BYTE showOpts = db_get_b(NULL,"CLUI","SBarShow",5);
- DWORD extraspace = DBGetContactSettingDword(NULL,"StatusBar","BkExtraSpace",0);
- DWORD startoffset = DBGetContactSettingDword(NULL,"StatusBar","FirstIconOffset",0);
+ DWORD extraspace = db_get_dw(NULL,"StatusBar","BkExtraSpace",0);
+ DWORD startoffset = db_get_dw(NULL,"StatusBar","FirstIconOffset",0);
int x;
hdc = GetDC(pcli->hwndStatus);
diff --git a/plugins/Clist_mw/src/commonheaders.h b/plugins/Clist_mw/src/commonheaders.h index 4faf052f07..8b4c9181de 100644 --- a/plugins/Clist_mw/src/commonheaders.h +++ b/plugins/Clist_mw/src/commonheaders.h @@ -63,7 +63,7 @@ extern HINSTANCE g_hInst; all the bad free()'s to good ones, however it's still incorrect code. The reasons for not
changing them include:
- * DBFreeVariant has a CallService() lookup
+ * db_free has a CallService() lookup
* free() is executed in some large loops to do with clist creation of group data
* easy search and replace
diff --git a/plugins/Clist_mw/src/contact.cpp b/plugins/Clist_mw/src/contact.cpp index e6c4f31805..bd2ad97052 100644 --- a/plugins/Clist_mw/src/contact.cpp +++ b/plugins/Clist_mw/src/contact.cpp @@ -178,7 +178,7 @@ INT_PTR ContactChangeGroup(WPARAM wParam,LPARAM lParam) {
CallService(MS_CLUI_CONTACTDELETED,wParam,0);
if ((HANDLE)lParam == NULL)
- DBDeleteContactSetting((HANDLE)wParam,"CList","Group");
+ db_unset((HANDLE)wParam,"CList","Group");
else
db_set_s((HANDLE)wParam,"CList","Group",(char*)CallService(MS_CLIST_GROUPGETNAME2,lParam,(LPARAM)(int*)NULL));
diff --git a/plugins/Clist_nicer/skineditor/src/main.cpp b/plugins/Clist_nicer/skineditor/src/main.cpp index 465071f7f5..e4a31f61df 100644 --- a/plugins/Clist_nicer/skineditor/src/main.cpp +++ b/plugins/Clist_nicer/skineditor/src/main.cpp @@ -688,8 +688,8 @@ static INT_PTR CALLBACK SkinEdit_ExtBkDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa SendDlgItemMessage(hwndDlg, IDC_BORDERTYPE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Bumped"));
SendDlgItemMessage(hwndDlg, IDC_BORDERTYPE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Etched"));
- SendDlgItemMessage(hwndDlg, IDC_3DDARKCOLOR, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, "CLCExt", "3ddark", RGB(224,224,224)));
- SendDlgItemMessage(hwndDlg, IDC_3DLIGHTCOLOR, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, "CLCExt", "3dbright", RGB(224,224,224)));
+ SendDlgItemMessage(hwndDlg, IDC_3DDARKCOLOR, CPM_SETCOLOUR, 0, db_get_dw(NULL, "CLCExt", "3ddark", RGB(224,224,224)));
+ SendDlgItemMessage(hwndDlg, IDC_3DLIGHTCOLOR, CPM_SETCOLOUR, 0, db_get_dw(NULL, "CLCExt", "3dbright", RGB(224,224,224)));
return 0;
case WM_DRAWITEM:
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp index c63cd319d7..0eb0752233 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp @@ -2477,7 +2477,7 @@ int OnFrameTitleBarBackgroundChange() hBmpBackground = NULL;
}
if (cfg::getByte("FrameTitleBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
- if ( !DBGetContactSetting(NULL, "FrameTitleBar", "BkBitmap", &dbv)) {
+ if ( !db_get(NULL, "FrameTitleBar", "BkBitmap", &dbv)) {
hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
mir_free(dbv.pszVal);
}
diff --git a/plugins/Clist_nicer/src/Include/commonheaders.h b/plugins/Clist_nicer/src/Include/commonheaders.h index d92f07724b..a094b29235 100644 --- a/plugins/Clist_nicer/src/Include/commonheaders.h +++ b/plugins/Clist_nicer/src/Include/commonheaders.h @@ -183,7 +183,7 @@ extern ImageItem *g_glyphItem; all the bad free()'s to good ones, however it's still incorrect code. The reasons for not
changing them include:
- * DBFreeVariant has a CallService() lookup
+ * db_free has a CallService() lookup
* free() is executed in some large loops to do with clist creation of group data
* easy search and replace
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 757fa029f0..6f49e7c97c 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -248,7 +248,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) szProto = GetContactProto(hContact);
if (szProto) {
if ( !result )
- DBFreeVariant( &dbv );
+ db_free( &dbv );
if ( !( result = cfg::getTString(hContact, szProto, "YMsg", &dbv)) && lstrlen(dbv.ptszVal) > 1)
p->bStatusMsgValid = STATUSMSG_YIM;
else if ( !(result = cfg::getTString(hContact, szProto, "StatusDescr", &dbv)) && lstrlen(dbv.ptszVal) > 1)
@@ -260,7 +260,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) if (p->bStatusMsgValid == STATUSMSG_NOTFOUND) { // no status msg, consider xstatus name (if available)
if ( !result )
- DBFreeVariant( &dbv );
+ db_free( &dbv );
result = cfg::getTString(hContact, szProto, "XStatusName", &dbv);
if ( !result && lstrlen(dbv.ptszVal) > 1) {
int iLen = lstrlen(dbv.ptszVal);
@@ -306,7 +306,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) p->statusMsg[j] = (TCHAR)0;
}
if ( !result )
- DBFreeVariant( &dbv );
+ db_free( &dbv );
if (p->bStatusMsgValid != STATUSMSG_NOTFOUND) {
WORD infoTypeC2[12];
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 49f569fd6c..5f249c17df 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -736,7 +736,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if ( PathToAbsoluteT(dbv.ptszVal, szPath))
SetDlgItemText(hwndDlg, IDC_FILENAME, szPath);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
WORD bmpUse = cfg::getWord("CLC", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
@@ -817,7 +817,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, COLORREF col;
col = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR, 0, 0);
if (col == CLCDEFAULT_BKCOLOUR)
- DBDeleteContactSetting(NULL, "CLC", "BkColour");
+ db_unset(NULL, "CLC", "BkColour");
else
cfg::writeDword("CLC", "BkColour", col);
cfg::writeByte("CLC", "UseWinColours", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR));
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index a9706be4c1..22f4e4ea75 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -251,12 +251,12 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA if ((iSel = SendDlgItemMessage(hWnd, IDC_SECONDLINEMODE, CB_GETCURSEL, 0, 0)) != CB_ERR) {
if (iSel == 0) {
- DBDeleteContactSetting(hContact, "CList", "CLN_2ndline");
+ db_unset(hContact, "CList", "CLN_2ndline");
if (contact)
contact->bSecondLine = cfg::dat.dualRowMode;
}
else {
- DBWriteContactSettingByte(hContact, "CList", "CLN_2ndline", (BYTE)(iSel - 1));
+ db_set_b(hContact, "CList", "CLN_2ndline", (BYTE)(iSel - 1));
if (contact)
contact->bSecondLine = (BYTE)(iSel - 1);
}
@@ -332,7 +332,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA else if (IsDlgButtonChecked(hWnd, IDC_IGN_ALWAYSOFFLINE))
wApparentMode = ID_STATUS_OFFLINE;
- //DBWriteContactSettingWord(hContact, contact->proto, "ApparentMode", wApparentMode);
+ //db_set_w(hContact, contact->proto, "ApparentMode", wApparentMode);
//if (oldApparentMode != wApparentMode)
CallContactService(hContact, PSS_SETAPPARENTMODE, (WPARAM)wApparentMode, 0);
SendMessage(hWnd, WM_USER + 120, 0, 0);
diff --git a/plugins/Clist_nicer/src/clistmod.cpp b/plugins/Clist_nicer/src/clistmod.cpp index e5e5ae8baf..ae022a4a7f 100644 --- a/plugins/Clist_nicer/src/clistmod.cpp +++ b/plugins/Clist_nicer/src/clistmod.cpp @@ -183,7 +183,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) clip = 5;
else
clip = 0;
- //clip = max(clip, DBGetContactSettingByte(NULL, "CLUI", "ignoreframepixels", 2));
+ //clip = max(clip, db_get_b(NULL, "CLUI", "ignoreframepixels", 2));
//rgn = CreateRoundRectRgn(rc.left + clip, rc.top + clip, rc.right - clip, rc.bottom - clip, 10 + clip, 10 + clip);
//rgn = CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom);
//for (i = rc.top + 3 + clip; i < rc.bottom - 3 - clip; i += (height / iStepY)) {
diff --git a/plugins/Clist_nicer/src/clistopts.cpp b/plugins/Clist_nicer/src/clistopts.cpp index a8210472bd..666b9b2ab8 100644 --- a/plugins/Clist_nicer/src/clistopts.cpp +++ b/plugins/Clist_nicer/src/clistopts.cpp @@ -106,7 +106,7 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP DBVARIANT dbv = {
DBVT_DELETED
};
- DBGetContactSetting(NULL, "CList", "PrimaryStatus", &dbv);
+ db_get(NULL, "CList", "PrimaryStatus", &dbv);
ProtoEnumAccounts( &count, &accs );
item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM) TranslateT("Global"));
SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETITEMDATA, item, (LPARAM) 0);
@@ -191,7 +191,7 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int cursel = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0);
PROTOACCOUNT* pa = (PROTOACCOUNT*)SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETITEMDATA, cursel, 0);
if ( !pa )
- DBDeleteContactSetting(NULL, "CList", "PrimaryStatus");
+ db_unset(NULL, "CList", "PrimaryStatus");
else
cfg::writeString(NULL, "CList", "PrimaryStatus", pa->szModuleName );
}
diff --git a/plugins/Clist_nicer/src/clisttray.cpp b/plugins/Clist_nicer/src/clisttray.cpp index 24edcfe047..9430ed1f56 100644 --- a/plugins/Clist_nicer/src/clisttray.cpp +++ b/plugins/Clist_nicer/src/clisttray.cpp @@ -108,7 +108,7 @@ void TrayIconUpdateBase(const char *szChangedProto) changed = pcli->pfnTrayIconSetBaseInfo(CopyIcon(hIcon), NULL);
else
changed = pcli->pfnTrayIconSetBaseInfo(ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL), NULL);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
break;
}
case SETTING_TRAYICON_CYCLE:
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index c4aa28a52e..843e27cccc 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -177,7 +177,7 @@ static HWND PreCreateCLC(HWND parent) WS_CHILD | CLS_CONTACTLIST
| (cfg::getByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0)
| CLS_HIDEOFFLINE
- //|(DBGetContactSettingByte(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CLS_HIDEOFFLINE:0)
+ //|(db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CLS_HIDEOFFLINE:0)
| (cfg::getByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? CLS_HIDEEMPTYGROUPS : 0)
| CLS_MULTICOLUMN
, 0, 0, 0, 0, parent, NULL, g_hInst, (LPVOID)0xff00ff00);
@@ -451,7 +451,7 @@ void SetDBButtonStates(HANDLE hPassedContact) if ( !cfg::getString(hFinalContact, szModule, szSetting, &dbv)) {
result = !strcmp((char *)buttonItem->bValuePush, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
} else {
switch (buttonItem->type) {
@@ -884,12 +884,12 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l if (cfg::getByte("CList", "AutoApplyLastViewMode", 0)) {
DBVARIANT dbv = {0};
- if ( !DBGetContactSetting(NULL, "CList", "LastViewMode", &dbv)) {
+ if ( !db_get(NULL, "CList", "LastViewMode", &dbv)) {
if (lstrlenA(dbv.pszVal) > 2) {
if (cfg::getDword(NULL, CLVM_MODULE, dbv.pszVal, -1) != 0xffffffff)
ApplyViewMode((char *)dbv.pszVal);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
if ( !cfg::dat.autosize)
@@ -1427,7 +1427,7 @@ skipbg: if (fDelete) {
//_DebugTraceA("delete value: %s, %s ON %d", szModule, szSetting, finalhContact);
- DBDeleteContactSetting(finalhContact, szModule, szSetting);
+ db_unset(finalhContact, szModule, szSetting);
} else {
switch (item->type) {
case DBVT_BYTE:
diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp index 15ad632d14..c2b5ced4d0 100644 --- a/plugins/Clist_nicer/src/cluiopts.cpp +++ b/plugins/Clist_nicer/src/cluiopts.cpp @@ -94,7 +94,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l DBVARIANT dbv;
if ( !cfg::getTString(NULL, "CList", "TitleText", &dbv)) {
SetDlgItemText(hwndDlg, IDC_TITLETEXT, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else
SetDlgItemTextA(hwndDlg, IDC_TITLETEXT, MIRANDANAME);
}
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index b21bc4d392..8e373e9138 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -204,7 +204,7 @@ void CluiProtocolStatusChanged( int parStatus, const char* szProto ) }
// update the clui button
- if ( !DBGetContactSetting(NULL, "CList", "PrimaryStatus", &dbv)) {
+ if ( !db_get(NULL, "CList", "PrimaryStatus", &dbv)) {
if (dbv.type == DBVT_ASCIIZ && lstrlenA(dbv.pszVal) > 1) {
wStatus = (WORD) CallProtoService(dbv.pszVal, PS_GETSTATUS, 0, 0);
iIcon = IconFromStatusMode(dbv.pszVal, (int) wStatus, 0, &hIcon);
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index e224682e70..c6b85f5468 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -84,7 +84,7 @@ void cfg::init() DWORD cfg::getDword(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD uDefault = 0)
{
- return((DWORD)DBGetContactSettingDword(hContact, szModule, szSetting, uDefault));
+ return((DWORD)db_get_dw(hContact, szModule, szSetting, uDefault));
}
/*
@@ -93,7 +93,7 @@ DWORD cfg::getDword(const HANDLE hContact = 0, const char *szModule = 0, const c DWORD cfg::getDword(const char *szSetting = 0, DWORD uDefault = 0)
{
- return((DWORD)DBGetContactSettingDword(0, DEFAULT_MODULE, szSetting, uDefault));
+ return((DWORD)db_get_dw(0, DEFAULT_MODULE, szSetting, uDefault));
}
/*
@@ -102,13 +102,13 @@ DWORD cfg::getDword(const char *szSetting = 0, DWORD uDefault = 0) DWORD cfg::getDword(const char *szModule, const char *szSetting, DWORD uDefault)
{
- return((DWORD)DBGetContactSettingDword(0, szModule, szSetting, uDefault));
+ return((DWORD)db_get_dw(0, szModule, szSetting, uDefault));
}
WORD cfg::getWord(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, WORD uDefault = 0)
{
- return((WORD)DBGetContactSettingWord(hContact, szModule, szSetting, uDefault));
+ return((WORD)db_get_w(hContact, szModule, szSetting, uDefault));
}
/*
@@ -117,7 +117,7 @@ WORD cfg::getWord(const HANDLE hContact = 0, const char *szModule = 0, const cha WORD cfg::getWord(const char *szSetting = 0, WORD uDefault = 0)
{
- return((WORD)DBGetContactSettingWord(0, DEFAULT_MODULE, szSetting, uDefault));
+ return((WORD)db_get_w(0, DEFAULT_MODULE, szSetting, uDefault));
}
/*
@@ -126,7 +126,7 @@ WORD cfg::getWord(const char *szSetting = 0, WORD uDefault = 0) WORD cfg::getWord(const char *szModule, const char *szSetting, WORD uDefault)
{
- return((WORD)DBGetContactSettingWord(0, szModule, szSetting, uDefault));
+ return((WORD)db_get_w(0, szModule, szSetting, uDefault));
}
/*
@@ -134,27 +134,27 @@ WORD cfg::getWord(const char *szModule, const char *szSetting, WORD uDefault) */
int cfg::getByte(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, int uDefault = 0)
{
- return(DBGetContactSettingByte(hContact, szModule, szSetting, uDefault));
+ return(db_get_b(hContact, szModule, szSetting, uDefault));
}
int cfg::getByte(const char *szSetting = 0, int uDefault = 0)
{
- return(DBGetContactSettingByte(0, DEFAULT_MODULE, szSetting, uDefault));
+ return(db_get_b(0, DEFAULT_MODULE, szSetting, uDefault));
}
int cfg::getByte(const char *szModule, const char *szSetting, int uDefault)
{
- return(DBGetContactSettingByte(0, szModule, szSetting, uDefault));
+ return(db_get_b(0, szModule, szSetting, uDefault));
}
INT_PTR cfg::getTString(const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
{
- return(DBGetContactSettingTString(hContact, szModule, szSetting, dbv));
+ return(db_get_ts(hContact, szModule, szSetting, dbv));
}
INT_PTR cfg::getString(const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
{
- return(DBGetContactSettingString(hContact, szModule, szSetting, dbv));
+ return(db_get_s(hContact, szModule, szSetting, dbv));
}
/*
@@ -163,42 +163,42 @@ INT_PTR cfg::getString(const HANDLE hContact, const char *szModule, const char * INT_PTR cfg::writeDword(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD value = 0)
{
- return(DBWriteContactSettingDword(hContact, szModule, szSetting, value));
+ return(db_set_dw(hContact, szModule, szSetting, value));
}
INT_PTR cfg::writeDword(const char *szModule = 0, const char *szSetting = 0, DWORD value = 0)
{
- return(DBWriteContactSettingDword(0, szModule, szSetting, value));
+ return(db_set_dw(0, szModule, szSetting, value));
}
INT_PTR cfg::writeWord(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, WORD value = 0)
{
- return(DBWriteContactSettingWord(hContact, szModule, szSetting, value));
+ return(db_set_w(hContact, szModule, szSetting, value));
}
INT_PTR cfg::writeWord(const char *szModule = 0, const char *szSetting = 0, WORD value = 0)
{
- return(DBWriteContactSettingWord(0, szModule, szSetting, value));
+ return(db_set_w(0, szModule, szSetting, value));
}
INT_PTR cfg::writeByte(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, BYTE value = 0)
{
- return(DBWriteContactSettingByte(hContact, szModule, szSetting, value));
+ return(db_set_b(hContact, szModule, szSetting, value));
}
INT_PTR cfg::writeByte(const char *szModule = 0, const char *szSetting = 0, BYTE value = 0)
{
- return(DBWriteContactSettingByte(0, szModule, szSetting, value));
+ return(db_set_b(0, szModule, szSetting, value));
}
INT_PTR cfg::writeTString(const HANDLE hContact, const char *szModule = 0, const char *szSetting = 0, const TCHAR *str = 0)
{
- return(DBWriteContactSettingTString(hContact, szModule, szSetting, str));
+ return(db_set_ts(hContact, szModule, szSetting, str));
}
INT_PTR cfg::writeString(const HANDLE hContact, const char *szModule = 0, const char *szSetting = 0, const char *str = 0)
{
- return(DBWriteContactSettingString(hContact, szModule, szSetting, str));
+ return(db_set_s(hContact, szModule, szSetting, str));
}
TExtraCache* cfg::getCache(const HANDLE hContact, const char *szProto)
@@ -211,7 +211,7 @@ TExtraCache* cfg::getCache(const HANDLE hContact, const char *szProto) TExtraCache *p = (TExtraCache*)calloc(sizeof(TExtraCache), 1);
p->hContact = hContact;
LoadSkinItemToCache(p, szProto);
- p->dwDFlags = DBGetContactSettingDword(hContact, "CList", "CLN_Flags", 0);
+ p->dwDFlags = db_get_dw(hContact, "CList", "CLN_Flags", 0);
GetCachedStatusMsg(p, const_cast<char *>(szProto));
p->dwLastMsgTime = INTSORT_GetLastMsgTime(hContact);
cfg::arCache.insert(p);
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index b6f3de75a3..b96be53a52 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -158,9 +158,9 @@ void LoadContactTree(void) pcli->pfnChangeContactIcon(hContact, IconFromStatusMode(GetContactProto(hContact), status, hContact, NULL), 1);
if (mc_disablehgh && !mc_hgh_removed) {
- if ( !DBGetContactSetting(hContact, "CList", "Group", &dbv)) {
+ if ( !db_get(hContact, "CList", "Group", &dbv)) {
if ( !strcmp(dbv.pszVal, "MetaContacts Hidden Group"))
- DBDeleteContactSetting(hContact, "CList", "Group");
+ db_unset(hContact, "CList", "Group");
mir_free(dbv.pszVal);
}
}
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 771e36bba0..a41f0f5ff6 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -522,7 +522,7 @@ void extbk_export(char *file) if ( !cfg::getString(NULL, "CLC", "BkBitmap", &dbv)) {
WritePrivateProfileStringA("Global", "BkBitmap", dbv.pszVal, file);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -1177,7 +1177,7 @@ void IMG_LoadItems() WideCharToMultiByte(CP_ACP, 0, tszFileName, MAX_PATH, szFileName, MAX_PATH, 0, 0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if ( !PathFileExists(tszFileName))
return;
@@ -1273,14 +1273,14 @@ void LoadPerContactSkins(TCHAR *tszFileName) if ((INT_PTR) uid != CALLSERVICE_NOTFOUND && uid != NULL) {
DBVARIANT dbv = {0};
- DBGetContactSetting(hContact, szProto, uid, &dbv);
+ db_get(hContact, szProto, uid, &dbv);
switch(dbv.type) {
case DBVT_DWORD:
mir_snprintf(UIN, 40, "%d", dbv.dVal);
break;
case DBVT_ASCIIZ:
mir_snprintf(UIN, 40, "%s", dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
break;
default:
UIN[0] = 0;
@@ -1451,7 +1451,7 @@ static void ApplyCLUISkin() SetWindowPos(pcli->hwndContactList, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -1484,7 +1484,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L if ( !cfg::getString(NULL, "CLC", "ContactSkins", &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_SKINFILE, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
Utils::enableDlgControl(hwndDlg, IDC_RELOAD, TRUE);
}
else
@@ -1492,7 +1492,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L CheckDlgButton(hwndDlg, IDC_USESKIN, cfg::getByte("CLUI", "useskin", 0) ? BST_CHECKED : BST_UNCHECKED);
if ( !cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
SetDlgItemText(hwndDlg, IDC_SKINFILENAME, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
SetDlgItemText(hwndDlg, IDC_SKINFILENAME, _T(""));
@@ -1537,7 +1537,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L if ( !cfg::getTString(NULL, "CLC", "AdvancedSkin", &dbv)) {
if (_tcscmp(dbv.ptszVal, final_path))
skinChanged = TRUE;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
skinChanged = TRUE;
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 2e6809b847..d574c00e11 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -223,7 +223,7 @@ static int FillDialog(HWND hwnd) item.pszText = &dbv.ptszVal[1];
newItem = SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);
ListView_Arrange(hwndList, LVA_ALIGNLEFT | LVA_ALIGNTOP);
@@ -484,7 +484,7 @@ void UpdateFilters() mir_snprintf(szTemp, 100, Translate("Current view mode: %s"), g_szModename);
SetDlgItemTextA(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
mir_snprintf(szSetting, 128, "%c%s_PF", 246, szBuf);
- if (DBGetContactSetting(NULL, CLVM_MODULE, szSetting, &dbv_pf))
+ if (db_get(NULL, CLVM_MODULE, szSetting, &dbv_pf))
goto cleanup;
mir_snprintf(szSetting, 128, "%c%s_GF", 246, szBuf);
if (cfg::getTString(NULL, CLVM_MODULE, szSetting, &dbv_gf))
@@ -580,8 +580,8 @@ void UpdateFilters() ShowPage(clvmHwnd, 0);
cleanup:
- DBFreeVariant(&dbv_pf);
- DBFreeVariant(&dbv_gf);
+ db_free(&dbv_pf);
+ db_free(&dbv_gf);
free(szBuf);
}
@@ -685,16 +685,16 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessageA(hwndDlg, IDC_VIEWMODES, LB_GETTEXT, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), (LPARAM)szBuf);
mir_snprintf(szSetting, 256, "%c%s_PF", 246, szBuf);
- DBDeleteContactSetting(NULL, CLVM_MODULE, szSetting);
+ db_unset(NULL, CLVM_MODULE, szSetting);
mir_snprintf(szSetting, 256, "%c%s_GF", 246, szBuf);
- DBDeleteContactSetting(NULL, CLVM_MODULE, szSetting);
+ db_unset(NULL, CLVM_MODULE, szSetting);
mir_snprintf(szSetting, 256, "%c%s_SM", 246, szBuf);
- DBDeleteContactSetting(NULL, CLVM_MODULE, szSetting);
+ db_unset(NULL, CLVM_MODULE, szSetting);
mir_snprintf(szSetting, 256, "%c%s_VA", 246, szBuf);
- DBDeleteContactSetting(NULL, CLVM_MODULE, szSetting);
+ db_unset(NULL, CLVM_MODULE, szSetting);
mir_snprintf(szSetting, 256, "%c%s_SSM", 246, szBuf);
- DBDeleteContactSetting(NULL, CLVM_MODULE, szSetting);
- DBDeleteContactSetting(NULL, CLVM_MODULE, szBuf);
+ db_unset(NULL, CLVM_MODULE, szSetting);
+ db_unset(NULL, CLVM_MODULE, szBuf);
if ( !strcmp(cfg::dat.current_viewmode, szBuf) && lstrlenA(szBuf) == lstrlenA(cfg::dat.current_viewmode)) {
cfg::dat.bFilterEffective = 0;
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 13a73e109f..12d3dc78b7 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -804,7 +804,7 @@ void HandleSoundsCommand(PCommand command, TArgument *argv, int argc, PReply rep case STATE_ON:
{
failure = 0;
- DBWriteContactSettingByte(NULL, "Skin", "UseSound", 1);
+ db_set_b(NULL, "Skin", "UseSound", 1);
state = TRUE;
break;
@@ -813,7 +813,7 @@ void HandleSoundsCommand(PCommand command, TArgument *argv, int argc, PReply rep case STATE_OFF:
{
failure = 0;
- DBWriteContactSettingByte(NULL, "Skin", "UseSound", 0);
+ db_set_b(NULL, "Skin", "UseSound", 0);
state = FALSE;
break;
@@ -821,11 +821,11 @@ void HandleSoundsCommand(PCommand command, TArgument *argv, int argc, PReply rep case STATE_TOGGLE:
{
- state = DBGetContactSettingByte(NULL, "Skin", "UseSound", 1);
+ state = db_get_b(NULL, "Skin", "UseSound", 1);
failure = 0;
state = 1 - state;
- DBWriteContactSettingByte(NULL, "Skin", "UseSound", state);
+ db_set_b(NULL, "Skin", "UseSound", state);
break;
}
@@ -1302,7 +1302,7 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r char *module = argv[3];
char *key = argv[4];
- DBDeleteContactSetting(NULL, module, key);
+ db_unset(NULL, module, key);
reply->code = MIMRES_SUCCESS;
mir_snprintf(reply->message, reply->cMessage, Translate("Setting '%s/%s' deleted."), module, key);
@@ -1330,7 +1330,7 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r {
case VALUE_STRING:
{
- DBWriteContactSettingString(NULL, module, key, (char *) value);
+ db_set_s(NULL, module, key, (char *) value);
wrote = "string";
break;
@@ -1338,7 +1338,7 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r case VALUE_BYTE:
{
- DBWriteContactSettingByte(NULL, module, key, (* (char *) value));
+ db_set_b(NULL, module, key, (* (char *) value));
wrote = "byte";
break;
@@ -1346,7 +1346,7 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r case VALUE_WORD:
{
- DBWriteContactSettingWord(NULL, module, key, (* (WORD *) value));
+ db_set_w(NULL, module, key, (* (WORD *) value));
wrote = "word";
break;
@@ -1354,7 +1354,7 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r case VALUE_DWORD:
{
- DBWriteContactSettingDword(NULL, module, key, (* (DWORD *) value));
+ db_set_dw(NULL, module, key, (* (DWORD *) value));
wrote = "dword";
break;
@@ -1362,7 +1362,7 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r case VALUE_WIDE:
{
- DBWriteContactSettingWString(NULL, module, key, (WCHAR *) value);
+ db_set_ws(NULL, module, key, (WCHAR *) value);
wrote = "wide string";
break;
@@ -1402,7 +1402,7 @@ void HandleDatabaseCommand(PCommand command, TArgument *argv, int argc, PReply r DBVARIANT var = {0};
- int res = DBGetContactSetting(NULL, module, key, &var);
+ int res = db_get(NULL, module, key, &var);
if (!res)
{
char buffer[1024];
@@ -1537,7 +1537,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe {
case 4:
{
- int value = DBGetContactSettingByte(NULL, module, "NLUseProxy", 0);
+ int value = db_get_b(NULL, module, "NLUseProxy", 0);
reply->code = MIMRES_SUCCESS;
mir_snprintf(buffer, sizeof(buffer), "%s proxy status is %s", protocol, (value) ? "enabled" : "disabled");
@@ -1552,7 +1552,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe {
case STATE_OFF:
{
- DBWriteContactSettingByte(NULL, module, "NLUseProxy", 0);
+ db_set_b(NULL, module, "NLUseProxy", 0);
reply->code = MIMRES_SUCCESS;
mir_snprintf(buffer, sizeof(buffer), Translate("'%s' proxy was disabled."), protocol);
@@ -1562,7 +1562,7 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe case STATE_ON:
{
- DBWriteContactSettingByte(NULL, module, "NLUseProxy", 1);
+ db_set_b(NULL, module, "NLUseProxy", 1);
reply->code = MIMRES_SUCCESS;
mir_snprintf(buffer, sizeof(buffer), Translate("'%s' proxy was enabled."), protocol);
@@ -1572,9 +1572,9 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe case STATE_TOGGLE:
{
- int value = DBGetContactSettingByte(NULL, module, "NLUseProxy", 0);
+ int value = db_get_b(NULL, module, "NLUseProxy", 0);
value = 1 - value;
- DBWriteContactSettingByte(NULL, module, "NLUseProxy", value);
+ db_set_b(NULL, module, "NLUseProxy", value);
reply->code = MIMRES_SUCCESS;
mir_snprintf(buffer, sizeof(buffer), (value) ? Translate("'%s' proxy was enabled.") : Translate("'%s' proxy was disabled."));
@@ -1613,8 +1613,8 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe int port;
char type[256];
GetStringFromDatabase(NULL, module, "NLProxyServer", "<unknown>", host, sizeof(host));
- port = DBGetContactSettingWord(NULL, module, "NLProxyPort", 0);
- PrettyProxyType(DBGetContactSettingByte(NULL, module, "NLProxyType", 0), type, sizeof(type));
+ port = db_get_w(NULL, module, "NLProxyPort", 0);
+ PrettyProxyType(db_get_b(NULL, module, "NLProxyType", 0), type, sizeof(type));
reply->code = MIMRES_SUCCESS;
mir_snprintf(buffer, sizeof(buffer), Translate("%s proxy server: %s %s:%d."), protocol, type, host, port);
@@ -1632,9 +1632,9 @@ void HandleProtocolProxyCommand(PCommand command, TArgument *argv, int argc, PRe if ((*stop == 0) && (type > 0))
{
- DBWriteContactSettingString(NULL, module, "NLProxyServer", host);
- DBWriteContactSettingWord(NULL, module, "NLProxyPort", port);
- DBWriteContactSettingByte(NULL, module, "NLProxyType", type);
+ db_set_s(NULL, module, "NLProxyServer", host);
+ db_set_w(NULL, module, "NLProxyPort", port);
+ db_set_b(NULL, module, "NLProxyType", type);
reply->code = MIMRES_SUCCESS;
mir_snprintf(buffer, sizeof(buffer), Translate("%s proxy set to %s %s:%d."), protocol, argv[4], host, port);
@@ -1774,7 +1774,7 @@ int ContactMatchSearch(HANDLE hContact, char *contact, char *id, char *account, char protocol[128];
AccountName2Protocol(account, protocol, sizeof(protocol));
- WORD contactStatus = DBGetContactSettingWord(hContact, protocol, "Status", ID_STATUS_ONLINE);
+ WORD contactStatus = db_get_w(hContact, protocol, "Status", ID_STATUS_ONLINE);
if (searchStatus != contactStatus)
{
diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp index f85fb74e43..626141e68f 100644 --- a/plugins/CmdLine/src/utils.cpp +++ b/plugins/CmdLine/src/utils.cpp @@ -138,7 +138,7 @@ int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, int res = 1;
size_t len;
dbv.type = DBVT_ASCIIZ;
- if (DBGetContactSetting(hContact, szModule, szSettingName, &dbv) == 0)
+ if (db_get(hContact, szModule, szSettingName, &dbv) == 0)
{
res = 0;
size_t tmp = strlen(dbv.pszVal);
@@ -169,7 +169,7 @@ int GetStringFromDatabase(HANDLE hContact, char *szModule, char *szSettingName, int res = 1;
size_t len;
dbv.type = DBVT_WCHAR;
- if (DBGetContactSettingWString(hContact, szModule, szSettingName, &dbv) == 0)
+ if (db_get_ws(hContact, szModule, szSettingName, &dbv) == 0)
{
res = 0;
if (dbv.type != DBVT_WCHAR)
diff --git a/plugins/CommonLibs/CString.cpp b/plugins/CommonLibs/CString.cpp index fb8760dc74..fde5e4dc2a 100644 --- a/plugins/CommonLibs/CString.cpp +++ b/plugins/CommonLibs/CString.cpp @@ -286,7 +286,7 @@ template class TString<char>; template class TString<WCHAR>;
-CString DBGetContactSettingString(HANDLE hContact, const char *szModule, const char *szSetting, const char *szDefaultValue)
+CString db_get_s(HANDLE hContact, const char *szModule, const char *szSetting, const char *szDefaultValue)
{
DBVARIANT dbv = {0};
DBCONTACTGETSETTING dbcgs;
@@ -311,7 +311,7 @@ CString DBGetContactSettingString(HANDLE hContact, const char *szModule, const c -TCString DBGetContactSettingString(HANDLE hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue)
+TCString db_get_s(HANDLE hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue)
{
DBVARIANT dbv = {0};
DBCONTACTGETSETTING dbcgs;
@@ -337,7 +337,7 @@ TCString DBGetContactSettingString(HANDLE hContact, const char *szModule, const -int DBGetContactSettingString(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
+int db_get_s(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
{
return db_get_s(hContact, szModule, szSetting, dbv, DBVT_ASCIIZ);
}
diff --git a/plugins/CommonLibs/CString.h b/plugins/CommonLibs/CString.h index fb956f6e4e..c9a4a9538e 100644 --- a/plugins/CommonLibs/CString.h +++ b/plugins/CommonLibs/CString.h @@ -231,10 +231,10 @@ __inline CHARARRAY WCHAR2UTF8(WCString Str) #endif // CHARARRAY_CONVERT
-#undef DBGetContactSettingString
-CString DBGetContactSettingString(HANDLE hContact, const char *szModule, const char *szSetting, const char *szDefaultValue);
-TCString DBGetContactSettingString(HANDLE hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue);
-int DBGetContactSettingString(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
+#undef db_get_s
+CString db_get_s(HANDLE hContact, const char *szModule, const char *szSetting, const char *szDefaultValue);
+TCString db_get_s(HANDLE hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue);
+int db_get_s(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
TCString DBGetContactSettingAsString(HANDLE hContact, const char *szModule, const char *szSetting, const TCHAR *szDefaultValue); // also converts numeric values to a string
// various string helpers. their return values are valid only while the class is visible
diff --git a/plugins/CommonLibs/Options.cpp b/plugins/CommonLibs/Options.cpp index 4583cae0b5..36226b0f11 100644 --- a/plugins/CommonLibs/Options.cpp +++ b/plugins/CommonLibs/Options.cpp @@ -182,7 +182,7 @@ void COptItem::SetIntDBVal(CString &sModule, int Value, CString *sDBSettingPrefi cws.value.type = nValueSize;
cws.value.dVal = Value;
-// DBWriteContactSettingByte(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_FLAGS + StrID, Value[I].Flags);
+// db_set_b(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_FLAGS + StrID, Value[I].Flags);
//itoa(Value[I].ID, StrID.GetBuffer(64), 10);
//StrID.ReleaseBuffer();
@@ -197,7 +197,7 @@ TCString COptItem::GetStrDBVal(CString &sModule, CString *sDBSettingPrefix) if (sDBSetting != NULL)
{
_ASSERT(GetDefValue());
- return DBGetContactSettingString(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting, *(TCString*)GetDefValue());
+ return db_get_s(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting, *(TCString*)GetDefValue());
}
return *(TCString*)GetDefValue();
}
@@ -206,7 +206,7 @@ void COptItem::SetStrDBVal(CString &sModule, TCString &Str, CString *sDBSettingP {
if (sDBSetting != NULL && !ReadOnly)
{
- DBWriteContactSettingTString(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting, Str);
+ db_set_ts(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting, Str);
}
}
@@ -355,11 +355,11 @@ int TreeReadEnum(const char *szSetting, LPARAM lParam) if (!strncmp(szSetting, TreeReadEnumData->TreeCtrl->sDBSetting + TREEITEM_DBSTR_TITLE, Len) && isdigit(szSetting[Len]))
{
int ID = atol(szSetting + Len);
- short ParentID = (TreeReadEnumData->TreeCtrl->TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL) ? 0 : DBGetContactSettingWord(NULL, *TreeReadEnumData->sModule,
+ short ParentID = (TreeReadEnumData->TreeCtrl->TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL) ? 0 : db_get_w(NULL, *TreeReadEnumData->sModule,
*TreeReadEnumData->sDBSettingPrefix + TreeReadEnumData->TreeCtrl->sDBSetting + TREEITEM_DBSTR_PARENT + (szSetting + Len), -1);
- short Order = DBGetContactSettingWord(NULL, *TreeReadEnumData->sModule,
+ short Order = db_get_w(NULL, *TreeReadEnumData->sModule,
*TreeReadEnumData->sDBSettingPrefix + TreeReadEnumData->TreeCtrl->sDBSetting + TREEITEM_DBSTR_ORDER + (szSetting + Len), -1);
- char Flags = (TreeReadEnumData->TreeCtrl->TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL && !(TreeReadEnumData->TreeCtrl->TreeFlags & TREECTRL_FLAG_HAS_CHECKBOXES)) ? 0 : DBGetContactSettingByte(NULL, *TreeReadEnumData->sModule,
+ char Flags = (TreeReadEnumData->TreeCtrl->TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL && !(TreeReadEnumData->TreeCtrl->TreeFlags & TREECTRL_FLAG_HAS_CHECKBOXES)) ? 0 : db_get_b(NULL, *TreeReadEnumData->sModule,
*TreeReadEnumData->sDBSettingPrefix + TreeReadEnumData->TreeCtrl->sDBSetting + TREEITEM_DBSTR_FLAGS + (szSetting + Len), 0);
if (ParentID >= 0 && Order >= 0)
{
@@ -367,9 +367,9 @@ int TreeReadEnum(const char *szSetting, LPARAM lParam) TreeReadEnumData->TreeCtrl->Value.SetAtGrow(Order).ParentID = ParentID;
TreeReadEnumData->TreeCtrl->Value.SetAtGrow(Order).Flags = Flags;
TreeReadEnumData->TreeCtrl->Value.SetAtGrow(Order).hItem = NULL;
- TreeReadEnumData->TreeCtrl->Value.SetAtGrow(Order).Title = DBGetContactSettingString(NULL, *TreeReadEnumData->sModule, *TreeReadEnumData->sDBSettingPrefix + szSetting, _T(""));
+ TreeReadEnumData->TreeCtrl->Value.SetAtGrow(Order).Title = db_get_s(NULL, *TreeReadEnumData->sModule, *TreeReadEnumData->sDBSettingPrefix + szSetting, _T(""));
TreeReadEnumData->TreeCtrl->Value.SetAtGrow(Order).User_Str1 = (TreeReadEnumData->TreeCtrl->User_Str1_DBName == NULL) ? NULL :
- DBGetContactSettingString(NULL, *TreeReadEnumData->sModule,
+ db_get_s(NULL, *TreeReadEnumData->sModule,
*TreeReadEnumData->sDBSettingPrefix + TreeReadEnumData->TreeCtrl->sDBSetting + TreeReadEnumData->TreeCtrl->User_Str1_DBName + (szSetting + Len), (TCHAR*)NULL);
}
}
@@ -426,20 +426,16 @@ void COptItem_TreeCtrl::MemToDB(CString &sModule, CString *sDBSettingPrefix) CString StrID;
_itoa(Value[I].ID, StrID.GetBuffer(64), 10);
StrID.ReleaseBuffer();
- DBWriteContactSettingTString(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_TITLE + StrID, Value[I].Title);
+ db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_TITLE + StrID, Value[I].Title);
if (!(TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL))
- {
- DBWriteContactSettingWord(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_PARENT + StrID, Value[I].ParentID);
- }
- DBWriteContactSettingWord(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_ORDER + StrID, I);
+ db_set_w(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_PARENT + StrID, Value[I].ParentID);
+
+ db_set_w(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_ORDER + StrID, I);
if (!(TreeFlags & TREECTRL_FLAG_IS_SINGLE_LEVEL) || TreeFlags & TREECTRL_FLAG_HAS_CHECKBOXES)
- {
- DBWriteContactSettingByte(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_FLAGS + StrID, Value[I].Flags);
- }
+ db_set_b(NULL, sModule, *sDBSettingPrefix + sDBSetting + TREEITEM_DBSTR_FLAGS + StrID, Value[I].Flags);
+
if (User_Str1_DBName != NULL && Value[I].User_Str1 != NULL)
- {
- DBWriteContactSettingTString(NULL, sModule, *sDBSettingPrefix + sDBSetting + User_Str1_DBName + StrID, Value[I].User_Str1);
- }
+ db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + User_Str1_DBName + StrID, Value[I].User_Str1);
}
COptItem::MemToDB(sModule, sDBSettingPrefix);
}
@@ -614,7 +610,7 @@ void COptItem_TreeCtrl::CleanDBSettings(CString &sModule, CString *sDBSettingPre int I;
for (I = 0; I < TreeDeleteEnumData.TreeSettings.GetSize(); I++)
{
- DBDeleteContactSetting(NULL, sModule, TreeDeleteEnumData.TreeSettings[I]);
+ db_unset(NULL, sModule, TreeDeleteEnumData.TreeSettings[I]);
}
}
@@ -809,7 +805,7 @@ int ListReadEnum(const char *szSetting, LPARAM lParam) if (!strncmp(szSetting, *ListReadEnumData->sDBSettingPrefix + ListReadEnumData->ListCtrl->sDBSetting + LISTITEM_DBSTR_TEXT, Len) && isdigit(szSetting[Len]))
{
int ID = atol(szSetting + Len);
- ListReadEnumData->ListCtrl->Value.SetAtGrow(ID).Text = DBGetContactSettingString(NULL, *ListReadEnumData->sModule, *ListReadEnumData->sDBSettingPrefix + szSetting, _T(""));
+ ListReadEnumData->ListCtrl->Value.SetAtGrow(ID).Text = db_get_s(NULL, *ListReadEnumData->sModule, *ListReadEnumData->sDBSettingPrefix + szSetting, _T(""));
}
return 0;
}
@@ -864,7 +860,7 @@ void COptItem_ListCtrl::MemToDB(CString &sModule, CString *sDBSettingPrefix) CString StrID;
_itoa(I, StrID.GetBuffer(64), 10);
StrID.ReleaseBuffer();
- DBWriteContactSettingTString(NULL, sModule, *sDBSettingPrefix + sDBSetting + LISTITEM_DBSTR_TEXT + StrID, Value[I].Text);
+ db_set_ts(NULL, sModule, *sDBSettingPrefix + sDBSetting + LISTITEM_DBSTR_TEXT + StrID, Value[I].Text);
}
COptItem::MemToDB(sModule, sDBSettingPrefix);
}
@@ -927,7 +923,7 @@ void COptItem_ListCtrl::CleanDBSettings(CString &sModule, CString *sDBSettingPre int I;
for (I = 0; I < ListDeleteEnumData.ListSettings.GetSize(); I++)
{
- DBDeleteContactSetting(NULL, sModule, ListDeleteEnumData.ListSettings[I]);
+ db_unset(NULL, sModule, ListDeleteEnumData.ListSettings[I]);
}
}
diff --git a/plugins/CommonLibs/Options.h b/plugins/CommonLibs/Options.h index 1b3bb0a284..666162c50a 100644 --- a/plugins/CommonLibs/Options.h +++ b/plugins/CommonLibs/Options.h @@ -43,7 +43,7 @@ public: virtual void MemToWnd(HWND hWnd) {EnableWindow(GetDlgItem(hWnd, DlgItemID), Enabled);}
void DBToMemToWnd(CString &sModule, HWND hWnd, CString *sDBSettingPrefix = NULL) {DBToMem(sModule, sDBSettingPrefix); MemToWnd(hWnd);}
void WndToMemToDB(HWND hWnd, CString &sModule, CString *sDBSettingPrefix = NULL) {WndToMem(hWnd); MemToDB(sModule, sDBSettingPrefix);}
- virtual void CleanDBSettings(CString &sModule, CString *sDBSettingPrefix = NULL) {DBDeleteContactSetting(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting);}; // TODO: also set Value to DefValue?
+ virtual void CleanDBSettings(CString &sModule, CString *sDBSettingPrefix = NULL) {db_unset(NULL, sModule, sDBSettingPrefix ? (*sDBSettingPrefix + sDBSetting) : sDBSetting);}; // TODO: also set Value to DefValue?
virtual void SetValue(int Value) {Modified = true;}
virtual void SetDefValue(int DefValue) {}
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index c53c5039db..50373a214f 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -161,7 +161,7 @@ static void ShowConsole(int show) ScrollDown( pActive );
}
ShowWindow(hwndConsole, (show)?SW_SHOW:SW_HIDE);
- DBWriteContactSettingByte(NULL,"Console","Show",(BYTE)((show)?1:0));
+ db_set_b(NULL,"Console","Show",(BYTE)((show)?1:0));
if (hwnd)
SetForegroundWindow(hwnd);
@@ -1005,14 +1005,14 @@ static int OnFastDump(WPARAM wParam,LPARAM lParam) static void LoadSettings()
{
- gIcons = DBGetContactSettingByte(NULL, "Console", "ShowIcons", 1);
- gSeparator = DBGetContactSettingByte(NULL, "Console", "Separator", 1);
- gSingleMode = DBGetContactSettingByte(NULL, "Console", "SingleMode", 0);
+ gIcons = db_get_b(NULL, "Console", "ShowIcons", 1);
+ gSeparator = db_get_b(NULL, "Console", "Separator", 1);
+ gSingleMode = db_get_b(NULL, "Console", "SingleMode", 0);
- gWrapLen = DBGetContactSettingByte(NULL, "Console", "Wrap", DEFAULT_WRAPLEN);
+ gWrapLen = db_get_b(NULL, "Console", "Wrap", DEFAULT_WRAPLEN);
if ( gWrapLen < MIN_WRAPLEN ) gWrapLen = DEFAULT_WRAPLEN;
- gLimit = DBGetContactSettingDword(NULL, "Console", "Limit", MAX_LIMIT);
+ gLimit = db_get_dw(NULL, "Console", "Limit", MAX_LIMIT);
if (gLimit > MAX_LIMIT) gLimit = MAX_LIMIT;
if (gLimit < MIN_LIMIT) gLimit = MIN_LIMIT;
}
@@ -1029,7 +1029,7 @@ static void SaveSettings(HWND hwndDlg) gWrapLen = len;
SetDlgItemInt(hwndDlg, IDC_WRAP, gWrapLen, FALSE);
- DBWriteContactSettingByte(NULL, "Console", "Wrap", (BYTE)len);
+ db_set_b(NULL, "Console", "Wrap", (BYTE)len);
len = GetDlgItemInt(hwndDlg, IDC_LIMIT, NULL, FALSE);
if (len < MIN_LIMIT )
@@ -1040,13 +1040,13 @@ static void SaveSettings(HWND hwndDlg) gLimit = len;
SetDlgItemInt(hwndDlg, IDC_LIMIT, gLimit, FALSE);
- DBWriteContactSettingDword(NULL, "Console", "Limit", len);
+ db_set_dw(NULL, "Console", "Limit", len);
- DBWriteContactSettingByte(NULL, "Console", "SingleMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SINGLE));
- DBWriteContactSettingByte(NULL, "Console", "Separator", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SEPARATOR));
- DBWriteContactSettingByte(NULL, "Console", "ShowIcons", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWICONS));
+ db_set_b(NULL, "Console", "SingleMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SINGLE));
+ db_set_b(NULL, "Console", "Separator", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SEPARATOR));
+ db_set_b(NULL, "Console", "ShowIcons", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWICONS));
- DBWriteContactSettingByte(NULL, "Console", "ShowAtStart", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_START));
+ db_set_b(NULL, "Console", "ShowAtStart", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_START));
}
@@ -1055,7 +1055,7 @@ static INT_PTR CALLBACK OptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM switch(msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_START, DBGetContactSettingByte(NULL, "Console", "ShowAtStart", 0));
+ CheckDlgButton(hwndDlg, IDC_START, db_get_b(NULL, "Console", "ShowAtStart", 0));
CheckDlgButton(hwndDlg, IDC_SINGLE, gSingleMode);
CheckDlgButton(hwndDlg, IDC_SHOWICONS, gIcons);
CheckDlgButton(hwndDlg, IDC_SEPARATOR, gSeparator);
@@ -1230,7 +1230,7 @@ static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam) OnFontChange(0,0);
OnColourChange(0,0);
- if (DBGetContactSettingByte(NULL,"Console","ShowAtStart",0) || DBGetContactSettingByte(NULL,"Console","Show",1))
+ if (db_get_b(NULL,"Console","ShowAtStart",0) || db_get_b(NULL,"Console","Show",1))
ShowConsole(1);
else
ShowConsole(0);
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index 32534bea8f..2406d660e6 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -34,7 +34,7 @@ HANDLE ghSendWindowList; HANDLE ghRecvWindowList;
gAckList gaAckData;
-HANDLE hContactMenuItem = NULL;
+HGENMENU hContactMenuItem;
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -122,7 +122,7 @@ static bool CheckContactsServiceSupport(const char* szProto) static int HookPreBuildContactMenu(WPARAM wParam, LPARAM lParam)
{
HANDLE hContact = (HANDLE)wParam;
- char* szProto =GetContactProto(hContact);
+ char *szProto = GetContactProto(hContact);
int bVisible = FALSE;
if (szProto && CheckContactsServiceSupport(szProto)) {
@@ -133,13 +133,7 @@ static int HookPreBuildContactMenu(WPARAM wParam, LPARAM lParam) }
// update contact menu item's visibility
- CLISTMENUITEM mi = { sizeof(mi) };
- if (bVisible)
- mi.flags = CMIM_FLAGS;
- else
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuItem, (LPARAM)&mi);
+ Menu_ShowItem(hContactMenuItem, bVisible);
return 0;
}
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp index 7b1c876a3e..dbb19d3330 100644 --- a/plugins/ContactsPlus/src/receive.cpp +++ b/plugins/ContactsPlus/src/receive.cpp @@ -95,7 +95,7 @@ static void RebuildGroupCombo(HWND hwndDlg) int bHasGroups = !DBGetContactSettingT(NULL, "CListGroups", "0", &dbv);
HWND hGroupsCombo = GetDlgItem(hwndDlg, IDC_GROUPS);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (bHasGroups)
{
int curs = SendMessageT(hGroupsCombo, CB_GETCURSEL, 0, 0);
diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index 03d9356062..454bd33b2d 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -227,7 +227,7 @@ static void SetAllContactChecks(HWND hwndList, HANDLE hReceiver) // doubtful nam char* szProto =GetContactProto(hReceiver);
if (szProto == NULL) return;
- if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_HIDEEMPTYGROUPS && DBGetContactSettingByte(NULL, "CList", "HideEmptyGroups", SETTING_USEGROUPS_DEFAULT))
+ if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_HIDEEMPTYGROUPS && db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_USEGROUPS_DEFAULT))
SendMessageT(hwndList, CLM_SETHIDEEMPTYGROUPS, (WPARAM) TRUE, 0);
else
SendMessageT(hwndList, CLM_SETHIDEEMPTYGROUPS, (WPARAM) FALSE, 0);
@@ -385,7 +385,7 @@ INT_PTR CALLBACK SendDlgProc( HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar if (!wndData->SendContacts(hwndDlg))
break;
- SetTimer(hwndDlg,TIMERID_MSGSEND,DBGetContactSettingDword(NULL,"SRMsg","MessageTimeout",TIMEOUT_MSGSEND),NULL);
+ SetTimer(hwndDlg,TIMERID_MSGSEND,db_get_dw(NULL,"SRMsg","MessageTimeout",TIMEOUT_MSGSEND),NULL);
break;
}
diff --git a/plugins/ContactsPlus/src/utils.cpp b/plugins/ContactsPlus/src/utils.cpp index 5ff85344b8..78f5fa52e6 100644 --- a/plugins/ContactsPlus/src/utils.cpp +++ b/plugins/ContactsPlus/src/utils.cpp @@ -100,7 +100,7 @@ char *GetContactUID(HANDLE hContact, int bTchar) SAFE_FREE((void**)&szAnsi);
}
}
- DBFreeVariant(&vrUid);
+ db_free(&vrUid);
}
}
if (bTchar)
@@ -120,7 +120,7 @@ int DBGetContactSettingT(HANDLE hContact, const char *szModule, const char* szSe if (ServiceExists(MS_DB_CONTACT_GETSETTING_STR))
return DBGetContactSettingW(hContact, szModule, szSetting, dbv);
else
- return DBGetContactSetting(hContact, szModule, szSetting, dbv);
+ return db_get(hContact, szModule, szSetting, dbv);
}
@@ -129,18 +129,18 @@ TCHAR* DBGetContactSettingStringT(HANDLE hContact, const char *szModule, const c DBVARIANT dbv = {DBVT_DELETED};
TCHAR* szRes;
- if (DBGetContactSettingWString(hContact, szModule, szSetting, &dbv))
+ if (db_get_ws(hContact, szModule, szSetting, &dbv))
return strdupT(szDef);
szRes = strdupT(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return szRes;
}
int DBWriteContactSettingStringT(HANDLE hContact, const char *szModule, const char* szSetting, TCHAR* szValue)
{
- return DBWriteContactSettingWString(hContact, szModule, szSetting, (WCHAR*)szValue);
+ return db_set_ws(hContact, szModule, szSetting, (WCHAR*)szValue);
}
@@ -193,7 +193,7 @@ void UpdateDialogTitle(HWND hwndDlg, HANDLE hContact, char* pszTitleStart) if (strcmpT(uid?uid:contactName, oldTitle))
SetDlgItemTextT(hwndDlg, IDC_NAME, uid?uid:contactName);
- szStatus = MirandaStatusToStringT(szProto==NULL ? ID_STATUS_OFFLINE:DBGetContactSettingWord(hContact,szProto,"Status",ID_STATUS_OFFLINE));
+ szStatus = MirandaStatusToStringT(szProto==NULL ? ID_STATUS_OFFLINE:db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE));
_snprintfT(newtitle, 256, "%s %s (%s)", SRCTranslateT(pszTitleStart, str), contactName, szStatus);
SAFE_FREE((void**)&uid);
@@ -216,7 +216,7 @@ void UpdateDialogTitle(HWND hwndDlg, HANDLE hContact, char* pszTitleStart) void UpdateDialogAddButton(HWND hwndDlg, HANDLE hContact)
{
- int bVisible = DBGetContactSettingByte(hContact,"CList","NotOnList",0);
+ int bVisible = db_get_b(hContact,"CList","NotOnList",0);
ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), bVisible?SW_SHOW:SW_HIDE);
}
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp index 3301c27249..ab109230ce 100644 --- a/plugins/CountryFlags/src/extraimg.cpp +++ b/plugins/CountryFlags/src/extraimg.cpp @@ -35,12 +35,12 @@ static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM lParam) char *pszProto = GetContactProto((HANDLE)wParam);
/* ip detect */
if ( db_get_b(NULL,"Flags","UseIpToCountry",SETTING_USEIPTOCOUNTRY_DEFAULT))
- countryNumber=ServiceIpToCountry(DBGetContactSettingDword((HANDLE)wParam,pszProto,"RealIP",0),0);
+ countryNumber=ServiceIpToCountry(db_get_dw((HANDLE)wParam,pszProto,"RealIP",0),0);
/* fallback */
if (countryNumber == 0xFFFF)
- countryNumber=DBGetContactSettingWord((HANDLE)wParam,pszProto,"Country",0);
+ countryNumber=db_get_w((HANDLE)wParam,pszProto,"Country",0);
if (countryNumber == 0 || countryNumber == 0xFFFF)
- countryNumber=DBGetContactSettingWord((HANDLE)wParam,pszProto,"CompanyCountry",0);
+ countryNumber=db_get_w((HANDLE)wParam,pszProto,"CompanyCountry",0);
return (countryNumber == 0) ? 0xFFFF : countryNumber;
}
@@ -250,14 +250,14 @@ static INT_PTR CALLBACK ExtraImgOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L case WM_NOTIFY:
switch(((NMHDR*)lParam)->code) {
case PSN_APPLY: /* setting change hook will pick these up */
- DBWriteContactSettingByte(NULL,"Flags","UseUnknownFlag",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_USEUNKNOWNFLAG) != 0));
- DBWriteContactSettingByte(NULL,"Flags","UseIpToCountry",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_USEIPTOCOUNTRY) != 0));
+ db_set_b(NULL,"Flags","UseUnknownFlag",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_USEUNKNOWNFLAG) != 0));
+ db_set_b(NULL,"Flags","UseIpToCountry",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_USEIPTOCOUNTRY) != 0));
/* Status Icon */
if (IsWindowEnabled(GetDlgItem(hwndDlg,IDC_CHECK_SHOWSTATUSICONFLAG)))
- DBWriteContactSettingByte(NULL,"Flags","ShowStatusIconFlag",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_SHOWSTATUSICONFLAG) != 0));
+ db_set_b(NULL,"Flags","ShowStatusIconFlag",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_SHOWSTATUSICONFLAG) != 0));
/* Extra Image */
if (IsWindowEnabled(GetDlgItem(hwndDlg,IDC_CHECK_SHOWEXTRAIMGFLAG)))
- DBWriteContactSettingByte(NULL,"Flags","ShowExtraImgFlag",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_SHOWEXTRAIMGFLAG) != 0));
+ db_set_b(NULL,"Flags","ShowExtraImgFlag",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_CHECK_SHOWEXTRAIMGFLAG) != 0));
return TRUE;
}
break;
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp index d01e364ee3..8b58bddd20 100644 --- a/plugins/CrashDumper/src/crshdmp.cpp +++ b/plugins/CrashDumper/src/crshdmp.cpp @@ -328,7 +328,7 @@ static int ModulesLoaded(WPARAM, LPARAM) if (servicemode)
ViewVersionInfo(0, 0);
- else if (DBGetContactSettingByte(NULL, PluginName, "UploadChanged", 0) && !ProcessVIHash(false))
+ else if (db_get_b(NULL, PluginName, "UploadChanged", 0) && !ProcessVIHash(false))
UploadVersionInfo(0, 0xa1);
CheckForOtherCrashReportingPlugins();
@@ -344,9 +344,9 @@ static int PreShutdown(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load(void)
{
- clsdates = DBGetContactSettingByte(NULL, PluginName, "ClassicDates", 1) != 0;
+ clsdates = db_get_b(NULL, PluginName, "ClassicDates", 1) != 0;
- dtsubfldr = DBGetContactSettingByte(NULL, PluginName, "SubFolders", 1) != 0;
+ dtsubfldr = db_get_b(NULL, PluginName, "SubFolders", 1) != 0;
mir_getLP(&pluginInfoEx);
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
diff --git a/plugins/CrashDumper/src/ui.cpp b/plugins/CrashDumper/src/ui.cpp index 21eea4fb13..d7366d24b9 100644 --- a/plugins/CrashDumper/src/ui.cpp +++ b/plugins/CrashDumper/src/ui.cpp @@ -215,18 +215,18 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TranslateDialogDefault(hwndDlg);
DBVARIANT dbv;
- if (DBGetContactSettingString(NULL, PluginName, "Username", &dbv) == 0)
+ if (db_get_s(NULL, PluginName, "Username", &dbv) == 0)
{
SetDlgItemTextA(hwndDlg, IDC_USERNAME, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if (DBGetContactSettingString(NULL, PluginName, "Password", &dbv) == 0)
+ if (db_get_s(NULL, PluginName, "Password", &dbv) == 0)
{
CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal)+1, (LPARAM)dbv.pszVal);
SetDlgItemTextA(hwndDlg, IDC_PASSWORD, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- CheckDlgButton(hwndDlg, IDC_UPLOADCHN, DBGetContactSettingByte(NULL, PluginName, "UploadChanged", 0));
+ CheckDlgButton(hwndDlg, IDC_UPLOADCHN, db_get_b(NULL, PluginName, "UploadChanged", 0));
CheckDlgButton(hwndDlg, IDC_CLASSICDATES, clsdates);
CheckDlgButton(hwndDlg, IDC_DATESUBFOLDER, dtsubfldr);
}
@@ -242,25 +242,25 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP {
char szSetting[100];
GetDlgItemTextA(hwndDlg, IDC_USERNAME, szSetting, SIZEOF(szSetting));
- DBWriteContactSettingString(NULL, PluginName, "Username", szSetting);
+ db_set_s(NULL, PluginName, "Username", szSetting);
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, szSetting, SIZEOF(szSetting));
CallService(MS_DB_CRYPT_ENCODESTRING, SIZEOF(szSetting), (LPARAM)szSetting);
- DBWriteContactSettingString(NULL, PluginName, "Password", szSetting);
+ db_set_s(NULL, PluginName, "Password", szSetting);
- DBWriteContactSettingByte(NULL, PluginName, "UploadChanged",
+ db_set_b(NULL, PluginName, "UploadChanged",
(BYTE)IsDlgButtonChecked(hwndDlg, IDC_UPLOADCHN));
clsdates = IsDlgButtonChecked(hwndDlg, IDC_CLASSICDATES) == BST_CHECKED;
if (clsdates)
- DBWriteContactSettingByte(NULL, PluginName, "ClassicDates", 1);
+ db_set_b(NULL, PluginName, "ClassicDates", 1);
else
- DBDeleteContactSetting(NULL, PluginName, "ClassicDates");
+ db_unset(NULL, PluginName, "ClassicDates");
dtsubfldr = IsDlgButtonChecked(hwndDlg, IDC_DATESUBFOLDER) == BST_CHECKED;
if (dtsubfldr)
- DBWriteContactSettingByte(NULL, PluginName, "SubFolders", 1);
+ db_set_b(NULL, PluginName, "SubFolders", 1);
else
- DBDeleteContactSetting(NULL, PluginName, "SubFolders");
+ db_unset(NULL, PluginName, "SubFolders");
}
break;
}
diff --git a/plugins/CrashDumper/src/upload.cpp b/plugins/CrashDumper/src/upload.cpp index 7b50d9f866..7dd74d65c4 100644 --- a/plugins/CrashDumper/src/upload.cpp +++ b/plugins/CrashDumper/src/upload.cpp @@ -40,15 +40,15 @@ void GetLoginStr(char* user, size_t szuser, char* pass) {
DBVARIANT dbv;
- if (DBGetContactSettingString(NULL, PluginName, "Username", &dbv) == 0)
+ if (db_get_s(NULL, PluginName, "Username", &dbv) == 0)
{
mir_snprintf(user, szuser, "%s", dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
user[0] = 0;
- if (DBGetContactSettingString(NULL, PluginName, "Password", &dbv) == 0)
+ if (db_get_s(NULL, PluginName, "Password", &dbv) == 0)
{
CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal)+1, (LPARAM)dbv.pszVal);
@@ -61,7 +61,7 @@ void GetLoginStr(char* user, size_t szuser, char* pass) arrayToHex(hash, sizeof(hash), pass);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
pass[0] = 0;
@@ -142,7 +142,7 @@ bool InternetDownloadFile(const char *szUrl, VerTrnsfr* szReq) switch(nlhrReply->resultCode)
{
case 200:
- if (DBGetContactSettingByte(NULL, PluginName, "UploadChanged", 0))
+ if (db_get_b(NULL, PluginName, "UploadChanged", 0))
ProcessVIHash(true);
for (i=nlhrReply->headersCount; i--; )
@@ -267,16 +267,16 @@ bool ProcessVIHash(bool store) bool result;
if (store)
{
- DBWriteContactSettingString(NULL, PluginName, "VIHash", hashstr);
+ db_set_s(NULL, PluginName, "VIHash", hashstr);
result = true;
}
else
{
DBVARIANT dbv;
- if (DBGetContactSettingString(NULL, PluginName, "VIHash", &dbv) == 0)
+ if (db_get_s(NULL, PluginName, "VIHash", &dbv) == 0)
{
result = strcmp(hashstr, dbv.pszVal) == 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
result = false;
diff --git a/plugins/CrashDumper/src/utils.cpp b/plugins/CrashDumper/src/utils.cpp index 625ca46ae5..1bb3b770aa 100644 --- a/plugins/CrashDumper/src/utils.cpp +++ b/plugins/CrashDumper/src/utils.cpp @@ -830,6 +830,6 @@ bool IsPluginEnabled(TCHAR* filename) char* fname;
crsi_t2a(fname, filename);
char* ext = strstr(_strlwr(fname), ".dll");
- bool res = ext && ext[4] == '\0' && DBGetContactSettingByte(NULL, "PluginDisable", fname, 0) == 0;
+ bool res = ext && ext[4] == '\0' && db_get_b(NULL, "PluginDisable", fname, 0) == 0;
return res;
}
diff --git a/plugins/Db3x/src/dbintf3x.cpp b/plugins/Db3x/src/dbintf3x.cpp index fcbfc8ce67..5bca636e1a 100644 --- a/plugins/Db3x/src/dbintf3x.cpp +++ b/plugins/Db3x/src/dbintf3x.cpp @@ -47,7 +47,7 @@ DWORD CDb3x::GetSettingsGroupOfsByModuleNameOfs(DBContact *dbc,DWORD ofsContact, DWORD ofsThis;
for ( int i=0; i < SETTINGSGROUPOFSCOUNT; i++)
- if(settingsGroupOfsCache[i].ofsContact == ofsContact && settingsGroupOfsCache[i].ofsModuleName == ofsModuleName)
+ if (settingsGroupOfsCache[i].ofsContact == ofsContact && settingsGroupOfsCache[i].ofsModuleName == ofsModuleName)
return settingsGroupOfsCache[i].ofsSettingsGroup;
ofsThis = dbc->ofsFirstSettings;
@@ -58,7 +58,7 @@ DWORD CDb3x::GetSettingsGroupOfsByModuleNameOfs(DBContact *dbc,DWORD ofsContact, settingsGroupOfsCache[nextSGOCacheEntry].ofsContact = ofsContact;
settingsGroupOfsCache[nextSGOCacheEntry].ofsModuleName = ofsModuleName;
settingsGroupOfsCache[nextSGOCacheEntry].ofsSettingsGroup = ofsThis;
- if(++nextSGOCacheEntry==SETTINGSGROUPOFSCOUNT) nextSGOCacheEntry = 0;
+ if (++nextSGOCacheEntry==SETTINGSGROUPOFSCOUNT) nextSGOCacheEntry = 0;
return ofsThis;
}
ofsThis = dbcs->ofsNext;
diff --git a/plugins/DbEditorPP/src/addeditsettingsdlg.cpp b/plugins/DbEditorPP/src/addeditsettingsdlg.cpp index 968ee92bc0..1c0b10a32d 100644 --- a/plugins/DbEditorPP/src/addeditsettingsdlg.cpp +++ b/plugins/DbEditorPP/src/addeditsettingsdlg.cpp @@ -11,20 +11,20 @@ static BOOL Convert(HANDLE hContact, char* module, char* setting, int value, int if (value > 0xFF)
Result = 0;
else
- DBWriteContactSettingByte(hContact, module, setting, (BYTE)value);
+ db_set_b(hContact, module, setting, (BYTE)value);
break;
case 1:
if (value > 0xFFFF)
Result = 0;
else
- DBWriteContactSettingWord(hContact, module, setting, (WORD)value);
+ db_set_w(hContact, module, setting, (WORD)value);
break;
case 2:
- DBWriteContactSettingDword(hContact, module, setting, (DWORD)value);
+ db_set_dw(hContact, module, setting, (DWORD)value);
break;
case 3:
- DBDeleteContactSetting(hContact, module, setting);
- DBWriteContactSettingString(hContact, module, setting, itoa(value,temp,10));
+ db_unset(hContact, module, setting);
+ db_set_s(hContact, module, setting, itoa(value,temp,10));
break;
}
return Result;
@@ -56,7 +56,7 @@ BOOL convertSetting(HANDLE hContact, char* module, char* setting, int toType) // int len = (int)strlen(dbv.pszVal) + 1;
WCHAR *wc = (WCHAR*)_alloca(len*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, dbv.pszVal, -1, wc, len);
- Result = !DBWriteContactSettingWString(hContact, module, setting, wc);
+ Result = !db_set_ws(hContact, module, setting, wc);
}
else if (strlen(dbv.pszVal) < 11 && toType != 3) {
int val = atoi(dbv.pszVal);
@@ -74,7 +74,7 @@ BOOL convertSetting(HANDLE hContact, char* module, char* setting, int toType) // WCHAR *wc = (WCHAR*)_alloca(len*sizeof(WCHAR));
MultiByteToWideChar(CP_UTF8, 0, dbv.pszVal, -1, wc, len);
WideCharToMultiByte(CP_ACP, 0, wc, -1, sz, len, NULL, NULL);
- Result = !DBWriteContactSettingString(hContact, module, setting, sz);
+ Result = !db_set_s(hContact, module, setting, sz);
}
break;
}
@@ -82,7 +82,7 @@ BOOL convertSetting(HANDLE hContact, char* module, char* setting, int toType) // if (!Result)
msg(Translate("Cannot Convert!"), modFullname);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return Result;
@@ -357,22 +357,22 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l // delete the old setting
if (mir_strcmp(setting, dbsetting->setting) && dbsetting->setting && (dbsetting->setting)[0] != 0)
- DBDeleteContactSetting(dbsetting->hContact, dbsetting->module, dbsetting->setting);
+ db_unset(dbsetting->hContact, dbsetting->module, dbsetting->setting);
// delete the setting if we are saving as a different type
switch (dbsetting->dbv.type)
{
case DBVT_BYTE:
- if (saveAsType(hwnd) != 0) DBDeleteContactSetting(dbsetting->hContact, dbsetting->module, setting);
+ if (saveAsType(hwnd) != 0) db_unset(dbsetting->hContact, dbsetting->module, setting);
break;
case DBVT_WORD:
- if (saveAsType(hwnd) != 1) DBDeleteContactSetting(dbsetting->hContact, dbsetting->module, setting);
+ if (saveAsType(hwnd) != 1) db_unset(dbsetting->hContact, dbsetting->module, setting);
break;
case DBVT_DWORD:
- if (saveAsType(hwnd) != 2) DBDeleteContactSetting(dbsetting->hContact, dbsetting->module, setting);
+ if (saveAsType(hwnd) != 2) db_unset(dbsetting->hContact, dbsetting->module, setting);
break;
//case DBVT_ASCIIZ:
- //DBWriteContactSettingString(dbsetting->hContact, dbsetting->module, setting, value);
+ //db_set_s(dbsetting->hContact, dbsetting->module, setting, value);
//break;
}
// write the setting
@@ -381,25 +381,25 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l case 0:
if (IsDlgButtonChecked(hwnd, CHK_HEX)) sscanf(value, "%x", &settingValue);
else sscanf(value, "%d", &settingValue);
- DBWriteContactSettingByte(dbsetting->hContact, dbsetting->module, setting, (BYTE)settingValue);
+ db_set_b(dbsetting->hContact, dbsetting->module, setting, (BYTE)settingValue);
break;
case 1:
if (IsDlgButtonChecked(hwnd, CHK_HEX)) sscanf(value, "%x", &settingValue);
else sscanf(value, "%d", &settingValue);
- DBWriteContactSettingWord(dbsetting->hContact, dbsetting->module, setting, (WORD)settingValue);
+ db_set_w(dbsetting->hContact, dbsetting->module, setting, (WORD)settingValue);
break;
case 2:
if (IsDlgButtonChecked(hwnd, CHK_HEX)) sscanf(value, "%x", &settingValue);
else sscanf(value, "%d", &settingValue);
- DBWriteContactSettingDword(dbsetting->hContact, dbsetting->module, setting, (DWORD)settingValue);
+ db_set_dw(dbsetting->hContact, dbsetting->module, setting, (DWORD)settingValue);
break;
case 3:
if (dbsetting->dbv.type == DBVT_UTF8)
- DBWriteContactSettingWString(dbsetting->hContact, dbsetting->module, setting, (WCHAR*)value);
+ db_set_ws(dbsetting->hContact, dbsetting->module, setting, (WCHAR*)value);
else if (dbsetting->dbv.type == DBVT_BLOB)
WriteBlobFromString(dbsetting->hContact,dbsetting->module,setting,value,valueLength);
else if (dbsetting->dbv.type == DBVT_ASCIIZ)
- DBWriteContactSettingString(dbsetting->hContact, dbsetting->module, setting, value);
+ db_set_s(dbsetting->hContact, dbsetting->module, setting, value);
break;
}
diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp index 28ee01a696..50077160a8 100644 --- a/plugins/DbEditorPP/src/copymodule.cpp +++ b/plugins/DbEditorPP/src/copymodule.cpp @@ -16,26 +16,26 @@ void copyModule(char* module, HANDLE hContactFrom, HANDLE hContactTo) switch (dbv.type)
{
case DBVT_BYTE:
- DBWriteContactSettingByte(hContactTo, module, setting->name, dbv.bVal);
+ db_set_b(hContactTo, module, setting->name, dbv.bVal);
break;
case DBVT_WORD:
- DBWriteContactSettingWord(hContactTo, module, setting->name, dbv.wVal);
+ db_set_w(hContactTo, module, setting->name, dbv.wVal);
break;
case DBVT_DWORD:
- DBWriteContactSettingDword(hContactTo, module, setting->name, dbv.dVal);
+ db_set_dw(hContactTo, module, setting->name, dbv.dVal);
break;
case DBVT_ASCIIZ:
- DBWriteContactSettingString(hContactTo, module, setting->name, dbv.pszVal);
+ db_set_s(hContactTo, module, setting->name, dbv.pszVal);
break;
case DBVT_UTF8:
- DBWriteContactSettingStringUtf(hContactTo, module, setting->name, dbv.pszVal);
+ db_set_utf(hContactTo, module, setting->name, dbv.pszVal);
break;
case DBVT_BLOB:
DBWriteContactSettingBlob(hContactTo, module, setting->name, dbv.pbVal, dbv.cpbVal);
break;
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
setting = (struct ModSetLinkLinkItem *)setting->next;
}
FreeModuleSettingLL(&msll);
diff --git a/plugins/DbEditorPP/src/deletemodule.cpp b/plugins/DbEditorPP/src/deletemodule.cpp index e55845d7bb..15998e74ad 100644 --- a/plugins/DbEditorPP/src/deletemodule.cpp +++ b/plugins/DbEditorPP/src/deletemodule.cpp @@ -11,14 +11,11 @@ int deleteModule(char* module, HANDLE hContact, int fromMenu) if (!module) return 0;
- if (!fromMenu)
- {
+ if (!fromMenu) {
mir_snprintf(msg, SIZEOF(msg), Translate("Are you sure you want to delete module \"%s\"?"), module);
- if (DBGetContactSettingByte(NULL,modname, "WarnOnDelete",1))
- {
+ if (db_get_b(NULL,modname, "WarnOnDelete",1))
if (MessageBox(0,msg, Translate("Confirm Module Deletion"), MB_YESNO|MB_ICONEXCLAMATION) == IDNO)
return 0;
- }
}
if (!EnumSettings(hContact,module,&settinglist)) return 0;
@@ -26,7 +23,7 @@ int deleteModule(char* module, HANDLE hContact, int fromMenu) setting = settinglist.first;
while (setting)
{
- DBDeleteContactSetting(hContact, module, setting->name);
+ db_unset(hContact, module, setting->name);
setting = (struct ModSetLinkLinkItem *)setting->next;
}
FreeModuleSettingLL(&settinglist);
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp index 5f8006e9ec..4c978e28f2 100644 --- a/plugins/DbEditorPP/src/exportimport.cpp +++ b/plugins/DbEditorPP/src/exportimport.cpp @@ -101,15 +101,15 @@ void exportModule(HANDLE hContact, char* module, FILE* file) {
case DBVT_BYTE:
fprintf(file, "\n%s=b%s", setting->name, itoa(dbv.bVal,tmp,10));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
break;
case DBVT_WORD:
fprintf(file, "\n%s=w%s", setting->name, itoa(dbv.wVal,tmp,10));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
break;
case DBVT_DWORD:
fprintf(file, "\n%s=d%s", setting->name, itoa(dbv.dVal,tmp,10));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
break;
case DBVT_ASCIIZ:
case DBVT_UTF8:
@@ -125,7 +125,7 @@ void exportModule(HANDLE hContact, char* module, FILE* file) fprintf(file, "\n%s=u%s", setting->name, dbv.pszVal);
else
fprintf(file, "\n%s=s%s", setting->name, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
break;
case DBVT_BLOB:
{
@@ -143,7 +143,7 @@ void exportModule(HANDLE hContact, char* module, FILE* file) fprintf(file,"\n%s=n%s",setting->name , data);
mir_free(data);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
break;
}
}
@@ -372,10 +372,10 @@ HANDLE Clist_GroupExists(WCHAR *tszGroup) do {
_itoa(i, str, 10);
- result = DBGetContactSettingTString(0, "CListGroups", str, &dbv);
+ result = db_get_ts(0, "CListGroups", str, &dbv);
if (!result) {
match = (!lstrcmpW(tszGroup, (LPCWSTR)&dbv.ptszVal[1]) && (lstrlenW(tszGroup) == lstrlenW((LPCWSTR)&dbv.ptszVal[1])));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if(match)
return((HANDLE)(i + 1));
}
@@ -501,21 +501,21 @@ void importSettings(HANDLE hContact, char *importstring ) case 'b':
case 'B':
if (sscanf((end+2), "%d", &value) == 1)
- DBWriteContactSettingByte(hContact, module, setting, (BYTE)value);
+ db_set_b(hContact, module, setting, (BYTE)value);
break;
case 'w':
case 'W':
if (sscanf((end+2), "%d", &value) == 1)
- DBWriteContactSettingWord(hContact, module, setting, (WORD)value);
+ db_set_w(hContact, module, setting, (WORD)value);
break;
case 'd':
case 'D':
if (sscanf((end+2), "%d", &value) == 1)
- DBWriteContactSettingDword(hContact, module, setting, (DWORD)value);
+ db_set_dw(hContact, module, setting, (DWORD)value);
break;
case 's':
case 'S':
- DBWriteContactSettingString(hContact,module, setting, (end+2));
+ db_set_s(hContact,module, setting, (end+2));
break;
case 'g':
case 'G':
@@ -532,11 +532,11 @@ void importSettings(HANDLE hContact, char *importstring ) } } }
case 'u':
case 'U':
- DBWriteContactSettingStringUtf(hContact,module, setting, (end+2));
+ db_set_utf(hContact,module, setting, (end+2));
break;
case 'l':
case 'L':
- DBDeleteContactSetting(hContact, module, setting);
+ db_unset(hContact, module, setting);
break;
case 'n':
case 'N':
diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp index e8fd22aa70..08a9a3e5c4 100644 --- a/plugins/DbEditorPP/src/findwindow.cpp +++ b/plugins/DbEditorPP/src/findwindow.cpp @@ -353,7 +353,7 @@ int replaceValue(HWND hwnd, HANDLE hContact, const char *module, const char *set if ((!cws.value.pszVal && !replace[0]) || (cws.value.pszVal && !cws.value.pszVal[0]))
{
ItemFound(hwnd,hContact,module,setting,NULL,FW_SETTINGNAME|FW_DELETED);
- DBDeleteContactSetting(hContact,module,setting);
+ db_unset(hContact,module,setting);
mir_free(myreplace);
return 1;
}
@@ -390,7 +390,7 @@ int replaceSetting(HWND hwnd, HANDLE hContact, const char *module, const char *s if (cws.szSetting[0]==0)
{
ItemFound(hwnd,hContact,module,setting,NULL,FW_SETTINGNAME|FW_DELETED);
- DBDeleteContactSetting(hContact,module,setting);
+ db_unset(hContact,module,setting);
mir_free(myreplace);
return 1;
}
@@ -410,12 +410,12 @@ int replaceSetting(HWND hwnd, HANDLE hContact, const char *module, const char *s if (!CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws))
{
count++;
- DBDeleteContactSetting(hContact,module,setting);
+ db_unset(hContact,module,setting);
ItemFound(hwnd,hContact,module,cws.szSetting,NULL,FW_SETTINGNAME|FW_REPLACED);
}
}
else
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
mir_free(myreplace);
@@ -465,27 +465,27 @@ int replaceModule(HWND hwnd, HANDLE hContact, const char *module, const char *fi switch (dbv.type)
{
case DBVT_BYTE:
- DBWriteContactSettingByte(hContact, newModule, setting->name, dbv.bVal);
+ db_set_b(hContact, newModule, setting->name, dbv.bVal);
break;
case DBVT_WORD:
- DBWriteContactSettingWord(hContact, newModule, setting->name, dbv.wVal);
+ db_set_w(hContact, newModule, setting->name, dbv.wVal);
break;
case DBVT_DWORD:
- DBWriteContactSettingDword(hContact, newModule, setting->name, dbv.dVal);
+ db_set_dw(hContact, newModule, setting->name, dbv.dVal);
break;
case DBVT_ASCIIZ:
- DBWriteContactSettingString(hContact, newModule, setting->name, dbv.pszVal);
+ db_set_s(hContact, newModule, setting->name, dbv.pszVal);
break;
case DBVT_UTF8:
- DBWriteContactSettingStringUtf(hContact, newModule, setting->name, dbv.pszVal);
+ db_set_utf(hContact, newModule, setting->name, dbv.pszVal);
break;
case DBVT_BLOB:
DBWriteContactSettingBlob(hContact, newModule, setting->name, dbv.pbVal, dbv.cpbVal);
break;
}
- DBFreeVariant(&dbv);
- DBDeleteContactSetting(hContact, module, setting->name);
+ db_free(&dbv);
+ db_unset(hContact, module, setting->name);
}
setting = (struct ModSetLinkLinkItem *)setting->next;
@@ -645,7 +645,7 @@ void __cdecl FindSettings(LPVOID di) break;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -659,7 +659,7 @@ void __cdecl FindSettings(LPVOID di) if (!GetSetting(hContact,module->name,setting->name,&dbv))
{
replaceCount += replaceSetting(hwnd, hContact, module->name, setting->name, &dbv, text, replace, mode);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
diff --git a/plugins/DbEditorPP/src/headers.h b/plugins/DbEditorPP/src/headers.h index 2e8688d5b9..3789be8e32 100644 --- a/plugins/DbEditorPP/src/headers.h +++ b/plugins/DbEditorPP/src/headers.h @@ -61,7 +61,7 @@ int AddIconToList(HIMAGELIST hil, HICON hIcon); void AddProtoIconsToList(HIMAGELIST hil, int newshift);
int GetProtoIcon(char *szProto);
extern HANDLE hRestore;
-extern HANDLE hUserMenu;
+extern HGENMENU hUserMenu;
/////////////////////
#ifndef NDEBUG
diff --git a/plugins/DbEditorPP/src/knownmodules.cpp b/plugins/DbEditorPP/src/knownmodules.cpp index 13c4379f6b..4e44aa740c 100644 --- a/plugins/DbEditorPP/src/knownmodules.cpp +++ b/plugins/DbEditorPP/src/knownmodules.cpp @@ -60,7 +60,7 @@ void doOldKnownModulesList() setting = msll.first;
while(setting)
{
- if (!DBGetContactSetting(NULL,"KnownModules",setting->name,&dbv) && dbv.type == DBVT_ASCIIZ)
+ if (!db_get(NULL,"KnownModules",setting->name,&dbv) && dbv.type == DBVT_ASCIIZ)
{
temp = (char*)mir_alloc((strlen(dbv.pszVal)+5)*sizeof(char));
if (!temp) break;
@@ -75,10 +75,10 @@ void doOldKnownModulesList() }
mir_free(temp);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
setting = (struct ModSetLinkLinkItem *)setting->next;
}
FreeModuleSettingLL(&msll);
- UseKnownModList = DBGetContactSettingByte(NULL,modname,"UseKnownModList",0);
+ UseKnownModList = db_get_b(NULL,modname,"UseKnownModList",0);
}
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index 7bc8b290fa..3c36401da3 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -8,9 +8,9 @@ BOOL usePopUps; HWND hwnd2watchedVarsWindow;
int hLangpack;
BYTE nameOrder[NAMEORDERCOUNT];
-HANDLE hUserMenu;
-HANDLE hRestore;
+HGENMENU hUserMenu;
WatchListArrayStruct WatchListArray;
+HANDLE hRestore;
HANDLE sMenuCommand, sRegisterModule, sRegisterSingleModule, sImport, sServicemodeLaunch;
HANDLE hModulesLoadedHook = NULL, hSettingsChangedHook=NULL, hOptInitHook=NULL, hPreShutdownHook=NULL;
@@ -166,7 +166,7 @@ int ModulesLoaded(WPARAM wParam,LPARAM lParam) ZeroMemory(&mi, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.position = 1900000001;
- mi.flags = DBGetContactSettingByte(NULL,modname,"UserMenuItem",0)?0:CMIF_HIDDEN;
+ mi.flags = db_get_b(NULL,modname,"UserMenuItem",0) ? 0 : CMIF_HIDDEN;
mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(ICO_REGUSER));
mi.pszName = LPGEN("Open user tree in DBE++");
mi.pszService = "DBEditorpp/MenuCommand";
@@ -187,10 +187,10 @@ int ModulesLoaded(WPARAM wParam,LPARAM lParam) char mod[64] = "";
TCHAR szModuleFileName[MAX_PATH];
int i=0, len;
- if (!DBGetContactSetting(NULL,modname,"CoreModules",&dbv) && dbv.type == DBVT_ASCIIZ)
+ if (!db_get(NULL,modname,"CoreModules",&dbv) && dbv.type == DBVT_ASCIIZ)
mods = dbv.pszVal;
else {
- DBWriteContactSettingString(NULL,modname,"CoreModules",coreMods);
+ db_set_s(NULL,modname,"CoreModules",coreMods);
mods = coreMods;
}
@@ -218,18 +218,18 @@ int ModulesLoaded(WPARAM wParam,LPARAM lParam) if (GetModuleFileName(hInst, szModuleFileName, MAX_PATH))
addIcons(szModuleFileName);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
UnhookEvent(hModulesLoadedHook);
- usePopUps = DBGetContactSettingByte(NULL,modname,"UsePopUps",0);
+ usePopUps = db_get_b(NULL,modname,"UsePopUps",0);
// Load the name order
for(i=0; i < NAMEORDERCOUNT; i++)
nameOrder[i] = i;
- if (!DBGetContactSetting(NULL,"Contact","NameOrder",&dbv)) {
+ if (!db_get(NULL,"Contact","NameOrder",&dbv)) {
CopyMemory(nameOrder,dbv.pbVal,dbv.cpbVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
HookEvent(ME_TTB_MODULELOADED, OnTTBLoaded);
@@ -311,21 +311,21 @@ extern "C" __declspec(dllexport) int Unload(void) //=======================================================
-//DBGetContactSettingString (prob shouldnt use this unless u know how big the string is gonna be..)
+//db_get_s (prob shouldnt use this unless u know how big the string is gonna be..)
//=======================================================
int DBGetContactSettingStringStatic(HANDLE hContact, char* szModule, char* szSetting, char* value, int maxLength)
{
DBVARIANT dbv;
- if (!DBGetContactSetting(hContact, szModule, szSetting, &dbv))
+ if (!db_get(hContact, szModule, szSetting, &dbv))
{
strncpy(value, dbv.pszVal, maxLength);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 1;
}
else
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 0;
}
@@ -407,7 +407,7 @@ int GetValue(HANDLE hContact, const char* szModule, const char* szSetting, char* break;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
Value[length-1] = 0;
return 1;
@@ -457,7 +457,7 @@ int GetValueW(HANDLE hContact, const char* szModule, const char* szSetting, WCHA break;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
Value[length-1] = 0;
return 1;
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp index 814361037d..64b2534f94 100644 --- a/plugins/DbEditorPP/src/main_window.cpp +++ b/plugins/DbEditorPP/src/main_window.cpp @@ -122,7 +122,7 @@ LRESULT CALLBACK ModuleTreeSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM }
}
else if ((mtis->type == CONTACT) && hContact) {
- if (DBGetContactSettingByte(NULL,"CList", "ConfirmDelete",1)) {
+ if (db_get_b(NULL,"CList", "ConfirmDelete",1)) {
char msg[1024];
mir_snprintf(msg, SIZEOF(msg), Translate("Are you sure you want to delete contact \"%s\"?"), module);
if (MessageBox(0,msg, Translate("Confirm Contact Delete"), MB_YESNO|MB_ICONEXCLAMATION) == IDNO)
@@ -199,7 +199,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) SetWindowText(hwnd, TranslateT("Database Editor++"));
// setup the splitter
- SetWindowLongPtr(GetDlgItem(hwnd,IDC_SPLITTER),GWLP_USERDATA,(LPARAM)DBGetContactSettingWord(NULL, modname, "Splitter", 300));
+ SetWindowLongPtr(GetDlgItem(hwnd,IDC_SPLITTER),GWLP_USERDATA,(LPARAM)db_get_w(NULL, modname, "Splitter", 300));
SendMessage(hwnd, GC_SPLITTERMOVED, 0,0);
mir_subclassWindow(GetDlgItem(hwnd,IDC_SPLITTER), SplitterSubclassProc);
// module tree
@@ -215,8 +215,8 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) TranslateMenu(GetSubMenu(hMenu,i));
// move the dialog to the users position
- MoveWindow(hwnd,DBGetContactSettingDword(NULL,modname,"x",0),DBGetContactSettingDword(NULL,modname,"y",0),DBGetContactSettingDword(NULL,modname,"width",500),DBGetContactSettingDword(NULL,modname,"height",250),0);
- if (DBGetContactSettingByte(NULL,modname,"Maximised",0)) {
+ MoveWindow(hwnd,db_get_dw(NULL,modname,"x",0),db_get_dw(NULL,modname,"y",0),db_get_dw(NULL,modname,"width",500),db_get_dw(NULL,modname,"height",250),0);
+ if (db_get_b(NULL,modname,"Maximised",0)) {
WINDOWPLACEMENT wp;
wp.length = sizeof(WINDOWPLACEMENT);
wp.flags = WPF_RESTORETOMAXIMIZED;
@@ -229,14 +229,14 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) Mode = MODE_ALL;
CheckMenuItem(GetSubMenu(hMenu,5),MENU_FILTER_ALL,MF_BYCOMMAND|MF_CHECKED);
- Hex = DBGetContactSettingByte(NULL,modname,"HexMode",0);
+ Hex = db_get_b(NULL,modname,"HexMode",0);
CheckMenuItem(GetSubMenu(hMenu,5),MENU_BYTE_HEX,MF_BYCOMMAND|((Hex & HEX_BYTE)?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(GetSubMenu(hMenu,5),MENU_WORD_HEX,MF_BYCOMMAND|((Hex & HEX_WORD)?MF_CHECKED:MF_UNCHECKED));
CheckMenuItem(GetSubMenu(hMenu,5),MENU_DWORD_HEX,MF_BYCOMMAND|((Hex & HEX_DWORD)?MF_CHECKED:MF_UNCHECKED));
- CheckMenuItem(GetSubMenu(GetMenu(hwnd),5),MENU_SAVE_POSITION,MF_BYCOMMAND|(DBGetContactSettingByte(NULL,modname,"RestoreOnOpen",1)?MF_CHECKED:MF_UNCHECKED));
+ CheckMenuItem(GetSubMenu(GetMenu(hwnd),5),MENU_SAVE_POSITION,MF_BYCOMMAND|(db_get_b(NULL,modname,"RestoreOnOpen",1)?MF_CHECKED:MF_UNCHECKED));
- Order = DBGetContactSettingByte(NULL,modname,"SortMode",1);
+ Order = db_get_b(NULL,modname,"SortMode",1);
CheckMenuItem(GetSubMenu(GetMenu(hwnd),5),MENU_SORT_ORDER,MF_BYCOMMAND|(Order?MF_CHECKED:MF_UNCHECKED));
// image list
@@ -298,7 +298,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int restore;
if (hRestore)
restore = 3;
- else if (DBGetContactSettingByte(NULL,modname,"RestoreOnOpen",1))
+ else if (db_get_b(NULL,modname,"RestoreOnOpen",1))
restore = 2;
else
restore = 0;
@@ -327,7 +327,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (splitterPos<65) splitterPos=65;
if (splitterPos > rc2.right-rc2.left-65) splitterPos=rc2.right-rc2.left-65;
SetWindowLongPtr(GetDlgItem(hwnd,IDC_SPLITTER),GWLP_USERDATA, splitterPos);
- DBWriteContactSettingWord(NULL, modname, "Splitter",(WORD)splitterPos);
+ db_set_w(NULL, modname, "Splitter",(WORD)splitterPos);
}
PostMessage(hwnd,WM_SIZE,0,0);
}
@@ -359,14 +359,14 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) CallService(MS_UTILS_RESIZEDIALOG,0,(LPARAM)&urd);
if (msg == WM_SIZE && wParam == SIZE_MAXIMIZED || wParam == SIZE_MINIMIZED)
- DBWriteContactSettingByte(NULL,modname,"Maximised",1);
+ db_set_b(NULL,modname,"Maximised",1);
else if (msg == WM_SIZE && wParam == SIZE_RESTORED)
- DBWriteContactSettingByte(NULL,modname,"Maximised",0);
+ db_set_b(NULL,modname,"Maximised",0);
}
break;
case WM_DESTROY: // free our shit!
- if (DBGetContactSettingByte(NULL,modname,"RestoreOnOpen",1)) {
+ if (db_get_b(NULL,modname,"RestoreOnOpen",1)) {
HTREEITEM item;
HWND hwnd2Tree = GetDlgItem(hwnd,IDC_MODULES);
char module[256] = {0};
@@ -385,16 +385,16 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) type = mtis->type;
}
- DBWriteContactSettingDword(NULL,modname,"LastContact",(DWORD)hContact);
+ db_set_dw(NULL,modname,"LastContact",(DWORD)hContact);
if (type == CONTACT)
- DBWriteContactSettingString(NULL,modname,"LastModule","");
+ db_set_s(NULL,modname,"LastModule","");
else
- DBWriteContactSettingString(NULL,modname,"LastModule",module);
+ db_set_s(NULL,modname,"LastModule",module);
}
else {
- DBDeleteContactSetting(NULL,modname,"LastContact");
- DBDeleteContactSetting(NULL,modname,"LastModule");
+ db_unset(NULL,modname,"LastContact");
+ db_unset(NULL,modname,"LastModule");
}
HWND hwnd2Settings = GetDlgItem(hwnd, IDC_SETTINGS);
@@ -403,13 +403,13 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (pos != -1) {
char text[256];
ListView_GetItemText(hwnd2Settings, pos, 0, text, SIZEOF(text));
- DBWriteContactSettingString(NULL,modname,"LastSetting",text);
+ db_set_s(NULL,modname,"LastSetting",text);
}
- else DBDeleteContactSetting(NULL,modname,"LastSetting");
+ else db_unset(NULL,modname,"LastSetting");
}
}
- DBWriteContactSettingByte(NULL,modname,"HexMode",(byte)Hex);
- DBWriteContactSettingByte(NULL,modname,"SortMode",(byte)Order);
+ db_set_b(NULL,modname,"HexMode",(byte)Hex);
+ db_set_b(NULL,modname,"SortMode",(byte)Order);
saveListSettings(GetDlgItem(hwnd,IDC_SETTINGS));
hwnd2mainWindow = 0;
ClearListview(GetDlgItem(hwnd,IDC_SETTINGS));
@@ -419,13 +419,13 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (himl2)
ImageList_Destroy(himl2);
- if (!DBGetContactSettingByte(NULL,modname,"Maximised",0)) {
+ if (!db_get_b(NULL,modname,"Maximised",0)) {
RECT rc;
GetWindowRect(hwnd,&rc);
- DBWriteContactSettingDword(NULL,modname,"x",rc.left);
- DBWriteContactSettingDword(NULL,modname,"y",rc.top);
- DBWriteContactSettingDword(NULL,modname,"width",rc.right-rc.left);
- DBWriteContactSettingDword(NULL,modname,"height",rc.bottom-rc.top);
+ db_set_dw(NULL,modname,"x",rc.left);
+ db_set_dw(NULL,modname,"y",rc.top);
+ db_set_dw(NULL,modname,"width",rc.right-rc.left);
+ db_set_dw(NULL,modname,"height",rc.bottom-rc.top);
}
if (hwnd2importWindow) {
@@ -543,9 +543,9 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break;
case MENU_SAVE_POSITION:
{
- BOOL save = !DBGetContactSettingByte(NULL,modname,"RestoreOnOpen",1);
+ BOOL save = !db_get_b(NULL,modname,"RestoreOnOpen",1);
CheckMenuItem(GetSubMenu(GetMenu(hwnd),5),MENU_SAVE_POSITION,MF_BYCOMMAND|(save?MF_CHECKED:MF_UNCHECKED));
- DBWriteContactSettingByte(NULL,modname,"RestoreOnOpen", (byte)save);
+ db_set_b(NULL,modname,"RestoreOnOpen", (byte)save);
}
break;
case MENU_SORT_ORDER:
diff --git a/plugins/DbEditorPP/src/modules.cpp b/plugins/DbEditorPP/src/modules.cpp index 2e650b2fe4..faeae05035 100644 --- a/plugins/DbEditorPP/src/modules.cpp +++ b/plugins/DbEditorPP/src/modules.cpp @@ -17,28 +17,28 @@ void renameModule(char* oldName, char* newName, HANDLE hContact) switch (dbv.type)
{
case DBVT_BYTE:
- DBWriteContactSettingByte(hContact, newName, setting->name, dbv.bVal);
+ db_set_b(hContact, newName, setting->name, dbv.bVal);
break;
case DBVT_WORD:
- DBWriteContactSettingWord(hContact, newName, setting->name, dbv.wVal);
+ db_set_w(hContact, newName, setting->name, dbv.wVal);
break;
case DBVT_DWORD:
- DBWriteContactSettingDword(hContact, newName, setting->name, dbv.dVal);
+ db_set_dw(hContact, newName, setting->name, dbv.dVal);
break;
case DBVT_ASCIIZ:
- DBWriteContactSettingString(hContact, newName, setting->name, dbv.pszVal);
+ db_set_s(hContact, newName, setting->name, dbv.pszVal);
break;
case DBVT_UTF8:
- DBWriteContactSettingStringUtf(hContact, newName, setting->name, dbv.pszVal);
+ db_set_utf(hContact, newName, setting->name, dbv.pszVal);
break;
case DBVT_BLOB:
DBWriteContactSettingBlob(hContact, newName, setting->name, dbv.pbVal, dbv.cpbVal);
break;
}
- DBDeleteContactSetting(hContact, oldName, setting->name);
+ db_unset(hContact, oldName, setting->name);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
setting = (struct ModSetLinkLinkItem *)setting->next;
}
FreeModuleSettingLL(&settinglist);
@@ -65,16 +65,16 @@ INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam {
HANDLE hContact = db_find_first();
// null contact
- DBWriteContactSettingByte(NULL, modulename, "(Default)", 0);
+ db_set_b(NULL, modulename, "(Default)", 0);
while (hContact)
{
- DBWriteContactSettingByte(hContact, modulename, "(Default)", 0);
+ db_set_b(hContact, modulename, "(Default)", 0);
hContact = db_find_next(hContact);
}
}
else
{
- DBWriteContactSettingByte((HANDLE)GetWindowLongPtr(hwnd,GWLP_USERDATA), modulename, "(Default)", 0);
+ db_set_b((HANDLE)GetWindowLongPtr(hwnd,GWLP_USERDATA), modulename, "(Default)", 0);
}
refreshTree(1);
}
diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp index ea520eacc2..4c6d4a0e47 100644 --- a/plugins/DbEditorPP/src/moduletree.cpp +++ b/plugins/DbEditorPP/src/moduletree.cpp @@ -379,7 +379,7 @@ void replaceTreeItem(HWND hwnd, HANDLE hContact, const char *module, const char void refreshTree(int restore)
{
- UseKnownModList = DBGetContactSettingByte(NULL,modname,"UseKnownModList",0);
+ UseKnownModList = db_get_b(NULL,modname,"UseKnownModList",0);
if (populating) return;
populating = 1;
forkthread(PopulateModuleTreeThreadFunc,0,(HWND)restore);
@@ -433,7 +433,7 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID di) }
case 2: // restore saved
if (GetValue(NULL,modname,"LastModule",SelectedModule,SIZEOF(SelectedModule))) {
- hSelectedContact = (HANDLE)DBGetContactSettingDword(NULL,modname,"LastContact",(DWORD)INVALID_HANDLE_VALUE);
+ hSelectedContact = (HANDLE)db_get_dw(NULL,modname,"LastContact",(DWORD)INVALID_HANDLE_VALUE);
if (hSelectedContact != INVALID_HANDLE_VALUE)
Select = 1;
GetValue(NULL,modname,"LastSetting",SelectedSetting,SIZEOF(SelectedSetting));
@@ -527,7 +527,7 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID di) module = (struct ModSetLinkLinkItem *)module->next;
}
- if (DBGetContactSettingByte(NULL,modname,"ExpandSettingsOnOpen",0))
+ if (db_get_b(NULL,modname,"ExpandSettingsOnOpen",0))
TreeView_Expand(hwnd2Tree,contact,TVE_EXPAND);
if (Select && hSelectedContact == NULL)
@@ -902,14 +902,14 @@ void moduleListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here i else strncat(moduletemp,&module[i],1);
}
- if ( !DBGetContactSetting(NULL,modname,"CoreModules",&dbv) && dbv.type == DBVT_ASCIIZ) {
+ if ( !db_get(NULL,modname,"CoreModules",&dbv) && dbv.type == DBVT_ASCIIZ) {
int len = (int)strlen(dbv.pszVal) + 10 + (int)strlen(moduletemp);
char* temp = (char*)_alloca(len);
mir_snprintf(temp, len, "%s, %s", dbv.pszVal, moduletemp);
- DBWriteContactSettingString(NULL,modname,"CoreModules",temp);
- DBFreeVariant(&dbv);
+ db_set_s(NULL,modname,"CoreModules",temp);
+ db_free(&dbv);
}
- else DBWriteContactSettingString(NULL,modname,"CoreModules",moduletemp);
+ else db_set_s(NULL,modname,"CoreModules",moduletemp);
RegisterSingleModule((WPARAM)module,0);
}
break;
@@ -925,7 +925,7 @@ void moduleListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here i break;
case MENU_DELETE_CONTACT:
- if (DBGetContactSettingByte(NULL,"CList", "ConfirmDelete",1)) {
+ if (db_get_b(NULL,"CList", "ConfirmDelete",1)) {
char msg[1024];
mir_snprintf(msg, SIZEOF(msg), Translate("Are you sure you want to delete contact \"%s\"?"), module);
if (MessageBox(0,msg, Translate("Confirm Contact Delete"), MB_YESNO|MB_ICONEXCLAMATION) == IDYES) {
diff --git a/plugins/DbEditorPP/src/options.cpp b/plugins/DbEditorPP/src/options.cpp index ba822c7321..17d69981d6 100644 --- a/plugins/DbEditorPP/src/options.cpp +++ b/plugins/DbEditorPP/src/options.cpp @@ -9,17 +9,17 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
bInitDone = false;
DBVARIANT dbv;
- CheckDlgButton(hwnd,IDC_EXPANDSETTINGS,DBGetContactSettingByte(NULL,modname,"ExpandSettingsOnOpen",0));
- CheckDlgButton(hwnd,IDC_RESTORESETTINGS,DBGetContactSettingByte(NULL,modname,"RestoreOnOpen",1));
- CheckDlgButton(hwnd,IDC_USEKNOWNMODS,DBGetContactSettingByte(NULL,modname,"UseKnownModList",0));
- CheckDlgButton(hwnd,IDC_WARNONDEL,DBGetContactSettingByte(NULL,modname,"WarnOnDelete",1));
- CheckDlgButton(hwnd,IDC_MENU,DBGetContactSettingByte(NULL,modname,"UserMenuItem",0));
+ CheckDlgButton(hwnd,IDC_EXPANDSETTINGS,db_get_b(NULL,modname,"ExpandSettingsOnOpen",0));
+ CheckDlgButton(hwnd,IDC_RESTORESETTINGS,db_get_b(NULL,modname,"RestoreOnOpen",1));
+ CheckDlgButton(hwnd,IDC_USEKNOWNMODS,db_get_b(NULL,modname,"UseKnownModList",0));
+ CheckDlgButton(hwnd,IDC_WARNONDEL,db_get_b(NULL,modname,"WarnOnDelete",1));
+ CheckDlgButton(hwnd,IDC_MENU,db_get_b(NULL,modname,"UserMenuItem",0));
CheckDlgButton(hwnd,IDC_POPUPS,usePopUps);
- if (!DBGetContactSetting(NULL,modname,"CoreModules",&dbv) && dbv.type == DBVT_ASCIIZ)
+ if (!db_get(NULL,modname,"CoreModules",&dbv) && dbv.type == DBVT_ASCIIZ)
SetDlgItemText(hwnd,IDC_MODULES,dbv.pszVal);
- DBFreeVariant(&dbv);
- SetDlgItemInt(hwnd,IDC_POPUPTIMEOUT,DBGetContactSettingWord(NULL,modname,"PopupDelay",4),0);
- SendDlgItemMessage(hwnd, IDC_COLOUR, CPM_SETCOLOUR, 0, (LPARAM)DBGetContactSettingDword(NULL,modname,"PopupColour",RGB(255,0,0)));
+ db_free(&dbv);
+ SetDlgItemInt(hwnd,IDC_POPUPTIMEOUT,db_get_w(NULL,modname,"PopupDelay",4),0);
+ SendDlgItemMessage(hwnd, IDC_COLOUR, CPM_SETCOLOUR, 0, (LPARAM)db_get_dw(NULL,modname,"PopupColour",RGB(255,0,0)));
TranslateDialogDefault(hwnd);
bInitDone = true;
}
@@ -52,25 +52,19 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case PSN_APPLY:
{
char mods[4096];
- DBWriteContactSettingByte(NULL,modname,"ExpandSettingsOnOpen",(BYTE)IsDlgButtonChecked(hwnd,IDC_EXPANDSETTINGS));
- DBWriteContactSettingByte(NULL,modname,"RestoreOnOpen",(BYTE)IsDlgButtonChecked(hwnd,IDC_RESTORESETTINGS));
- DBWriteContactSettingByte(NULL,modname,"WarnOnDelete",(BYTE)IsDlgButtonChecked(hwnd,IDC_WARNONDEL));
- DBWriteContactSettingByte(NULL,modname,"UserMenuItem",(BYTE)IsDlgButtonChecked(hwnd,IDC_MENU));
- DBWriteContactSettingByte(NULL,modname,"UseKnownModList",(BYTE)IsDlgButtonChecked(hwnd,IDC_USEKNOWNMODS));
+ db_set_b(NULL,modname,"ExpandSettingsOnOpen",(BYTE)IsDlgButtonChecked(hwnd,IDC_EXPANDSETTINGS));
+ db_set_b(NULL,modname,"RestoreOnOpen",(BYTE)IsDlgButtonChecked(hwnd,IDC_RESTORESETTINGS));
+ db_set_b(NULL,modname,"WarnOnDelete",(BYTE)IsDlgButtonChecked(hwnd,IDC_WARNONDEL));
+ db_set_b(NULL,modname,"UserMenuItem",(BYTE)IsDlgButtonChecked(hwnd,IDC_MENU));
+ db_set_b(NULL,modname,"UseKnownModList",(BYTE)IsDlgButtonChecked(hwnd,IDC_USEKNOWNMODS));
usePopUps = IsDlgButtonChecked(hwnd,IDC_POPUPS);
- DBWriteContactSettingByte(NULL,modname,"UsePopUps",(BYTE)usePopUps);
+ db_set_b(NULL,modname,"UsePopUps",(BYTE)usePopUps);
if (GetDlgItemText(hwnd,IDC_MODULES,mods,4096))
- DBWriteContactSettingString(NULL,modname,"CoreModules",mods);
- DBWriteContactSettingWord(NULL,modname,"PopupDelay",(WORD)GetDlgItemInt(hwnd,IDC_POPUPTIMEOUT,NULL,0));
- DBWriteContactSettingDword(NULL,modname,"PopupColour",(DWORD)SendDlgItemMessage(hwnd, IDC_COLOUR, CPM_GETCOLOUR, 0, 0));
+ db_set_s(NULL,modname,"CoreModules",mods);
+ db_set_w(NULL,modname,"PopupDelay",(WORD)GetDlgItemInt(hwnd,IDC_POPUPTIMEOUT,NULL,0));
+ db_set_dw(NULL,modname,"PopupColour",(DWORD)SendDlgItemMessage(hwnd, IDC_COLOUR, CPM_GETCOLOUR, 0, 0));
- CLISTMENUITEM mi = { sizeof(mi) };
- if (!IsDlgButtonChecked(hwnd,IDC_MENU))
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- else
- mi.flags = CMIM_FLAGS;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hUserMenu, (LPARAM) & mi);
+ Menu_ShowItem(hUserMenu, IsDlgButtonChecked(hwnd,IDC_MENU));
}
return TRUE;
}
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp index 3afbc56629..816244d8ec 100644 --- a/plugins/DbEditorPP/src/settinglist.cpp +++ b/plugins/DbEditorPP/src/settinglist.cpp @@ -11,16 +11,16 @@ void setupSettingsList(HWND hwnd2List) sLC.mask = LVCF_FMT | LVCF_TEXT | LVCF_SUBITEM | LVCF_WIDTH;
sLC.pszText = Translate("Name");
- sLC.cx = DBGetContactSettingWord(NULL, modname, "Column0width", 145);
+ sLC.cx = db_get_w(NULL, modname, "Column0width", 145);
ListView_InsertColumn(hwnd2List,0,&sLC);
sLC.pszText = Translate("Data");
- sLC.cx = DBGetContactSettingWord(NULL, modname, "Column1width", 145);
+ sLC.cx = db_get_w(NULL, modname, "Column1width", 145);
ListView_InsertColumn(hwnd2List,1,&sLC);
sLC.pszText = Translate("Type");
- sLC.cx = DBGetContactSettingWord(NULL, modname, "Column2width", 60);
+ sLC.cx = db_get_w(NULL, modname, "Column2width", 60);
ListView_InsertColumn(hwnd2List,2,&sLC);
sLC.pszText = Translate("Size");
- sLC.cx = DBGetContactSettingWord(NULL, modname, "Column3width", 80);
+ sLC.cx = db_get_w(NULL, modname, "Column3width", 80);
ListView_InsertColumn(hwnd2List,3,&sLC);
}
@@ -37,7 +37,7 @@ void saveListSettings(HWND hwnd2List) if (ListView_GetColumn(hwnd2List,i,&sLC))
{
mir_snprintf(tmp, SIZEOF(tmp), "Column%dwidth", i);
- DBWriteContactSettingWord(NULL, modname, tmp, (WORD)sLC.cx);
+ db_set_w(NULL, modname, tmp, (WORD)sLC.cx);
}
}
@@ -68,7 +68,7 @@ void DeleteSettingsFromList(HWND hSettings, HANDLE hContact, char *module, char else
if (count == 1)
{
- DBDeleteContactSetting(hContact,module,setting);
+ db_unset(hContact,module,setting);
}
else
{
@@ -81,7 +81,7 @@ void DeleteSettingsFromList(HWND hSettings, HANDLE hContact, char *module, char if (ListView_GetItemState(hSettings,i,LVIS_SELECTED))
{
ListView_GetItemText(hSettings, i, 0, text, SIZEOF(text));
- DBDeleteContactSetting(hContact,module,text);
+ db_unset(hContact,module,text);
items--;
}
else
@@ -224,7 +224,7 @@ void additem(HWND hwnd2Settings,HANDLE hContact, char* module, char* setting, in else
ListView_DeleteItem(hwnd2Settings,index);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_free(data);
}
@@ -322,14 +322,14 @@ typedef struct { void writeStandardTextfromLabel(EditLabelInfoStruct* info, char* value, WCHAR *wc, int type)
{
if (type != DBVT_ASCIIZ && type != DBVT_UTF8)
- DBDeleteContactSetting(info->hContact,info->module,info->setting);
+ db_unset(info->hContact,info->module,info->setting);
if (type == DBVT_UTF8 && wc)
{
- DBWriteContactSettingWString(info->hContact,info->module,info->setting,wc);
+ db_set_ws(info->hContact,info->module,info->setting,wc);
mir_free(wc);
}
else
- DBWriteContactSettingString(info->hContact,info->module,info->setting,value);
+ db_set_s(info->hContact,info->module,info->setting,value);
}
@@ -389,32 +389,32 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd,UINT msg,WPARAM w case 0:// setting name
if (!mir_strcmp(info->setting,value) || mir_strlen(value)>255)
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
SendMessage(hwnd,WM_COMMAND,MAKEWPARAM(IDCANCEL,0),0);
return 0;
}
switch (dbv.type)
{
case DBVT_UTF8:
- DBWriteContactSettingStringUtf(info->hContact,info->module,value,dbv.pszVal);
+ db_set_utf(info->hContact,info->module,value,dbv.pszVal);
break;
case DBVT_ASCIIZ:
- DBWriteContactSettingString(info->hContact,info->module,value,dbv.pszVal);
+ db_set_s(info->hContact,info->module,value,dbv.pszVal);
break;
case DBVT_BYTE:
- DBWriteContactSettingByte(info->hContact,info->module,value,dbv.bVal);
+ db_set_b(info->hContact,info->module,value,dbv.bVal);
break;
case DBVT_WORD:
- DBWriteContactSettingWord(info->hContact,info->module,value,dbv.wVal);
+ db_set_w(info->hContact,info->module,value,dbv.wVal);
break;
case DBVT_DWORD:
- DBWriteContactSettingDword(info->hContact,info->module,value,dbv.dVal);
+ db_set_dw(info->hContact,info->module,value,dbv.dVal);
break;
case DBVT_BLOB:
DBWriteContactSettingBlob(info->hContact,info->module,value,dbv.pbVal,dbv.cpbVal);
break;
}
- DBDeleteContactSetting(info->hContact,info->module,info->setting);
+ db_unset(info->hContact,info->module,info->setting);
{
LVFINDINFO lvfi;
int item;
@@ -448,9 +448,9 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd,UINT msg,WPARAM w {
val = atoi(&value[1]);
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_UTF8)
- DBDeleteContactSetting(info->hContact,info->module,info->setting);
+ db_unset(info->hContact,info->module,info->setting);
- DBWriteContactSettingByte(info->hContact,info->module,info->setting,(BYTE)val);
+ db_set_b(info->hContact,info->module,info->setting,(BYTE)val);
}
else
writeStandardTextfromLabel(info, value, wc, dbv.type);
@@ -463,8 +463,8 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd,UINT msg,WPARAM w {
val = atoi(&value[1]);
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_UTF8)
- DBDeleteContactSetting(info->hContact,info->module,info->setting);
- DBWriteContactSettingWord(info->hContact,info->module,info->setting,(WORD)val);
+ db_unset(info->hContact,info->module,info->setting);
+ db_set_w(info->hContact,info->module,info->setting,(WORD)val);
}
else
writeStandardTextfromLabel(info, value, wc, dbv.type);
@@ -477,8 +477,8 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd,UINT msg,WPARAM w {
val = atoi(&value[1]);
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_UTF8)
- DBDeleteContactSetting(info->hContact,info->module,info->setting);
- DBWriteContactSettingDword(info->hContact,info->module,info->setting,val);
+ db_unset(info->hContact,info->module,info->setting);
+ db_set_dw(info->hContact,info->module,info->setting,val);
}
else
writeStandardTextfromLabel(info, value, wc, dbv.type);
@@ -498,13 +498,13 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd,UINT msg,WPARAM w writeStandardTextfromLabel(info, value, wc, dbv.type);
break;
case DBVT_BYTE:
- DBWriteContactSettingByte(info->hContact,info->module,info->setting,(BYTE)val);
+ db_set_b(info->hContact,info->module,info->setting,(BYTE)val);
break;
case DBVT_WORD:
- DBWriteContactSettingWord(info->hContact,info->module,info->setting,(WORD)val);
+ db_set_w(info->hContact,info->module,info->setting,(WORD)val);
break;
case DBVT_DWORD:
- DBWriteContactSettingDword(info->hContact,info->module,info->setting,(DWORD)val);
+ db_set_dw(info->hContact,info->module,info->setting,(DWORD)val);
break;
}
}
@@ -518,13 +518,13 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd,UINT msg,WPARAM w writeStandardTextfromLabel(info, value, wc, dbv.type);
break;
case DBVT_BYTE:
- DBWriteContactSettingByte(info->hContact,info->module,info->setting,(BYTE)val);
+ db_set_b(info->hContact,info->module,info->setting,(BYTE)val);
break;
case DBVT_WORD:
- DBWriteContactSettingWord(info->hContact,info->module,info->setting,(WORD)val);
+ db_set_w(info->hContact,info->module,info->setting,(WORD)val);
break;
case DBVT_DWORD:
- DBWriteContactSettingDword(info->hContact,info->module,info->setting,(DWORD)val);
+ db_set_dw(info->hContact,info->module,info->setting,(DWORD)val);
break;
}
}
@@ -563,13 +563,13 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd,UINT msg,WPARAM w writeStandardTextfromLabel(info, value, wc, dbv.type);
break;
case DBVT_BYTE:
- DBWriteContactSettingByte(info->hContact,info->module,info->setting,(BYTE)val);
+ db_set_b(info->hContact,info->module,info->setting,(BYTE)val);
break;
case DBVT_WORD:
- DBWriteContactSettingWord(info->hContact,info->module,info->setting,(WORD)val);
+ db_set_w(info->hContact,info->module,info->setting,(WORD)val);
break;
case DBVT_DWORD:
- DBWriteContactSettingDword(info->hContact,info->module,info->setting,(DWORD)val);
+ db_set_dw(info->hContact,info->module,info->setting,(DWORD)val);
break;
}
break;
@@ -580,7 +580,7 @@ static LRESULT CALLBACK SettingLabelEditSubClassProc(HWND hwnd,UINT msg,WPARAM w }
break; // case 1:
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} // fall through
case IDCANCEL:
{
@@ -706,7 +706,7 @@ void EditLabel(HWND hwnd2List, int item, int subitem) default: return;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
SettingLabelEditSubClass=(WNDPROC)SetWindowLongPtrW(info->hwnd2Edit,GWLP_WNDPROC,(LONG)SettingLabelEditSubClassProc);
@@ -746,7 +746,7 @@ void SettingsListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) LVHITTESTINFO hti;
hti.pt=((NMLISTVIEW*)lParam)->ptAction;
- if (DBGetContactSettingByte(NULL,modname,"DontAllowInLineEdit",0) || !IsWinVer2000Plus()) /* fix for TioDuke and win98 */
+ if (db_get_b(NULL,modname,"DontAllowInLineEdit",0) || !IsWinVer2000Plus()) /* fix for TioDuke and win98 */
break;
if (info && ListView_SubItemHitTest(GetDlgItem(hwnd,IDC_SETTINGS),&hti) >-1)
{
@@ -790,7 +790,7 @@ void SettingsListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) hti.pt=((NMLISTVIEW*)lParam)->ptAction;
if (info && ListView_SubItemHitTest(GetDlgItem(hwnd,IDC_SETTINGS),&hti) >-1)
{
- if ((hti.iSubItem > 1 || hti.flags == LVHT_ONITEMICON) || (DBGetContactSettingByte(NULL,modname,"DontAllowInLineEdit",0) || !IsWinVer2000Plus()/* fix for TioDuke and win98 */ ))
+ if ((hti.iSubItem > 1 || hti.flags == LVHT_ONITEMICON) || (db_get_b(NULL,modname,"DontAllowInLineEdit",0) || !IsWinVer2000Plus()/* fix for TioDuke and win98 */ ))
{
char setting[256];
SendMessage(info->hwnd2Edit,WM_COMMAND,MAKEWPARAM(IDOK,0),0);
@@ -1093,7 +1093,7 @@ void SettingsListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here ///////////////////////// convert to submenu
case MENU_VIEWDECRYPT:
- if (!DBGetContactSetting(hContact,module,setting,&dbv) && dbv.type == DBVT_ASCIIZ) {
+ if (!db_get(hContact,module,setting,&dbv) && dbv.type == DBVT_ASCIIZ) {
if (lstrcmpA(setting, "LoginPassword")) {
char *text = mir_strdup(dbv.pszVal);
CallService(MS_DB_CRYPT_DECODESTRING, (WPARAM)lstrlenA(dbv.pszVal)+1, (LPARAM)text);
@@ -1113,38 +1113,38 @@ void SettingsListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here mir_free(res);
mir_free(str);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
break;
case MENU_VIEWENCRYPT:
- if (!DBGetContactSetting(hContact,module,setting,&dbv) && dbv.type == DBVT_ASCIIZ) {
+ if (!db_get(hContact,module,setting,&dbv) && dbv.type == DBVT_ASCIIZ) {
char *text = mir_tstrdup(dbv.pszVal);
CallService(MS_DB_CRYPT_ENCODESTRING, (WPARAM)strlen(dbv.pszVal)+1, (LPARAM)text);
msg(text, Translate("Encoded string.."));
mir_free(text);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
break;
case MENU_DECRYPT:
- if (!DBGetContactSetting(hContact,module,setting,&dbv) && dbv.type == DBVT_ASCIIZ) {
+ if (!db_get(hContact,module,setting,&dbv) && dbv.type == DBVT_ASCIIZ) {
char *text = mir_tstrdup(dbv.pszVal);
CallService(MS_DB_CRYPT_DECODESTRING, (WPARAM)strlen(dbv.pszVal)+1, (LPARAM)text);
- DBWriteContactSettingString(hContact,module,setting,text);
+ db_set_s(hContact,module,setting,text);
mir_free(text);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
break;
case MENU_ENCRYPT:
- if (!DBGetContactSetting(hContact,module,setting,&dbv) && dbv.type == DBVT_ASCIIZ) {
+ if (!db_get(hContact,module,setting,&dbv) && dbv.type == DBVT_ASCIIZ) {
char *text = mir_tstrdup(dbv.pszVal);
CallService(MS_DB_CRYPT_ENCODESTRING, (WPARAM)strlen(dbv.pszVal)+1, (LPARAM)text);
- DBWriteContactSettingString(hContact,module,setting,text);
+ db_set_s(hContact,module,setting,text);
mir_free(text);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
break;
///////////////////////// divider
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp index 66aef8654e..865029c358 100644 --- a/plugins/DbEditorPP/src/watchedvars.cpp +++ b/plugins/DbEditorPP/src/watchedvars.cpp @@ -8,7 +8,7 @@ int addSettingToWatchList(HANDLE hContact, char* module, char* setting) WatchListArray.item = (struct DBsetting*)mir_realloc(WatchListArray.item, sizeof(struct DBsetting)*WatchListArray.size);
}
if (!WatchListArray.item) return 0;
- if (setting && DBGetContactSetting(hContact,module, setting, &(WatchListArray.item[WatchListArray.count].dbv))) return 0;
+ if (setting && db_get(hContact,module, setting, &(WatchListArray.item[WatchListArray.count].dbv))) return 0;
WatchListArray.item[WatchListArray.count].hContact = hContact;
WatchListArray.item[WatchListArray.count].module = mir_tstrdup(module);
if (setting) WatchListArray.item[WatchListArray.count].setting = mir_tstrdup(setting);
@@ -25,7 +25,7 @@ void freeWatchListItem(int item) WatchListArray.item[item].module = 0;
if (WatchListArray.item[item].setting) mir_free(WatchListArray.item[item].setting);
WatchListArray.item[item].setting = 0;
- DBFreeVariant(&(WatchListArray.item[item].dbv));
+ db_free(&(WatchListArray.item[item].dbv));
WatchListArray.item[item].hContact = 0;
}
@@ -64,7 +64,7 @@ void addwatchtolist(HWND hwnd2list, struct DBsetting *lParam) FreeModuleSettingLL(&settinglist);
return;
}
- DBFreeVariant(&(lParam->dbv));
+ db_free(&(lParam->dbv));
if (GetSetting(hContact, module, setting, &(lParam->dbv))) return;
if (!hContact)
@@ -287,9 +287,9 @@ void popupWatchedVar(HANDLE hContact,const char* module,const char* setting) HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(ICO_REGEDIT));
char lpzContactName[MAX_CONTACTNAME];
char lpzText[MAX_SECONDLINE];
- COLORREF colorBack = DBGetContactSettingDword(NULL,modname,"PopupColour",RGB(255,0,0));
+ COLORREF colorBack = db_get_dw(NULL,modname,"PopupColour",RGB(255,0,0));
COLORREF colorText = RGB(0,0,0);
- int timeout = DBGetContactSettingByte(NULL,modname,"PopupDelay",3);
+ int timeout = db_get_b(NULL,modname,"PopupDelay",3);
if (hContact) {
// contacts nick
@@ -326,7 +326,7 @@ void popupWatchedVar(HANDLE hContact,const char* module,const char* setting) return;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
POPUPDATA ppd = { 0 };
ppd.lchContact = (HANDLE)hContact;
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp index 1922212386..2a2495b62b 100644 --- a/plugins/Db_autobackups/src/backup.cpp +++ b/plugins/Db_autobackups/src/backup.cpp @@ -171,7 +171,7 @@ int Backup(TCHAR* backup_filename) {
SendMessage(progress_dialog, PBM_SETPOS, (WPARAM)(int)(100), 0);
UpdateWindow(progress_dialog);
- DBWriteContactSettingDword(0, "AutoBackups", "LastBackupTimestamp", (DWORD)time(0));
+ db_set_dw(0, "AutoBackups", "LastBackupTimestamp", (DWORD)time(0));
if (!options.disable_popups)
{
size_t dest_file_len = lstrlen(dest_file);
@@ -204,7 +204,7 @@ int Backup(TCHAR* backup_filename) VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
time_t t = time(NULL);
- time_t diff = t - (time_t)DBGetContactSettingDword(0, "AutoBackups", "LastBackupTimestamp", (DWORD)t);
+ time_t diff = t - (time_t)db_get_dw(0, "AutoBackups", "LastBackupTimestamp", (DWORD)t);
if(diff > (time_t)(options.period * (options.period_type == PT_MINUTES ? 60 : (options.period_type == PT_HOURS ? 60 * 60 : 60 * 60 * 24 ))))
mir_forkthread(BackupThread, NULL);
}
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index da944bc205..839aacc582 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -4,14 +4,14 @@ Options options; int LoadOptions(void)
{
- options.backup_types = (BackupType)DBGetContactSettingByte(0, "AutoBackups", "BackupType", (BYTE)(BT_PERIODIC));
- options.period = (unsigned int)DBGetContactSettingWord(0, "AutoBackups", "Period", 1);
- options.period_type = (PeriodType)DBGetContactSettingByte(0, "AutoBackups", "PeriodType", (BYTE)PT_DAYS);
+ options.backup_types = (BackupType)db_get_b(0, "AutoBackups", "BackupType", (BYTE)(BT_PERIODIC));
+ options.period = (unsigned int)db_get_w(0, "AutoBackups", "Period", 1);
+ options.period_type = (PeriodType)db_get_b(0, "AutoBackups", "PeriodType", (BYTE)PT_DAYS);
if (!ServiceExists(MS_FOLDERS_GET_PATH)) {
DBVARIANT dbv;
- if (!DBGetContactSettingTString(0, "AutoBackups", "Folder", &dbv)) {
+ if (!db_get_ts(0, "AutoBackups", "Folder", &dbv)) {
TCHAR *tmp = Utils_ReplaceVarsT(dbv.ptszVal);
if(_tcslen(tmp) >= 2 && tmp[1] == ':')
@@ -19,15 +19,15 @@ int LoadOptions(void) else
mir_sntprintf(options.folder, MAX_PATH, _T("%s\\%s"), profilePath, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_free(tmp);
} else
mir_sntprintf(options.folder, MAX_PATH, _T("%s%s"), DIR, SUB_DIR);
}
- options.num_backups = (unsigned int)DBGetContactSettingWord(0, "AutoBackups", "NumBackups", 3);
+ options.num_backups = (unsigned int)db_get_w(0, "AutoBackups", "NumBackups", 3);
- options.disable_progress = (BOOL)DBGetContactSettingByte(0, "AutoBackups", "NoProgress", 0);
- options.disable_popups = (BOOL)DBGetContactSettingByte(0, "AutoBackups", "NoPopups", 0);
+ options.disable_progress = (BOOL)db_get_b(0, "AutoBackups", "NoProgress", 0);
+ options.disable_popups = (BOOL)db_get_b(0, "AutoBackups", "NoPopups", 0);
SetBackupTimer();
return 0;
@@ -37,19 +37,19 @@ int SaveOptions(void) {
TCHAR prof_dir[MAX_PATH];
- DBWriteContactSettingByte(0, "AutoBackups", "BackupType", (BYTE)options.backup_types);
+ db_set_b(0, "AutoBackups", "BackupType", (BYTE)options.backup_types);
if (options.period < 1) options.period = 1;
- DBWriteContactSettingWord(0, "AutoBackups", "Period", (WORD)options.period);
- DBWriteContactSettingByte(0, "AutoBackups", "PeriodType", (BYTE)options.period_type);
+ db_set_w(0, "AutoBackups", "Period", (WORD)options.period);
+ db_set_b(0, "AutoBackups", "PeriodType", (BYTE)options.period_type);
mir_sntprintf(prof_dir, MAX_PATH, _T("%s\\"), profilePath);
size_t prof_len = _tcslen(prof_dir);
size_t opt_len = _tcslen(options.folder);
if(opt_len > prof_len && _tcsncmp(options.folder, prof_dir, prof_len) == 0) {
- DBWriteContactSettingTString(0, "AutoBackups", "Folder", (options.folder + prof_len));
+ db_set_ts(0, "AutoBackups", "Folder", (options.folder + prof_len));
} else
- DBWriteContactSettingTString(0, "AutoBackups", "Folder", options.folder);
+ db_set_ts(0, "AutoBackups", "Folder", options.folder);
TCHAR *tmp = Utils_ReplaceVarsT(options.folder);
if(_tcslen(tmp) < 2 || tmp[1] != ':')
@@ -59,9 +59,9 @@ int SaveOptions(void) mir_free(buf);
}
mir_free(tmp);
- DBWriteContactSettingWord(0, "AutoBackups", "NumBackups", (WORD)options.num_backups);
- DBWriteContactSettingByte(0, "AutoBackups", "NoProgress", (BYTE)options.disable_progress);
- DBWriteContactSettingByte(0, "AutoBackups", "NoPopups", (BYTE)options.disable_popups);
+ db_set_w(0, "AutoBackups", "NumBackups", (WORD)options.num_backups);
+ db_set_b(0, "AutoBackups", "NoProgress", (BYTE)options.disable_progress);
+ db_set_b(0, "AutoBackups", "NoPopups", (BYTE)options.disable_popups);
SetBackupTimer();
return 0;
diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp index 55e8022a39..d0747f234b 100644 --- a/plugins/FTPFileYM/src/ftpfile.cpp +++ b/plugins/FTPFileYM/src/ftpfile.cpp @@ -216,49 +216,21 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) bool bHideRoot = opt.bHideInactive;
for (int i = 0; i < ServerList::FTP_COUNT; i++)
- {
if (ftpList[i]->bEnabled)
bHideRoot = false;
- }
-
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS;
if (opt.bUseSubmenu)
- {
- if (!bIsContact || bHideRoot) mi.flags |= CMIF_HIDDEN;
- else mi.flags &= ~CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenu, (LPARAM)&mi);
- }
+ Menu_ShowItem(hMenu, bIsContact && !bHideRoot);
for (int i = 0; i < ServerList::FTP_COUNT; i++)
- {
- mi.flags = CMIM_FLAGS;
- if (!bIsContact)
- {
- mi.flags |= CMIF_HIDDEN;
- }
- else if (!ftpList[i]->bEnabled)
- {
- mi.flags |= opt.bHideInactive ? CMIF_HIDDEN : CMIF_GRAYED;
- }
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hSubMenu[i], (LPARAM)&mi);
- }
-
+ Menu_ShowItem(hSubMenu[i], bIsContact && ftpList[i]->bEnabled);
return 0;
}
void PrebuildMainMenu()
{
- CLISTMENUITEM mi = { sizeof(mi) };
- for (int i=0; i < ServerList::FTP_COUNT; i++) {
- mi.flags = CMIM_FLAGS;
- if (!ftpList[i]->bEnabled)
- mi.flags |= opt.bHideInactive ? CMIF_HIDDEN : CMIF_GRAYED;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMainSubMenu[i], (LPARAM)&mi);
- }
+ for (int i=0; i < ServerList::FTP_COUNT; i++)
+ Menu_ShowItem(hMainSubMenu[i], ftpList[i]->bEnabled);
}
int TabsrmmButtonPressed(WPARAM wParam, LPARAM lParam)
diff --git a/plugins/FTPFileYM/src/mir_db.cpp b/plugins/FTPFileYM/src/mir_db.cpp index 254734c8db..63e85cc056 100644 --- a/plugins/FTPFileYM/src/mir_db.cpp +++ b/plugins/FTPFileYM/src/mir_db.cpp @@ -85,10 +85,10 @@ int DB::getDwordF(HANDLE hContact, char *szModule, char *szSetting, int id, int int DB::getAString(HANDLE hContact, char *szModule, char *szSetting, char *buff)
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(hContact, szModule, szSetting, &dbv))
+ if (!db_get_s(hContact, szModule, szSetting, &dbv))
{
strcpy(buff, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 0;
}
@@ -106,10 +106,10 @@ int DB::getAStringF(HANDLE hContact, char *szModule, char *szSetting, int id, ch int DB::getString(HANDLE hContact, char *szModule, char *szSetting, TCHAR *buff)
{
DBVARIANT dbv;
- if (!DBGetContactSettingTString(hContact, szModule, szSetting, &dbv))
+ if (!db_get_ts(hContact, szModule, szSetting, &dbv))
{
_tcscpy(buff, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 0;
}
diff --git a/plugins/FavContacts/src/favlist.h b/plugins/FavContacts/src/favlist.h index dc2dd610e9..40f44b6e6d 100644 --- a/plugins/FavContacts/src/favlist.h +++ b/plugins/FavContacts/src/favlist.h @@ -20,10 +20,10 @@ public: this->bManual = bManual;
this->fRate = fRate;
name = mir_tstrdup((TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR));
- if (g_Options.bUseGroups && !DBGetContactSettingTString(hContact, "CList", "Group", &dbv))
+ if (g_Options.bUseGroups && !db_get_ts(hContact, "CList", "Group", &dbv))
{
group = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else
if (g_Options.bUseGroups)
{
@@ -32,7 +32,7 @@ public: {
group = mir_tstrdup(TranslateT("Favourite Contacts"));
}
- status = DBGetContactSettingWord(hContact, GetContactProto(hContact), "Status", ID_STATUS_OFFLINE);
+ status = db_get_w(hContact, GetContactProto(hContact), "Status", ID_STATUS_OFFLINE);
}
~TContactInfo()
@@ -105,7 +105,7 @@ public: HANDLE hContact = db_find_first();
for ( ; hContact; hContact = db_find_next(hContact))
- if (DBGetContactSettingByte(hContact, "FavContacts", "IsFavourite", 0))
+ if (db_get_b(hContact, "FavContacts", "IsFavourite", 0))
{
TCHAR *group = addContact(hContact, true)->getGroup();
if (prevGroup && lstrcmp(prevGroup, group))
@@ -118,7 +118,7 @@ public: {
hContact = g_contactCache->get(i);
if (!hContact) break;
- if (!DBGetContactSettingByte(hContact, "FavContacts", "IsFavourite", 0))
+ if (!db_get_b(hContact, "FavContacts", "IsFavourite", 0))
{
TCHAR *group = addContact(hContact, false)->getGroup();
if (prevGroup && lstrcmp(prevGroup, group))
diff --git a/plugins/FavContacts/src/http_api.cpp b/plugins/FavContacts/src/http_api.cpp index c4929e6c3c..0806cddcd9 100644 --- a/plugins/FavContacts/src/http_api.cpp +++ b/plugins/FavContacts/src/http_api.cpp @@ -70,7 +70,7 @@ public: HANDLE hContact = favList[i]->getHandle();
TCHAR *name = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
AVATARCACHEENTRY *avatar = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
- int status = DBGetContactSettingWord(hContact, GetContactProto(hContact), "Status", ID_STATUS_OFFLINE);
+ int status = db_get_w(hContact, GetContactProto(hContact), "Status", ID_STATUS_OFFLINE);
Send("SetContact(");
Send(i);
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp index 878b7d01bd..7e065d60fd 100644 --- a/plugins/FavContacts/src/main.cpp +++ b/plugins/FavContacts/src/main.cpp @@ -233,7 +233,7 @@ int ProcessModulesLoaded(WPARAM wParam, LPARAM lParam) if (ServiceExists(MS_AV_GETAVATARBITMAP)) {
HANDLE hContact = db_find_first();
for ( ; hContact; hContact = db_find_next(hContact))
- if (DBGetContactSettingByte(hContact, "FavContacts", "IsFavourite", 0))
+ if (db_get_b(hContact, "FavContacts", "IsFavourite", 0))
CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
}
@@ -322,36 +322,36 @@ extern "C" __declspec(dllexport) int Unload(void) static void sttLoadOptions()
{
- g_Options.bSecondLine = DBGetContactSettingByte(NULL, "FavContacts", "SecondLine", 1);
- g_Options.bAvatars = DBGetContactSettingByte(NULL, "FavContacts", "Avatars", 1);
- g_Options.bAvatarBorder = DBGetContactSettingByte(NULL, "FavContacts", "AvatarBorder", 0);
- g_Options.wAvatarRadius = DBGetContactSettingWord(NULL, "FavContacts", "AvatarRadius", 3);
- g_Options.bNoTransparentBorder = DBGetContactSettingByte(NULL, "FavContacts", "NoTransparentBorder",
- !DBGetContactSettingByte(NULL, "FavContacts", "AvatarBorderTransparent", 1));
- g_Options.bSysColors = DBGetContactSettingByte(NULL, "FavContacts", "SysColors", 0);
- g_Options.bCenterHotkey = DBGetContactSettingByte(NULL, "FavContacts", "CenterHotkey", 1);
- g_Options.bUseGroups = DBGetContactSettingByte(NULL, "FavContacts", "UseGroups", 0);
- g_Options.bUseColumns = DBGetContactSettingByte(NULL, "FavContacts", "UseColumns", 1);
- g_Options.bRightAvatars = DBGetContactSettingByte(NULL, "FavContacts", "RightAvatars", 0);
- g_Options.bDimIdle = DBGetContactSettingByte(NULL, "FavContacts", "DimIdle", 1);
-
- g_Options.wMaxRecent = DBGetContactSettingByte(NULL, "FavContacts", "MaxRecent", 10);
+ g_Options.bSecondLine = db_get_b(NULL, "FavContacts", "SecondLine", 1);
+ g_Options.bAvatars = db_get_b(NULL, "FavContacts", "Avatars", 1);
+ g_Options.bAvatarBorder = db_get_b(NULL, "FavContacts", "AvatarBorder", 0);
+ g_Options.wAvatarRadius = db_get_w(NULL, "FavContacts", "AvatarRadius", 3);
+ g_Options.bNoTransparentBorder = db_get_b(NULL, "FavContacts", "NoTransparentBorder",
+ !db_get_b(NULL, "FavContacts", "AvatarBorderTransparent", 1));
+ g_Options.bSysColors = db_get_b(NULL, "FavContacts", "SysColors", 0);
+ g_Options.bCenterHotkey = db_get_b(NULL, "FavContacts", "CenterHotkey", 1);
+ g_Options.bUseGroups = db_get_b(NULL, "FavContacts", "UseGroups", 0);
+ g_Options.bUseColumns = db_get_b(NULL, "FavContacts", "UseColumns", 1);
+ g_Options.bRightAvatars = db_get_b(NULL, "FavContacts", "RightAvatars", 0);
+ g_Options.bDimIdle = db_get_b(NULL, "FavContacts", "DimIdle", 1);
+
+ g_Options.wMaxRecent = db_get_b(NULL, "FavContacts", "MaxRecent", 10);
}
static void sttSaveOptions()
{
- DBWriteContactSettingByte(NULL, "FavContacts", "SecondLine", g_Options.bSecondLine);
- DBWriteContactSettingByte(NULL, "FavContacts", "Avatars", g_Options.bAvatars);
- DBWriteContactSettingByte(NULL, "FavContacts", "AvatarBorder", g_Options.bAvatarBorder);
- DBWriteContactSettingWord(NULL, "FavContacts", "AvatarRadius", g_Options.wAvatarRadius);
- DBWriteContactSettingByte(NULL, "FavContacts", "NoTransparentBorder", g_Options.bNoTransparentBorder);
- DBWriteContactSettingByte(NULL, "FavContacts", "SysColors", g_Options.bSysColors);
- DBWriteContactSettingByte(NULL, "FavContacts", "CenterHotkey", g_Options.bCenterHotkey);
- DBWriteContactSettingByte(NULL, "FavContacts", "UseGroups", g_Options.bUseGroups);
- DBWriteContactSettingByte(NULL, "FavContacts", "UseColumns", g_Options.bUseColumns);
- DBWriteContactSettingByte(NULL, "FavContacts", "RightAvatars", g_Options.bRightAvatars);
- DBWriteContactSettingByte(NULL, "FavContacts", "DimIdle", g_Options.bDimIdle);
- DBWriteContactSettingWord(NULL, "FavContacts", "MaxRecent", g_Options.wMaxRecent);
+ db_set_b(NULL, "FavContacts", "SecondLine", g_Options.bSecondLine);
+ db_set_b(NULL, "FavContacts", "Avatars", g_Options.bAvatars);
+ db_set_b(NULL, "FavContacts", "AvatarBorder", g_Options.bAvatarBorder);
+ db_set_w(NULL, "FavContacts", "AvatarRadius", g_Options.wAvatarRadius);
+ db_set_b(NULL, "FavContacts", "NoTransparentBorder", g_Options.bNoTransparentBorder);
+ db_set_b(NULL, "FavContacts", "SysColors", g_Options.bSysColors);
+ db_set_b(NULL, "FavContacts", "CenterHotkey", g_Options.bCenterHotkey);
+ db_set_b(NULL, "FavContacts", "UseGroups", g_Options.bUseGroups);
+ db_set_b(NULL, "FavContacts", "UseColumns", g_Options.bUseColumns);
+ db_set_b(NULL, "FavContacts", "RightAvatars", g_Options.bRightAvatars);
+ db_set_b(NULL, "FavContacts", "DimIdle", g_Options.bDimIdle);
+ db_set_w(NULL, "FavContacts", "MaxRecent", g_Options.wMaxRecent);
}
static bool sttIsGroup(int id)
@@ -361,9 +361,9 @@ static bool sttIsGroup(int id) DBVARIANT dbv = {0};
char buf[32];
wsprintfA(buf, "%d", (int)(id-2));
- if (!DBGetContactSettingTString(NULL, "CListGroups", buf, &dbv))
+ if (!db_get_ts(NULL, "CListGroups", buf, &dbv))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return true;
}
return false;
@@ -381,10 +381,10 @@ static TCHAR *sttGetGroupName(int id) DBVARIANT dbv = {0};
char buf[32];
wsprintfA(buf, "%d", (int)(id-2));
- if (!DBGetContactSettingTString(NULL, "CListGroups", buf, &dbv))
+ if (!db_get_ts(NULL, "CListGroups", buf, &dbv))
{
TCHAR *res = mir_tstrdup(dbv.ptszVal+1);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return res;
}
return NULL;
@@ -397,15 +397,15 @@ static int sttGetGroupId(TCHAR *name) DBVARIANT dbv = {0};
char buf[32];
wsprintfA(buf, "%d", (int)i);
- if (!DBGetContactSettingTString(NULL, "CListGroups", buf, &dbv))
+ if (!db_get_ts(NULL, "CListGroups", buf, &dbv))
{
if (!lstrcmp(dbv.ptszVal+1, name))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return i+2;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else
{
// default is root
@@ -459,10 +459,10 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options) DBVARIANT dbv;
TCHAR *title;
bool bFree = false;
- if (DBGetContactSettingTString(hContact, "CList", "StatusMsg", &dbv) || !*dbv.ptszVal)
+ if (db_get_ts(hContact, "CList", "StatusMsg", &dbv) || !*dbv.ptszVal)
{
char *proto = GetContactProto(hContact);
- int status = DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE);
+ int status = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE);
title = (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, status, GSMDF_TCHAR);
} else
{
@@ -472,7 +472,7 @@ static BOOL sttMeasureItem_Contact(LPMEASUREITEMSTRUCT lpmis, Options *options) if (!options->bSysColors) SelectObject(hdc, g_Options.hfntSecond);
GetTextExtentPoint32(hdc, title, lstrlen(title), &sz);
- if (bFree) DBFreeVariant(&dbv);
+ if (bFree) db_free(&dbv);
textWidth = sz.cx;
lpmis->itemHeight += sz.cy + 3;
}
@@ -667,7 +667,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) HIMAGELIST hIml = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
int iIcon = CallService(MS_CLIST_GETCONTACTICON, (WPARAM)hContact, 0);
- if (DBGetContactSettingDword(hContact, proto, "IdleTS", 0))
+ if (db_get_dw(hContact, proto, "IdleTS", 0))
{
ImageList_DrawDimmed(hIml, iIcon, hdcTemp,
lpdis->rcItem.left, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2,
@@ -682,7 +682,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) lpdis->rcItem.left += 20;
}
- if (options->wMaxRecent && DBGetContactSettingByte(hContact, "FavContacts", "IsFavourite", 0))
+ if (options->wMaxRecent && db_get_b(hContact, "FavContacts", "IsFavourite", 0))
{
DrawIconEx(hdcTemp, lpdis->rcItem.right - 18, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2,
Skin_GetIconByHandle(iconList[0].hIcolib), 16, 16, 0, NULL, DI_NORMAL);
@@ -747,9 +747,9 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) DBVARIANT dbv;
TCHAR *title;
bool bFree = false;
- if (DBGetContactSettingTString(hContact, "CList", "StatusMsg", &dbv) || !*dbv.ptszVal)
+ if (db_get_ts(hContact, "CList", "StatusMsg", &dbv) || !*dbv.ptszVal)
{
- int status = DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE);
+ int status = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE);
title = (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, status, GSMDF_TCHAR);
} else
{
@@ -761,7 +761,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) SetTextColor(hdcTemp, clLine2);
DrawText(hdcTemp, title, lstrlen(title), &lpdis->rcItem, DT_NOPREFIX|DT_SINGLELINE|DT_TOP|DT_LEFT);
- if (bFree) DBFreeVariant(&dbv);
+ if (bFree) db_free(&dbv);
}
SelectObject(hdcTemp, hfntSave);
@@ -946,7 +946,7 @@ int sttShowMenu(bool centered) szMenu.cy = max(szMenu.cy, szColumn.cy);
szColumn.cx = szColumn.cy = 0;
- unsigned maxWidth = GetSystemMetrics(SM_CXSCREEN) * DBGetContactSettingByte(NULL, "FavContacts", "MenuWidth", 66) / 100;
+ unsigned maxWidth = GetSystemMetrics(SM_CXSCREEN) * db_get_b(NULL, "FavContacts", "MenuWidth", 66) / 100;
if (szMenu.cx > maxWidth) {
g_widthMultiplier = (float)maxWidth / szMenu.cx;
szMenu.cx *= g_widthMultiplier;
@@ -1019,7 +1019,7 @@ int ProcessSrmmEvent( WPARAM wParam, LPARAM lParam ) hDialogsList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
WindowList_Add(hDialogsList, event->hwndWindow, event->hContact);
- BYTE fav = DBGetContactSettingByte(event->hContact, "FavContacts", "IsFavourite", 0);
+ BYTE fav = db_get_b(event->hContact, "FavContacts", "IsFavourite", 0);
StatusIconData sid = {0};
sid.cbSize = sizeof(sid);
sid.szModule = "FavContacts";
@@ -1060,8 +1060,8 @@ int ProcessSrmmIconClick( WPARAM wParam, LPARAM lParam ) if (sicd->flags & MBCF_RIGHTBUTTON)
{
- BYTE fav = !DBGetContactSettingByte(hContact, "FavContacts", "IsFavourite", 0);
- DBWriteContactSettingByte(hContact, "FavContacts", "IsFavourite", fav);
+ BYTE fav = !db_get_b(hContact, "FavContacts", "IsFavourite", 0);
+ db_set_b(hContact, "FavContacts", "IsFavourite", fav);
if (fav) CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
StatusIconData sid = {0};
@@ -1131,7 +1131,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA {
SendDlgItemMessage(hwnd, IDC_CLIST, CLM_SETCHECKMARK,
SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0),
- DBGetContactSettingByte(hContact, "FavContacts", "IsFavourite", 0));
+ db_get_b(hContact, "FavContacts", "IsFavourite", 0));
}
bInitialized = true;
@@ -1268,8 +1268,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA {
BYTE fav = SendDlgItemMessage(hwnd, IDC_CLIST, CLM_GETCHECKMARK,
SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0), 0);
- if (fav != DBGetContactSettingByte(hContact, "FavContacts", "IsFavourite", 0))
- DBWriteContactSettingByte(hContact, "FavContacts", "IsFavourite", fav);
+ if (fav != db_get_b(hContact, "FavContacts", "IsFavourite", 0))
+ db_set_b(hContact, "FavContacts", "IsFavourite", fav);
if (fav) CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
}
} else
@@ -1291,7 +1291,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA if (SendDlgItemMessage(hwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0) == iSelection)
{
SendDlgItemMessage(hwnd, IDC_CLIST, CLM_SETCHECKMARK, iSelection,
- DBGetContactSettingByte(hContact, "FavContacts", "IsFavourite", 0));
+ db_get_b(hContact, "FavContacts", "IsFavourite", 0));
break;
}
break;
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index 6d5069ab5f..466525ce88 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -264,18 +264,18 @@ int RetrieveFileSize(char *filename) FILEECHO::FILEECHO(HANDLE Contact)
{
hContact = Contact;
- dwSendInterval = DBGetContactSettingDword(NULL, SERVICE_NAME, "SendDelay", 6000);
- //dwChunkSize = DBGetContactSettingDword(NULL, SERVICE_NAME, "ChunkSize", 5000);
+ dwSendInterval = db_get_dw(NULL, SERVICE_NAME, "SendDelay", 6000);
+ //dwChunkSize = db_get_dw(NULL, SERVICE_NAME, "ChunkSize", 5000);
- chunkMaxLen = DBGetContactSettingDword(NULL, SERVICE_NAME, "ChunkSize", 5000);
+ chunkMaxLen = db_get_dw(NULL, SERVICE_NAME, "ChunkSize", 5000);
chunkCount = 0;
filename = NULL;
- rgbRecv = DBGetContactSettingDword(NULL, SERVICE_NAME, "colorRecv", RGB(64,255,64));
- rgbSent = DBGetContactSettingDword(NULL, SERVICE_NAME, "colorSent", RGB(255,255,64));
- rgbUnSent = DBGetContactSettingDword(NULL, SERVICE_NAME, "colorUnsent", RGB(128,128,128));
- rgbToSend = DBGetContactSettingDword(NULL, SERVICE_NAME, "colorTosend", RGB(192,192,192));
- asBinary = DBGetContactSettingDword(NULL, SERVICE_NAME, "base64", 1) == 0;
+ rgbRecv = db_get_dw(NULL, SERVICE_NAME, "colorRecv", RGB(64,255,64));
+ rgbSent = db_get_dw(NULL, SERVICE_NAME, "colorSent", RGB(255,255,64));
+ rgbUnSent = db_get_dw(NULL, SERVICE_NAME, "colorUnsent", RGB(128,128,128));
+ rgbToSend = db_get_dw(NULL, SERVICE_NAME, "colorTosend", RGB(192,192,192));
+ asBinary = db_get_dw(NULL, SERVICE_NAME, "base64", 1) == 0;
}
uint controlEnabled[][2] =
@@ -573,8 +573,8 @@ void FILEECHO::incomeRequest(char *param) inSend = FALSE;
SkinPlaySound("RecvFile");
- int AutoMin = DBGetContactSettingByte(NULL,"SRFile","AutoMin",0);
- if(DBGetContactSettingByte(NULL,"SRFile","AutoAccept",0) && !DBGetContactSettingByte((HANDLE)hContact,"CList","NotOnList",0))
+ int AutoMin = db_get_b(NULL,"SRFile","AutoMin",0);
+ if(db_get_b(NULL,"SRFile","AutoAccept",0) && !db_get_b((HANDLE)hContact,"CList","NotOnList",0))
{
PostMessage(hDlg, WM_COMMAND, IDC_PLAY, 0);
if(AutoMin)
@@ -667,7 +667,7 @@ void FILEECHO::onRecvTimer() SetDlgItemText(hDlg, IDC_STATUS, msg);
MakePopupMsg(hDlg, hContact, msg);
setState(STATE_FINISHED);
- if(DBGetContactSettingByte(NULL,"SRFile","AutoClose",0))
+ if(db_get_b(NULL,"SRFile","AutoClose",0))
{
PostMessage(hDlg, WM_CLOSE, 0,0);
CallService(MS_CLIST_REMOVEEVENT, (WPARAM)hContact, 0);
@@ -1184,7 +1184,7 @@ INT_PTR CALLBACK DialogProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam if (szProto)
{
int dwStatus;
- dwStatus = DBGetContactSettingWord(dat->hContact,szProto,"Status",ID_STATUS_OFFLINE);
+ dwStatus = db_get_w(dat->hContact,szProto,"Status",ID_STATUS_OFFLINE);
if(dat->inSend && dwStatus != dat->contactStatus)
{
if(dat->contactStatus == ID_STATUS_OFFLINE)
diff --git a/plugins/FileAsMessage/src/optionsdlg.cpp b/plugins/FileAsMessage/src/optionsdlg.cpp index 748a118db5..d1b402c5c8 100644 --- a/plugins/FileAsMessage/src/optionsdlg.cpp +++ b/plugins/FileAsMessage/src/optionsdlg.cpp @@ -45,11 +45,11 @@ INT_PTR CALLBACK OptionsDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM for(int indx = 0; indx < SIZEOF(settingId); indx++)
if(settingId[indx] > 0)
- SendDlgItemMessage(hwndDlg, settingId[indx], CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, SERVICE_NAME, settingName[indx], settingDefault[indx]));
+ SendDlgItemMessage(hwndDlg, settingId[indx], CPM_SETCOLOUR, 0, db_get_dw(NULL, SERVICE_NAME, settingName[indx], settingDefault[indx]));
else
- SetDlgItemInt(hwndDlg, -settingId[indx], DBGetContactSettingDword(NULL, SERVICE_NAME, settingName[indx], settingDefault[indx]), FALSE);
+ SetDlgItemInt(hwndDlg, -settingId[indx], db_get_dw(NULL, SERVICE_NAME, settingName[indx], settingDefault[indx]), FALSE);
- CheckDlgButton(hwndDlg, IDC_ALPHANUM, DBGetContactSettingDword(NULL, SERVICE_NAME, "base64", 1)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALPHANUM, db_get_dw(NULL, SERVICE_NAME, "base64", 1)?BST_CHECKED:BST_UNCHECKED);
return TRUE;
@@ -97,9 +97,9 @@ INT_PTR CALLBACK OptionsDlgProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM value = GetDlgItemInt(hwndDlg, -settingId[indx], &succ, FALSE);
if(!succ) value = settingDefault[indx];
}
- DBWriteContactSettingDword(NULL,SERVICE_NAME,settingName[indx], value);
+ db_set_dw(NULL,SERVICE_NAME,settingName[indx], value);
}
- DBWriteContactSettingDword(NULL,SERVICE_NAME, "base64", (IsDlgButtonChecked(hwndDlg, IDC_ALPHANUM) == BST_CHECKED)?1:0);
+ db_set_dw(NULL,SERVICE_NAME, "base64", (IsDlgButtonChecked(hwndDlg, IDC_ALPHANUM) == BST_CHECKED)?1:0);
return TRUE;
}
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index b67d2e8b58..6c502acfca 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -213,7 +213,7 @@ int OnExtraImageApply(WPARAM wParam, LPARAM lParam) DBVARIANT dbvMirVer;
if ( !db_get_ts(hContact, szProto, "MirVer", &dbvMirVer)) {
ApplyFingerprintImage(hContact, dbvMirVer.ptszVal);
- DBFreeVariant(&dbvMirVer);
+ db_free(&dbvMirVer);
}
else ApplyFingerprintImage(hContact, NULL);
}
diff --git a/plugins/FlashAvatars/src/cflash.cpp b/plugins/FlashAvatars/src/cflash.cpp index 711a3b2f1c..7153d41c9f 100644 --- a/plugins/FlashAvatars/src/cflash.cpp +++ b/plugins/FlashAvatars/src/cflash.cpp @@ -199,7 +199,7 @@ static void __cdecl loadFlash_Thread(void *p) { // change flash frame according user's status
int status;
if (fai->hFA.hContact)
- status = DBGetContactSettingWord(fai->hFA.hContact, fai->getProto(), "Status", ID_STATUS_OFFLINE);
+ status = db_get_w(fai->hFA.hContact, fai->getProto(), "Status", ID_STATUS_OFFLINE);
else
status = CallProtoService(fai->getProto(), PS_GETSTATUS, 0, 0);
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index ba94e8fd69..ceb9c2d971 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -66,15 +66,14 @@ BOOL bVersionOK = FALSE; BOOL bDockHorz = TRUE;
//UINT nStatus = 0;
HMENU hContactMenu = NULL;
-HANDLE hMenuItemRemove = NULL;
-HANDLE hMenuItemHideAll = NULL;
-HANDLE hMainMenuItemHideAll = NULL;
RECT rcScreen;
DWORD dwOfflineModes = 0;
BOOL bEnableTip = FALSE;
UINT_PTR ToTopTimerID = 0;
BOOL bIsCListShow = TRUE;
+HGENMENU hMenuItemRemove, hMenuItemHideAll, hMainMenuItemHideAll;
+
int hLangpack;
pfnSHAutoComplete fnSHAutoComplete = NULL;
@@ -226,16 +225,15 @@ static int OnContactDrop( WPARAM wParam, LPARAM lParam ) static int OnContactDragStop( WPARAM wParam, LPARAM lParam )
{
- HANDLE hContact = ( HANDLE )wParam;
+ HANDLE hContact = ( HANDLE )wParam;
ThumbInfo *pThumb = thumbList.FindThumbByContact( hContact );
- if ( ( pThumb != NULL ) && ( hNewContact == hContact ))
- {
+ if (pThumb != NULL && hNewContact == hContact ) {
thumbList.RemoveThumb( pThumb );
hNewContact = NULL;
}
- return( 0 );
+ return 0;
}
@@ -248,7 +246,7 @@ static int OnSkinIconsChanged( WPARAM wParam, LPARAM lParam ) for (int i = 0; i < thumbList.getCount(); ++i)
thumbList[i]->UpdateContent();
- return( 0 );
+ return 0;
}
@@ -269,10 +267,10 @@ static int OnContactSettingChanged( WPARAM wParam, LPARAM lParam ) ApplyOptionsChanges();
}
- return( 0 );
+ return 0;
}
- if ( pThumb == NULL ) return( 0 );
+ if ( pThumb == NULL ) return 0;
// Only on these 2 events we need to refresh
if ( 0 == _stricmp( pdbcws->szSetting, "Status" ))
@@ -302,7 +300,7 @@ static int OnContactSettingChanged( WPARAM wParam, LPARAM lParam ) PostMessage( pThumb->hwnd, WM_REFRESH_CONTACT, 0, idStatus );
}
- return( 0 );
+ return 0;
}
@@ -322,7 +320,7 @@ static int OnStatusModeChange( WPARAM wParam, LPARAM lParam ) // Floating status window will use this
}
- return( 0 );
+ return 0;
}
@@ -331,14 +329,9 @@ static int OnPrebuildContactMenu( WPARAM wParam, LPARAM lParam ) {
ThumbInfo *pThumb = thumbList.FindThumbByContact( (HANDLE) wParam );
- CLISTMENUITEM clmi = { sizeof(clmi) };
- clmi.flags = ( pThumb == NULL ) ? CMIM_FLAGS | CMIF_HIDDEN : CMIM_FLAGS &~CMIF_HIDDEN;
- CallService( MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemRemove, (LPARAM)&clmi );
-
- clmi.flags = fcOpt.bHideAll ? CMIM_FLAGS | CMIF_HIDDEN : CMIM_FLAGS &~CMIF_HIDDEN;
- CallService( MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemHideAll, (LPARAM)&clmi );
-
- return( 0 );
+ Menu_ShowItem(hMenuItemRemove, pThumb != NULL);
+ Menu_ShowItem(hMenuItemHideAll, !fcOpt.bHideAll);
+ return 0;
}
@@ -680,7 +673,7 @@ static void CreateBackgroundBrush() if (db_get_b(NULL, MODULE, "BkUseBitmap", FLT_DEFAULT_BKGNDUSEBITMAP)) {
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, MODULE, "BkBitmap", &dbv)) {
+ if ( !db_get_ts(NULL, MODULE, "BkBitmap", &dbv)) {
hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
@@ -736,7 +729,7 @@ void RegHotkey( HANDLE hContact, HWND hwnd ) char szBuf[ MAX_PATH ] = {0};
DBVARIANT dbv;
- if (DBGetContactSettingString(hContact, MODULE, "Hotkey", &dbv)) return;
+ if (db_get_s(hContact, MODULE, "Hotkey", &dbv)) return;
strncpy(szBuf, dbv.pszVal, MAX_PATH - 1);
db_free( &dbv );
@@ -1021,7 +1014,7 @@ static int OnModulesLoded( WPARAM wParam, LPARAM lParam ) fcOpt.ToTopTime = (fcOpt.ToTopTime>TOTOPTIME_MAX)?TOTOPTIME_MAX:fcOpt.ToTopTime;
ToTopTimerID = SetTimer(NULL, 0, fcOpt.ToTopTime*TOTOPTIME_P, ToTopTimerProc);
}
- return( 0 );
+ return 0;
}
extern "C" int __declspec(dllexport) Load()
diff --git a/plugins/FloatingContacts/src/options.cpp b/plugins/FloatingContacts/src/options.cpp index 4eb3cf3fd1..0ec7c56a44 100644 --- a/plugins/FloatingContacts/src/options.cpp +++ b/plugins/FloatingContacts/src/options.cpp @@ -180,7 +180,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP SendMessage(hwndDlg, M_REFRESHBKGBOXES, 0, 0);
{
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, MODULE, "BkBitmap", &dbv)) {
+ if ( !db_get_ts(NULL, MODULE, "BkBitmap", &dbv)) {
SetDlgItemText(hwndDlg, IDC_FILENAME, dbv.ptszVal);
db_free(&dbv);
}
@@ -196,7 +196,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP fnSHAutoComplete(GetDlgItem(hwndDlg, IDC_FILENAME), 1);
// Windows 2K/XP
- BYTE btOpacity = (BYTE)DBGetContactSettingByte(NULL, MODULE, "Opacity", 100);
+ BYTE btOpacity = (BYTE)db_get_b(NULL, MODULE, "Opacity", 100);
SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_SETRANGE, TRUE, MAKELONG(0, 100));
SendDlgItemMessage(hwndDlg, IDC_SLIDER_OPACITY, TBM_SETPOS, TRUE, btOpacity);
@@ -306,7 +306,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP TCHAR str[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, SIZEOF(str));
- DBWriteContactSettingTString(NULL, MODULE, "BkBitmap", str);
+ db_set_ts(NULL, MODULE, "BkBitmap", str);
WORD flags = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHH))
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp index 407bf18220..c56bff0840 100644 --- a/plugins/FloatingContacts/src/thumbs.cpp +++ b/plugins/FloatingContacts/src/thumbs.cpp @@ -407,7 +407,7 @@ void ThumbInfo::RefreshContactStatus(int idStatus) void ThumbInfo::DeleteContactPos()
{
- DBDeleteContactSetting( hContact, MODULE, "ThumbsPos" );
+ db_unset( hContact, MODULE, "ThumbsPos" );
}
void ThumbInfo::OnLButtonDown(int nX, int nY)
diff --git a/plugins/Folders/src/utils.cpp b/plugins/Folders/src/utils.cpp index 69d571990f..93d572cf78 100644 --- a/plugins/Folders/src/utils.cpp +++ b/plugins/Folders/src/utils.cpp @@ -183,7 +183,7 @@ int GetStringFromDatabase(char *szSettingName, const wchar_t *szError, TCHAR *sz {
size_t len;
DBVARIANT dbv;
- if ( DBGetContactSettingWString(NULL, ModuleName, szSettingName, &dbv) == 0) {
+ if ( db_get_ws(NULL, ModuleName, szSettingName, &dbv) == 0) {
size_t tmp = _tcslen(dbv.ptszVal);
len = (tmp < size - 1) ? tmp : size - 1;
_tcsncpy(szResult, dbv.ptszVal, len);
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 1e159b146f..19193efdd4 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -104,7 +104,7 @@ string DBGetString(HANDLE hContact, const char *szModule, const char *szSetting, }
} else
ret = pszError;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return ret;
}
@@ -955,16 +955,16 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara HWND hShareList = GetDlgItem(hwndDlg, IDC_CURRENT_SHARES);
HWND hUserList = GetDlgItem(hwndDlg, IDC_CURRENT_USERS);
- DBWriteContactSettingWord(NULL, MODULE, "StatWnd_cx1", (WORD)ListView_GetColumnWidth(hShareList, 0));
- DBWriteContactSettingWord(NULL, MODULE, "StatWnd_cx2", (WORD)ListView_GetColumnWidth(hShareList, 1));
- DBWriteContactSettingWord(NULL, MODULE, "StatWnd_cx3", (WORD)ListView_GetColumnWidth(hShareList, 2));
- DBWriteContactSettingWord(NULL, MODULE, "StatWnd_cx4", (WORD)ListView_GetColumnWidth(hShareList, 3));
- DBWriteContactSettingWord(NULL, MODULE, "StatWnd_cx5", (WORD)ListView_GetColumnWidth(hShareList, 4));
- DBWriteContactSettingWord(NULL, MODULE, "StatWnd_cx6", (WORD)ListView_GetColumnWidth(hUserList, 0));
- DBWriteContactSettingWord(NULL, MODULE, "StatWnd_cx7", (WORD)ListView_GetColumnWidth(hUserList, 1));
- DBWriteContactSettingWord(NULL, MODULE, "StatWnd_cx8", (WORD)ListView_GetColumnWidth(hUserList, 2));
- DBWriteContactSettingWord(NULL, MODULE, "StatWnd_cx9", (WORD)ListView_GetColumnWidth(hUserList, 3));
- DBWriteContactSettingWord(NULL, MODULE, "StatWnd_cx10", (WORD)ListView_GetColumnWidth(hUserList, 4));
+ db_set_w(NULL, MODULE, "StatWnd_cx1", (WORD)ListView_GetColumnWidth(hShareList, 0));
+ db_set_w(NULL, MODULE, "StatWnd_cx2", (WORD)ListView_GetColumnWidth(hShareList, 1));
+ db_set_w(NULL, MODULE, "StatWnd_cx3", (WORD)ListView_GetColumnWidth(hShareList, 2));
+ db_set_w(NULL, MODULE, "StatWnd_cx4", (WORD)ListView_GetColumnWidth(hShareList, 3));
+ db_set_w(NULL, MODULE, "StatWnd_cx5", (WORD)ListView_GetColumnWidth(hShareList, 4));
+ db_set_w(NULL, MODULE, "StatWnd_cx6", (WORD)ListView_GetColumnWidth(hUserList, 0));
+ db_set_w(NULL, MODULE, "StatWnd_cx7", (WORD)ListView_GetColumnWidth(hUserList, 1));
+ db_set_w(NULL, MODULE, "StatWnd_cx8", (WORD)ListView_GetColumnWidth(hUserList, 2));
+ db_set_w(NULL, MODULE, "StatWnd_cx9", (WORD)ListView_GetColumnWidth(hUserList, 3));
+ db_set_w(NULL, MODULE, "StatWnd_cx10", (WORD)ListView_GetColumnWidth(hUserList, 4));
bool b = IsDlgButtonChecked(hwndDlg, IDC_SHOWHIDDENSHARES) == BST_CHECKED;
db_set_b(NULL, MODULE, "StatWnd_ShowHidden", b);
@@ -1032,7 +1032,7 @@ static INT_PTR nShareNewFile(WPARAM wParam, LPARAM lParam) { if (hContact) {
// Try to locate an IP address.
DBVARIANT dbv = {0};
- if (! DBGetContactSetting(hContact, "Protocol", "p", &dbv)) {
+ if (! db_get(hContact, "Protocol", "p", &dbv)) {
if (dbv.type == DBVT_ASCIIZ) {
stNewShare.dwAllowedIP = db_get_dw(hContact, dbv.pszVal, "IP", 0);
if (! stNewShare.dwAllowedIP)
@@ -1041,7 +1041,7 @@ static INT_PTR nShareNewFile(WPARAM wParam, LPARAM lParam) { stNewShare.dwAllowedIP = db_get_dw(hContact, MODULE, "LastUsedIP", 0);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
stNewShare.dwAllowedMask = db_get_dw(hContact, MODULE, "LastUsedMask", 0);
}
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp index bde839a30c..17ebfa7af0 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp @@ -49,23 +49,23 @@ INT_PTR WINAPI MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) TranslateDialogDefault(hDlg);
TranslateMenu(listMenu);
- if ( DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SAVESPECIAL, 0x00) == 0x00 )
+ if ( db_get_b(NULL, LINKLIST_MODULE, LINKLIST_SAVESPECIAL, 0x00) == 0x00 )
hContact = NULL;
else
hContact = DlgParam->hContact;
- if ( DBGetContactSettingByte(hContact, LINKLIST_MODULE, LINKLIST_FIRST, 0) == 0 )
+ if ( db_get_b(hContact, LINKLIST_MODULE, LINKLIST_FIRST, 0) == 0 )
{
// First use of this plugin! Set default size!
- DBWriteContactSettingDword(hContact, LINKLIST_MODULE, "LinklistWidth", 400);
- DBWriteContactSettingDword(hContact, LINKLIST_MODULE, "LinklistHeight", 450);
- DBWriteContactSettingDword(hContact, LINKLIST_MODULE, "LinklistX", 0);
- DBWriteContactSettingDword(hContact, LINKLIST_MODULE, "LinklistY", 0);
+ db_set_dw(hContact, LINKLIST_MODULE, "LinklistWidth", 400);
+ db_set_dw(hContact, LINKLIST_MODULE, "LinklistHeight", 450);
+ db_set_dw(hContact, LINKLIST_MODULE, "LinklistX", 0);
+ db_set_dw(hContact, LINKLIST_MODULE, "LinklistY", 0);
- DBWriteContactSettingByte(hContact, LINKLIST_MODULE, LINKLIST_FIRST, 1);
+ db_set_b(hContact, LINKLIST_MODULE, LINKLIST_FIRST, 1);
}
- DlgParam->splitterPosNew = (int)DBGetContactSettingDword(hContact, LINKLIST_MODULE, LINKLIST_SPLITPOS, -1);
+ DlgParam->splitterPosNew = (int)db_get_dw(hContact, LINKLIST_MODULE, LINKLIST_SPLITPOS, -1);
GetWindowRect(GetDlgItem(hDlg, IDC_MAIN), &rc);
DlgParam->minSize.cx = rc.right - rc.left;
@@ -122,7 +122,7 @@ INT_PTR WINAPI MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) pENLink = (ENLINK*)lpNmhdr;
- mouseEvent = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_MOUSE_EVENT, 0xFF);
+ mouseEvent = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_MOUSE_EVENT, 0xFF);
if ( pENLink->msg == WM_MOUSEMOVE && mouseEvent == 0x01 )
{
@@ -140,7 +140,7 @@ INT_PTR WINAPI MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) ShellExecute(HWND_TOP, NULL, link, NULL, NULL, SW_SHOWNORMAL);
else
{
- openNewWindow = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_OPEN_WINDOW, 0xFF);
+ openNewWindow = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_OPEN_WINDOW, 0xFF);
if ( openNewWindow == 0xFF )
openNewWindow = 0;
@@ -156,7 +156,7 @@ INT_PTR WINAPI MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) hSubMenu = GetSubMenu(hPopup, 0);
// Disable Menuoption if "mouse over" events are active
- mouseEvent = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_MOUSE_EVENT, 0xFF);
+ mouseEvent = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_MOUSE_EVENT, 0xFF);
if (mouseEvent == 0x01 )
EnableMenuItem(hSubMenu, IDM_SHOWMESSAGE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
@@ -442,12 +442,12 @@ INT_PTR WINAPI MainDlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam ) case WM_DESTROY:
{
HANDLE hContact;
- if ( DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SAVESPECIAL, 0x00) == 0x00 )
+ if ( db_get_b(NULL, LINKLIST_MODULE, LINKLIST_SAVESPECIAL, 0x00) == 0x00 )
hContact = NULL;
else
hContact = DlgParam->hContact;
Utils_SaveWindowPosition(hDlg, hContact, LINKLIST_MODULE, "Linklist");
- DBWriteContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_SPLITPOS, DlgParam->splitterPosNew);
+ db_set_dw(NULL, LINKLIST_MODULE, LINKLIST_SPLITPOS, DlgParam->splitterPosNew);
RemoveList(DlgParam->listStart);
free(DlgParam);
// Remove entry from Window list
@@ -548,7 +548,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l case WM_INITDIALOG:
{
TranslateDialogDefault(hDlg);
- useDefault = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0xFF);
+ useDefault = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0xFF);
if ( useDefault == 0x01 )
{
mCol = GetMirandaColour(&colourSet);
@@ -838,7 +838,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l options.showTime = 1;
WriteOptionExample(hDlg, colourSet.incoming, colourSet.outgoing, colourSet.background, colourSet.text, &options);
- //DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TIME, 0x01);
+ //db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TIME, 0x01);
WriteOptionExample(hDlg, colourSet.incoming, colourSet.outgoing, colourSet.background, colourSet.text, &options);
break;
@@ -853,7 +853,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l options.showDirection = 1;
WriteOptionExample(hDlg, colourSet.incoming, colourSet.outgoing, colourSet.background, colourSet.text, &options);
- //DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_DIRECTION, 0x01);
+ //db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_DIRECTION, 0x01);
WriteOptionExample(hDlg, colourSet.incoming, colourSet.outgoing, colourSet.background, colourSet.text, &options);
break;
@@ -868,7 +868,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l options.showType = 1;
WriteOptionExample(hDlg, colourSet.incoming, colourSet.outgoing, colourSet.background, colourSet.text, &options);
- //DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TYPE, 0x01);
+ //db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TYPE, 0x01);
WriteOptionExample(hDlg, colourSet.incoming, colourSet.outgoing, colourSet.background, colourSet.text, &options);
break;
@@ -882,10 +882,10 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l {
// Write Settings to Database
if ( SendDlgItemMessage(hDlg, IDC_CHECK1, BM_GETCHECK, 0, 0) == BST_CHECKED )
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0x01);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0x01);
else
{
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0x00);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0x00);
colourSet.incoming = SendDlgItemMessage(hDlg, IDC_INCOMING, CPM_GETCOLOUR, 0, 0);
colourSet.outgoing = SendDlgItemMessage(hDlg, IDC_OUTGOING, CPM_GETCOLOUR, 0, 0);
colourSet.background = SendDlgItemMessage(hDlg, IDC_BACKGROUND, CPM_GETCOLOUR, 0, 0);
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index bc5c5abe61..3e12ced1ef 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -842,77 +842,77 @@ void GetListInfo(BYTE params, LISTELEMENT *listStart, LPCTSTR searchString, siz void GetListOptions(LISTOPTIONS *options)
{
- options->openNewWindow = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_OPEN_WINDOW, 0xFF);
+ options->openNewWindow = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_OPEN_WINDOW, 0xFF);
if(options->openNewWindow == 0xFF)
{
// No DB entry for this Plugin
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_OPEN_WINDOW, 0x00);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_OPEN_WINDOW, 0x00);
options->openNewWindow = 0x00;
}
- options->updateWindow = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_UPDATE_WINDOW, 0xFF);
+ options->updateWindow = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_UPDATE_WINDOW, 0xFF);
if(options->updateWindow == 0xFF)
{
// No DB entry for this Plugin
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_UPDATE_WINDOW, 0x00);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_UPDATE_WINDOW, 0x00);
options->updateWindow = 0x00;
}
- options->mouseEvent = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_MOUSE_EVENT, 0xFF);
+ options->mouseEvent = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_MOUSE_EVENT, 0xFF);
if(options->mouseEvent == 0xFF)
{
// No DB entry for this Plugin
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_MOUSE_EVENT, 0x00);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_MOUSE_EVENT, 0x00);
options->mouseEvent = 0x00;
}
- options->saveSpecial = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SAVESPECIAL, 0xFF);
+ options->saveSpecial = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_SAVESPECIAL, 0xFF);
if(options->saveSpecial == 0xFF)
{
// No DB entry for this Plugin
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SAVESPECIAL, 0x00);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SAVESPECIAL, 0x00);
options->saveSpecial = 0x00;
}
- options->showDate = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_DATE, 0xFF);
+ options->showDate = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_DATE, 0xFF);
if(options->showDate == 0xFF)
{
// No DB entry for this Plugin
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_DATE, 0x01);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_DATE, 0x01);
options->showDate = 0x01;
}
- options->showLine = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_LINE, 0xFF);
+ options->showLine = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_LINE, 0xFF);
if(options->showLine == 0xFF)
{
// No DB entry for this Plugin
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_LINE, 0x01);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_LINE, 0x01);
options->showLine = 0x01;
}
- options->showTime = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TIME, 0xFF);
+ options->showTime = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TIME, 0xFF);
if(options->showTime == 0xFF)
{
// No DB entry for this Plugin
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TIME, 0x01);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TIME, 0x01);
options->showTime = 0x01;
}
- options->showDirection = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_DIRECTION, 0xFF);
+ options->showDirection = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_DIRECTION, 0xFF);
if(options->showDirection == 0xFF)
{
// No DB entry for this Plugin
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_DIRECTION, 0x01);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_DIRECTION, 0x01);
options->showDirection = 0x01;
}
- options->showType = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TYPE, 0xFF);
+ options->showType = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TYPE, 0xFF);
if(options->showType == 0xFF)
{
// No DB entry for this Plugin
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TYPE, 0x01);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TYPE, 0x01);
options->showType = 0x01;
}
@@ -921,15 +921,15 @@ void GetListOptions(LISTOPTIONS *options) void SetListOptions(LISTOPTIONS *options)
{
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_OPEN_WINDOW, options->openNewWindow);
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_UPDATE_WINDOW, options->updateWindow);
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_MOUSE_EVENT, options->mouseEvent);
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SAVESPECIAL, options->saveSpecial);
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_DATE, options->showDate);
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_LINE, options->showLine);
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TIME, options->showTime);
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_DIRECTION, options->showDirection);
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TYPE, options->showType);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_OPEN_WINDOW, options->openNewWindow);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_UPDATE_WINDOW, options->updateWindow);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_MOUSE_EVENT, options->mouseEvent);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SAVESPECIAL, options->saveSpecial);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_DATE, options->showDate);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_LINE, options->showLine);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TIME, options->showTime);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_DIRECTION, options->showDirection);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_SHOW_TYPE, options->showType);
}
/*
@@ -977,11 +977,11 @@ void GetColour(MYCOLOURSET *colourSet) DWORD colour;
BYTE useDefault;
- useDefault = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0xFF);
+ useDefault = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0xFF);
if ( useDefault == 0xFF )
{
// No DB entry for this Plugin
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0x01);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0x01);
useDefault = 0x01;
}
@@ -990,51 +990,51 @@ void GetColour(MYCOLOURSET *colourSet) // Use Miranda-IM Default colours
// CHANGED AT MIRANDA 0.4!!!!
// Use SRMM... if it is not there try SRMsg (older Miranda Versions)
- colour = DBGetContactSettingDword(NULL, "SRMM", "SRMFont1Col", 0xFF000000);
+ colour = db_get_dw(NULL, "SRMM", "SRMFont1Col", 0xFF000000);
if ( colour != 0xFF000000 )
colourSet->incoming = colour;
else
{
- colour = DBGetContactSettingDword(NULL, "SRMsg", "Font3Col", 0xFF000000);
+ colour = db_get_dw(NULL, "SRMsg", "Font3Col", 0xFF000000);
if ( colour != 0xFF000000 )
colourSet->incoming = colour;
else
{
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0x00);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0x00);
useDefault = 0x00;
}
}
// SRMM
- colour = DBGetContactSettingDword(NULL, "SRMM", "SRMFont0Col", 0xFF000000);
+ colour = db_get_dw(NULL, "SRMM", "SRMFont0Col", 0xFF000000);
if ( colour != 0xFF000000 )
colourSet->outgoing = colour;
else
{
// SRMsg
- colour = DBGetContactSettingDword(NULL, "SRMsg", "Font0Col", 0xFF000000);
+ colour = db_get_dw(NULL, "SRMsg", "Font0Col", 0xFF000000);
if ( colour != 0xFF000000 )
colourSet->outgoing = colour;
else
{
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0x00);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0x00);
useDefault = 0x00;
}
}
// SRMM
- colour = DBGetContactSettingDword(NULL, "SRMM", "BkgColour", 0xFF000000);
+ colour = db_get_dw(NULL, "SRMM", "BkgColour", 0xFF000000);
if ( colour != 0xFF000000 )
colourSet->background = colour;
else
{
// SRMsg
- colour = DBGetContactSettingDword(NULL, "SRMsg", "BkgColour", 0xFF000000);
+ colour = db_get_dw(NULL, "SRMsg", "BkgColour", 0xFF000000);
if ( colour != 0xFF000000 )
colourSet->background = colour;
else
{
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0x00);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_USE_DEF, 0x00);
useDefault = 0x00;
}
}
@@ -1044,25 +1044,25 @@ void GetColour(MYCOLOURSET *colourSet) if ( useDefault == 0x00 )
{
// Use Plugin user defined or default colours
- colour = DBGetContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_IN_COL, 0xFF000000);
+ colour = db_get_dw(NULL, LINKLIST_MODULE, LINKLIST_IN_COL, 0xFF000000);
if ( colour != 0xFF000000 )
colourSet->incoming = colour;
else
colourSet->incoming = IN_COL_DEF;
- colour = DBGetContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_OUT_COL, 0xFF000000);
+ colour = db_get_dw(NULL, LINKLIST_MODULE, LINKLIST_OUT_COL, 0xFF000000);
if ( colour != 0xFF000000 )
colourSet->outgoing = colour;
else
colourSet->outgoing = OUT_COL_DEF;
- colour = DBGetContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_BG_COL, 0xFF000000);
+ colour = db_get_dw(NULL, LINKLIST_MODULE, LINKLIST_BG_COL, 0xFF000000);
if ( colour != 0xFF000000 )
colourSet->background = colour;
else
colourSet->background = BG_COL_DEF;
- colour = DBGetContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_TXT_COL, 0xFF000000);
+ colour = db_get_dw(NULL, LINKLIST_MODULE, LINKLIST_TXT_COL, 0xFF000000);
if ( colour != 0xFF000000 )
colourSet->text = colour;
else
@@ -1079,39 +1079,39 @@ void GetDBColour(MYCOLOURSET *colourSet) DWORD colour;
// Use Plugin user defined or default colours
- colour = DBGetContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_IN_COL, 0xFF000000);
+ colour = db_get_dw(NULL, LINKLIST_MODULE, LINKLIST_IN_COL, 0xFF000000);
if(colour != 0xFF000000)
colourSet->incoming = colour;
else
{
- DBWriteContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_IN_COL, IN_COL_DEF);
+ db_set_dw(NULL, LINKLIST_MODULE, LINKLIST_IN_COL, IN_COL_DEF);
colourSet->incoming = IN_COL_DEF;
}
- colour = DBGetContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_OUT_COL, 0xFF000000);
+ colour = db_get_dw(NULL, LINKLIST_MODULE, LINKLIST_OUT_COL, 0xFF000000);
if(colour != 0xFF000000)
colourSet->outgoing = colour;
else
{
- DBWriteContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_OUT_COL, OUT_COL_DEF);
+ db_set_dw(NULL, LINKLIST_MODULE, LINKLIST_OUT_COL, OUT_COL_DEF);
colourSet->outgoing = OUT_COL_DEF;
}
- colour = DBGetContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_BG_COL, 0xFF000000);
+ colour = db_get_dw(NULL, LINKLIST_MODULE, LINKLIST_BG_COL, 0xFF000000);
if(colour != 0xFF000000)
colourSet->background = colour;
else
{
- DBWriteContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_BG_COL, BG_COL_DEF);
+ db_set_dw(NULL, LINKLIST_MODULE, LINKLIST_BG_COL, BG_COL_DEF);
colourSet->background = BG_COL_DEF;
}
- colour = DBGetContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_TXT_COL, 0xFF000000);
+ colour = db_get_dw(NULL, LINKLIST_MODULE, LINKLIST_TXT_COL, 0xFF000000);
if(colour != 0xFF000000)
colourSet->text = colour;
else
{
- DBWriteContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_TXT_COL, TXT_COL_DEF);
+ db_set_dw(NULL, LINKLIST_MODULE, LINKLIST_TXT_COL, TXT_COL_DEF);
colourSet->text = TXT_COL_DEF;
}
}
@@ -1125,12 +1125,12 @@ int GetMirandaColour(MYCOLOURSET *colourSet) // Use Miranda-IM Default colours
// Try SRMM (Miranda 0.4) .... or SRMsg... for older versions
- colour = DBGetContactSettingDword(NULL, "SRMM", "SRMFont1Col", 0xFF000000);
+ colour = db_get_dw(NULL, "SRMM", "SRMFont1Col", 0xFF000000);
if(colour != 0xFF000000)
colourSet->incoming = colour;
else
{
- colour = DBGetContactSettingDword(NULL, "SRMsg", "Font3Col", 0xFF000000);
+ colour = db_get_dw(NULL, "SRMsg", "Font3Col", 0xFF000000);
if(colour != 0xFF000000)
colourSet->incoming = colour;
else
@@ -1138,24 +1138,24 @@ int GetMirandaColour(MYCOLOURSET *colourSet) }
- colour = DBGetContactSettingDword(NULL, "SRMM", "SRMFont0Col", 0xFF000000);
+ colour = db_get_dw(NULL, "SRMM", "SRMFont0Col", 0xFF000000);
if(colour != 0xFF000000)
colourSet->outgoing = colour;
else
{
- colour = DBGetContactSettingDword(NULL, "SRMsg", "Font0Col", 0xFF000000);
+ colour = db_get_dw(NULL, "SRMsg", "Font0Col", 0xFF000000);
if(colour != 0xFF000000)
colourSet->outgoing = colour;
else
return 1;
}
- colour = DBGetContactSettingDword(NULL, "SRMM", "BkgColour", 0xFF000000);
+ colour = db_get_dw(NULL, "SRMM", "BkgColour", 0xFF000000);
if(colour != 0xFF000000)
colourSet->background = colour;
else
{
- colour = DBGetContactSettingDword(NULL, "SRMsg", "BkgColour", 0xFF000000);
+ colour = db_get_dw(NULL, "SRMsg", "BkgColour", 0xFF000000);
if(colour != 0xFF000000)
colourSet->background = colour;
else
@@ -1172,21 +1172,21 @@ Write user defined colours to the database */
void SetDBColour(MYCOLOURSET *colourSet)
{
- DBWriteContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_IN_COL, colourSet->incoming);
- DBWriteContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_OUT_COL, colourSet->outgoing);
- DBWriteContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_BG_COL, colourSet->background);
- DBWriteContactSettingDword(NULL, LINKLIST_MODULE, LINKLIST_TXT_COL, colourSet->text);
+ db_set_dw(NULL, LINKLIST_MODULE, LINKLIST_IN_COL, colourSet->incoming);
+ db_set_dw(NULL, LINKLIST_MODULE, LINKLIST_OUT_COL, colourSet->outgoing);
+ db_set_dw(NULL, LINKLIST_MODULE, LINKLIST_BG_COL, colourSet->background);
+ db_set_dw(NULL, LINKLIST_MODULE, LINKLIST_TXT_COL, colourSet->text);
}
BYTE GetUpdateSetting(void)
{
BYTE updateWindow;
- updateWindow = DBGetContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_UPDATE_WINDOW, 0xFF);
+ updateWindow = db_get_b(NULL, LINKLIST_MODULE, LINKLIST_UPDATE_WINDOW, 0xFF);
if ( updateWindow == 0xFF )
{
// No DB entry for this Plugin
- DBWriteContactSettingByte(NULL, LINKLIST_MODULE, LINKLIST_UPDATE_WINDOW, 0x00);
+ db_set_b(NULL, LINKLIST_MODULE, LINKLIST_UPDATE_WINDOW, 0x00);
return 0;
}
if ( updateWindow == 0x00 )
diff --git a/plugins/HistorySweeperLight/src/historysweeperlight.cpp b/plugins/HistorySweeperLight/src/historysweeperlight.cpp index 8783aafa34..70be70347b 100644 --- a/plugins/HistorySweeperLight/src/historysweeperlight.cpp +++ b/plugins/HistorySweeperLight/src/historysweeperlight.cpp @@ -132,7 +132,7 @@ static void GetBookmarks(HANDLE hContact, BEventData** books, size_t* bookcnt ) mir_free(tbooks);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -141,15 +141,15 @@ void SweepHistoryFromContact(HANDLE hContact, CriteriaStruct Criteria, BOOL keep {
int lPolicy;
if (hContact == NULL) // for system history
- lPolicy = DBGetContactSettingByte(NULL, ModuleName, "SweepSHistory", 0);
+ lPolicy = db_get_b(NULL, ModuleName, "SweepSHistory", 0);
else // for contact history (or "SweepHistory" - default action)
- lPolicy = DBGetContactSettingByte(hContact, ModuleName, "SweepHistory", DBGetContactSettingByte(NULL, ModuleName, "SweepHistory", 0));
+ lPolicy = db_get_b(hContact, ModuleName, "SweepHistory", db_get_b(NULL, ModuleName, "SweepHistory", 0));
if (lPolicy == 0) return; // nothing to do
int eventsCnt = db_event_count(hContact);
if (eventsCnt != 0) {
- BOOL doDelete, unsafe = DBGetContactSettingByte(NULL, ModuleName, "UnsafeMode", 0);
+ BOOL doDelete, unsafe = db_get_b(NULL, ModuleName, "UnsafeMode", 0);
BEventData *books, *item, ev = { 0 };
size_t bookcnt, btshift;
@@ -211,8 +211,8 @@ void ShutdownAction(void) CriteriaStruct Criteria;
HANDLE hContact = db_find_first();
- Criteria.keep = KeepCriteria(DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownKeep", 0));
- Criteria.time = BuildCriteria(DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownOlder", 0));
+ Criteria.keep = KeepCriteria(db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0));
+ Criteria.time = BuildCriteria(db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0));
SweepHistoryFromContact(NULL, Criteria, FALSE); // sweep system history, keepunread==0
@@ -228,12 +228,12 @@ int OnWindowEvent(WPARAM wParam, LPARAM lParam) {
MessageWindowEventData* msgEvData = (MessageWindowEventData*)lParam;
- if (msgEvData->uType == MSG_WINDOW_EVT_CLOSE && DBGetContactSettingByte(NULL, ModuleName, "SweepOnClose", 0))
+ if (msgEvData->uType == MSG_WINDOW_EVT_CLOSE && db_get_b(NULL, ModuleName, "SweepOnClose", 0))
{
CriteriaStruct Criteria;
- Criteria.keep = KeepCriteria(DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownKeep", 0));
- Criteria.time = BuildCriteria(DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownOlder", 0));
+ Criteria.keep = KeepCriteria(db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0));
+ Criteria.time = BuildCriteria(db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0));
SweepHistoryFromContact(msgEvData->hContact, Criteria, TRUE);
}
diff --git a/plugins/HistorySweeperLight/src/main.cpp b/plugins/HistorySweeperLight/src/main.cpp index 6f1133dbea..3508a6b8dc 100644 --- a/plugins/HistorySweeperLight/src/main.cpp +++ b/plugins/HistorySweeperLight/src/main.cpp @@ -52,7 +52,7 @@ int OnIconPressed(WPARAM wParam, LPARAM lParam) StatusIconClickData *sicd = (StatusIconClickData *)lParam;
if ( !(sicd->flags & MBCF_RIGHTBUTTON) && !lstrcmpA(sicd->szModule, ModuleName)
- && DBGetContactSettingByte(NULL, ModuleName, "ChangeInMW", 0))
+ && db_get_b(NULL, ModuleName, "ChangeInMW", 0))
{
int nh = sicd->dwId; HANDLE hContact = (HANDLE)wParam; StatusIconData sid = {0};
@@ -63,7 +63,7 @@ int OnIconPressed(WPARAM wParam, LPARAM lParam) CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
nh = (nh + 1) % 4;
- DBWriteContactSettingByte((HANDLE)wParam, ModuleName, "SweepHistory", (BYTE)nh);
+ db_set_b((HANDLE)wParam, ModuleName, "SweepHistory", (BYTE)nh);
sid.dwId = nh;
sid.flags = 0;
@@ -76,7 +76,7 @@ int OnIconPressed(WPARAM wParam, LPARAM lParam) int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
StatusIconData sid = {0};
- int i, sweep = DBGetContactSettingByte(NULL, ModuleName, "SweepHistory", 0);
+ int i, sweep = db_get_b(NULL, ModuleName, "SweepHistory", 0);
HANDLE hContact = db_find_first();
sid.cbSize = sizeof(sid);
@@ -87,11 +87,11 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) sid.szTooltip = Translate("Keep all events");
else if (sweep == 1)
{
- sid.szTooltip = Translate(time_stamp_strings[DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownOlder", 0)]);
+ sid.szTooltip = Translate(time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)]);
}
else if (sweep == 2)
{
- sid.szTooltip = Translate(keep_strings[DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownKeep", 0)]);
+ sid.szTooltip = Translate(keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)]);
}
else if (sweep == 3)
{
@@ -102,13 +102,13 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) sid.dwId = 1;
sid.hIcon = LoadIconEx("act1");
- sid.szTooltip = Translate(time_stamp_strings[DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownOlder", 0)]);
+ sid.szTooltip = Translate(time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)]);
sid.flags = MBF_HIDDEN;
CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid);
sid.dwId = 2;
sid.hIcon = LoadIconEx("act2");
- sid.szTooltip = Translate(keep_strings[DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownKeep", 0)]);
+ sid.szTooltip = Translate(keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)]);
sid.flags = MBF_HIDDEN;
CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid);
@@ -123,7 +123,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
ZeroMemory(&sid,sizeof(sid));
- sweep = DBGetContactSettingByte(hContact, ModuleName, "SweepHistory", 0);
+ sweep = db_get_b(hContact, ModuleName, "SweepHistory", 0);
sid.cbSize = sizeof(sid);
sid.szModule = ModuleName;
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index 2d13aefd7f..d77d4946f9 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -105,16 +105,16 @@ static void ShowAllContactIcons(HWND hwndList) HANDLE hContact, hItem;
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hAllContacts,
- MAKELPARAM(0, DBGetContactSettingByte(NULL, ModuleName, "SweepHistory", 0)));
+ MAKELPARAM(0, db_get_b(NULL, ModuleName, "SweepHistory", 0)));
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hSystemHistory,
- MAKELPARAM(0, DBGetContactSettingByte(NULL, ModuleName, "SweepSHistory", 0)));
+ MAKELPARAM(0, db_get_b(NULL, ModuleName, "SweepSHistory", 0)));
for (hContact=db_find_first(); hContact;
hContact=db_find_next(hContact))
{
hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem,
- MAKELPARAM(0, DBGetContactSettingByte(hContact, ModuleName, "SweepHistory", 0)));
+ MAKELPARAM(0, db_get_b(hContact, ModuleName, "SweepHistory", 0)));
}
}//ShowAllContactIcons
@@ -150,12 +150,12 @@ void LoadSettings(HWND hwndDlg) mir_free(ptszTimeStr);
}
- SendDlgItemMessage(hwndDlg, IDC_SSOLDER, CB_SETCURSEL, DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownOlder", 0), 0);
- SendDlgItemMessage(hwndDlg, IDC_SSKEEP, CB_SETCURSEL, DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownKeep", 0), 0);
+ SendDlgItemMessage(hwndDlg, IDC_SSOLDER, CB_SETCURSEL, db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0), 0);
+ SendDlgItemMessage(hwndDlg, IDC_SSKEEP, CB_SETCURSEL, db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0), 0);
- CheckDlgButton(hwndDlg, IDC_UNSAFEMODE, DBGetContactSettingByte(NULL, ModuleName, "UnsafeMode", 0));
- CheckDlgButton(hwndDlg, IDC_SWEEPONCLOSE, DBGetContactSettingByte(NULL, ModuleName, "SweepOnClose", 0));
- CheckDlgButton(hwndDlg, IDC_HISTMW, DBGetContactSettingByte(NULL, ModuleName, "ChangeInMW", 0));
+ CheckDlgButton(hwndDlg, IDC_UNSAFEMODE, db_get_b(NULL, ModuleName, "UnsafeMode", 0));
+ CheckDlgButton(hwndDlg, IDC_SWEEPONCLOSE, db_get_b(NULL, ModuleName, "SweepOnClose", 0));
+ CheckDlgButton(hwndDlg, IDC_HISTMW, db_get_b(NULL, ModuleName, "ChangeInMW", 0));
}//LoadSettings
@@ -163,18 +163,18 @@ void SaveSettings(HWND hwndDlg) {
int st, i; StatusIconData sid = {0}; HANDLE hContact, hItem; HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST);
- DBWriteContactSettingByte(NULL, ModuleName, "StartupShutdownOlder", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SSOLDER, CB_GETCURSEL, 0, 0));
- DBWriteContactSettingByte(NULL, ModuleName, "StartupShutdownKeep", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SSKEEP, CB_GETCURSEL, 0, 0));
- DBWriteContactSettingByte(NULL, ModuleName, "UnsafeMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_UNSAFEMODE));
- DBWriteContactSettingByte(NULL, ModuleName, "SweepOnClose", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SWEEPONCLOSE));
- DBWriteContactSettingByte(NULL, ModuleName, "ChangeInMW", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HISTMW));
+ db_set_b(NULL, ModuleName, "StartupShutdownOlder", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SSOLDER, CB_GETCURSEL, 0, 0));
+ db_set_b(NULL, ModuleName, "StartupShutdownKeep", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SSKEEP, CB_GETCURSEL, 0, 0));
+ db_set_b(NULL, ModuleName, "UnsafeMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_UNSAFEMODE));
+ db_set_b(NULL, ModuleName, "SweepOnClose", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SWEEPONCLOSE));
+ db_set_b(NULL, ModuleName, "ChangeInMW", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HISTMW));
sid.cbSize = sizeof(sid);
sid.szModule = ModuleName;
- DBWriteContactSettingByte(NULL, ModuleName, "SweepHistory",
+ db_set_b(NULL, ModuleName, "SweepHistory",
(BYTE)SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hAllContacts, 0));
- DBWriteContactSettingByte(NULL, ModuleName, "SweepSHistory",
+ db_set_b(NULL, ModuleName, "SweepSHistory",
(BYTE)SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hSystemHistory, 0));
for (hContact=db_find_first(); hContact;
@@ -183,8 +183,8 @@ void SaveSettings(HWND hwndDlg) hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
st = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, 0);
- if ( st != 0 ) DBWriteContactSettingByte(hContact, ModuleName, "SweepHistory", (BYTE)st);
- else DBDeleteContactSetting(hContact, ModuleName, "SweepHistory");
+ if ( st != 0 ) db_set_b(hContact, ModuleName, "SweepHistory", (BYTE)st);
+ else db_unset(hContact, ModuleName, "SweepHistory");
// set per-contact icons in status bar
for(i = 0; i < 4; i++)
@@ -196,21 +196,21 @@ void SaveSettings(HWND hwndDlg) }
// set tooltips
- st = DBGetContactSettingByte(NULL, ModuleName, "SweepHistory", 0);
+ st = db_get_b(NULL, ModuleName, "SweepHistory", 0);
sid.dwId = 0;
if (st == 0) sid.szTooltip = Translate("Keep all events");
- else if (st == 1) sid.szTooltip = Translate(time_stamp_strings[DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownOlder", 0)]);
- else if (st == 2) sid.szTooltip = Translate(keep_strings[DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownKeep", 0)]);
+ else if (st == 1) sid.szTooltip = Translate(time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)]);
+ else if (st == 2) sid.szTooltip = Translate(keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)]);
else if (st == 3) sid.szTooltip = Translate("Delete all events");
CallService(MS_MSG_MODIFYICON, 0, (LPARAM)&sid);
sid.dwId = 1;
- sid.szTooltip = Translate(time_stamp_strings[DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownOlder", 0)]);
+ sid.szTooltip = Translate(time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)]);
CallService(MS_MSG_MODIFYICON, 0, (LPARAM)&sid);
sid.dwId = 2;
- sid.szTooltip = Translate(keep_strings[DBGetContactSettingByte(NULL, ModuleName, "StartupShutdownKeep", 0)]);
+ sid.szTooltip = Translate(keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)]);
CallService(MS_MSG_MODIFYICON, 0, (LPARAM)&sid);
}//SaveSettings
diff --git a/plugins/IEView/src/ChatHTMLBuilder.cpp b/plugins/IEView/src/ChatHTMLBuilder.cpp index 636f070464..ff441a8642 100644 --- a/plugins/IEView/src/ChatHTMLBuilder.cpp +++ b/plugins/IEView/src/ChatHTMLBuilder.cpp @@ -49,33 +49,33 @@ void ChatHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) { DBVARIANT dbv;
if (colour) {
wsprintfA(str, "Font%dCol", i);
- *colour = DBGetContactSettingDword(NULL, CHATFONTMOD, str, 0x000000);
+ *colour = db_get_dw(NULL, CHATFONTMOD, str, 0x000000);
}
if (lf) {
wsprintfA(str, "Font%dSize", i);
- lf->lfHeight = (char) DBGetContactSettingByte(NULL, CHATFONTMOD, str, 10);
+ lf->lfHeight = (char) db_get_b(NULL, CHATFONTMOD, str, 10);
lf->lfHeight = abs(lf->lfHeight);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
wsprintfA(str, "Font%dSty", i);
- style = DBGetContactSettingByte(NULL, CHATFONTMOD, str, 0);
+ style = db_get_b(NULL, CHATFONTMOD, str, 0);
lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & FONTF_ITALIC ? 1 : 0;
lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0;
lf->lfStrikeOut = 0;
wsprintfA(str, "Font%dSet", i);
- lf->lfCharSet = DBGetContactSettingByte(NULL, CHATFONTMOD, str, DEFAULT_CHARSET);
+ lf->lfCharSet = db_get_b(NULL, CHATFONTMOD, str, DEFAULT_CHARSET);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
wsprintfA(str, "Font%d", i);
- if (DBGetContactSetting(NULL, CHATFONTMOD, str, &dbv))
+ if (db_get(NULL, CHATFONTMOD, str, &dbv))
lstrcpyA(lf->lfFaceName, "Verdana");
else {
lstrcpynA(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -115,7 +115,7 @@ void ChatHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) { ReleaseDC(NULL, hdc);
Utils::appendText(&output, &outputSize, "<html><head>");
Utils::appendText(&output, &outputSize, "<style type=\"text/css\">\n");
- COLORREF bkgColor = DBGetContactSettingDword(NULL, CHATMOD, "BackgroundLog", 0xFFFFFF);
+ COLORREF bkgColor = db_get_dw(NULL, CHATMOD, "BackgroundLog", 0xFFFFFF);
COLORREF inColor, outColor;
bkgColor= (((bkgColor & 0xFF) << 16) | (bkgColor & 0xFF00) | ((bkgColor & 0xFF0000) >> 16));
inColor = outColor = bkgColor;
@@ -159,7 +159,7 @@ void ChatHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) { */
void ChatHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) {
- DWORD iconFlags = DBGetContactSettingDword(NULL, CHATMOD, CHAT_ICON_FLAGS, 0);
+ DWORD iconFlags = db_get_dw(NULL, CHATMOD, CHAT_ICON_FLAGS, 0);
IEVIEWEVENTDATA* eventData = event->eventData;
for (int eventIdx = 0; eventData!=NULL && (eventIdx < event->count || event->count==-1); eventData = eventData->next, eventIdx++) {
//DWORD dwFlags = eventData->dwFlags;
diff --git a/plugins/IEView/src/HistoryHTMLBuilder.cpp b/plugins/IEView/src/HistoryHTMLBuilder.cpp index 129941cf5c..bb75c2434f 100644 --- a/plugins/IEView/src/HistoryHTMLBuilder.cpp +++ b/plugins/IEView/src/HistoryHTMLBuilder.cpp @@ -101,38 +101,38 @@ void HistoryHTMLBuilder::loadMsgDlgFont(const char *dbSetting, LOGFONTA * lf, CO DBVARIANT dbv;
if (bkgColour) {
wsprintfA(str, "Back.%s", dbSetting);
- *bkgColour = DBGetContactSettingDword(NULL, HPPMOD, str, 0xFFFFFF);
+ *bkgColour = db_get_dw(NULL, HPPMOD, str, 0xFFFFFF);
}
if (colour) {
wsprintfA(str, "Font.%s.Color", dbSetting);
- *colour = DBGetContactSettingDword(NULL, HPPMOD, str, 0x000000);
+ *colour = db_get_dw(NULL, HPPMOD, str, 0x000000);
}
if (lf) {
wsprintfA(str, "Font.%s.Size", dbSetting);
- lf->lfHeight = (char) DBGetContactSettingByte(NULL, HPPMOD, str, 10);
+ lf->lfHeight = (char) db_get_b(NULL, HPPMOD, str, 10);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
wsprintfA(str, "Font.%s.Style.Bold", dbSetting);
- style = DBGetContactSettingByte(NULL, HPPMOD, str, 0);
+ style = db_get_b(NULL, HPPMOD, str, 0);
lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
wsprintfA(str, "Font.%s.Style.Italic", dbSetting);
- style = DBGetContactSettingByte(NULL, HPPMOD, str, 0) << 1;
+ style = db_get_b(NULL, HPPMOD, str, 0) << 1;
lf->lfItalic = style & FONTF_ITALIC ? 1 : 0;
lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0;
lf->lfStrikeOut = 0;
wsprintfA(str, "Font.%s.Charset", dbSetting);
- lf->lfCharSet = DBGetContactSettingByte(NULL, HPPMOD, str, DEFAULT_CHARSET);
+ lf->lfCharSet = db_get_b(NULL, HPPMOD, str, DEFAULT_CHARSET);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
wsprintfA(str, "Font.%s.Name", dbSetting);
- if (DBGetContactSetting(NULL, HPPMOD, str, &dbv))
+ if (db_get(NULL, HPPMOD, str, &dbv))
lstrcpyA(lf->lfFaceName, "Verdana");
else {
lstrcpynA(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -165,7 +165,7 @@ void HistoryHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) { } else {
Utils::appendText(&output, &outputSize, "<html><head>");
Utils::appendText(&output, &outputSize, "<style type=\"text/css\">\n");
- COLORREF lineColor = DBGetContactSettingDword(NULL, HPPMOD, "LineColour", 0xFFFFFF);
+ COLORREF lineColor = db_get_dw(NULL, HPPMOD, "LineColour", 0xFFFFFF);
lineColor= 0;//(((lineColor & 0xFF) << 16) | (lineColor & 0xFF00) | ((lineColor & 0xFF0000) >> 16));
bkgColor = 0xFFFFFF;
if (protoSettings->getHistoryFlags() & Options::LOG_IMAGE_ENABLED) {
@@ -222,7 +222,7 @@ void HistoryHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) { void HistoryHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) {
- DWORD dwFlags = DBGetContactSettingByte(NULL, HPPMOD, SRMSGSET_SHOWICONS, 0) ? SMF_LOG_SHOWICONS : 0;
+ DWORD dwFlags = db_get_b(NULL, HPPMOD, SRMSGSET_SHOWICONS, 0) ? SMF_LOG_SHOWICONS : 0;
char *szRealProto = getRealProto(event->hContact);
IEVIEWEVENTDATA* eventData = event->eventData;
for (int eventIdx = 0; eventData!=NULL && (eventIdx < event->count || event->count==-1); eventData = eventData->next, eventIdx++) {
diff --git a/plugins/IEView/src/MUCCHTMLBuilder.cpp b/plugins/IEView/src/MUCCHTMLBuilder.cpp index 962fb44b5a..6787de8e11 100644 --- a/plugins/IEView/src/MUCCHTMLBuilder.cpp +++ b/plugins/IEView/src/MUCCHTMLBuilder.cpp @@ -45,33 +45,33 @@ void MUCCHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) { DBVARIANT dbv;
if (colour) {
wsprintfA(str, "Font%dCol", i);
- *colour = DBGetContactSettingDword(NULL, MUCCMOD, str, 0x000000);
+ *colour = db_get_dw(NULL, MUCCMOD, str, 0x000000);
}
if (lf) {
wsprintfA(str, "Font%dSize", i);
- lf->lfHeight = (char) DBGetContactSettingByte(NULL, MUCCMOD, str, 10);
+ lf->lfHeight = (char) db_get_b(NULL, MUCCMOD, str, 10);
lf->lfHeight = abs(lf->lfHeight);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
wsprintfA(str, "Font%dStyle", i);
- style = DBGetContactSettingByte(NULL, MUCCMOD, str, 0);
+ style = db_get_b(NULL, MUCCMOD, str, 0);
lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & FONTF_ITALIC ? 1 : 0;
lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0;
lf->lfStrikeOut = 0;
wsprintfA(str, "Font%dSet", i);
- lf->lfCharSet = DBGetContactSettingByte(NULL, MUCCMOD, str, DEFAULT_CHARSET);
+ lf->lfCharSet = db_get_b(NULL, MUCCMOD, str, DEFAULT_CHARSET);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
wsprintfA(str, "Font%dFace", i);
- if (DBGetContactSetting(NULL, MUCCMOD, str, &dbv))
+ if (db_get(NULL, MUCCMOD, str, &dbv))
lstrcpyA(lf->lfFaceName, "Verdana");
else {
lstrcpynA(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -137,7 +137,7 @@ void MUCCHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) { ReleaseDC(NULL, hdc);
Utils::appendText(&output, &outputSize, "<html><head>");
Utils::appendText(&output, &outputSize, "<style type=\"text/css\">\n");
- COLORREF bkgColor = DBGetContactSettingDword(NULL, MUCCMOD, "BackgroundLog", 0xFFFFFF);
+ COLORREF bkgColor = db_get_dw(NULL, MUCCMOD, "BackgroundLog", 0xFFFFFF);
COLORREF inColor, outColor;
bkgColor= (((bkgColor & 0xFF) << 16) | (bkgColor & 0xFF00) | ((bkgColor & 0xFF0000) >> 16));
inColor = outColor = bkgColor;
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index 278659d502..d8e34f7c87 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -1506,7 +1506,7 @@ void Options::init() { }
- generalFlags = DBGetContactSettingDword(NULL, ieviewModuleName, DBS_BASICFLAGS, 13);
+ generalFlags = db_get_dw(NULL, ieviewModuleName, DBS_BASICFLAGS, 13);
/* TODO: move to buildProtocolList method */
int protoCount;
@@ -1530,101 +1530,101 @@ void Options::init() { }
/* SRMM settings */
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_ENABLE);
- proto->setSRMMEnable(i==0 ? true : DBGetContactSettingByte(NULL, ieviewModuleName, dbsName, FALSE));
+ proto->setSRMMEnable(i==0 ? true : db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_MODE);
- proto->setSRMMMode(DBGetContactSettingByte(NULL, ieviewModuleName, dbsName, FALSE));
+ proto->setSRMMMode(db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_FLAGS);
- proto->setSRMMFlags(DBGetContactSettingDword(NULL, ieviewModuleName, dbsName, 16128));
+ proto->setSRMMFlags(db_get_dw(NULL, ieviewModuleName, dbsName, 16128));
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_BACKGROUND);
- if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
if ( strncmp(tmpPath, "http://", 7))
PathToAbsolute(dbv.pszVal, tmpPath);
proto->setSRMMBackgroundFilename(tmpPath);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_CSS);
- if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
if ( strncmp(tmpPath, "http://", 7))
PathToAbsolute(dbv.pszVal, tmpPath);
proto->setSRMMCssFilename(tmpPath);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_TEMPLATE);
- if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
PathToAbsolute(dbv.pszVal, tmpPath);
proto->setSRMMTemplateFilename(tmpPath);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
/* Group chat settings */
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_ENABLE);
- proto->setChatEnable(i==0 ? true : DBGetContactSettingByte(NULL, ieviewModuleName, dbsName, FALSE));
+ proto->setChatEnable(i==0 ? true : db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_MODE);
- proto->setChatMode(DBGetContactSettingByte(NULL, ieviewModuleName, dbsName, FALSE));
+ proto->setChatMode(db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_FLAGS);
- proto->setChatFlags(DBGetContactSettingDword(NULL, ieviewModuleName, dbsName, 16128));
+ proto->setChatFlags(db_get_dw(NULL, ieviewModuleName, dbsName, 16128));
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_BACKGROUND);
- if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
if ( strncmp(tmpPath, "http://", 7))
PathToAbsolute(dbv.pszVal, tmpPath);
proto->setChatBackgroundFilename(tmpPath);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_CSS);
- if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
if ( strncmp(tmpPath, "http://", 7))
PathToAbsolute(dbv.pszVal, tmpPath);
proto->setChatCssFilename(tmpPath);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_TEMPLATE);
- if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
PathToAbsolute(dbv.pszVal, tmpPath);
proto->setChatTemplateFilename(tmpPath);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
/* History settings */
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_ENABLE);
- proto->setHistoryEnable(i==0 ? true : DBGetContactSettingByte(NULL, ieviewModuleName, dbsName, FALSE));
+ proto->setHistoryEnable(i==0 ? true : db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_MODE);
- proto->setHistoryMode(DBGetContactSettingByte(NULL, ieviewModuleName, dbsName, FALSE));
+ proto->setHistoryMode(db_get_b(NULL, ieviewModuleName, dbsName, FALSE));
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_FLAGS);
- proto->setHistoryFlags(DBGetContactSettingDword(NULL, ieviewModuleName, dbsName, 16128));
+ proto->setHistoryFlags(db_get_dw(NULL, ieviewModuleName, dbsName, 16128));
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_BACKGROUND);
- if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
if ( strncmp(tmpPath, "http://", 7))
PathToAbsolute(dbv.pszVal, tmpPath);
proto->setHistoryBackgroundFilename(tmpPath);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_CSS);
- if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
if ( strncmp(tmpPath, "http://", 7))
PathToAbsolute(dbv.pszVal, tmpPath);
proto->setHistoryCssFilename(tmpPath);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_TEMPLATE);
- if (!DBGetContactSetting(NULL, ieviewModuleName, dbsName, &dbv)) {
+ if (!db_get(NULL, ieviewModuleName, dbsName, &dbv)) {
strcpy(tmpPath, dbv.pszVal);
PathToAbsolute(dbv.pszVal, tmpPath);
proto->setHistoryTemplateFilename(tmpPath);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
proto->copyToTemp();
if (lastProto != NULL) {
@@ -1662,7 +1662,7 @@ void Options::uninit() { void Options::setGeneralFlags(int flags) {
generalFlags = flags;
- DBWriteContactSettingDword(NULL, ieviewModuleName, DBS_BASICFLAGS, (DWORD) flags);
+ db_set_dw(NULL, ieviewModuleName, DBS_BASICFLAGS, (DWORD) flags);
}
int Options::getGeneralFlags() {
@@ -1670,11 +1670,11 @@ int Options::getGeneralFlags() { }
void Options::setEmbedsize(int size){
- DBWriteContactSettingDword(NULL, ieviewModuleName, "Embedsize", (DWORD) size);
+ db_set_dw(NULL, ieviewModuleName, "Embedsize", (DWORD) size);
}
int Options::getEmbedsize() {
- return DBGetContactSettingDword(NULL, ieviewModuleName, "Embedsize", 0);
+ return db_get_dw(NULL, ieviewModuleName, "Embedsize", 0);
}
bool Options::isMathModule() {
@@ -1717,68 +1717,68 @@ void Options::saveProtocolSettings() { proto->copyFromTemp();
/* SRMM settings */
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_ENABLE);
- DBWriteContactSettingByte(NULL, ieviewModuleName, dbsName, proto->isSRMMEnable());
+ db_set_b(NULL, ieviewModuleName, dbsName, proto->isSRMMEnable());
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_MODE);
- DBWriteContactSettingByte(NULL, ieviewModuleName, dbsName, proto->getSRMMMode());
+ db_set_b(NULL, ieviewModuleName, dbsName, proto->getSRMMMode());
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_FLAGS);
- DBWriteContactSettingDword(NULL, ieviewModuleName, dbsName, proto->getSRMMFlags());
+ db_set_dw(NULL, ieviewModuleName, dbsName, proto->getSRMMFlags());
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_BACKGROUND);
strcpy(tmpPath, proto->getSRMMBackgroundFilename());
PathToRelative(proto->getSRMMBackgroundFilename(), tmpPath);
- DBWriteContactSettingString(NULL, ieviewModuleName, dbsName, tmpPath);
+ db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_CSS);
strcpy (tmpPath, proto->getSRMMCssFilename());
PathToRelative(proto->getSRMMCssFilename(), tmpPath);
- DBWriteContactSettingString(NULL, ieviewModuleName, dbsName, tmpPath);
+ db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_SRMM_TEMPLATE);
strcpy (tmpPath, proto->getSRMMTemplateFilename());
PathToRelative(proto->getSRMMTemplateFilename(), tmpPath);
- DBWriteContactSettingString(NULL, ieviewModuleName, dbsName, tmpPath);
+ db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
/* Group Chat settings */
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_ENABLE);
- DBWriteContactSettingByte(NULL, ieviewModuleName, dbsName, proto->isChatEnable());
+ db_set_b(NULL, ieviewModuleName, dbsName, proto->isChatEnable());
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_MODE);
- DBWriteContactSettingByte(NULL, ieviewModuleName, dbsName, proto->getChatMode());
+ db_set_b(NULL, ieviewModuleName, dbsName, proto->getChatMode());
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_FLAGS);
- DBWriteContactSettingDword(NULL, ieviewModuleName, dbsName, proto->getChatFlags());
+ db_set_dw(NULL, ieviewModuleName, dbsName, proto->getChatFlags());
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_BACKGROUND);
strcpy (tmpPath, proto->getChatBackgroundFilename());
PathToRelative(proto->getChatBackgroundFilename(), tmpPath);
- DBWriteContactSettingString(NULL, ieviewModuleName, dbsName, tmpPath);
+ db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_CSS);
strcpy (tmpPath, proto->getChatCssFilename());
PathToRelative(proto->getChatCssFilename(), tmpPath);
- DBWriteContactSettingString(NULL, ieviewModuleName, dbsName, tmpPath);
+ db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_CHAT_TEMPLATE);
strcpy (tmpPath, proto->getChatTemplateFilename());
PathToRelative(proto->getChatTemplateFilename(), tmpPath);
- DBWriteContactSettingString(NULL, ieviewModuleName, dbsName, tmpPath);
+ db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
/* History settings */
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_ENABLE);
- DBWriteContactSettingByte(NULL, ieviewModuleName, dbsName, proto->isHistoryEnable());
+ db_set_b(NULL, ieviewModuleName, dbsName, proto->isHistoryEnable());
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_MODE);
- DBWriteContactSettingByte(NULL, ieviewModuleName, dbsName, proto->getHistoryMode());
+ db_set_b(NULL, ieviewModuleName, dbsName, proto->getHistoryMode());
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_FLAGS);
- DBWriteContactSettingDword(NULL, ieviewModuleName, dbsName, proto->getHistoryFlags());
+ db_set_dw(NULL, ieviewModuleName, dbsName, proto->getHistoryFlags());
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_BACKGROUND);
strcpy (tmpPath, proto->getHistoryBackgroundFilename());
PathToRelative(proto->getHistoryBackgroundFilename(), tmpPath);
- DBWriteContactSettingString(NULL, ieviewModuleName, dbsName, tmpPath);
+ db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_CSS);
strcpy (tmpPath, proto->getHistoryCssFilename());
PathToRelative(proto->getHistoryCssFilename(), tmpPath);
- DBWriteContactSettingString(NULL, ieviewModuleName, dbsName, tmpPath);
+ db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
sprintf(dbsName, "%s.%s", proto->getProtocolName(), DBS_HISTORY_TEMPLATE);
strcpy (tmpPath, proto->getHistoryTemplateFilename());
PathToRelative(proto->getHistoryTemplateFilename(), tmpPath);
- DBWriteContactSettingString(NULL, ieviewModuleName, dbsName, tmpPath);
+ db_set_s(NULL, ieviewModuleName, dbsName, tmpPath);
}
}
diff --git a/plugins/IEView/src/ScriverHTMLBuilder.cpp b/plugins/IEView/src/ScriverHTMLBuilder.cpp index 8d43424b26..666ea3fb74 100644 --- a/plugins/IEView/src/ScriverHTMLBuilder.cpp +++ b/plugins/IEView/src/ScriverHTMLBuilder.cpp @@ -89,33 +89,33 @@ void ScriverHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) DBVARIANT dbv;
if (colour) {
wsprintfA(str, "SRMFont%dCol", i);
- *colour = DBGetContactSettingDword(NULL, SRMMMOD, str, 0x000000);
+ *colour = db_get_dw(NULL, SRMMMOD, str, 0x000000);
}
if (lf) {
wsprintfA(str, "SRMFont%dSize", i);
- lf->lfHeight = (char) DBGetContactSettingByte(NULL, SRMMMOD, str, 10);
+ lf->lfHeight = (char) db_get_b(NULL, SRMMMOD, str, 10);
lf->lfHeight = abs(lf->lfHeight);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
wsprintfA(str, "SRMFont%dSty", i);
- style = DBGetContactSettingByte(NULL, SRMMMOD, str, 0);
+ style = db_get_b(NULL, SRMMMOD, str, 0);
lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & FONTF_ITALIC ? 1 : 0;
lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0;
lf->lfStrikeOut = 0;
wsprintfA(str, "SRMFont%dSet", i);
- lf->lfCharSet = DBGetContactSettingByte(NULL, SRMMMOD, str, DEFAULT_CHARSET);
+ lf->lfCharSet = db_get_b(NULL, SRMMMOD, str, DEFAULT_CHARSET);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
wsprintfA(str, "SRMFont%d", i);
- if (DBGetContactSetting(NULL, SRMMMOD, str, &dbv))
+ if (db_get(NULL, SRMMMOD, str, &dbv))
lstrcpyA(lf->lfFaceName, "Verdana");
else {
lstrcpynA(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -204,10 +204,10 @@ void ScriverHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) { ReleaseDC(NULL, hdc);
Utils::appendText(&output, &outputSize, "<html><head>");
Utils::appendText(&output, &outputSize, "<style type=\"text/css\">\n");
- COLORREF bkgColor = DBGetContactSettingDword(NULL, SRMMMOD, "BkgColour", 0xFFFFFF);
- COLORREF inColor = DBGetContactSettingDword(NULL, SRMMMOD, "IncomingBkgColour", 0xFFFFFF);
- COLORREF outColor = DBGetContactSettingDword(NULL, SRMMMOD, "OutgoingBkgColour", 0xFFFFFF);
- COLORREF lineColor = DBGetContactSettingDword(NULL, SRMMMOD, "LineColour", 0xFFFFFF);
+ COLORREF bkgColor = db_get_dw(NULL, SRMMMOD, "BkgColour", 0xFFFFFF);
+ COLORREF inColor = db_get_dw(NULL, SRMMMOD, "IncomingBkgColour", 0xFFFFFF);
+ COLORREF outColor = db_get_dw(NULL, SRMMMOD, "OutgoingBkgColour", 0xFFFFFF);
+ COLORREF lineColor = db_get_dw(NULL, SRMMMOD, "LineColour", 0xFFFFFF);
bkgColor= (((bkgColor & 0xFF) << 16) | (bkgColor & 0xFF00) | ((bkgColor & 0xFF0000) >> 16));
inColor= (((inColor & 0xFF) << 16) | (inColor & 0xFF00) | ((inColor & 0xFF0000) >> 16));
outColor= (((outColor & 0xFF) << 16) | (outColor & 0xFF00) | ((outColor & 0xFF0000) >> 16));
@@ -269,18 +269,18 @@ void ScriverHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) { void ScriverHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) {
bool showColon;
- DWORD dwFlags = DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_SHOWTIME, 0) ? SMF_LOG_SHOWTIME : 0;
- dwFlags |= !DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_HIDENAMES, 0) ? SMF_LOG_SHOWNICK : 0;
- dwFlags |= DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_SHOWDATE, 0) ? SMF_LOG_SHOWDATE : 0;
- dwFlags |= DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_SHOWLOGICONS, 0) ? SMF_LOG_SHOWICONS : 0;
- dwFlags |= DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_SHOWSTATUSCHANGES, 0) ? SMF_LOG_SHOWSTATUSCHANGES : 0;
- dwFlags |= DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_SHOWSECONDS, 0) ? SMF_LOG_SHOWSECONDS : 0;
- dwFlags |= DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_USERELATIVEDATE, 0) ? SMF_LOG_USERELATIVEDATE : 0;
- dwFlags |= DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_USELONGDATE, 0) ? SMF_LOG_USELONGDATE : 0;
- dwFlags |= DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_GROUPMESSAGES, 0) ? SMF_LOG_GROUPMESSAGES : 0;
- dwFlags |= DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_MARKFOLLOWUPS, 0) ? SMF_LOG_MARKFOLLOWUPS : 0;
- dwFlags |= DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_MESSAGEONNEWLINE, 0) ? SMF_LOG_MSGONNEWLINE : 0;
- dwFlags |= DBGetContactSettingByte(NULL, SRMMMOD, SRMSGSET_DRAWLINES, 0) ? SMF_LOG_DRAWLINES : 0;
+ DWORD dwFlags = db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWTIME, 0) ? SMF_LOG_SHOWTIME : 0;
+ dwFlags |= !db_get_b(NULL, SRMMMOD, SRMSGSET_HIDENAMES, 0) ? SMF_LOG_SHOWNICK : 0;
+ dwFlags |= db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWDATE, 0) ? SMF_LOG_SHOWDATE : 0;
+ dwFlags |= db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWLOGICONS, 0) ? SMF_LOG_SHOWICONS : 0;
+ dwFlags |= db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWSTATUSCHANGES, 0) ? SMF_LOG_SHOWSTATUSCHANGES : 0;
+ dwFlags |= db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWSECONDS, 0) ? SMF_LOG_SHOWSECONDS : 0;
+ dwFlags |= db_get_b(NULL, SRMMMOD, SRMSGSET_USERELATIVEDATE, 0) ? SMF_LOG_USERELATIVEDATE : 0;
+ dwFlags |= db_get_b(NULL, SRMMMOD, SRMSGSET_USELONGDATE, 0) ? SMF_LOG_USELONGDATE : 0;
+ dwFlags |= db_get_b(NULL, SRMMMOD, SRMSGSET_GROUPMESSAGES, 0) ? SMF_LOG_GROUPMESSAGES : 0;
+ dwFlags |= db_get_b(NULL, SRMMMOD, SRMSGSET_MARKFOLLOWUPS, 0) ? SMF_LOG_MARKFOLLOWUPS : 0;
+ dwFlags |= db_get_b(NULL, SRMMMOD, SRMSGSET_MESSAGEONNEWLINE, 0) ? SMF_LOG_MSGONNEWLINE : 0;
+ dwFlags |= db_get_b(NULL, SRMMMOD, SRMSGSET_DRAWLINES, 0) ? SMF_LOG_DRAWLINES : 0;
char *szRealProto = getRealProto(event->hContact);
IEVIEWEVENTDATA* eventData = event->eventData;
diff --git a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp index f407dd62b4..23a2706b57 100644 --- a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp +++ b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp @@ -105,8 +105,8 @@ bool TabSRMMHTMLBuilder::isDbEventShown(DWORD dwFlags, DBEVENTINFO * dbei) bool TabSRMMHTMLBuilder::isDbEventShown(DBEVENTINFO * dbei)
{
- DWORD dwFlags2 = DBGetContactSettingByte(NULL, SRMSGMOD_T, SRMSGSET_SHOWURLS, 0) ? MWF_SHOW_URLEVENTS : 0;
- dwFlags2 |= DBGetContactSettingByte(NULL, SRMSGMOD_T, SRMSGSET_SHOWFILES, 0) ? MWF_SHOW_FILEEVENTS : 0;
+ DWORD dwFlags2 = db_get_b(NULL, SRMSGMOD_T, SRMSGSET_SHOWURLS, 0) ? MWF_SHOW_URLEVENTS : 0;
+ dwFlags2 |= db_get_b(NULL, SRMSGMOD_T, SRMSGSET_SHOWFILES, 0) ? MWF_SHOW_FILEEVENTS : 0;
return isDbEventShown(dwFlags2, dbei);
}
@@ -116,7 +116,7 @@ void TabSRMMHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) DBVARIANT dbv;
if (colour) {
wsprintfA(str, "Font%dCol", i);
- *colour = DBGetContactSettingDword(NULL, TABSRMM_FONTMODULE, str, 0x000000);
+ *colour = db_get_dw(NULL, TABSRMM_FONTMODULE, str, 0x000000);
}
if (lf) {
HDC hdc = GetDC(NULL);
@@ -124,7 +124,7 @@ void TabSRMMHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) // if(i == H_MSGFONTID_DIVIDERS)
// lf->lfHeight = 5;
// else {
- lf->lfHeight = (char) DBGetContactSettingByte(NULL, TABSRMM_FONTMODULE, str, 10);
+ lf->lfHeight = (char) db_get_b(NULL, TABSRMM_FONTMODULE, str, 10);
// lf->lfHeight= MulDiv(lf->lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 74);
// }
ReleaseDC(NULL,hdc);
@@ -132,23 +132,23 @@ void TabSRMMHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) lf->lfEscapement = 0;
lf->lfOrientation = 0;
wsprintfA(str, "Font%dSty", i);
- style = DBGetContactSettingByte(NULL, TABSRMM_FONTMODULE, str, 0);
+ style = db_get_b(NULL, TABSRMM_FONTMODULE, str, 0);
lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & FONTF_ITALIC ? 1 : 0;
lf->lfUnderline = style & FONTF_UNDERLINE ? 1 : 0;
lf->lfStrikeOut = 0;
wsprintfA(str, "Font%dSet", i);
- lf->lfCharSet = DBGetContactSettingByte(NULL, TABSRMM_FONTMODULE, str, DEFAULT_CHARSET);
+ lf->lfCharSet = db_get_b(NULL, TABSRMM_FONTMODULE, str, DEFAULT_CHARSET);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
wsprintfA(str, "Font%d", i);
- if (DBGetContactSetting(NULL, TABSRMM_FONTMODULE, str, &dbv))
+ if (db_get(NULL, TABSRMM_FONTMODULE, str, &dbv))
lstrcpyA(lf->lfFaceName, "Verdana");
else {
lstrcpynA(lf->lfFaceName, dbv.pszVal, sizeof(lf->lfFaceName));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -229,16 +229,16 @@ void TabSRMMHTMLBuilder::buildHead(IEView *view, IEVIEWEVENT *event) { HDC hdc = GetDC(NULL);
int logPixelSY = GetDeviceCaps(hdc, LOGPIXELSY);
ReleaseDC(NULL, hdc);
- DWORD dwFlags = DBGetContactSettingDword(NULL, SRMSGMOD_T, "mwflags", MWF_LOG_DEFAULT);
+ DWORD dwFlags = db_get_dw(NULL, SRMSGMOD_T, "mwflags", MWF_LOG_DEFAULT);
Utils::appendText(&output, &outputSize, "<html><head><style type=\"text/css\">\n");
COLORREF inColor, outColor;
- COLORREF bkgColor = DBGetContactSettingDword(NULL, TABSRMM_FONTMODULE, "BkgColour", 0xFFFFFF);
+ COLORREF bkgColor = db_get_dw(NULL, TABSRMM_FONTMODULE, "BkgColour", 0xFFFFFF);
bkgColor= (((bkgColor & 0xFF) << 16) | (bkgColor & 0xFF00) | ((bkgColor & 0xFF0000) >> 16));
- COLORREF gridColor = DBGetContactSettingDword(NULL, TABSRMM_FONTMODULE, "hgrid", 0xFFFFFF);
+ COLORREF gridColor = db_get_dw(NULL, TABSRMM_FONTMODULE, "hgrid", 0xFFFFFF);
gridColor= (((gridColor & 0xFF) << 16) | (gridColor & 0xFF00) | ((gridColor & 0xFF0000) >> 16));
if (dwFlags & MWF_LOG_INDIVIDUALBKG) {
- inColor = DBGetContactSettingDword(NULL, TABSRMM_FONTMODULE, "inbg", RGB(224,224,224));
- outColor = DBGetContactSettingDword(NULL, TABSRMM_FONTMODULE, "outbg", RGB(224,224,224));
+ inColor = db_get_dw(NULL, TABSRMM_FONTMODULE, "inbg", RGB(224,224,224));
+ outColor = db_get_dw(NULL, TABSRMM_FONTMODULE, "outbg", RGB(224,224,224));
inColor= (((inColor & 0xFF) << 16) | (inColor & 0xFF00) | ((inColor & 0xFF0000) >> 16));
outColor= (((outColor & 0xFF) << 16) | (outColor & 0xFF00) | ((outColor & 0xFF0000) >> 16));
} else {
@@ -300,17 +300,17 @@ time_t TabSRMMHTMLBuilder::getStartedTime() { }
void TabSRMMHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) {
-// int indentLeft = DBGetContactSettingDword(NULL, SRMSGMOD_T, "IndentAmount", 0);
-// int indentRight = DBGetContactSettingDword(NULL, SRMSGMOD_T, "RightIndent", 0);
+// int indentLeft = db_get_dw(NULL, SRMSGMOD_T, "IndentAmount", 0);
+// int indentRight = db_get_dw(NULL, SRMSGMOD_T, "RightIndent", 0);
DWORD today = (DWORD)time(NULL);
today = today - today % 86400;
- DWORD dwFlags = DBGetContactSettingDword(NULL, SRMSGMOD_T, "mwflags", MWF_LOG_DEFAULT);
- DWORD dwFlags2 = DBGetContactSettingByte(NULL, SRMSGMOD_T, SRMSGSET_SHOWURLS, 0) ? MWF_SHOW_URLEVENTS : 0;
- dwFlags2 |= DBGetContactSettingByte(NULL, SRMSGMOD_T, SRMSGSET_SHOWFILES, 0) ? MWF_SHOW_FILEEVENTS : 0;
- dwFlags2 |= DBGetContactSettingByte(NULL, SRMSGMOD_T, "in_out_icons", 0) ? MWF_SHOW_INOUTICONS : 0;
- dwFlags2 |= DBGetContactSettingByte(NULL, SRMSGMOD_T, "emptylinefix", 1) ? MWF_SHOW_EMPTYLINEFIX : 0;
+ DWORD dwFlags = db_get_dw(NULL, SRMSGMOD_T, "mwflags", MWF_LOG_DEFAULT);
+ DWORD dwFlags2 = db_get_b(NULL, SRMSGMOD_T, SRMSGSET_SHOWURLS, 0) ? MWF_SHOW_URLEVENTS : 0;
+ dwFlags2 |= db_get_b(NULL, SRMSGMOD_T, SRMSGSET_SHOWFILES, 0) ? MWF_SHOW_FILEEVENTS : 0;
+ dwFlags2 |= db_get_b(NULL, SRMSGMOD_T, "in_out_icons", 0) ? MWF_SHOW_INOUTICONS : 0;
+ dwFlags2 |= db_get_b(NULL, SRMSGMOD_T, "emptylinefix", 1) ? MWF_SHOW_EMPTYLINEFIX : 0;
dwFlags2 |= MWF_SHOW_MICROLF;
- dwFlags2 |= DBGetContactSettingByte(NULL, SRMSGMOD_T, "followupts", 1) ? MWF_SHOW_MARKFOLLOWUPTS : 0;
+ dwFlags2 |= db_get_b(NULL, SRMSGMOD_T, "followupts", 1) ? MWF_SHOW_MARKFOLLOWUPTS : 0;
char *szRealProto = getRealProto(event->hContact);
IEVIEWEVENTDATA* eventData = event->eventData;
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index 09d2de312f..32ba30ee62 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -64,7 +64,7 @@ char *TemplateHTMLBuilder::getAvatar(HANDLE hContact, const char * szProto) { }
}
}
- if (!DBGetContactSettingTString(hContact, "ContactPhoto", "File", &dbv)) {
+ if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
if (_tcslen(dbv.ptszVal) > 0) {
TCHAR* ext = _tcsrchr(dbv.ptszVal, '.');
if (ext && lstrcmpi(ext, _T(".xml")) == 0) {
@@ -80,7 +80,7 @@ char *TemplateHTMLBuilder::getAvatar(HANDLE hContact, const char * szProto) { }
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
char* res = mir_utf8encodeT(result);
Utils::convertPath(res);
@@ -221,11 +221,11 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr if (szAvatarOut == NULL) {
szAvatarOut = mir_strdup(szNoAvatar);
}
- if (!DBGetContactSetting(event->hContact, "CList", "StatusMsg",&dbv)) {
+ if (!db_get(event->hContact, "CList", "StatusMsg",&dbv)) {
if (strlen(dbv.pszVal) > 0) {
szStatusMsg = mir_utf8encode(dbv.pszVal);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
ZeroMemory(&ci, sizeof(ci));
ci.cbSize = sizeof(ci);
@@ -404,11 +404,11 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, szAvatarOut = mir_strdup(szNoAvatar);
}
if(event->hContact != NULL) {
- if (!DBGetContactSetting(event->hContact, "CList", "StatusMsg",&dbv)) {
+ if (!db_get(event->hContact, "CList", "StatusMsg",&dbv)) {
if (strlen(dbv.pszVal) > 0) {
szStatusMsg = mir_utf8encode(dbv.pszVal);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
ZeroMemory(&ci, sizeof(ci));
diff --git a/plugins/IgnoreState/src/main.cpp b/plugins/IgnoreState/src/main.cpp index f25fbd35db..15deb3e489 100644 --- a/plugins/IgnoreState/src/main.cpp +++ b/plugins/IgnoreState/src/main.cpp @@ -117,9 +117,9 @@ static IconItem iconList[] = VOID fill_filter(void)
{
- bUseMirandaSettings = DBGetContactSettingByte(NULL, MODULENAME, "UseMirandaSettings", 0);
+ bUseMirandaSettings = db_get_b(NULL, MODULENAME, "UseMirandaSettings", 0);
- currentFilter = bUseMirandaSettings ? DBGetContactSettingDword(NULL, "Ignore", "Default1", 0) : DBGetContactSettingDword(NULL, MODULENAME, "Filter", 0x8);
+ currentFilter = bUseMirandaSettings ? db_get_dw(NULL, "Ignore", "Default1", 0) : db_get_dw(NULL, MODULENAME, "Filter", 0x8);
for (int i=0; i < SIZEOF(ii); i++) {
if (checkState((ii[i].type)))
diff --git a/plugins/IgnoreState/src/options.cpp b/plugins/IgnoreState/src/options.cpp index 994887e01a..776ed37c78 100644 --- a/plugins/IgnoreState/src/options.cpp +++ b/plugins/IgnoreState/src/options.cpp @@ -85,10 +85,10 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if(TreeView_GetCheckState(hTree,tvi.hItem)) flags|=1<<(tvi.lParam-1);
tvi.hItem=TreeView_GetNextSibling(hTree,tvi.hItem);
}
- DBWriteContactSettingDword(NULL, MODULENAME, "Filter", flags);
+ db_set_dw(NULL, MODULENAME, "Filter", flags);
bUseMirandaSettings = IsDlgButtonChecked(hwndDlg,IDC_IGNORE_IGNOREALL) ? 1 : 0;
- DBWriteContactSettingByte(NULL, MODULENAME, "UseMirandaSettings", bUseMirandaSettings);
+ db_set_b(NULL, MODULENAME, "UseMirandaSettings", bUseMirandaSettings);
fill_filter();
}
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index e77334dde8..6d2d16215e 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -110,7 +110,7 @@ static HANDLE HistoryImportFindContact(HWND hdlgProgress, char* szModuleName, DW hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)szModuleName);
- DBWriteContactSettingDword(hContact, szModuleName, "UIN", uin);
+ db_set_dw(hContact, szModuleName, "UIN", uin);
AddMessage( LPGENT("Added contact %u (found in history)"), uin );
return hContact;
}
diff --git a/plugins/Import/src/main.cpp b/plugins/Import/src/main.cpp index e4ac431248..c5cb25aa7e 100644 --- a/plugins/Import/src/main.cpp +++ b/plugins/Import/src/main.cpp @@ -84,7 +84,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_IMPORT, static int ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- if (DBGetContactSettingByte(NULL, IMPORT_MODULE, IMP_KEY_FR, 0))
+ if (db_get_b(NULL, IMPORT_MODULE, IMP_KEY_FR, 0))
return 0;
// Only autorun import wizard if at least one protocol is installed
@@ -93,7 +93,7 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam) ProtoEnumAccounts(&nProtocols, &ppProtos);
if (nProtocols > 0) {
CallService(IMPORT_SERVICE, 0, 0);
- DBWriteContactSettingByte(NULL, IMPORT_MODULE, IMP_KEY_FR, 1);
+ db_set_b(NULL, IMPORT_MODULE, IMP_KEY_FR, 1);
}
return 0;
}
diff --git a/plugins/Import/src/miranda.cpp b/plugins/Import/src/miranda.cpp index 71e149c0f4..fc9a654165 100644 --- a/plugins/Import/src/miranda.cpp +++ b/plugins/Import/src/miranda.cpp @@ -243,7 +243,7 @@ INT_PTR CALLBACK MirandaAdvOptionsPageProc(HWND hdlg,UINT message,WPARAM wParam, struct tm *TM = NULL;
struct _SYSTEMTIME ST = {0};
- dwSinceDate = DBGetContactSettingDword(NULL,IMPORT_MODULE,"ImportSinceTS",time(NULL));
+ dwSinceDate = db_get_dw(NULL,IMPORT_MODULE,"ImportSinceTS",time(NULL));
TM = localtime(&dwSinceDate);
@@ -306,7 +306,7 @@ INT_PTR CALLBACK MirandaAdvOptionsPageProc(HWND hdlg,UINT message,WPARAM wParam, dwSinceDate = mktime(&TM);
- DBWriteContactSettingDword(NULL,IMPORT_MODULE,"ImportSinceTS",dwSinceDate);
+ db_set_dw(NULL,IMPORT_MODULE,"ImportSinceTS",dwSinceDate);
} }
if (nCustomOptions)
diff --git a/plugins/Import/src/utils.cpp b/plugins/Import/src/utils.cpp index 397f5df370..58bad9efc9 100644 --- a/plugins/Import/src/utils.cpp +++ b/plugins/Import/src/utils.cpp @@ -50,26 +50,26 @@ int CreateGroup(const TCHAR* group, HANDLE hContact) for (int groupId = 0; ; groupId++) {
DBVARIANT dbv;
itoa(groupId, groupIdStr,10);
- if (DBGetContactSettingTString(NULL, "CListGroups", groupIdStr, &dbv))
+ if (db_get_ts(NULL, "CListGroups", groupIdStr, &dbv))
break;
if ( !lstrcmp(dbv.ptszVal + 1, tszGrpName + 1 )) {
if (hContact)
- DBWriteContactSettingTString( hContact, "CList", "Group", tszGrpName+1 );
+ db_set_ts( hContact, "CList", "Group", tszGrpName+1 );
else
AddMessage( LPGENT("Skipping duplicate group %s."), tszGrpName + 1);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 0;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- DBWriteContactSettingTString( NULL, "CListGroups", groupIdStr, tszGrpName );
+ db_set_ts( NULL, "CListGroups", groupIdStr, tszGrpName );
if (hContact)
- DBWriteContactSettingTString( hContact, "CList", "Group", tszGrpName+1 );
+ db_set_ts( hContact, "CList", "Group", tszGrpName+1 );
return 1;
}
diff --git a/plugins/Import/src/wizard.cpp b/plugins/Import/src/wizard.cpp index 8a4b71faf3..71dc010786 100644 --- a/plugins/Import/src/wizard.cpp +++ b/plugins/Import/src/wizard.cpp @@ -78,7 +78,7 @@ INT_PTR CALLBACK FinishedPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM // prevent the plugin from disabling/enabling correctly (this fix relies
// on the plugin loader to ignore case)
CharLowerA(pszFileName);
- DBWriteContactSettingByte(NULL, "PluginDisable", pszFileName, 1);
+ db_set_b(NULL, "PluginDisable", pszFileName, 1);
}
PostMessage(GetParent(hdlg), WM_CLOSE, 0, 0);
break;
diff --git a/plugins/KeyboardNotify/src/flash.cpp b/plugins/KeyboardNotify/src/flash.cpp index 8e2809f31f..e0189f050f 100644 --- a/plugins/KeyboardNotify/src/flash.cpp +++ b/plugins/KeyboardNotify/src/flash.cpp @@ -99,9 +99,9 @@ FLASHING_SEQUENCE *getCustomSeq(void) customStr[0] = _T('\0');
- if (!DBGetContactSetting(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", wCustomTheme), &dbv)) {
+ if (!db_get(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", wCustomTheme), &dbv)) {
wcscpy(customStr, dbv.pwszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
Custom = str2FS(customStr);
@@ -345,8 +345,8 @@ static void TestThread(FLASHING_SEQUENCE *pTest) unsigned int i;
DWORD dwEndTest;
- unsigned int testNum = (unsigned int)DBGetContactSettingByte(NULL, KEYBDMODULE, "testnum", DEF_SETTING_TESTNUM);
- unsigned int testSecs = (unsigned int)DBGetContactSettingByte(NULL, KEYBDMODULE, "testsecs", DEF_SETTING_TESTSECS);
+ unsigned int testNum = (unsigned int)db_get_b(NULL, KEYBDMODULE, "testnum", DEF_SETTING_TESTNUM);
+ unsigned int testSecs = (unsigned int)db_get_b(NULL, KEYBDMODULE, "testsecs", DEF_SETTING_TESTSECS);
for (i=0, dwEndTest=GetTickCount()+testSecs*1000; i < testNum || GetTickCount() < dwEndTest; i++)
for (pTest->index=0; pTest->index < pTest->size; pTest->index++) {
diff --git a/plugins/KeyboardNotify/src/ignore.cpp b/plugins/KeyboardNotify/src/ignore.cpp index 769cf5bce2..ac83735f01 100644 --- a/plugins/KeyboardNotify/src/ignore.cpp +++ b/plugins/KeyboardNotify/src/ignore.cpp @@ -31,15 +31,15 @@ extern BOOL bWindowsNT; static DWORD GetMask(HANDLE hContact)
{
- DWORD mask = DBGetContactSettingDword(hContact, KEYBDMODULE, "Mask1", (DWORD)(-1));
+ DWORD mask = db_get_dw(hContact, KEYBDMODULE, "Mask1", (DWORD)(-1));
if(mask == (DWORD)(-1)) {
if(hContact == NULL)
mask=0;
else {
- if(DBGetContactSettingByte(hContact, "CList", "Hidden", 0) || DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
- mask = DBGetContactSettingDword(NULL, KEYBDMODULE, "Mask1", 0);
+ if(db_get_b(hContact, "CList", "Hidden", 0) || db_get_b(hContact, "CList", "NotOnList", 0))
+ mask = db_get_dw(NULL, KEYBDMODULE, "Mask1", 0);
else
- mask = DBGetContactSettingDword(NULL, KEYBDMODULE, "Default1", 0);
+ mask = db_get_dw(NULL, KEYBDMODULE, "Default1", 0);
}
}
return mask;
@@ -183,7 +183,7 @@ static void SaveItemMask(HWND hwndList, HANDLE hContact, HANDLE hItem, const cha if(iImage && iImage != EMPTY_EXTRA_ICON)
mask |= 1<<i;
}
- DBWriteContactSettingDword(hContact, KEYBDMODULE, pszSetting, mask);
+ db_set_dw(hContact, KEYBDMODULE, pszSetting, mask);
}
static void SetAllContactIcons(HWND hwndList)
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 31b3f94623..5383bc5acd 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -148,7 +148,7 @@ BOOL isMetaContactsSubContact(HANDLE hMetaContact, HANDLE hContact) {
char *szProto = GetContactProto(hMetaContact);
if (szProto && !strcmp(szMetaProto, szProto)) { // Safety check
- int i = DBGetContactSettingDword(hContact, szMetaProto, "ContactNumber", -1);
+ int i = db_get_dw(hContact, szMetaProto, "ContactNumber", -1);
if (i >= 0 && hContact == (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hMetaContact, i))
return TRUE;
}
@@ -165,7 +165,7 @@ BOOL checkOpenWindow(HANDLE hContact) found = CheckMsgWnd(hContact, &focus);
if (!found && szMetaProto && bMetaProtoEnabled) {
- HANDLE hMetaContact = (HANDLE)DBGetContactSettingDword(hContact, szMetaProto, "Handle", 0);
+ HANDLE hMetaContact = (HANDLE)db_get_dw(hContact, szMetaProto, "Handle", 0);
if (hMetaContact && isMetaContactsSubContact(hMetaContact, hContact))
found = CheckMsgWnd(hMetaContact, &focus);
}
@@ -482,7 +482,7 @@ BOOL checkMsgTimestamp(HANDLE hEventCurrent, DWORD timestampCurrent) BOOL contactCheckProtocol(char *szProto, HANDLE hContact, WORD eventType)
{
if (szMetaProto && bMetaProtoEnabled && hContact) {
- HANDLE hMetaContact = (HANDLE)DBGetContactSettingDword(hContact, szMetaProto, "Handle", 0);
+ HANDLE hMetaContact = (HANDLE)db_get_dw(hContact, szMetaProto, "Handle", 0);
if (hMetaContact && isMetaContactsSubContact(hMetaContact, hContact))
return FALSE;
}
@@ -661,19 +661,19 @@ void createProcessList(void) DBVARIANT dbv;
unsigned int i, count;
- count = (unsigned int)DBGetContactSettingWord(NULL, KEYBDMODULE, "processcount", 0);
+ count = (unsigned int)db_get_w(NULL, KEYBDMODULE, "processcount", 0);
ProcessList.count = 0;
ProcessList.szFileName = (TCHAR **)malloc(count * sizeof(TCHAR *));
if (ProcessList.szFileName) {
for(i=0; i < count; i++)
- if (DBGetContactSettingTString(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i), &dbv))
+ if (db_get_ts(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i), &dbv))
ProcessList.szFileName[i] = NULL;
else {
ProcessList.szFileName[i] = (TCHAR *)malloc(wcslen(dbv.ptszVal) + 1);
if (ProcessList.szFileName[i])
wcscpy(ProcessList.szFileName[i], dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
ProcessList.count = count;
}
@@ -700,36 +700,36 @@ void destroyProcessList(void) void LoadSettings(void)
{
- bFlashOnMsg = DBGetContactSettingByte(NULL, KEYBDMODULE, "onmsg", DEF_SETTING_ONMSG);
- bFlashOnURL = DBGetContactSettingByte(NULL, KEYBDMODULE, "onurl", DEF_SETTING_ONURL);
- bFlashOnFile = DBGetContactSettingByte(NULL, KEYBDMODULE, "onfile", DEF_SETTING_ONFILE);
- bFlashOnOther = DBGetContactSettingByte(NULL, KEYBDMODULE, "onother", DEF_SETTING_OTHER);
- bFullScreenMode = DBGetContactSettingByte(NULL, KEYBDMODULE, "fscreenmode", DEF_SETTING_FSCREEN);
- bScreenSaverRunning = DBGetContactSettingByte(NULL, KEYBDMODULE, "ssaverrunning", DEF_SETTING_SSAVER);
- bWorkstationLocked = (bWindowsNT ? DBGetContactSettingByte(NULL, KEYBDMODULE, "wstationlocked", DEF_SETTING_LOCKED):0);
- bProcessesAreRunning = DBGetContactSettingByte(NULL, KEYBDMODULE, "procsrunning", DEF_SETTING_PROCS);
- bWorkstationActive = DBGetContactSettingByte(NULL, KEYBDMODULE, "wstationactive", DEF_SETTING_ACTIVE);
- bFlashIfMsgOpen = DBGetContactSettingByte(NULL, KEYBDMODULE, "ifmsgopen", DEF_SETTING_IFMSGOPEN);
- bFlashIfMsgWinNotTop = DBGetContactSettingByte(NULL, KEYBDMODULE, "ifmsgnottop", DEF_SETTING_IFMSGNOTTOP);
- bFlashIfMsgOlder = DBGetContactSettingByte(NULL, KEYBDMODULE, "ifmsgolder", DEF_SETTING_IFMSGOLDER);
- wSecondsOlder = DBGetContactSettingWord(NULL, KEYBDMODULE, "secsolder", DEF_SETTING_SECSOLDER);
- bFlashUntil = DBGetContactSettingByte(NULL, KEYBDMODULE, "funtil", DEF_SETTING_FLASHUNTIL);
- wBlinksNumber = DBGetContactSettingWord(NULL, KEYBDMODULE, "nblinks", DEF_SETTING_NBLINKS);
- bMirandaOrWindows = DBGetContactSettingByte(NULL, KEYBDMODULE, "mirorwin", DEF_SETTING_MIRORWIN);
- wStatusMap = DBGetContactSettingWord(NULL, KEYBDMODULE, "status", DEF_SETTING_STATUS);
- wReminderCheck = DBGetContactSettingWord(NULL, KEYBDMODULE, "remcheck", DEF_SETTING_CHECKTIME);
- bFlashLed[0] = !!DBGetContactSettingByte(NULL, KEYBDMODULE, "fnum", DEF_SETTING_FLASHNUM);
- bFlashLed[1] = !!DBGetContactSettingByte(NULL, KEYBDMODULE, "fcaps", DEF_SETTING_FLASHCAPS);
- bFlashLed[2] = !!DBGetContactSettingByte(NULL, KEYBDMODULE, "fscroll", DEF_SETTING_FLASHSCROLL);
- bFlashEffect = DBGetContactSettingByte(NULL, KEYBDMODULE, "feffect", DEF_SETTING_FLASHEFFECT);
- bSequenceOrder = DBGetContactSettingByte(NULL, KEYBDMODULE, "order", DEF_SETTING_SEQORDER);
- wCustomTheme = DBGetContactSettingWord(NULL, KEYBDMODULE, "custom", DEF_SETTING_CUSTOMTHEME);
- bTrillianLedsMsg = DBGetContactSettingByte(NULL, KEYBDMODULE, "ledsmsg", DEF_SETTING_LEDSMSG);
- bTrillianLedsURL = DBGetContactSettingByte(NULL, KEYBDMODULE, "ledsurl", DEF_SETTING_LEDSURL);
- bTrillianLedsFile = DBGetContactSettingByte(NULL, KEYBDMODULE, "ledsfile", DEF_SETTING_LEDSFILE);
- bTrillianLedsOther = DBGetContactSettingByte(NULL, KEYBDMODULE, "ledsother", DEF_SETTING_LEDSOTHER);
- wStartDelay = DBGetContactSettingWord(NULL, KEYBDMODULE, "sdelay", DEF_SETTING_STARTDELAY);
- bFlashSpeed = DBGetContactSettingByte(NULL, KEYBDMODULE, "speed", DEF_SETTING_FLASHSPEED);
+ bFlashOnMsg = db_get_b(NULL, KEYBDMODULE, "onmsg", DEF_SETTING_ONMSG);
+ bFlashOnURL = db_get_b(NULL, KEYBDMODULE, "onurl", DEF_SETTING_ONURL);
+ bFlashOnFile = db_get_b(NULL, KEYBDMODULE, "onfile", DEF_SETTING_ONFILE);
+ bFlashOnOther = db_get_b(NULL, KEYBDMODULE, "onother", DEF_SETTING_OTHER);
+ bFullScreenMode = db_get_b(NULL, KEYBDMODULE, "fscreenmode", DEF_SETTING_FSCREEN);
+ bScreenSaverRunning = db_get_b(NULL, KEYBDMODULE, "ssaverrunning", DEF_SETTING_SSAVER);
+ bWorkstationLocked = (bWindowsNT ? db_get_b(NULL, KEYBDMODULE, "wstationlocked", DEF_SETTING_LOCKED):0);
+ bProcessesAreRunning = db_get_b(NULL, KEYBDMODULE, "procsrunning", DEF_SETTING_PROCS);
+ bWorkstationActive = db_get_b(NULL, KEYBDMODULE, "wstationactive", DEF_SETTING_ACTIVE);
+ bFlashIfMsgOpen = db_get_b(NULL, KEYBDMODULE, "ifmsgopen", DEF_SETTING_IFMSGOPEN);
+ bFlashIfMsgWinNotTop = db_get_b(NULL, KEYBDMODULE, "ifmsgnottop", DEF_SETTING_IFMSGNOTTOP);
+ bFlashIfMsgOlder = db_get_b(NULL, KEYBDMODULE, "ifmsgolder", DEF_SETTING_IFMSGOLDER);
+ wSecondsOlder = db_get_w(NULL, KEYBDMODULE, "secsolder", DEF_SETTING_SECSOLDER);
+ bFlashUntil = db_get_b(NULL, KEYBDMODULE, "funtil", DEF_SETTING_FLASHUNTIL);
+ wBlinksNumber = db_get_w(NULL, KEYBDMODULE, "nblinks", DEF_SETTING_NBLINKS);
+ bMirandaOrWindows = db_get_b(NULL, KEYBDMODULE, "mirorwin", DEF_SETTING_MIRORWIN);
+ wStatusMap = db_get_w(NULL, KEYBDMODULE, "status", DEF_SETTING_STATUS);
+ wReminderCheck = db_get_w(NULL, KEYBDMODULE, "remcheck", DEF_SETTING_CHECKTIME);
+ bFlashLed[0] = !!db_get_b(NULL, KEYBDMODULE, "fnum", DEF_SETTING_FLASHNUM);
+ bFlashLed[1] = !!db_get_b(NULL, KEYBDMODULE, "fcaps", DEF_SETTING_FLASHCAPS);
+ bFlashLed[2] = !!db_get_b(NULL, KEYBDMODULE, "fscroll", DEF_SETTING_FLASHSCROLL);
+ bFlashEffect = db_get_b(NULL, KEYBDMODULE, "feffect", DEF_SETTING_FLASHEFFECT);
+ bSequenceOrder = db_get_b(NULL, KEYBDMODULE, "order", DEF_SETTING_SEQORDER);
+ wCustomTheme = db_get_w(NULL, KEYBDMODULE, "custom", DEF_SETTING_CUSTOMTHEME);
+ bTrillianLedsMsg = db_get_b(NULL, KEYBDMODULE, "ledsmsg", DEF_SETTING_LEDSMSG);
+ bTrillianLedsURL = db_get_b(NULL, KEYBDMODULE, "ledsurl", DEF_SETTING_LEDSURL);
+ bTrillianLedsFile = db_get_b(NULL, KEYBDMODULE, "ledsfile", DEF_SETTING_LEDSFILE);
+ bTrillianLedsOther = db_get_b(NULL, KEYBDMODULE, "ledsother", DEF_SETTING_LEDSOTHER);
+ wStartDelay = db_get_w(NULL, KEYBDMODULE, "sdelay", DEF_SETTING_STARTDELAY);
+ bFlashSpeed = db_get_b(NULL, KEYBDMODULE, "speed", DEF_SETTING_FLASHSPEED);
switch (bFlashSpeed) {
case 0: nWaitDelay = 1500; break;
case 1: nWaitDelay = 0750; break;
@@ -739,23 +739,23 @@ void LoadSettings(void) default: nWaitDelay = 0050; break;
}
setFlashingSequence();
- bEmulateKeypresses = DBGetContactSettingByte(NULL, KEYBDMODULE, "keypresses", DEF_SETTING_KEYPRESSES);
- bOverride = DBGetContactSettingByte(NULL, KEYBDMODULE, "override", DEF_SETTING_OVERRIDE);
+ bEmulateKeypresses = db_get_b(NULL, KEYBDMODULE, "keypresses", DEF_SETTING_KEYPRESSES);
+ bOverride = db_get_b(NULL, KEYBDMODULE, "override", DEF_SETTING_OVERRIDE);
// Create hidden settings (for test button) if needed
- if (DBGetContactSettingByte(NULL, KEYBDMODULE, "testnum", -1) == -1)
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "testnum", DEF_SETTING_TESTNUM);
- if (DBGetContactSettingByte(NULL, KEYBDMODULE, "testsecs", -1) == -1)
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "testsecs", DEF_SETTING_TESTSECS);
+ if (db_get_b(NULL, KEYBDMODULE, "testnum", -1) == -1)
+ db_set_b(NULL, KEYBDMODULE, "testnum", DEF_SETTING_TESTNUM);
+ if (db_get_b(NULL, KEYBDMODULE, "testsecs", -1) == -1)
+ db_set_b(NULL, KEYBDMODULE, "testsecs", DEF_SETTING_TESTSECS);
for(int i=0; i < ProtoList.protoCount; i++)
if (ProtoList.protoInfo[i].visible) {
unsigned int j;
- ProtoList.protoInfo[i].enabled = DBGetContactSettingByte(NULL, KEYBDMODULE, ProtoList.protoInfo[i].szProto, DEF_SETTING_PROTOCOL);
+ ProtoList.protoInfo[i].enabled = db_get_b(NULL, KEYBDMODULE, ProtoList.protoInfo[i].szProto, DEF_SETTING_PROTOCOL);
for(j=0; j < ProtoList.protoInfo[i].xstatus.count; j++)
- ProtoList.protoInfo[i].xstatus.enabled[j] = DBGetContactSettingByte(NULL, KEYBDMODULE, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), DEF_SETTING_XSTATUS);
+ ProtoList.protoInfo[i].xstatus.enabled[j] = db_get_b(NULL, KEYBDMODULE, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), DEF_SETTING_XSTATUS);
}
if (szMetaProto)
- bMetaProtoEnabled = DBGetContactSettingByte(NULL, szMetaProto, "Enabled", 1);
+ bMetaProtoEnabled = db_get_b(NULL, szMetaProto, "Enabled", 1);
destroyProcessList();
createProcessList();
diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index e1dd452c01..c0245c5e2f 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -316,7 +316,7 @@ INT_PTR CALLBACK DlgProcProtoOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR for (i=0; i < ListView_GetItemCount(hList); i++) {
lvItem.iItem = i;
ListView_GetItem(hList, &lvItem);
- DBWriteContactSettingByte(NULL, KEYBDMODULE, (char *)lvItem.lParam, (BYTE)!!ListView_GetCheckState(hList, lvItem.iItem));
+ db_set_b(NULL, KEYBDMODULE, (char *)lvItem.lParam, (BYTE)!!ListView_GetCheckState(hList, lvItem.iItem));
}
}
@@ -517,21 +517,21 @@ INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "onmsg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONMESSAGE) == BST_CHECKED ? 1:0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "onurl", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONURL) == BST_CHECKED ? 1:0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "onfile", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONFILE) == BST_CHECKED ? 1:0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "onother", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONOTHER) == BST_CHECKED ? 1:0));
-
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "fscreenmode", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_FSCREEN) == BST_CHECKED ? 1:0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "ssaverrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SSAVER) == BST_CHECKED ? 1:0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "wstationlocked", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_LOCKED) == BST_CHECKED ? 1:0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "procsrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PGMS) == BST_CHECKED ? 1:0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "wstationactive", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ACTIVE) == BST_CHECKED ? 1:0));
-
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "ifmsgopen", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOPEN) == BST_CHECKED ? 1:0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "ifmsgnottop", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFNOTTOP) == BST_CHECKED ? 1:0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "ifmsgolder", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOLDER) == BST_CHECKED ? 1:0));
- DBWriteContactSettingWord(NULL, KEYBDMODULE, "secsolder", (WORD)SendDlgItemMessage(hwndDlg, IDC_OLDERSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(NULL, KEYBDMODULE, "onmsg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONMESSAGE) == BST_CHECKED ? 1:0));
+ db_set_b(NULL, KEYBDMODULE, "onurl", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONURL) == BST_CHECKED ? 1:0));
+ db_set_b(NULL, KEYBDMODULE, "onfile", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONFILE) == BST_CHECKED ? 1:0));
+ db_set_b(NULL, KEYBDMODULE, "onother", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONOTHER) == BST_CHECKED ? 1:0));
+
+ db_set_b(NULL, KEYBDMODULE, "fscreenmode", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_FSCREEN) == BST_CHECKED ? 1:0));
+ db_set_b(NULL, KEYBDMODULE, "ssaverrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SSAVER) == BST_CHECKED ? 1:0));
+ db_set_b(NULL, KEYBDMODULE, "wstationlocked", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_LOCKED) == BST_CHECKED ? 1:0));
+ db_set_b(NULL, KEYBDMODULE, "procsrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PGMS) == BST_CHECKED ? 1:0));
+ db_set_b(NULL, KEYBDMODULE, "wstationactive", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ACTIVE) == BST_CHECKED ? 1:0));
+
+ db_set_b(NULL, KEYBDMODULE, "ifmsgopen", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOPEN) == BST_CHECKED ? 1:0));
+ db_set_b(NULL, KEYBDMODULE, "ifmsgnottop", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFNOTTOP) == BST_CHECKED ? 1:0));
+ db_set_b(NULL, KEYBDMODULE, "ifmsgolder", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOLDER) == BST_CHECKED ? 1:0));
+ db_set_w(NULL, KEYBDMODULE, "secsolder", (WORD)SendDlgItemMessage(hwndDlg, IDC_OLDERSPIN, UDM_GETPOS, 0, 0));
if(IsDlgButtonChecked(hwndDlg, IDC_UNTILBLK) == BST_CHECKED)
untilMap |= UNTIL_NBLINKS;
@@ -541,9 +541,9 @@ INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR untilMap |= UNTIL_EVENTSOPEN;
if (IsDlgButtonChecked(hwndDlg, IDC_UNTILCOND) == BST_CHECKED)
untilMap |= UNTIL_CONDITIONS;
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "funtil", untilMap);
- DBWriteContactSettingWord(NULL, KEYBDMODULE, "nblinks", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "mirorwin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETCURSEL, 0, 0), 0));
+ db_set_b(NULL, KEYBDMODULE, "funtil", untilMap);
+ db_set_w(NULL, KEYBDMODULE, "nblinks", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
+ db_set_b(NULL, KEYBDMODULE, "mirorwin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETCURSEL, 0, 0), 0));
if(IsDlgButtonChecked(hwndDlg, IDC_ONLINE) == BST_CHECKED)
statusMap |= MAP_ONLINE;
@@ -565,21 +565,21 @@ INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR statusMap |= MAP_OUTTOLUNCH;
if(IsDlgButtonChecked(hwndDlg, IDC_OFFLINE) == BST_CHECKED)
statusMap |= MAP_OFFLINE;
- DBWriteContactSettingWord(NULL, KEYBDMODULE, "status", statusMap);
+ db_set_w(NULL, KEYBDMODULE, "status", statusMap);
- DBWriteContactSettingWord(NULL, KEYBDMODULE, "remcheck", (WORD)SendDlgItemMessage(hwndDlg, IDC_REMCHECK, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, KEYBDMODULE, "remcheck", (WORD)SendDlgItemMessage(hwndDlg, IDC_REMCHECK, UDM_GETPOS, 0, 0));
int i = 0;
for (int j = 0; j < ProcessListAux.count; j++)
if (ProcessListAux.szFileName[j])
- DBWriteContactSettingTString(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i++), ProcessListAux.szFileName[j]);
- DBWriteContactSettingWord(NULL, KEYBDMODULE, "processcount", (WORD)i);
- while (!DBDeleteContactSetting(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i++)));
+ db_set_ts(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i++), ProcessListAux.szFileName[j]);
+ db_set_w(NULL, KEYBDMODULE, "processcount", (WORD)i);
+ while (!db_unset(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i++)));
if (XstatusListAux)
for (int i = 0; i < ProtoList.protoCount; i++)
for(int j = 0; j < (int)XstatusListAux[i].count; j++)
- DBWriteContactSettingByte(NULL, KEYBDMODULE, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), (BYTE)XstatusListAux[i].enabled[j]);
+ db_set_b(NULL, KEYBDMODULE, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), (BYTE)XstatusListAux[i].enabled[j]);
LoadSettings();
@@ -630,9 +630,9 @@ INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA if (bFlashEffect != FLASH_INSEQUENCE)
EnableWindow(GetDlgItem(hwndDlg, IDC_SEQORDER), FALSE);
CheckDlgButton(hwndDlg, IDC_CUSTOM, bFlashEffect == FLASH_CUSTOM ? BST_CHECKED:BST_UNCHECKED);
- for (i=0; !DBGetContactSettingTString(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), &dbv); i++) {
+ for (i=0; !db_get_ts(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), &dbv); i++) {
int index = SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (index != CB_ERR && index != CB_ERRSPACE)
SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_SETITEMDATA, (WPARAM)index, (LPARAM)i);
}
@@ -707,36 +707,36 @@ INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "fnum", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NUM) == BST_CHECKED ? 1:0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "fcaps", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CAPS) == BST_CHECKED ? 1:0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "fscroll", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCROLL) == BST_CHECKED ? 1:0));
+ db_set_b(NULL, KEYBDMODULE, "fnum", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NUM) == BST_CHECKED ? 1:0));
+ db_set_b(NULL, KEYBDMODULE, "fcaps", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CAPS) == BST_CHECKED ? 1:0));
+ db_set_b(NULL, KEYBDMODULE, "fscroll", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCROLL) == BST_CHECKED ? 1:0));
if(IsDlgButtonChecked(hwndDlg, IDC_INTURN) == BST_CHECKED)
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "feffect", FLASH_INTURN);
+ db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_INTURN);
else
if (IsDlgButtonChecked(hwndDlg, IDC_INSEQUENCE) == BST_CHECKED)
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "feffect", FLASH_INSEQUENCE);
+ db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_INSEQUENCE);
else
if (IsDlgButtonChecked(hwndDlg, IDC_CUSTOM) == BST_CHECKED)
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "feffect", FLASH_CUSTOM);
+ db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_CUSTOM);
else
if (IsDlgButtonChecked(hwndDlg, IDC_TRILLIAN) == BST_CHECKED)
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "feffect", FLASH_TRILLIAN);
+ db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_TRILLIAN);
else
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "feffect", FLASH_SAMETIME);
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "order", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETCURSEL, 0, 0), 0));
- DBWriteContactSettingWord(NULL, KEYBDMODULE, "custom", (WORD)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETCURSEL, 0, 0), 0));
+ db_set_b(NULL, KEYBDMODULE, "feffect", FLASH_SAMETIME);
+ db_set_b(NULL, KEYBDMODULE, "order", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETCURSEL, 0, 0), 0));
+ db_set_w(NULL, KEYBDMODULE, "custom", (WORD)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETCURSEL, 0, 0), 0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "ledsmsg", trillianLedsMsg);
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "ledsfile", trillianLedsFile);
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "ledsurl", trillianLedsURL);
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "ledsother", trillianLedsOther);
+ db_set_b(NULL, KEYBDMODULE, "ledsmsg", trillianLedsMsg);
+ db_set_b(NULL, KEYBDMODULE, "ledsfile", trillianLedsFile);
+ db_set_b(NULL, KEYBDMODULE, "ledsurl", trillianLedsURL);
+ db_set_b(NULL, KEYBDMODULE, "ledsother", trillianLedsOther);
- DBWriteContactSettingWord(NULL, KEYBDMODULE, "sdelay", (WORD)SendDlgItemMessage(hwndDlg, IDC_DELAYSPIN, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, KEYBDMODULE, "sdelay", (WORD)SendDlgItemMessage(hwndDlg, IDC_DELAYSPIN, UDM_GETPOS, 0, 0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "speed", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SPEED, TBM_GETPOS, 0, 0));
+ db_set_b(NULL, KEYBDMODULE, "speed", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SPEED, TBM_GETPOS, 0, 0));
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "keypresses", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_KEYPRESSES) == BST_CHECKED ? 1:0));
+ db_set_b(NULL, KEYBDMODULE, "keypresses", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_KEYPRESSES) == BST_CHECKED ? 1:0));
LoadSettings();
@@ -770,17 +770,17 @@ INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SendDlgItemMessage(hwndDlg, IDC_THEME, EM_LIMITTEXT, MAX_PATH, 0);
SendDlgItemMessage(hwndDlg, IDC_CUSTOMSTRING, EM_LIMITTEXT, MAX_PATH, 0);
- for (i=0; !DBGetContactSettingTString(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), &dbv); i++) {
+ for (i=0; !db_get_ts(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), &dbv); i++) {
int index = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (index != CB_ERR && index != CB_ERRSPACE) {
str = (TCHAR *)malloc(MAX_PATH+1);
if (str)
- if (DBGetContactSettingTString(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), &dbv))
+ if (db_get_ts(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), &dbv))
str[0] = _T('\0');
else {
_tcscpy(str, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
SendDlgItemMessage(hwndDlg, IDC_THEME, CB_SETITEMDATA, (WPARAM)index, (LPARAM)str);
}
@@ -1001,7 +1001,7 @@ INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- if (!DBGetContactSettingTString(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", wCustomTheme), &dbv))
+ if (!db_get_ts(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", wCustomTheme), &dbv))
_tcscpy(theme, dbv.ptszVal);
else
theme[0] = _T('\0');
@@ -1012,12 +1012,12 @@ INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR count = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETCOUNT, 0, 0);
for (i=0, wCustomTheme=0; i < count; i++) {
SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETLBTEXT, (WPARAM)i, (LPARAM)themeAux);
- DBWriteContactSettingTString(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), themeAux);
+ db_set_ts(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), themeAux);
str = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)i, 0);
if (str)
- DBWriteContactSettingTString(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), str);
+ db_set_ts(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), str);
else
- DBWriteContactSettingTString(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), _T(""));
+ db_set_ts(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), _T(""));
if (!wcscmp(theme, themeAux))
wCustomTheme = i;
@@ -1026,14 +1026,14 @@ INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_INSERTSTRING, (WPARAM)i, (LPARAM)themeAux);
SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_SETITEMDATA, (WPARAM)i, (LPARAM)i);
}
- for (i=count; !DBDeleteContactSetting(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++)
- DBDeleteContactSetting(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i));
+ for (i=count; !db_unset(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i)); i++)
+ db_unset(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i));
- DBWriteContactSettingWord(NULL, KEYBDMODULE, "custom", wCustomTheme);
+ db_set_w(NULL, KEYBDMODULE, "custom", wCustomTheme);
// Still updating here the the Flashing tab's controls
SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_SETCURSEL, (WPARAM)wCustomTheme, 0);
- DBWriteContactSettingByte(NULL, KEYBDMODULE, "override", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_OVERRIDE) == BST_CHECKED ? 1:0));
+ db_set_b(NULL, KEYBDMODULE, "override", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_OVERRIDE) == BST_CHECKED ? 1:0));
return TRUE;
} // switch code
@@ -1073,14 +1073,14 @@ void exportThemes(const TCHAR *filename) fwprintf(fExport, TranslateT("\n; Automatically generated Keyboard Notify Theme file\n\n\n"));
- for (i=0; !DBGetContactSettingTString(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), &dbv); i++) {
+ for (i=0; !db_get_ts(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), &dbv); i++) {
_ftprintf(fExport, _T("[%s]\n"), dbv.ptszVal);
- DBFreeVariant(&dbv);
- if (DBGetContactSettingTString(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), &dbv))
+ db_free(&dbv);
+ if (db_get_ts(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), &dbv))
_ftprintf(fExport, _T("0\n\n"));
else {
_ftprintf(fExport, _T("%s\n\n"), dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
diff --git a/plugins/KeyboardNotify/src/trigger.cpp b/plugins/KeyboardNotify/src/trigger.cpp index e441a8cf60..147744b96d 100644 --- a/plugins/KeyboardNotify/src/trigger.cpp +++ b/plugins/KeyboardNotify/src/trigger.cpp @@ -35,12 +35,12 @@ int getCustomNro(DWORD actionID, HWND hwndDlg, int nItems) for (i=0; i < nItems; i++) {
SendDlgItemMessage(hwndDlg, IDC_CUSTOMTHEME, CB_GETLBTEXT, (WPARAM)i, (LPARAM)theme);
if (!strcmp(dbv.pszVal, theme)) {
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return i;
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return DEF_SETTING_CUSTOMTHEME;
}
@@ -56,9 +56,9 @@ static INT_PTR CALLBACK DlgProcOptsActionKbdNotify(HWND hwndDlg, UINT msg, WPARA actionID = (DWORD)lParam;
TranslateDialogDefault(hwndDlg);
- for (i=0; !DBGetContactSetting(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), &dbv); i++) {
+ for (i=0; !db_get(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), &dbv); i++) {
int index = SendDlgItemMessage(hwndDlg, IDC_CUSTOMTHEME, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (index != CB_ERR && index != CB_ERRSPACE)
SendDlgItemMessage(hwndDlg, IDC_CUSTOMTHEME, CB_SETITEMDATA, (WPARAM)index, (LPARAM)i);
}
@@ -106,20 +106,20 @@ char *getCustomString(DWORD actionID) if (DBGetTriggerSetting(actionID, NULL, KEYBDMODULE, "custom", &dbv))
return NULL;
- for (i=0; !DBGetContactSetting(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), &dbv2); i++) {
+ for (i=0; !db_get(NULL, KEYBDMODULE, fmtDBSettingName("theme%d", i), &dbv2); i++) {
if (!strcmp(dbv.pszVal, dbv2.pszVal)) {
- DBFreeVariant(&dbv);
- DBFreeVariant(&dbv2);
- if(DBGetContactSetting(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), &dbv2))
+ db_free(&dbv);
+ db_free(&dbv2);
+ if(db_get(NULL, KEYBDMODULE, fmtDBSettingName("custom%d", i), &dbv2))
return NULL;
strcpy(customString, dbv2.pszVal);
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
return customString;
}
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return NULL;
}
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 75be3cdacf..7070307b18 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -19,7 +19,7 @@ const int vf_default = VF_VS|VF_HFL|VF_IGN|VF_CID|VF_SHOWID|VF_RECV|VF_STAT|VF_S HINSTANCE hinstance;
HGENMENU hmenuVis,hmenuOff,hmenuHide,hmenuIgnore,hmenuProto,hmenuAdded,hmenuAuthReq;
HGENMENU hmenuCopyID,hmenuRecvFiles,hmenuStatusMsg,hmenuCopyIP,hmenuCopyMirVer;
-static HANDLE hIgnoreItem[9], hProtoItem[MAX_PROTOS];
+static HGENMENU hIgnoreItem[9], hProtoItem[MAX_PROTOS];
HICON hIcon[5];
BOOL bMetaContacts = FALSE, bPopUpService = FALSE;
PROTOACCOUNT **accs;
@@ -185,19 +185,19 @@ void RenameDbProto(HANDLE hContact, HANDLE hContactNew, char* oldName, char* new if (!GetSetting(hContact,oldName,setting->name,&dbv)) {
switch (dbv.type) {
case DBVT_BYTE:
- DBWriteContactSettingByte(hContactNew, newName, setting->name, dbv.bVal);
+ db_set_b(hContactNew, newName, setting->name, dbv.bVal);
break;
case DBVT_WORD:
- DBWriteContactSettingWord(hContactNew, newName, setting->name, dbv.wVal);
+ db_set_w(hContactNew, newName, setting->name, dbv.wVal);
break;
case DBVT_DWORD:
- DBWriteContactSettingDword(hContactNew, newName, setting->name, dbv.dVal);
+ db_set_dw(hContactNew, newName, setting->name, dbv.dVal);
break;
case DBVT_ASCIIZ:
- DBWriteContactSettingString(hContactNew, newName, setting->name, dbv.pszVal);
+ db_set_s(hContactNew, newName, setting->name, dbv.pszVal);
break;
case DBVT_UTF8:
- DBWriteContactSettingStringUtf(hContactNew, newName, setting->name, dbv.pszVal);
+ db_set_utf(hContactNew, newName, setting->name, dbv.pszVal);
break;
case DBVT_BLOB:
DBWriteContactSettingBlob(hContactNew, newName, setting->name, dbv.pbVal, dbv.cpbVal);
@@ -205,9 +205,9 @@ void RenameDbProto(HANDLE hContact, HANDLE hContactNew, char* oldName, char* new }
if (delOld)
- DBDeleteContactSetting(hContact, oldName, setting->name);
+ db_unset(hContact, oldName, setting->name);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
setting = (struct ModSetLinkLinkItem *)setting->next;
}
FreeModuleSettingLL(&settinglist);
@@ -273,7 +273,7 @@ void CopyToClipboard(HWND hwnd,LPSTR pszMsg, LPTSTR ptszMsg) BOOL isMetaContact(HANDLE hContact)
{
char *proto;
- if(bMetaContacts) {
+ if (bMetaContacts) {
proto = GetContactProto(hContact);
if ( lstrcmpA(proto, "MetaContacts") == 0 ) {
return TRUE;
@@ -284,14 +284,14 @@ BOOL isMetaContact(HANDLE hContact) HANDLE getDefaultContact(HANDLE hContact)
{
- if(bMetaContacts)
+ if (bMetaContacts)
return (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT, (WPARAM)hContact, 0);
return 0;
}
HANDLE getMostOnline(HANDLE hContact)
{
- if(bMetaContacts)
+ if (bMetaContacts)
return (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
return 0;
}
@@ -305,7 +305,7 @@ void GetID(HANDLE hContact,LPSTR szProto,LPSTR szID) *szID = '\0';
- if ( uID && DBGetContactSetting(hContact, szProto, uID ,&dbv_uniqueid) == 0 ) {
+ if ( uID && db_get(hContact, szProto, uID ,&dbv_uniqueid) == 0 ) {
if (dbv_uniqueid.type == DBVT_DWORD)
wsprintfA(szID, "%u", dbv_uniqueid.dVal);
else if (dbv_uniqueid.type == DBVT_WORD)
@@ -315,7 +315,7 @@ void GetID(HANDLE hContact,LPSTR szProto,LPSTR szID) else
wsprintfA(szID, "%s", dbv_uniqueid.pszVal);
- DBFreeVariant(&dbv_uniqueid);
+ db_free(&dbv_uniqueid);
}
}
@@ -336,8 +336,8 @@ int StatusMsgExists(HANDLE hContact) strcpy(par, statusMsg[i].name);
msg = DBGetString(hContact, (statusMsg[i].module) ? statusMsg[i].module : module, par);
- if(msg) {
- if(strlen(msg))
+ if (msg) {
+ if (strlen(msg))
ret |= statusMsg[i].flag;
mir_free(msg);
}
@@ -353,8 +353,8 @@ BOOL IPExists(HANDLE hContact) szProto = GetContactProto(hContact);
if (!szProto) return 0;
- mIP = DBGetContactSettingDword(hContact, szProto, "IP", 0);
- rIP = DBGetContactSettingDword(hContact, szProto, "RealIP", 0);
+ mIP = db_get_dw(hContact, szProto, "IP", 0);
+ rIP = db_get_dw(hContact, szProto, "RealIP", 0);
return (mIP != 0 || rIP != 0);
}
@@ -368,8 +368,8 @@ BOOL MirVerExists(HANDLE hContact) if (!szProto) return 0;
msg = DBGetString(hContact,szProto,"MirVer");
- if(msg) {
- if(strlen(msg)) ret = 1;
+ if (msg) {
+ if (strlen(msg)) ret = 1;
mir_free(msg);
}
@@ -380,8 +380,8 @@ void getIP(HANDLE hContact,LPSTR szProto,LPSTR szIP) {
char szmIP[64] = {0};
char szrIP[64] = {0};
- DWORD mIP = DBGetContactSettingDword(hContact, szProto, "IP", 0);
- DWORD rIP = DBGetContactSettingDword(hContact, szProto, "RealIP", 0);
+ DWORD mIP = db_get_dw(hContact, szProto, "IP", 0);
+ DWORD rIP = db_get_dw(hContact, szProto, "RealIP", 0);
if ( mIP ) wsprintfA(szmIP, "External IP: %d.%d.%d.%d\r\n", mIP>>24,(mIP>>16)&0xFF,(mIP>>8)&0xFF,mIP&0xFF);
if ( rIP ) wsprintfA(szrIP, "Internal IP: %d.%d.%d.%d\r\n", rIP>>24,(rIP>>16)&0xFF,(rIP>>8)&0xFF,rIP&0xFF);
strcpy(szIP,szrIP);
@@ -396,8 +396,8 @@ LPSTR getMirVer(HANDLE hContact) if (!szProto) return NULL;
msg = DBGetString(hContact,szProto,"MirVer");
- if(msg) {
- if(strlen(msg))
+ if (msg) {
+ if (strlen(msg))
return msg;
mir_free(msg);
}
@@ -409,11 +409,11 @@ static LRESULT CALLBACK AuthReqEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam {
switch(msg) {
case WM_CHAR:
- if(wParam == '\n' && CTRL_IS_PRESSED) { // ctrl + ENTER
+ if (wParam == '\n' && CTRL_IS_PRESSED) { // ctrl + ENTER
PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
return 0;
}
- if(wParam == 1 && CTRL_IS_PRESSED) { // ctrl + a
+ if (wParam == 1 && CTRL_IS_PRESSED) { // ctrl + a
SendMessage(hwnd, EM_SETSEL, 0, -1);
return 0;
}
@@ -456,20 +456,6 @@ INT_PTR CALLBACK AuthReqWndProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) return 0;
}
-BOOL isVisSupport(HANDLE hContact)
-{
- char *szProto = GetContactProto(hContact);
- if(szProto == NULL) return 0;
- return CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_1,0)&PF1_INVISLIST;
-}
-
-BOOL isInvSupport(HANDLE hContact)
-{
- char *szProto = GetContactProto(hContact);
- if(szProto == NULL) return 0;
- return CallProtoService(szProto,PS_GETCAPS,PFLAGNUM_1,0)&PF1_VISLIST;
-}
-
BOOL isProtoOnline(char *szProto)
{
//#ifdef _DEBUG
@@ -505,192 +491,159 @@ INT_PTR onSendAdded(WPARAM wparam,LPARAM lparam) // set the invisible-flag in db
INT_PTR onSetInvis(WPARAM wparam,LPARAM lparam)
{
- CallContactService((HANDLE)wparam,PSS_SETAPPARENTMODE,(DBGetContactSettingWord((HANDLE)wparam, GetContactProto((HANDLE)wparam),"ApparentMode",0) == ID_STATUS_OFFLINE)?0:ID_STATUS_OFFLINE,0);
+ CallContactService((HANDLE)wparam,PSS_SETAPPARENTMODE,(db_get_w((HANDLE)wparam, GetContactProto((HANDLE)wparam),"ApparentMode",0) == ID_STATUS_OFFLINE)?0:ID_STATUS_OFFLINE,0);
return 0;
}
// set visible-flag in db
INT_PTR onSetVis(WPARAM wparam,LPARAM lparam)
{
- CallContactService((HANDLE)wparam,PSS_SETAPPARENTMODE,(DBGetContactSettingWord((HANDLE)wparam, GetContactProto((HANDLE)wparam),"ApparentMode",0) == ID_STATUS_ONLINE)?0:ID_STATUS_ONLINE,0);
+ CallContactService((HANDLE)wparam,PSS_SETAPPARENTMODE,(db_get_w((HANDLE)wparam, GetContactProto((HANDLE)wparam),"ApparentMode",0) == ID_STATUS_ONLINE)?0:ID_STATUS_ONLINE,0);
return 0;
}
INT_PTR onHide(WPARAM wparam,LPARAM lparam)
{
- DBWriteContactSettingByte((HANDLE)wparam,"CList","Hidden",(byte)!DBGetContactSettingByte((HANDLE)wparam,"CList","Hidden",0));
+ db_set_b((HANDLE)wparam,"CList","Hidden",(byte)!db_get_b((HANDLE)wparam,"CList","Hidden",0));
CallService(MS_CLUI_SORTLIST,0,0);
return 0;
}
-void ShowItem(CLISTMENUITEM *cli, HANDLE hmenu)
-{
- cli->flags = CMIM_FLAGS | CMIF_TCHAR;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hmenu,(LPARAM)cli);
-}
-
-void HideItem(CLISTMENUITEM *cli,HANDLE hmenu)
-{
- cli->flags|=CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hmenu,(LPARAM)cli);
-}
-
// following 4 functions should be self-explanatory
-void ModifyVisibleSet(CLISTMENUITEM *cli,int mode,BOOL alpha)
+void ModifyVisibleSet(int mode, BOOL alpha)
{
- cli->flags |= CMIM_ICON;
- cli->hIcon = (mode) ? hIcon[1] : (alpha?hIcon[3] : LoadSkinnedIcon(SKINICON_OTHER_SMALLDOT));
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hmenuVis, (LPARAM)cli);
-}
-
-void ModifyInvisSet(CLISTMENUITEM *cli,int mode,BOOL alpha)
-{
- cli->flags |= CMIM_ICON;
- cli->hIcon = (mode) ? hIcon[2] : (alpha ? hIcon[4] : LoadSkinnedIcon(SKINICON_OTHER_SMALLDOT));
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hmenuOff, (LPARAM)cli);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_ICON;
+ mi.hIcon = (mode) ? hIcon[1] : (alpha ? hIcon[3] : LoadSkinnedIcon(SKINICON_OTHER_SMALLDOT));
+ Menu_ModifyItem(hmenuVis, &mi);
}
-void ModifyHidden(CLISTMENUITEM *cli,int mode)
+void ModifyInvisSet(int mode,BOOL alpha)
{
- cli->flags |= CMIM_ICON | CMIM_NAME;
- cli->hIcon = Skin_GetIcon((mode) ? "miex_showil" : "miex_hidefl");
- cli->ptszName = mode ? LPGENT("Show in list") : LPGENT("Hide from list");
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hmenuHide, (LPARAM)cli);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_ICON;
+ mi.hIcon = (mode) ? hIcon[2] : (alpha ? hIcon[4] : LoadSkinnedIcon(SKINICON_OTHER_SMALLDOT));
+ Menu_ModifyItem(hmenuVis, &mi);
}
-void ModifyCopyID(CLISTMENUITEM *cli, HANDLE hContact, BOOL bShowID, BOOL bTrimID)
+void ModifyCopyID(HANDLE hContact, BOOL bShowID, BOOL bTrimID)
{
- LPSTR szProto;
- char szID[256];
- TCHAR buffer[256];
- HICON hIconCID;
- HANDLE hC;
-
- cli->flags|=CMIM_ICON|CMIM_NAME;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_ICON | CMIM_NAME;
- if(isMetaContact(hContact)) {
- hC = getMostOnline(hContact);
+ if (isMetaContact(hContact)) {
+ HANDLE hC = getMostOnline(hContact);
if ( !hContact ) hC = getDefaultContact(hContact);
hContact = hC;
}
- szProto = GetContactProto(hContact);
+ LPSTR szProto = GetContactProto(hContact);
if (!szProto) {
- HideItem(cli,hmenuCopyID);
+ Menu_ShowItem(hmenuCopyID, false);
return;
}
- hIconCID = (HICON) CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
- cli->hIcon = BindOverlayIcon(hIconCID, "miex_copyid");
+
+ HICON hIconCID = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
+ mi.hIcon = BindOverlayIcon(hIconCID, "miex_copyid");
DestroyIcon(hIconCID);
- hIconCID = cli->hIcon;
+ hIconCID = mi.hIcon;
- GetID(hContact,szProto,(LPSTR)&szID);
- if(szID[0])
- {
- if (bShowID)
- {
- TCHAR* tmp;
-
- if (bTrimID && (strlen(szID) > MAX_IDLEN))
- {
+ char szID[256];
+ GetID(hContact, szProto, (LPSTR)&szID);
+ if (szID[0]) {
+ if (bShowID) {
+ if (bTrimID && (strlen(szID) > MAX_IDLEN)) {
szID[MAX_IDLEN - 2] = szID[MAX_IDLEN - 1] = szID[MAX_IDLEN] = '.';
szID[MAX_IDLEN + 1] = 0;
}
- tmp = mir_a2t(szID);
- mir_sntprintf(buffer, SIZEOF(buffer), _T("%s [%s]"), TranslateT("Copy ID"), tmp);
- mir_free(tmp);
- cli->ptszName = (TCHAR*)&buffer;
+ TCHAR buffer[256];
+ mir_sntprintf(buffer, SIZEOF(buffer), _T("%s [%S]"), TranslateT("Copy ID"), szID);
+ mi.ptszName = buffer;
}
- else
- cli->ptszName = _T("Copy ID");
- }
- else {
- cli->flags = CMIM_FLAGS|CMIF_HIDDEN;
+ else mi.ptszName = LPGENT("Copy ID");
}
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hmenuCopyID,(LPARAM)cli);
+ else mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
+
+ Menu_ModifyItem(hmenuCopyID, &mi);
DestroyIcon(hIconCID);
}
-void ModifyStatusMsg(CLISTMENUITEM *cli,HANDLE hContact)
+void ModifyStatusMsg(HANDLE hContact)
{
- LPSTR szProto;
- HICON hIconSMsg;
-
- cli->flags|=CMIM_ICON;
-
- szProto = GetContactProto(hContact);
+ LPSTR szProto = GetContactProto(hContact);
if (!szProto) {
- HideItem(cli,hmenuStatusMsg);
+ Menu_ShowItem(hmenuStatusMsg, false);
return;
}
-
- hIconSMsg = (HICON) CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
- cli->hIcon = BindOverlayIcon(hIconSMsg, (StatusMsgExists(hContact)&2) ? "miex_copysm2" : "miex_copysm1");
+
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_ICON;
+
+ HICON hIconSMsg = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
+ mi.hIcon = BindOverlayIcon(hIconSMsg, (StatusMsgExists(hContact)&2) ? "miex_copysm2" : "miex_copysm1");
DestroyIcon(hIconSMsg);
- hIconSMsg = cli->hIcon;
+ hIconSMsg = mi.hIcon;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hmenuStatusMsg,(LPARAM)cli);
+ Menu_ModifyItem(hmenuStatusMsg, &mi);
DestroyIcon(hIconSMsg);
}
-void ModifyCopyIP(CLISTMENUITEM *cli,HANDLE hContact)
+void ModifyCopyIP(HANDLE hContact)
{
- LPSTR szProto;
- HICON hIconCIP;
-
- cli->flags |= CMIM_ICON;
-
- szProto = GetContactProto(hContact);
+ LPSTR szProto = GetContactProto(hContact);
if (!szProto) {
- HideItem(cli,hmenuCopyIP);
+ Menu_ShowItem(hmenuCopyIP, false);
return;
}
- hIconCIP = (HICON) CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_ICON;
- cli->hIcon = BindOverlayIcon(hIconCIP, "miex_copyip");
+ HICON hIconCIP = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
+ mi.hIcon = BindOverlayIcon(hIconCIP, "miex_copyip");
DestroyIcon(hIconCIP);
- hIconCIP = cli->hIcon;
+ hIconCIP = mi.hIcon;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hmenuCopyIP,(LPARAM)cli);
+ Menu_ModifyItem(hmenuCopyIP, &mi);
DestroyIcon(hIconCIP);
}
-void ModifyCopyMirVer(CLISTMENUITEM *cli,HANDLE hContact)
+void ModifyCopyMirVer(HANDLE hContact)
{
- LPSTR msg;
- cli->flags|=CMIM_ICON;
- cli->hIcon = NULL;
- if(ServiceExists(MS_FP_GETCLIENTICON)) {
- msg = getMirVer(hContact);
- if(msg) {
- cli->hIcon = (HICON)CallService(MS_FP_GETCLIENTICON,(WPARAM)msg,(LPARAM)1);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_ICON;
+
+ if (ServiceExists(MS_FP_GETCLIENTICON)) {
+ LPSTR msg = getMirVer(hContact);
+ if (msg) {
+ mi.hIcon = (HICON)CallService(MS_FP_GETCLIENTICON,(WPARAM)msg,(LPARAM)1);
mir_free(msg);
}
}
- if (!cli->hIcon) cli->hIcon = hIcon[0];
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hmenuCopyMirVer,(LPARAM)cli);
+ if (!mi.hIcon) mi.hIcon = hIcon[0];
+ Menu_ModifyItem(hmenuCopyMirVer, &mi);
}
INT_PTR onCopyID(WPARAM wparam,LPARAM lparam)
{
- LPSTR szProto;
char szID[128] = {0}, buffer[256] = {0};
- HANDLE hContact ,hC;
- hContact = (HANDLE)wparam;
- if(isMetaContact(hContact)) {
- hC = getMostOnline(hContact);
- if ( !hContact ) hC = getDefaultContact(hContact);
+ HANDLE hContact = (HANDLE)wparam;
+ if (isMetaContact(hContact)) {
+ HANDLE hC = getMostOnline(hContact);
+ if (!hContact)
+ hC = getDefaultContact(hContact);
hContact = hC;
}
- if ((szProto = GetContactProto(hContact)) == NULL)
+
+ LPSTR szProto = GetContactProto(hContact);
+ if (szProto == NULL)
return 0;
GetID(hContact, szProto, (LPSTR)&szID);
- if(db_get_dw(NULL, MODULENAME, "flags", vf_default) & VF_CIDN) {
+ if (db_get_dw(NULL, MODULENAME, "flags", vf_default) & VF_CIDN) {
PROTOACCOUNT *pa = ProtoGetAccount(szProto);
if (!pa->bOldProto)
@@ -698,11 +651,10 @@ INT_PTR onCopyID(WPARAM wparam,LPARAM lparam) else
mir_snprintf(buffer, SIZEOF(buffer), "%s: %s", szProto, szID);
}
- else
- strcpy(buffer, szID);
+ else strcpy(buffer, szID);
CopyToClipboard((HWND)lparam, buffer, 0);
- if(CTRL_IS_PRESSED && bPopUpService)
+ if (CTRL_IS_PRESSED && bPopUpService)
ShowPopup(buffer, 0, hContact);
return 0;
@@ -711,7 +663,6 @@ INT_PTR onCopyID(WPARAM wparam,LPARAM lparam) INT_PTR onCopyStatusMsg(WPARAM wparam,LPARAM lparam)
{
LPSTR module;
- LPTSTR msg;
char par[32];
TCHAR buffer[2048];
int i;
@@ -728,13 +679,10 @@ INT_PTR onCopyStatusMsg(WPARAM wparam,LPARAM lparam) else
strcpy(par, statusMsg[i].name);
- msg = DBGetStringT((HANDLE)wparam, (statusMsg[i].module) ? statusMsg[i].module : module, par);
- if(msg)
- {
- if(_tcsclen(msg))
- {
- if (flags&VF_SMNAME)
- {
+ LPTSTR msg = DBGetStringT((HANDLE)wparam, (statusMsg[i].module) ? statusMsg[i].module : module, par);
+ if (msg) {
+ if (_tcsclen(msg)) {
+ if (flags & VF_SMNAME) {
_tcsncat (buffer, TranslateTS(statusMsg[i].fullName), (SIZEOF(buffer) - _tcsclen(buffer) - 1));
_tcsncat (buffer, _T(": "), (SIZEOF(buffer) - _tcsclen(buffer) - 1));
}
@@ -746,7 +694,7 @@ INT_PTR onCopyStatusMsg(WPARAM wparam,LPARAM lparam) }
CopyToClipboard((HWND)lparam, 0, buffer);
- if(CTRL_IS_PRESSED && bPopUpService)
+ if (CTRL_IS_PRESSED && bPopUpService)
ShowPopup(0, buffer, (HANDLE)wparam);
return 0;
@@ -760,7 +708,7 @@ INT_PTR onCopyIP(WPARAM wparam,LPARAM lparam) getIP((HANDLE)wparam,szProto,(LPSTR)&szIP);
CopyToClipboard((HWND)lparam, szIP, 0);
- if(CTRL_IS_PRESSED && bPopUpService)
+ if (CTRL_IS_PRESSED && bPopUpService)
ShowPopup(szIP, 0, (HANDLE)wparam);
return 0;
@@ -769,9 +717,9 @@ INT_PTR onCopyIP(WPARAM wparam,LPARAM lparam) INT_PTR onCopyMirVer(WPARAM wparam,LPARAM lparam)
{
LPSTR msg = getMirVer((HANDLE)wparam);
- if(msg) {
+ if (msg) {
CopyToClipboard((HWND)lparam, msg, 0);
- if(CTRL_IS_PRESSED && bPopUpService)
+ if (CTRL_IS_PRESSED && bPopUpService)
ShowPopup(msg, 0, (HANDLE)wparam);
mir_free(msg);
@@ -800,11 +748,9 @@ INT_PTR onChangeProto(WPARAM wparam,LPARAM lparam) CallService(MS_PROTO_REMOVEFROMCONTACT, (WPARAM)hContact, (LPARAM)GetContactProto(hContact));
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContactNew, lparam);
}
- else
- {
+ else {
hContactNew = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
- if (hContactNew)
- {
+ if (hContactNew) {
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContactNew, lparam);
RenameDbProto(hContact, hContactNew, GetContactProto(hContact), (char*)lparam, 0);
RenameDbProto(hContact, hContactNew, "CList", "CList", 0);
@@ -812,7 +758,7 @@ INT_PTR onChangeProto(WPARAM wparam,LPARAM lparam) else
return 0;
}
- if(MessageBox(NULL,(LPCTSTR)TranslateT("Do you want to send authorization request\nto new contact?"),
+ if (MessageBox(NULL,(LPCTSTR)TranslateT("Do you want to send authorization request\nto new contact?"),
TranslateT("Miranda NG"), MB_OKCANCEL | MB_SETFOREGROUND | MB_TOPMOST) == IDOK)
onSendAuthRequest((WPARAM)hContactNew, 0);
@@ -822,18 +768,15 @@ INT_PTR onChangeProto(WPARAM wparam,LPARAM lparam) int isIgnored(HANDLE hContact, int type)
{
- int i = 0, all = 0;
- if (type == IGNOREEVENT_ALL)
- {
- for (i = 1; i < SIZEOF(ii); i++)
- {
- if (isIgnored(hContact, ii[i].type))
- all++;
- }
- return (all == SIZEOF(ii) - 1) ? 1 : 0; // ignoring all or not
- }
- else
+ if (type != IGNOREEVENT_ALL)
return CallService(MS_IGNORE_ISIGNORED, (WPARAM)hContact, (LPARAM)type);
+
+ int i = 0, all = 0;
+ for (i = 1; i < SIZEOF(ii); i++)
+ if (isIgnored(hContact, ii[i].type))
+ all++;
+
+ return (all == SIZEOF(ii) - 1) ? 1 : 0; // ignoring all or not
}
INT_PTR onIgnore(WPARAM wparam,LPARAM lparam)
@@ -847,7 +790,7 @@ INT_PTR onIgnore(WPARAM wparam,LPARAM lparam) return 0;
}
-static HANDLE AddSubmenuItem(HGENMENU hRoot, TCHAR* name, HICON icon, DWORD flag, char* service, int pos, int param)
+static HGENMENU AddSubmenuItem(HGENMENU hRoot, TCHAR* name, HICON icon, DWORD flag, char* service, int pos, int param)
{
CLISTMENUITEM mi = { sizeof(mi) };
mi.hParentMenu = hRoot;
@@ -860,59 +803,53 @@ static HANDLE AddSubmenuItem(HGENMENU hRoot, TCHAR* name, HICON icon, DWORD flag return Menu_AddContactMenuItem(&mi);
}
-static void ModifySubmenuItem(HANDLE hItem, TCHAR* name, int checked, int hidden)
+static void ModifySubmenuItem(HGENMENU hItem, TCHAR *name, int checked, int hidden)
{
CLISTMENUITEM mi = { sizeof(mi) };
- mi.ptszName = name;
- mi.flags = CMIM_FLAGS | CMIF_TCHAR;
- if ( checked )
+ mi.ptszName = name;
+ mi.flags = CMIM_FLAGS | CMIF_TCHAR;
+ if (checked)
mi.flags |= CMIF_CHECKED;
- if ( hidden )
+ if (hidden)
mi.flags |= CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hItem, (LPARAM)&mi);
+ Menu_ModifyItem(hItem, &mi);
}
// called when the contact-menu is built
int BuildMenu(WPARAM wparam,LPARAM lparam)
{
- CLISTMENUITEM miAV = {0}, miNV, miHFL, miIGN, miPROTO, miADD, miREQ, miCID, miRECV, miSTAT, miCIP, miCMV;
DWORD flags = db_get_dw(NULL, MODULENAME, "flags", vf_default);
- int i = 0, j = 0, check = 0, all = 0, hide = 0;
+ int j = 0, all = 0, hide = 0;
BOOL bIsOnline = FALSE, bShowAll = CTRL_IS_PRESSED;
- char* pszProto = GetContactProto((HANDLE)wparam);
+ HANDLE hContact = (HANDLE)wparam;
+ char* pszProto = GetContactProto(hContact);
PROTOACCOUNT *pa = ProtoGetAccount(pszProto);
bIsOnline = isProtoOnline(pszProto);
- miAV.cbSize = sizeof(CLISTMENUITEM);
- miAV.flags = CMIM_FLAGS | CMIF_TCHAR;
- miAV.hIcon = NULL;
- miAV.pszContactOwner = NULL;
- miNV = miHFL = miIGN = miPROTO = miADD = miREQ = miCID = miRECV = miSTAT = miCIP = miCMV = miAV;
-
- if(bShowAll || flags&VF_VS) {
- ShowItem(&miAV,hmenuVis);
- ShowItem(&miNV,hmenuOff);
- }
- else {
- HideItem(&miAV,hmenuVis);
- HideItem(&miNV,hmenuOff);
- }
-
- if(bShowAll || flags&VF_HFL){
- ShowItem(&miHFL,hmenuHide);
- ModifyHidden(&miHFL,DBGetContactSettingByte((HANDLE)wparam,"CList","Hidden",0));
+ bool bEnabled = bShowAll || (flags & VF_VS);
+ Menu_ShowItem(hmenuVis, bEnabled);
+ Menu_ShowItem(hmenuOff, bEnabled);
+
+ bEnabled = bShowAll || (flags & VF_HFL);
+ Menu_ShowItem(hmenuHide, bEnabled);
+ if (bEnabled) {
+ BYTE bHidden = db_get_b((HANDLE)wparam,"CList","Hidden",0);
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags |= CMIM_ICON | CMIM_NAME;
+ mi.hIcon = Skin_GetIcon(bHidden ? "miex_showil" : "miex_hidefl");
+ mi.ptszName = bHidden ? LPGENT("Show in list") : LPGENT("Hide from list");
+ Menu_ModifyItem(hmenuHide, &mi);
}
- else HideItem(&miHFL,hmenuHide);
- if(bShowAll || flags&VF_IGN)
- {
- ShowItem(&miIGN,hmenuIgnore);
- for (i = 1; i < SIZEOF(ii); i++)
- {
- check = isIgnored((HANDLE)wparam, ii[i].type);
+ bEnabled = bShowAll || (flags & VF_IGN);
+ Menu_ShowItem(hmenuIgnore, bEnabled);
+ if (bEnabled) {
+ for (int i=1; i < SIZEOF(ii); i++) {
+ int check = isIgnored(hContact, ii[i].type);
if (check)
all++;
+
ModifySubmenuItem(hIgnoreItem[i], ii[i].name, check, 0);
if (all == SIZEOF(ii) - 1) // ignor all
@@ -923,78 +860,58 @@ int BuildMenu(WPARAM wparam,LPARAM lparam) }
}
- else HideItem(&miIGN,hmenuIgnore);
-
- if(pa && (bShowAll || flags&VF_PROTO))
- {
- for (i = 0; i < protoCount; i++)
- {
+ if (pa && (bShowAll || (flags & VF_PROTO))) {
+ for (int i=0; i < protoCount; i++) {
if ((!accs[i]->bIsEnabled) || (strcmp(pa->szProtoName, accs[i]->szProtoName)))
hide = 1;
- else
- {
+ else {
hide = 0;
j++;
}
- if (CallService(MS_PROTO_ISPROTOONCONTACT, wparam, (LPARAM)accs[i]->szModuleName))
- check = 1;
- else
- check = 0;
-
+ int check = 0 != CallService(MS_PROTO_ISPROTOONCONTACT, wparam, (LPARAM)accs[i]->szModuleName);
ModifySubmenuItem(hProtoItem[i], accs[i]->tszAccountName, check, hide);
}
- if (j > 1)
- ShowItem(&miPROTO,hmenuProto);
- else
- HideItem(&miPROTO,hmenuProto);
+ Menu_ShowItem(hmenuProto, j > 1);
}
- else HideItem(&miPROTO,hmenuProto);
-
- if ((bShowAll || flags & VF_ADD) && bIsOnline && IsAccountEnabled(pa))
- ShowItem(&miADD,hmenuAdded);
- else
- HideItem(&miADD,hmenuAdded);
+ else Menu_ShowItem(hmenuProto, false);
- if ((bShowAll || flags & VF_REQ) && bIsOnline && IsAccountEnabled(pa))
- ShowItem(&miREQ,hmenuAuthReq);
- else
- HideItem(&miREQ,hmenuAuthReq);
+ Menu_ShowItem(hmenuAdded, (bShowAll || (flags & VF_ADD)) && bIsOnline && IsAccountEnabled(pa));
+ Menu_ShowItem(hmenuAuthReq, (bShowAll || (flags & VF_REQ)) && bIsOnline && IsAccountEnabled(pa));
- if(bShowAll || flags&VF_CID){
- ShowItem(&miCID,hmenuCopyID);
- ModifyCopyID(&miCID,(HANDLE)wparam, flags&VF_SHOWID, flags&VF_TRIMID);
- }
- else HideItem(&miCID,hmenuCopyID);
+ bEnabled = bShowAll || (flags & VF_CID);
+ Menu_ShowItem(hmenuCopyID, bEnabled);
+ if (bEnabled)
+ ModifyCopyID(hContact, flags & VF_SHOWID, flags & VF_TRIMID);
- if ((bShowAll || flags&VF_RECV) && DirectoryExists((HANDLE)wparam)) ShowItem(&miRECV,hmenuRecvFiles);
- else HideItem(&miRECV,hmenuRecvFiles);
+ Menu_ShowItem(hmenuRecvFiles, (bShowAll || (flags & VF_RECV)) && DirectoryExists(hContact));
- if ((bShowAll || flags&VF_STAT) && StatusMsgExists((HANDLE)wparam)) {
- ShowItem(&miSTAT,hmenuStatusMsg);
- ModifyStatusMsg(&miSTAT,(HANDLE)wparam);
- }
- else HideItem(&miSTAT,hmenuStatusMsg);
+ bEnabled = (bShowAll || (flags & VF_STAT)) && StatusMsgExists(hContact);
+ Menu_ShowItem(hmenuStatusMsg, bEnabled);
+ if (bEnabled)
+ ModifyStatusMsg(hContact);
- if ((bShowAll || flags&VF_CIP) && IPExists((HANDLE)wparam)) {
- ShowItem(&miCIP,hmenuCopyIP);
- ModifyCopyIP(&miCIP,(HANDLE)wparam);
- }
- else HideItem(&miCIP,hmenuCopyIP);
+ bEnabled = (bShowAll || (flags & VF_CIP)) && IPExists(hContact);
+ Menu_ShowItem(hmenuCopyIP, bEnabled);
+ if (bEnabled)
+ ModifyCopyIP(hContact);
- if ((bShowAll || flags&VF_CMV) && MirVerExists((HANDLE)wparam)) {
- ShowItem(&miCMV,hmenuCopyMirVer);
- ModifyCopyMirVer(&miCMV,(HANDLE)wparam);
- }
- else HideItem(&miCMV,hmenuCopyMirVer);
+ bEnabled = (bShowAll || (flags & VF_CMV)) && MirVerExists(hContact);
+ Menu_ShowItem(hmenuCopyMirVer, bEnabled);
+ if (bEnabled)
+ ModifyCopyMirVer(hContact);
- if(bShowAll || (flags&VF_VS))
- {
- int apparent = DBGetContactSettingWord((HANDLE)wparam, GetContactProto((HANDLE)wparam),"ApparentMode",0);
- if(isVisSupport((HANDLE)wparam)) ModifyVisibleSet(&miAV,apparent == ID_STATUS_ONLINE,flags&VF_SAI);
- else HideItem(&miAV,hmenuVis);
- if(isInvSupport((HANDLE)wparam)) ModifyInvisSet(&miNV,apparent == ID_STATUS_OFFLINE,flags&VF_SAI);
- else HideItem(&miAV,hmenuOff);
+ if ((bShowAll || (flags & VF_VS)) && pszProto) {
+ INT_PTR caps = CallProtoService(pszProto, PS_GETCAPS, PFLAGNUM_1, 0);
+ int apparent = db_get_w(hContact, GetContactProto(hContact),"ApparentMode", 0);
+
+ Menu_ShowItem(hmenuVis, caps & PF1_VISLIST);
+ if (caps & PF1_VISLIST)
+ ModifyVisibleSet(apparent == ID_STATUS_ONLINE, flags & VF_SAI);
+
+ Menu_ShowItem(hmenuOff, caps & PF1_INVISLIST);
+ if (caps & PF1_INVISLIST)
+ ModifyInvisSet(apparent == ID_STATUS_OFFLINE, flags & VF_SAI);
}
return 0;
}
@@ -1070,7 +987,7 @@ static int ContactWindowOpen(WPARAM wparam,LPARAM lParam) {
MessageWindowEventData *MWeventdata = (MessageWindowEventData*)lParam;
- if(MWeventdata->uType == MSG_WINDOW_EVT_OPENING && MWeventdata->hContact)
+ if (MWeventdata->uType == MSG_WINDOW_EVT_OPENING && MWeventdata->hContact)
{
TabsrmmButtonsModify(MWeventdata->hContact);
}
@@ -1105,29 +1022,29 @@ static int ContactSettingChanged( WPARAM wParam, LPARAM lParam ) char *lpzProto = GetContactProto(hContact);
// ignore chat rooms
- if (DBGetContactSettingByte(hContact, lpzProto, "ChatRoom", 0))
+ if (db_get_b(hContact, lpzProto, "ChatRoom", 0))
return 0;
if (oldStatus == ID_STATUS_OFFLINE) {
// set logon timestamp for this contact, only when not set already
- if (!DBGetContactSettingDword(hContact, lpzProto, "LogonTS", FALSE))
- DBWriteContactSettingDword(hContact, lpzProto, "LogonTS", ( DWORD )time(NULL));
+ if (!db_get_dw(hContact, lpzProto, "LogonTS", FALSE))
+ db_set_dw(hContact, lpzProto, "LogonTS", ( DWORD )time(NULL));
// reset logoff timestamp
- DBDeleteContactSetting(hContact, lpzProto, "LogoffTS");
+ db_unset(hContact, lpzProto, "LogoffTS");
// TESTING: updating user's details
if (db_get_dw(NULL, MODULENAME, "flags", vf_default) & VF_REFRESH) {
// don't refresh Hidden or NotOnList contact's details
- if (!DBGetContactSettingByte(hContact, "CList", "Hidden", 0) && !DBGetContactSettingByte((HANDLE)wParam, "CList", "NotOnList", 0))
+ if (!db_get_b(hContact, "CList", "Hidden", 0) && !db_get_b((HANDLE)wParam, "CList", "NotOnList", 0))
CallContactService(hContact, PSS_GETINFO, 0, 0 );
}
}
if (newStatus == ID_STATUS_OFFLINE) {
// set logoff timestamp for this contact
- DBWriteContactSettingDword(hContact, lpzProto, "LogoffTS", ( DWORD )time(NULL));
+ db_set_dw(hContact, lpzProto, "LogoffTS", ( DWORD )time(NULL));
// reset logon timestamp
- DBDeleteContactSetting(hContact, lpzProto, "LogonTS");
+ db_unset(hContact, lpzProto, "LogonTS");
}
if (p != NULL)
diff --git a/plugins/MenuItemEx/src/options.cpp b/plugins/MenuItemEx/src/options.cpp index 106c77453a..2622d13692 100644 --- a/plugins/MenuItemEx/src/options.cpp +++ b/plugins/MenuItemEx/src/options.cpp @@ -87,7 +87,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) mod_flags |= IsDlgButtonChecked(hdlg, checkboxes[i].idc) ? checkboxes[i].flag : 0;
}
- //DBDeleteContactSetting(NULL,VISPLG,"flags");
+ //db_unset(NULL,VISPLG,"flags");
db_set_dw(NULL, MODULENAME, "flags", mod_flags);
return 1;
@@ -96,7 +96,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) break;
case WM_COMMAND:
- if(HIWORD(wparam)==BN_CLICKED && GetFocus()==(HWND)lparam) {
+ if (HIWORD(wparam)==BN_CLICKED && GetFocus()==(HWND)lparam) {
SendMessage(GetParent(hdlg),PSM_CHANGED,0,0);
if (LOWORD(wparam) == IDC_VIS ||
LOWORD(wparam) == IDC_IGNORE ||
diff --git a/plugins/MetaContacts/src/meta_menu.cpp b/plugins/MetaContacts/src/meta_menu.cpp index e4eaf8257d..7ba3115d16 100644 --- a/plugins/MetaContacts/src/meta_menu.cpp +++ b/plugins/MetaContacts/src/meta_menu.cpp @@ -325,7 +325,7 @@ INT_PTR Meta_ForceDefault(WPARAM wParam,LPARAM lParam) return 0;
}
-HANDLE hMenuContact[MAX_CONTACTS];
+HGENMENU hMenuContact[MAX_CONTACTS];
/** Called when the context-menu of a contact is about to be displayed
*
@@ -341,79 +341,75 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
char buf[512], idStr[512];
WORD status;
-
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS;
if (db_get_dw((HANDLE)wParam, META_PROTO, META_ID,-1) != (DWORD)-1) {
// save the mouse pos in case they open a subcontact menu
GetCursorPos(&menuMousePoint);
// This is a MetaContact, show the edit, force default, and the delete menu, and hide the others
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuEdit, (LPARAM)&mi);
-
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuAdd, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuConvert, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDefault, (LPARAM)&mi);
+ Menu_ShowItem(hMenuEdit, true);
+ Menu_ShowItem(hMenuAdd, false);
+ Menu_ShowItem(hMenuConvert, false);
+ Menu_ShowItem(hMenuDefault, false);
+ Menu_ShowItem(hMenuDelete, false);
- mi.flags = CMIM_FLAGS | CMIM_NAME | CMIF_HIDDEN; // we don't need delete - already in contact menu
- mi.pszName = Translate("Delete MetaContact");
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDelete, (LPARAM)&mi);
+ mi.flags = CMIM_NAME | CMIF_TCHAR;
+ mi.ptszName = (TCHAR*)TranslateT("Remove from MetaContact");
+ Menu_ModifyItem(hMenuDelete, &mi);
//show subcontact menu items
int num_contacts = db_get_dw((HANDLE)wParam, META_PROTO, "NumContacts", 0);
for (int i = 0; i < MAX_CONTACTS; i++) {
- if (i < num_contacts) {
- HANDLE hContact = Meta_GetContactHandle((HANDLE)wParam, i);
- char *szProto = GetContactProto(hContact);
- if ( !szProto)
- status = ID_STATUS_OFFLINE;
- else
- status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
-
- if (options.menu_contact_label == DNT_UID) {
- strcpy(buf, "Login");
- strcat(buf, _itoa(i, idStr, 10));
-
- db_get((HANDLE)wParam, META_PROTO, buf, &dbv);
- switch(dbv.type) {
- case DBVT_ASCIIZ:
- mir_snprintf(buf,512,"%s",dbv.pszVal);
- break;
- case DBVT_BYTE:
- mir_snprintf(buf,512,"%d",dbv.bVal);
- break;
- case DBVT_WORD:
- mir_snprintf(buf,512,"%d",dbv.wVal);
- break;
- case DBVT_DWORD:
- mir_snprintf(buf,512,"%d",dbv.dVal);
- break;
- default:
- buf[0] = 0;
- }
- db_free(&dbv);
- mi.pszName = buf;
- mi.flags = 0;
- }
- else {
- mi.ptszName = pcli->pfnGetContactDisplayName(hContact, GCDNF_TCHAR);
- mi.flags = CMIF_TCHAR;
+ if (i >= num_contacts) {
+ Menu_ShowItem(hMenuContact[i], false);
+ continue;
+ }
+
+ HANDLE hContact = Meta_GetContactHandle((HANDLE)wParam, i);
+ char *szProto = GetContactProto(hContact);
+ if ( !szProto)
+ status = ID_STATUS_OFFLINE;
+ else
+ status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+
+ if (options.menu_contact_label == DNT_UID) {
+ strcpy(buf, "Login");
+ strcat(buf, _itoa(i, idStr, 10));
+
+ db_get((HANDLE)wParam, META_PROTO, buf, &dbv);
+ switch(dbv.type) {
+ case DBVT_ASCIIZ:
+ mir_snprintf(buf,512,"%s",dbv.pszVal);
+ break;
+ case DBVT_BYTE:
+ mir_snprintf(buf,512,"%d",dbv.bVal);
+ break;
+ case DBVT_WORD:
+ mir_snprintf(buf,512,"%d",dbv.wVal);
+ break;
+ case DBVT_DWORD:
+ mir_snprintf(buf,512,"%d",dbv.dVal);
+ break;
+ default:
+ buf[0] = 0;
}
-
- mi.flags |= CMIM_FLAGS | CMIM_NAME | CMIM_ICON;
-
- int iconIndex = CallService(MS_CLIST_GETCONTACTICON, (WPARAM)hContact, 0);
- mi.hIcon = ImageList_GetIcon((HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0), iconIndex, 0);
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuContact[i], (LPARAM)&mi);
- DestroyIcon(mi.hIcon);
+ db_free(&dbv);
+ mi.pszName = buf;
+ mi.flags = 0;
}
else {
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuContact[i], (LPARAM)&mi);
+ mi.ptszName = pcli->pfnGetContactDisplayName(hContact, GCDNF_TCHAR);
+ mi.flags = CMIF_TCHAR;
}
+
+ mi.flags |= CMIM_FLAGS | CMIM_NAME | CMIM_ICON;
+
+ int iconIndex = CallService(MS_CLIST_GETCONTACTICON, (WPARAM)hContact, 0);
+ mi.hIcon = ImageList_GetIcon((HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0), iconIndex, 0);
+
+ Menu_ModifyItem(hMenuContact[i], &mi);
+ DestroyIcon(mi.hIcon);
}
// show hide nudge menu item
@@ -427,37 +423,36 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam) else { // This is a simple contact
if ( !Meta_IsEnabled()) {
// groups disabled - all meta menu options hidden
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDefault, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDelete, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuAdd, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuConvert, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuEdit, (LPARAM)&mi);
+ Menu_ShowItem(hMenuDefault, false);
+ Menu_ShowItem(hMenuDelete, false);
+ Menu_ShowItem(hMenuAdd, false);
+ Menu_ShowItem(hMenuConvert, false);
+ Menu_ShowItem(hMenuEdit, false);
}
else if (db_get_dw((HANDLE)wParam, META_PROTO, META_LINK,(DWORD)-1)!=(DWORD)-1) {
// The contact is affected to a metacontact.
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDefault, (LPARAM)&mi);
- mi.flags |= CMIM_NAME | CMIF_TCHAR;
+ Menu_ShowItem(hMenuDefault, true);
+
+ mi.flags = CMIM_NAME | CMIF_TCHAR;
mi.ptszName = (TCHAR*)TranslateT("Remove from MetaContact");
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDelete, (LPARAM)&mi);
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuAdd, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuConvert, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuEdit, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuDelete, &mi);
+
+ Menu_ShowItem(hMenuAdd, false);
+ Menu_ShowItem(hMenuConvert, false);
+ Menu_ShowItem(hMenuEdit, false);
}
else {
// The contact is neutral
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuAdd, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuConvert, (LPARAM)&mi);
- mi.flags |= CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuEdit, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDelete, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuDefault, (LPARAM)&mi);
+ Menu_ShowItem(hMenuAdd, true);
+ Menu_ShowItem(hMenuConvert, true);
+ Menu_ShowItem(hMenuEdit, false);
+ Menu_ShowItem(hMenuDelete, false);
+ Menu_ShowItem(hMenuDefault, false);
}
for (int i = 0; i < MAX_CONTACTS; i++) {
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuContact[i], (LPARAM)&mi);
+ Menu_ShowItem(hMenuContact[i], (LPARAM)&mi);
}
}
return 0;
diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp index 610a08af73..4ef0be7e69 100755 --- a/plugins/MetaContacts/src/meta_services.cpp +++ b/plugins/MetaContacts/src/meta_services.cpp @@ -229,31 +229,9 @@ INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam) // if subcontact sending, add db event to keep metacontact history correct
if (options.metahistory && !(ccs->wParam & PREF_METANODB)) {
-
- // reject "file As Message" messages
- if (strlen((char *)ccs->lParam) > 5 && strncmp((char *)ccs->lParam, "<%fAM", 5) == 0)
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam); // continue processing
-
- // reject "data As Message" messages
- if (strlen((char *)ccs->lParam) > 5 && strncmp((char *)ccs->lParam, "<%dAM", 5) == 0)
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam); // continue processing
-
- // reject "OTR" messages
- if (strlen((char *)ccs->lParam) > 5 && strncmp((char *)ccs->lParam, "?OTR", 4) == 0)
- return CallService(MS_PROTO_CHAINSEND, wParam, lParam); // continue processing
-
- DBEVENTINFO dbei = { sizeof(dbei) };
- dbei.szModule = META_PROTO;
- dbei.flags = DBEF_SENT;
- dbei.timestamp = time(NULL);
- dbei.eventType = EVENTTYPE_MESSAGE;
- if (ccs->wParam & PREF_RTL) dbei.flags |= DBEF_RTL;
- if (ccs->wParam & PREF_UTF) dbei.flags |= DBEF_UTF;
- dbei.cbBlob = (DWORD)strlen((char *)ccs->lParam) + 1;
- if ( ccs->wParam & PREF_UNICODE )
- dbei.cbBlob *= ( sizeof( wchar_t )+1 );
- dbei.pBlob = (PBYTE)ccs->lParam;
- db_event_add(hMeta, &dbei);
+ HANDLE hContact = ccs->hContact; ccs->hContact = hMeta;
+ CallService(MS_PROTO_CHAINSEND, 0, lParam);
+ ccs->hContact = hContact;
}
return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
@@ -672,7 +650,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) db_set_utf(hMeta, META_PROTO, "ListeningTo", dcws->value.pszVal);
break;
case DBVT_WCHAR:
- DBWriteContactSettingWString(hMeta, META_PROTO, "ListeningTo", dcws->value.pwszVal);
+ db_set_ws(hMeta, META_PROTO, "ListeningTo", dcws->value.pwszVal);
break;
case DBVT_DELETED:
db_unset(hMeta, META_PROTO, "ListeningTo");
diff --git a/plugins/MetaContacts/src/metacontacts.h b/plugins/MetaContacts/src/metacontacts.h index 8dcca13ceb..e5139a5e0b 100644 --- a/plugins/MetaContacts/src/metacontacts.h +++ b/plugins/MetaContacts/src/metacontacts.h @@ -63,7 +63,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // I can't think of a way around this - mental block
INT_PTR TranslateMenuFunc(HANDLE hContact, int i);
-extern HANDLE hMenuContact[MAX_CONTACTS];
+extern HGENMENU hMenuContact[MAX_CONTACTS];
extern HINSTANCE hInstance;
extern PLUGININFOEX pluginInfo;
diff --git a/plugins/MirOTR/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/MirOTR/src/dbfilter.cpp index 9c0739fad3..790de635c6 100644 --- a/plugins/MirOTR/MirOTR/src/dbfilter.cpp +++ b/plugins/MirOTR/MirOTR/src/dbfilter.cpp @@ -54,7 +54,7 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { const char *proto = contact_get_proto(hContact);
if (!proto ) return 0;
- if (DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) == 1)
+ if (db_get_b(hContact, proto, "ChatRoom", 0) == 1)
return 0;
if(g_metaproto && strcmp(proto, g_metaproto) == 0) {
diff --git a/plugins/MirOTR/MirOTR/src/dllmain.cpp b/plugins/MirOTR/MirOTR/src/dllmain.cpp index ee1198e2bf..9d788fac89 100644 --- a/plugins/MirOTR/MirOTR/src/dllmain.cpp +++ b/plugins/MirOTR/MirOTR/src/dllmain.cpp @@ -101,13 +101,13 @@ extern "C" __declspec(dllexport) int Load(void) CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd);
// remove us as a filter to all contacts - fix filter type problem
- if(DBGetContactSettingByte(0, MODULENAME, "FilterOrderFix", 0) != 2) {
+ if(db_get_b(0, MODULENAME, "FilterOrderFix", 0) != 2) {
HANDLE hContact = db_find_first();
while ( hContact != NULL ) {
CallService(MS_PROTO_REMOVEFROMCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME);
hContact = db_find_next(hContact);
}
- DBWriteContactSettingByte(0, MODULENAME, "FilterOrderFix", 2);
+ db_set_b(0, MODULENAME, "FilterOrderFix", 2);
}
// create our services
@@ -131,7 +131,6 @@ extern "C" __declspec(dllexport) int Unload(void) DEBUGOUT_T("UNLOAD MIROTR")
DeinitSRMM();
DeinitOptions();
- DeinitMenu();
DeinitDBFilter();
lib_cs_lock();
diff --git a/plugins/MirOTR/MirOTR/src/options.cpp b/plugins/MirOTR/MirOTR/src/options.cpp index 5def9d9470..1007d0e848 100644 --- a/plugins/MirOTR/MirOTR/src/options.cpp +++ b/plugins/MirOTR/MirOTR/src/options.cpp @@ -53,7 +53,7 @@ void LoadFilenames() }
void LoadOptions() {
- options.default_policy = DBGetContactSettingWord(0, MODULENAME, "DefaultPolicy", OTRL_POLICY_OPPORTUNISTIC);
+ options.default_policy = db_get_w(0, MODULENAME, "DefaultPolicy", OTRL_POLICY_OPPORTUNISTIC);
// deal with changed flags in proto.h and new interpretation of 'manual' mode (see common.h)
switch(options.default_policy) {
case OTRL_POLICY_MANUAL:
@@ -68,26 +68,26 @@ void LoadOptions() { options.default_policy = OTRL_POLICY_OPPORTUNISTIC;
break;
}
- options.err_method = (ErrorDisplay)DBGetContactSettingWord(0, MODULENAME, "ErrorDisplay", ED_POP);
- options.prefix_messages = (DBGetContactSettingByte(0, MODULENAME, "PrefixMessages", 0) == 1);
- options.msg_inline = (DBGetContactSettingByte(0, MODULENAME, "MsgInline", 0) == 1);
- options.msg_popup = (DBGetContactSettingByte(0, MODULENAME, "MsgPopup", 1) == 1);
- options.delete_history = (DBGetContactSettingByte(0, MODULENAME, "NoHistory", 0) == 1);
- options.delete_systeminfo = (DBGetContactSettingByte(0, MODULENAME, "NoSystemHistory", 0) == 1);
- options.autoshow_verify = (DBGetContactSettingByte(0, MODULENAME, "AutoShowVerify", 1) == 1);
+ options.err_method = (ErrorDisplay)db_get_w(0, MODULENAME, "ErrorDisplay", ED_POP);
+ options.prefix_messages = (db_get_b(0, MODULENAME, "PrefixMessages", 0) == 1);
+ options.msg_inline = (db_get_b(0, MODULENAME, "MsgInline", 0) == 1);
+ options.msg_popup = (db_get_b(0, MODULENAME, "MsgPopup", 1) == 1);
+ options.delete_history = (db_get_b(0, MODULENAME, "NoHistory", 0) == 1);
+ options.delete_systeminfo = (db_get_b(0, MODULENAME, "NoSystemHistory", 0) == 1);
+ options.autoshow_verify = (db_get_b(0, MODULENAME, "AutoShowVerify", 1) == 1);
DBVARIANT dbv;
if (!DBGetContactSettingUTF8String(0, MODULENAME, "Prefix", &dbv)) {
strncpy(options.prefix, dbv.pszVal, OPTIONS_PREFIXLEN);
options.prefix[OPTIONS_PREFIXLEN-1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else
strcpy(options.prefix, ("OTR: "));
- options.timeout_finished = (DBGetContactSettingByte(0, MODULENAME, "TimeoutFinished", 0) == 1);
+ options.timeout_finished = (db_get_b(0, MODULENAME, "TimeoutFinished", 0) == 1);
- options.end_offline = (DBGetContactSettingByte(0, MODULENAME, "EndOffline", 1) == 1);
- options.end_window_close = (DBGetContactSettingByte(0, MODULENAME, "EndWindowClose", 0) == 1);
+ options.end_offline = (db_get_b(0, MODULENAME, "EndOffline", 1) == 1);
+ options.end_window_close = (db_get_b(0, MODULENAME, "EndWindowClose", 0) == 1);
options.bHaveMetaContacts = 0!=ServiceExists(MS_MC_GETMETACONTACT);
options.bHavePopups = 0!=ServiceExists(MS_POPUP_ADDPOPUPT) && ServiceExists(MS_POPUP_SHOWMESSAGE);
@@ -142,30 +142,22 @@ void DeinitOptions() { }
void SaveOptions() {
- DBWriteContactSettingWord(0, MODULENAME, "DefaultPolicy", options.default_policy);
- DBWriteContactSettingWord(0, MODULENAME, "ErrorDisplay", (int)options.err_method);
- DBWriteContactSettingByte(0, MODULENAME, "PrefixMessages", options.prefix_messages ? 1 : 0);
- DBWriteContactSettingByte(0, MODULENAME, "MsgInline", options.msg_inline ? 1 : 0);
- DBWriteContactSettingByte(0, MODULENAME, "MsgPopup", options.msg_popup ? 1 : 0);
-
- DBWriteContactSettingByte(0, MODULENAME, "NoHistory", options.delete_history ? 1 : 0);
- DBWriteContactSettingByte(0, MODULENAME, "NoSystemHistory", options.delete_systeminfo ? 1 : 0);
- DBWriteContactSettingByte(0, MODULENAME, "AutoShowVerify", options.autoshow_verify ? 1 : 0);
-
- /*
- if (contact_policies) {
- for(ContactPolicyMap::iterator i = contact_policies->begin(); i != contact_policies->end(); i++) {
- DBWriteContactSettingWord(i->first, MODULENAME, "Policy", i->second);
- }
- }
- */
+ db_set_w(0, MODULENAME, "DefaultPolicy", options.default_policy);
+ db_set_w(0, MODULENAME, "ErrorDisplay", (int)options.err_method);
+ db_set_b(0, MODULENAME, "PrefixMessages", options.prefix_messages ? 1 : 0);
+ db_set_b(0, MODULENAME, "MsgInline", options.msg_inline ? 1 : 0);
+ db_set_b(0, MODULENAME, "MsgPopup", options.msg_popup ? 1 : 0);
+
+ db_set_b(0, MODULENAME, "NoHistory", options.delete_history ? 1 : 0);
+ db_set_b(0, MODULENAME, "NoSystemHistory", options.delete_systeminfo ? 1 : 0);
+ db_set_b(0, MODULENAME, "AutoShowVerify", options.autoshow_verify ? 1 : 0);
- DBWriteContactSettingStringUtf(0, MODULENAME, "Prefix", options.prefix);
+ db_set_utf(0, MODULENAME, "Prefix", options.prefix);
- DBWriteContactSettingByte(0, MODULENAME, "TimeoutFinished", options.timeout_finished ? 1 : 0);
+ db_set_b(0, MODULENAME, "TimeoutFinished", options.timeout_finished ? 1 : 0);
- DBWriteContactSettingByte(0, MODULENAME, "EndOffline", options.end_offline ? 1 : 0);
- DBWriteContactSettingByte(0, MODULENAME, "EndWindowClose", options.end_window_close ? 1 : 0);
+ db_set_b(0, MODULENAME, "EndOffline", options.end_offline ? 1 : 0);
+ db_set_b(0, MODULENAME, "EndWindowClose", options.end_window_close ? 1 : 0);
}
extern "C" void set_context_contact(void *data, ConnContext *context) {
@@ -640,7 +632,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM for(ContactPolicyMap::const_iterator it = cpm->begin(); it != cpm->end(); ++it)
{
if (!it->first) continue;
- if (it->second.policy) DBWriteContactSettingDword(it->first, MODULENAME, "Policy", (DWORD)it->second.policy);
+ if (it->second.policy) db_set_dw(it->first, MODULENAME, "Policy", (DWORD)it->second.policy);
if (it->second.htmlconv) db_set_b(it->first, MODULENAME, "HTMLConv", it->second.htmlconv-1);
}
return TRUE;
diff --git a/plugins/MirOTR/MirOTR/src/otr.cpp b/plugins/MirOTR/MirOTR/src/otr.cpp index 1590d9244b..c7f37b9ac6 100644 --- a/plugins/MirOTR/MirOTR/src/otr.cpp +++ b/plugins/MirOTR/MirOTR/src/otr.cpp @@ -79,7 +79,7 @@ extern "C" { HANDLE hContact = (HANDLE)opdata;
DWORD pol;
if(hContact) {
- pol = DBGetContactSettingDword(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY);
+ pol = db_get_dw(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY);
if (options.bHaveSecureIM && pol != OTRL_POLICY_MANUAL_MOD && pol != OTRL_POLICY_NEVER && db_get_b(hContact, "SecureIM" , "StatusID", 0)) {
// if SecureIM is not disabled for this contact, MirOTR will be set to manual
db_set_dw(hContact, MODULENAME, "Policy", OTRL_POLICY_MANUAL_MOD);
@@ -126,7 +126,7 @@ extern "C" { DEBUGOUT_T("OTR_GUI_IS_LOGGED_IN")
HANDLE hContact = (HANDLE)opdata;
if(hContact) {
- WORD status = DBGetContactSettingWord(hContact, contact_get_proto(hContact), "Status", ID_STATUS_OFFLINE);
+ WORD status = db_get_w(hContact, contact_get_proto(hContact), "Status", ID_STATUS_OFFLINE);
if(status == ID_STATUS_OFFLINE) return 0;
else return 1;
}
@@ -141,7 +141,7 @@ extern "C" { //MessageBox(0, message, "OTR Inject", MB_OK);
HANDLE hContact = (HANDLE)opdata;
- if(protocol && DBGetContactSettingWord(hContact, protocol, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
+ if(protocol && db_get_w(hContact, protocol, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
/* this would be with translation
TCHAR *decode = mir_utf8decodeT(message);
TCHAR *encode = mir_utf8encodeT(TranslateT(decide));
diff --git a/plugins/MirOTR/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/MirOTR/src/svcs_menu.cpp index d09fe916b5..f1885a31a3 100644 --- a/plugins/MirOTR/MirOTR/src/svcs_menu.cpp +++ b/plugins/MirOTR/MirOTR/src/svcs_menu.cpp @@ -1,6 +1,6 @@ #include "stdafx.h"
-HANDLE hMenuBuildEvent, hStopItem, hStartItem;
+static HGENMENU hStopItem, hStartItem;
////////////////////////////////
///////// Menu Services ////////
@@ -11,7 +11,7 @@ int StartOTR(HANDLE hContact) { if (!proto) return 1; // error
char *uname = contact_get_id(hContact);
if (!uname) return 1; // error
- DWORD pol = DBGetContactSettingDword(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY);
+ DWORD pol = db_get_dw(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY);
if(pol == CONTACT_DEFAULT_POLICY) pol = options.default_policy;
lib_cs_lock();
@@ -22,6 +22,7 @@ int StartOTR(HANDLE hContact) { mir_free(uname);
return 0;
}
+
INT_PTR SVC_StartOTR(WPARAM wParam, LPARAM lParam) {
HANDLE hContact = (HANDLE)wParam, hSub;
if(options.bHaveMetaContacts && (hSub = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0) {
@@ -44,6 +45,7 @@ INT_PTR SVC_StartOTR(WPARAM wParam, LPARAM lParam) { return 0;
}
+
INT_PTR SVC_RefreshOTR(WPARAM wParam, LPARAM lParam) {
HANDLE hContact = (HANDLE)wParam, hSub;
if(options.bHaveMetaContacts && (hSub = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0) {
@@ -145,12 +147,7 @@ void InitMenu() hStartItem = Menu_AddContactMenuItem(&mi);
- hMenuBuildEvent = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, SVC_PrebuildContactMenu);
-
-}
-
-void DeinitMenu() {
- UnhookEvent(hMenuBuildEvent);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, SVC_PrebuildContactMenu);
}
int SVC_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
@@ -163,8 +160,11 @@ int SVC_PrebuildContactMenu(WPARAM wParam, LPARAM lParam) const char *proto = contact_get_proto(hContact);
DWORD pol = CONTACT_DEFAULT_POLICY;
- if (!proto || DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) == 1) {
- goto hide_all;
+ if (!proto || db_get_b(hContact, proto, "ChatRoom", 0) == 1) {
+hide_all:
+ Menu_ShowItem(hStartItem, false);
+ Menu_ShowItem(hStopItem, false);
+ return 0;
}
if(proto && g_metaproto && strcmp(proto, g_metaproto) == 0) {
@@ -175,36 +175,15 @@ int SVC_PrebuildContactMenu(WPARAM wParam, LPARAM lParam) proto = contact_get_proto(hContact);
}
- pol = DBGetContactSettingDword(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY);
+ pol = db_get_dw(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY);
if(pol == CONTACT_DEFAULT_POLICY) pol = options.default_policy;
- if(pol == OTRL_POLICY_NEVER || pol == OTRL_POLICY_ALWAYS) {
+ if(pol == OTRL_POLICY_NEVER || pol == OTRL_POLICY_ALWAYS)
goto hide_all;
- }
- {
- ConnContext *context = otrl_context_find_miranda(otr_user_state, hContact);
- TrustLevel encrypted = otr_context_get_trust(context);
- if(encrypted != TRUST_NOT_PRIVATE) {
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hStopItem, (LPARAM)&mi);
- mi.flags |= CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hStartItem, (LPARAM)&mi);
- } else {
- //if(pol == OTRL_POLICY_MANUAL_MOD) {
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hStartItem, (LPARAM)&mi);
- mi.flags |= CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hStopItem, (LPARAM)&mi);
- //} else { // should only be 'opportunistic'
- // goto hide_all;
- //}
- }
- }
-
- return 0;
-
-hide_all:
- mi.flags |= CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hStopItem, (LPARAM)&mi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hStartItem, (LPARAM)&mi);
+ ConnContext *context = otrl_context_find_miranda(otr_user_state, hContact);
+ TrustLevel encrypted = otr_context_get_trust(context);
+ Menu_ShowItem(hStartItem, encrypted == TRUST_NOT_PRIVATE);
+ Menu_ShowItem(hStopItem, encrypted != TRUST_NOT_PRIVATE);
return 0;
}
\ No newline at end of file diff --git a/plugins/MirOTR/MirOTR/src/svcs_menu.h b/plugins/MirOTR/MirOTR/src/svcs_menu.h index 7dfc11a9ea..145a080be9 100644 --- a/plugins/MirOTR/MirOTR/src/svcs_menu.h +++ b/plugins/MirOTR/MirOTR/src/svcs_menu.h @@ -5,7 +5,6 @@ INT_PTR SVC_StopOTR(WPARAM wParam, LPARAM lParam); INT_PTR SVC_VerifyOTR(WPARAM wParam, LPARAM lParam);
int SVC_PrebuildContactMenu(WPARAM wParam, LPARAM lParam);
void InitMenu();
-void DeinitMenu();
#define MS_OTR_MENUSTART MODULENAME"/Start"
#define MS_OTR_MENUSTOP MODULENAME"/Stop"
diff --git a/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp index ed17aa29ab..030a534b28 100644 --- a/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp +++ b/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp @@ -40,7 +40,7 @@ int SVC_IconPressed(WPARAM wParam, LPARAM lParam) { if(strcmp(sicd->szModule, MODULENAME) == 0) {
char *proto = GetContactProto(hContact);
- if(proto && DBGetContactSettingByte(hContact, proto, "ChatRoom", 0))
+ if(proto && db_get_b(hContact, proto, "ChatRoom", 0))
return 0;
ShowOTRMenu(hContact, sicd->clickLocation);
/*
@@ -146,9 +146,9 @@ void SetEncryptionStatus(HANDLE hContact, TrustLevel level) { //strcat(dbg_msg, (encrypted ? "true" : "false"));
char *proto = GetContactProto(hContact);
- bool chat_room = (proto && DBGetContactSettingByte(hContact, proto, "ChatRoom", 0));
+ bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0));
- // if (!chat_room) DBWriteContactSettingByte(hContact, MODULENAME, "Encrypted", (encrypted ? 1 : 0));
+ // if (!chat_room) db_set_b(hContact, MODULENAME, "Encrypted", (encrypted ? 1 : 0));
if(options.bHaveSRMMIcons || options.bHaveButtonsBar) {
//strcat(dbg_msg, "\nchanging icon");
@@ -226,7 +226,7 @@ int SVC_ButtonsBarPressed(WPARAM w, LPARAM l) { HANDLE hContact = (HANDLE)w;
char *proto = GetContactProto(hContact);
- if(proto && DBGetContactSettingByte(hContact, proto, "ChatRoom", 0))
+ if(proto && db_get_b(hContact, proto, "ChatRoom", 0))
return 0;
ShowOTRMenu(hContact, cbcd->pt);
diff --git a/plugins/MirOTR/MirOTR/src/utils.cpp b/plugins/MirOTR/MirOTR/src/utils.cpp index 7877065ccc..148934b9cc 100644 --- a/plugins/MirOTR/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/MirOTR/src/utils.cpp @@ -349,7 +349,7 @@ void ShowMessage(const HANDLE hContact, const TCHAR *msg) { /*
bool GetEncryptionStatus(HANDLE hContact) {
char *proto = GetContactProto(hContact);
- bool chat_room = (proto && DBGetContactSettingByte(hContact, proto, "ChatRoom", 0));
+ bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0));
if (!chat_room) {
if (options.bHaveMetaContacts) {
@@ -358,7 +358,7 @@ bool GetEncryptionStatus(HANDLE hContact) { //strcat(dbg_msg, "\nrecursing for meta");
return GetEncryptionStatus(hMeta);
}
- return 0!=DBGetContactSettingByte(hContact, MODULENAME, "Encrypted", 0 );
+ return 0!=db_get_b(hContact, MODULENAME, "Encrypted", 0 );
}
}
return 0;
diff --git a/plugins/ModernOpt/src/modernopt.cpp b/plugins/ModernOpt/src/modernopt.cpp index 3f5a260687..47709d9ca3 100644 --- a/plugins/ModernOpt/src/modernopt.cpp +++ b/plugins/ModernOpt/src/modernopt.cpp @@ -687,7 +687,7 @@ void LoadModernOptsModule() // Unload module
void UnloadModernOptsModule()
{
- if(hwndModernOpt)
+ if (hwndModernOpt)
{
DestroyWindow(hwndModernOpt);
hwndModernOpt = 0;
diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp index bdc1a5ab5e..1319bd5c85 100644 --- a/plugins/MsgPopup/src/main.cpp +++ b/plugins/MsgPopup/src/main.cpp @@ -225,11 +225,11 @@ void LoadConfig() mir_snprintf(szNameFG, SIZEOF(szNameFG), "FG%d", indx);
mir_snprintf(szNameBG, SIZEOF(szNameBG), "BG%d", indx);
mir_snprintf(szNameTO, SIZEOF(szNameTO), "TO%d", indx);
- options.FG[indx] = DBGetContactSettingDword(NULL, SERVICENAME, szNameFG, optionsDefault.FG[indx]);
- options.BG[indx] = DBGetContactSettingDword(NULL, SERVICENAME, szNameBG, optionsDefault.BG[indx]);
- options.Timeout[indx] = DBGetContactSettingDword(NULL, SERVICENAME, szNameTO, (DWORD)optionsDefault.Timeout[indx]);
+ options.FG[indx] = db_get_dw(NULL, SERVICENAME, szNameFG, optionsDefault.FG[indx]);
+ options.BG[indx] = db_get_dw(NULL, SERVICENAME, szNameBG, optionsDefault.BG[indx]);
+ options.Timeout[indx] = db_get_dw(NULL, SERVICENAME, szNameTO, (DWORD)optionsDefault.Timeout[indx]);
}
- options.Sound = DBGetContactSettingByte(NULL, SERVICENAME, "Sound", (DWORD)optionsDefault.Sound);
+ options.Sound = db_get_b(NULL, SERVICENAME, "Sound", (DWORD)optionsDefault.Sound);
}
extern "C" __declspec(dllexport) int Load(void)
diff --git a/plugins/MsgPopup/src/options.cpp b/plugins/MsgPopup/src/options.cpp index 2b251b57ae..e9b5eca13d 100644 --- a/plugins/MsgPopup/src/options.cpp +++ b/plugins/MsgPopup/src/options.cpp @@ -30,10 +30,10 @@ int idOptionControls[4][3] = { static int __inline DBWriteContactSettingDwordDef(HANDLE hContact,const char *szModule,const char *szSetting,DWORD val, DWORD defValue)
{
- if(val == DBGetContactSettingDword(hContact, szModule, szSetting, defValue))
+ if(val == db_get_dw(hContact, szModule, szSetting, defValue))
return 0;
else
- return DBWriteContactSettingDword(hContact, szModule, szSetting, val);
+ return db_set_dw(hContact, szModule, szSetting, val);
}
INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index a691f2da31..ca57895617 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -418,10 +418,10 @@ BOOL bApplyChanges( HWND hwndDlg ) if (_tcslen( szTemp) > 0 )
db_set_ts( hUser, MODULE, "FileName", szTemp );
else
- DBDeleteContactSetting( hUser, MODULE, "FileName" );
+ db_unset( hUser, MODULE, "FileName" );
if (sItem.iImage )
- DBDeleteContactSetting( hUser, MODULE, "EnableLog" ); // default is Enabled !!
+ db_unset( hUser, MODULE, "EnableLog" ); // default is Enabled !!
else
db_set_b( hUser, MODULE, "EnableLog",0);
}
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index f614520b28..b525503d2a 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -283,7 +283,7 @@ tstring _DBGetStringW(HANDLE hContact,const char *szModule,const char *szSetting {
tstring ret;
DBVARIANT dbv = {0};
- //DBGetContactSetting
+ //db_get
if ( !db_get_ws( hContact, szModule, szSetting, &dbv))
{
if (dbv.type != DBVT_WCHAR)
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index e38c23ce7e..f88fb35acf 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -411,7 +411,7 @@ TCHAR * Protocol::GetListeningTo() }
DBVARIANT dbv = {0};
- if ( DBGetContactSettingTString(NULL, name, "ListeningTo", &dbv))
+ if ( db_get_ts(NULL, name, "ListeningTo", &dbv))
{
lcopystr(listening_to, _T(""), SIZEOF(listening_to));
return listening_to;
@@ -536,7 +536,7 @@ void ProtocolArray::SetNicks(const TCHAR *nick) lstrcpyn(default_nick, nick, SIZEOF(default_nick));
- DBWriteContactSettingTString(0, MODULE_NAME, SETTING_DEFAULT_NICK, nick);
+ db_set_ts(0, MODULE_NAME, SETTING_DEFAULT_NICK, nick);
for ( int i = 0 ; i < buffer_len ; i++ )
buffer[i]->SetNick(default_nick);
@@ -556,11 +556,11 @@ void ProtocolArray::SetStatusMsgs(const TCHAR *message) void ProtocolArray::SetStatusMsgs(int status, const TCHAR *message)
{
- DBWriteContactSettingTString(NULL,"SRAway",StatusModeToDbSetting(status,"Msg"),message);
+ db_set_ts(NULL,"SRAway",StatusModeToDbSetting(status,"Msg"),message);
// Save default also
if ( !db_get_b(NULL,"SRAway",StatusModeToDbSetting(status,"UsePrev"),0))
- DBWriteContactSettingTString(NULL,"SRAway",StatusModeToDbSetting(status,"Default"),message);
+ db_set_ts(NULL,"SRAway",StatusModeToDbSetting(status,"Default"),message);
for ( int i = 0 ; i < buffer_len ; i++ )
if (buffer[i]->status == status)
@@ -570,7 +570,7 @@ void ProtocolArray::SetStatusMsgs(int status, const TCHAR *message) void ProtocolArray::GetDefaultNick()
{
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(0, MODULE_NAME, SETTING_DEFAULT_NICK, &dbv)) {
+ if ( !db_get_ts(0, MODULE_NAME, SETTING_DEFAULT_NICK, &dbv)) {
lstrcpyn(default_nick, dbv.ptszVal, SIZEOF(default_nick));
db_free(&dbv);
}
@@ -580,7 +580,7 @@ void ProtocolArray::GetDefaultNick() void ProtocolArray::GetDefaultAvatar()
{
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(0, "ContactPhoto", "File", &dbv)) {
+ if ( !db_get_ts(0, "ContactPhoto", "File", &dbv)) {
lstrcpyn(default_avatar_file, dbv.ptszVal, SIZEOF(default_avatar_file));
db_free(&dbv);
}
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index d71b93e4df..61b65eeb68 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -1559,7 +1559,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar data->get_status_messages = false;
data->showing_menu = false;
- data->protocol_number = DBGetContactSettingWord(NULL,"MyDetails","ProtocolNumber",0);
+ data->protocol_number = db_get_w(NULL,"MyDetails","ProtocolNumber",0);
if (data->protocol_number >= protocols->GetSize())
data->protocol_number = 0;
@@ -2341,7 +2341,7 @@ void SetStatusMessageRefreshTime(HWND hwnd) {
KillTimer(hwnd, ID_STATUSMESSAGE_TIMER);
- opts.refresh_status_message_timer = DBGetContactSettingWord(NULL,"MyDetails","RefreshStatusMessageTimer",12);
+ opts.refresh_status_message_timer = db_get_w(NULL,"MyDetails","RefreshStatusMessageTimer",12);
if (opts.refresh_status_message_timer > 0)
SetTimer(hwnd, ID_STATUSMESSAGE_TIMER, opts.refresh_status_message_timer * 1000, NULL);
}
@@ -2357,7 +2357,7 @@ INT_PTR PluginCommand_ShowNextProtocol(WPARAM wParam,LPARAM lParam) if (data->protocol_number >= protocols->GetSize())
data->protocol_number = 0;
- DBWriteContactSettingWord(NULL,"MyDetails","ProtocolNumber",data->protocol_number);
+ db_set_w(NULL,"MyDetails","ProtocolNumber",data->protocol_number);
data->recalc_rectangles = true;
@@ -2379,7 +2379,7 @@ INT_PTR PluginCommand_ShowPreviousProtocol(WPARAM wParam,LPARAM lParam) if (data->protocol_number < 0)
data->protocol_number = protocols->GetSize() - 1;
- DBWriteContactSettingWord(NULL,"MyDetails","ProtocolNumber",data->protocol_number);
+ db_set_w(NULL,"MyDetails","ProtocolNumber",data->protocol_number);
data->recalc_rectangles = true;
@@ -2413,7 +2413,7 @@ INT_PTR PluginCommand_ShowProtocol(WPARAM wParam,LPARAM lParam) MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLong(hwnd_frame, GWLP_USERDATA);
data->protocol_number = proto_num;
- DBWriteContactSettingWord(NULL,"MyDetails","ProtocolNumber",data->protocol_number);
+ db_set_w(NULL,"MyDetails","ProtocolNumber",data->protocol_number);
data->recalc_rectangles = true;
diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp index 8d7c95c0e3..b690c55478 100644 --- a/plugins/NewEventNotify/src/main.cpp +++ b/plugins/NewEventNotify/src/main.cpp @@ -229,7 +229,7 @@ int CheckMsgWnd(HANDLE hContact) szProto = GetContactProto(hContact);
contactName = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
- szStatus = (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, szProto?DBGetContactSettingWord(hContact,szProto,"Status",ID_STATUS_OFFLINE):ID_STATUS_OFFLINE, GSMDF_TCHAR);
+ szStatus = (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, szProto?db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE):ID_STATUS_OFFLINE, GSMDF_TCHAR);
// vj: This code was added by preeze and it does not work:
// vlko: it maybe work with other plugins
diff --git a/plugins/NewEventNotify/src/options.cpp b/plugins/NewEventNotify/src/options.cpp index 8df56a94e3..2bbe91f843 100644 --- a/plugins/NewEventNotify/src/options.cpp +++ b/plugins/NewEventNotify/src/options.cpp @@ -29,80 +29,80 @@ BOOL bWmNotify; int OptionsRead(void)
{
- options->bDisable = DBGetContactSettingByte(NULL, MODULE, OPT_DISABLE, FALSE);
- options->bPreview = DBGetContactSettingByte(NULL, MODULE, OPT_PREVIEW, TRUE);
- options->bMenuitem = DBGetContactSettingByte(NULL, MODULE, OPT_MENUITEM, FALSE);
- options->bDefaultColorMsg = DBGetContactSettingByte(NULL, MODULE, OPT_COLDEFAULT_MESSAGE, FALSE);
- options->bDefaultColorUrl = DBGetContactSettingByte(NULL, MODULE, OPT_COLDEFAULT_URL, FALSE);
- options->bDefaultColorFile = DBGetContactSettingByte(NULL, MODULE, OPT_COLDEFAULT_FILE, FALSE);
- options->bDefaultColorOthers = DBGetContactSettingByte(NULL, MODULE, OPT_COLDEFAULT_OTHERS, FALSE);
- options->colBackMsg = (COLORREF)DBGetContactSettingDword(NULL, MODULE, OPT_COLBACK_MESSAGE, DEFAULT_COLBACK);
- options->colTextMsg = (COLORREF)DBGetContactSettingDword(NULL, MODULE, OPT_COLTEXT_MESSAGE, DEFAULT_COLTEXT);
- options->colBackUrl = (COLORREF)DBGetContactSettingDword(NULL, MODULE, OPT_COLBACK_URL, DEFAULT_COLBACK);
- options->colTextUrl = (COLORREF)DBGetContactSettingDword(NULL, MODULE, OPT_COLTEXT_URL, DEFAULT_COLTEXT);
- options->colBackFile = (COLORREF)DBGetContactSettingDword(NULL, MODULE, OPT_COLBACK_FILE, DEFAULT_COLBACK);
- options->colTextFile = (COLORREF)DBGetContactSettingDword(NULL, MODULE, OPT_COLTEXT_FILE, DEFAULT_COLTEXT);
- options->colBackOthers = (COLORREF)DBGetContactSettingDword(NULL, MODULE, OPT_COLBACK_OTHERS, DEFAULT_COLBACK);
- options->colTextOthers = (COLORREF)DBGetContactSettingDword(NULL, MODULE, OPT_COLTEXT_OTHERS, DEFAULT_COLTEXT);
- options->maskNotify = (UINT)DBGetContactSettingByte(NULL, MODULE, OPT_MASKNOTIFY, DEFAULT_MASKNOTIFY);
- options->maskActL = (UINT)DBGetContactSettingByte(NULL, MODULE, OPT_MASKACTL, DEFAULT_MASKACTL);
- options->maskActR = (UINT)DBGetContactSettingByte(NULL, MODULE, OPT_MASKACTR, DEFAULT_MASKACTR);
- options->maskActTE = (UINT)DBGetContactSettingByte(NULL, MODULE, OPT_MASKACTTE, DEFAULT_MASKACTE);
- options->bMsgWindowCheck = DBGetContactSettingByte(NULL, MODULE, OPT_MSGWINDOWCHECK, TRUE);
- options->bMsgReplyWindow = DBGetContactSettingByte(NULL, MODULE, OPT_MSGREPLYWINDOW, FALSE);
- options->bMergePopup = DBGetContactSettingByte(NULL, MODULE, OPT_MERGEPOPUP, TRUE);
- options->iDelayMsg = (int)DBGetContactSettingDword(NULL, MODULE, OPT_DELAY_MESSAGE, DEFAULT_DELAY);
- options->iDelayUrl = (int)DBGetContactSettingDword(NULL, MODULE, OPT_DELAY_URL, DEFAULT_DELAY);
- options->iDelayFile = (int)DBGetContactSettingDword(NULL, MODULE, OPT_DELAY_FILE, DEFAULT_DELAY);
- options->iDelayOthers = (int)DBGetContactSettingDword(NULL, MODULE, OPT_DELAY_OTHERS, DEFAULT_DELAY);
+ options->bDisable = db_get_b(NULL, MODULE, OPT_DISABLE, FALSE);
+ options->bPreview = db_get_b(NULL, MODULE, OPT_PREVIEW, TRUE);
+ options->bMenuitem = db_get_b(NULL, MODULE, OPT_MENUITEM, FALSE);
+ options->bDefaultColorMsg = db_get_b(NULL, MODULE, OPT_COLDEFAULT_MESSAGE, FALSE);
+ options->bDefaultColorUrl = db_get_b(NULL, MODULE, OPT_COLDEFAULT_URL, FALSE);
+ options->bDefaultColorFile = db_get_b(NULL, MODULE, OPT_COLDEFAULT_FILE, FALSE);
+ options->bDefaultColorOthers = db_get_b(NULL, MODULE, OPT_COLDEFAULT_OTHERS, FALSE);
+ options->colBackMsg = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLBACK_MESSAGE, DEFAULT_COLBACK);
+ options->colTextMsg = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLTEXT_MESSAGE, DEFAULT_COLTEXT);
+ options->colBackUrl = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLBACK_URL, DEFAULT_COLBACK);
+ options->colTextUrl = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLTEXT_URL, DEFAULT_COLTEXT);
+ options->colBackFile = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLBACK_FILE, DEFAULT_COLBACK);
+ options->colTextFile = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLTEXT_FILE, DEFAULT_COLTEXT);
+ options->colBackOthers = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLBACK_OTHERS, DEFAULT_COLBACK);
+ options->colTextOthers = (COLORREF)db_get_dw(NULL, MODULE, OPT_COLTEXT_OTHERS, DEFAULT_COLTEXT);
+ options->maskNotify = (UINT)db_get_b(NULL, MODULE, OPT_MASKNOTIFY, DEFAULT_MASKNOTIFY);
+ options->maskActL = (UINT)db_get_b(NULL, MODULE, OPT_MASKACTL, DEFAULT_MASKACTL);
+ options->maskActR = (UINT)db_get_b(NULL, MODULE, OPT_MASKACTR, DEFAULT_MASKACTR);
+ options->maskActTE = (UINT)db_get_b(NULL, MODULE, OPT_MASKACTTE, DEFAULT_MASKACTE);
+ options->bMsgWindowCheck = db_get_b(NULL, MODULE, OPT_MSGWINDOWCHECK, TRUE);
+ options->bMsgReplyWindow = db_get_b(NULL, MODULE, OPT_MSGREPLYWINDOW, FALSE);
+ options->bMergePopup = db_get_b(NULL, MODULE, OPT_MERGEPOPUP, TRUE);
+ options->iDelayMsg = (int)db_get_dw(NULL, MODULE, OPT_DELAY_MESSAGE, DEFAULT_DELAY);
+ options->iDelayUrl = (int)db_get_dw(NULL, MODULE, OPT_DELAY_URL, DEFAULT_DELAY);
+ options->iDelayFile = (int)db_get_dw(NULL, MODULE, OPT_DELAY_FILE, DEFAULT_DELAY);
+ options->iDelayOthers = (int)db_get_dw(NULL, MODULE, OPT_DELAY_OTHERS, DEFAULT_DELAY);
options->iDelayDefault = (int)DBGetContactSettingRangedWord(NULL, "PopUp", "Seconds", SETTING_LIFETIME_DEFAULT, SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX);
- options->bShowDate = DBGetContactSettingByte(NULL, MODULE, OPT_SHOW_DATE, TRUE);
- options->bShowTime = DBGetContactSettingByte(NULL, MODULE, OPT_SHOW_TIME, TRUE);
- options->bShowHeaders = DBGetContactSettingByte(NULL, MODULE, OPT_SHOW_HEADERS, TRUE);
- options->iNumberMsg = (BYTE)DBGetContactSettingByte(NULL, MODULE, OPT_NUMBER_MSG, TRUE);
- options->bShowON = DBGetContactSettingByte(NULL, MODULE, OPT_SHOW_ON, TRUE);
- options->bHideSend = DBGetContactSettingByte(NULL, MODULE, OPT_HIDESEND, TRUE);
- options->bNoRSS = DBGetContactSettingByte(NULL, MODULE, OPT_NORSS, FALSE);
- options->bReadCheck = DBGetContactSettingByte(NULL, MODULE, OPT_READCHECK, FALSE);
+ options->bShowDate = db_get_b(NULL, MODULE, OPT_SHOW_DATE, TRUE);
+ options->bShowTime = db_get_b(NULL, MODULE, OPT_SHOW_TIME, TRUE);
+ options->bShowHeaders = db_get_b(NULL, MODULE, OPT_SHOW_HEADERS, TRUE);
+ options->iNumberMsg = (BYTE)db_get_b(NULL, MODULE, OPT_NUMBER_MSG, TRUE);
+ options->bShowON = db_get_b(NULL, MODULE, OPT_SHOW_ON, TRUE);
+ options->bHideSend = db_get_b(NULL, MODULE, OPT_HIDESEND, TRUE);
+ options->bNoRSS = db_get_b(NULL, MODULE, OPT_NORSS, FALSE);
+ options->bReadCheck = db_get_b(NULL, MODULE, OPT_READCHECK, FALSE);
return 0;
}
int OptionsWrite(void)
{
- DBWriteContactSettingByte(NULL, MODULE, OPT_DISABLE, options->bDisable);
- DBWriteContactSettingByte(NULL, MODULE, OPT_PREVIEW, options->bPreview);
- DBWriteContactSettingByte(NULL, MODULE, OPT_MENUITEM, options->bMenuitem);
- DBWriteContactSettingByte(NULL, MODULE, OPT_COLDEFAULT_MESSAGE, options->bDefaultColorMsg);
- DBWriteContactSettingByte(NULL, MODULE, OPT_COLDEFAULT_URL, options->bDefaultColorUrl);
- DBWriteContactSettingByte(NULL, MODULE, OPT_COLDEFAULT_FILE, options->bDefaultColorFile);
- DBWriteContactSettingByte(NULL, MODULE, OPT_COLDEFAULT_OTHERS, options->bDefaultColorOthers);
- DBWriteContactSettingDword(NULL, MODULE, OPT_COLBACK_MESSAGE, (DWORD)options->colBackMsg);
- DBWriteContactSettingDword(NULL, MODULE, OPT_COLTEXT_MESSAGE, (DWORD)options->colTextMsg);
- DBWriteContactSettingDword(NULL, MODULE, OPT_COLBACK_URL, (DWORD)options->colBackUrl);
- DBWriteContactSettingDword(NULL, MODULE, OPT_COLTEXT_URL, (DWORD)options->colTextUrl);
- DBWriteContactSettingDword(NULL, MODULE, OPT_COLBACK_FILE, (DWORD)options->colBackFile);
- DBWriteContactSettingDword(NULL, MODULE, OPT_COLTEXT_FILE, (DWORD)options->colTextFile);
- DBWriteContactSettingDword(NULL, MODULE, OPT_COLBACK_OTHERS, (DWORD)options->colBackOthers);
- DBWriteContactSettingDword(NULL, MODULE, OPT_COLTEXT_OTHERS, (DWORD)options->colTextOthers);
- DBWriteContactSettingByte(NULL, MODULE, OPT_MASKNOTIFY, (BYTE)options->maskNotify);
- DBWriteContactSettingByte(NULL, MODULE, OPT_MASKACTL, (BYTE)options->maskActL);
- DBWriteContactSettingByte(NULL, MODULE, OPT_MASKACTR, (BYTE)options->maskActR);
- DBWriteContactSettingByte(NULL, MODULE, OPT_MASKACTTE, (BYTE)options->maskActTE);
- DBWriteContactSettingByte(NULL, MODULE, OPT_MSGWINDOWCHECK, options->bMsgWindowCheck);
- DBWriteContactSettingByte(NULL, MODULE, OPT_MSGREPLYWINDOW, options->bMsgReplyWindow);
- DBWriteContactSettingByte(NULL, MODULE, OPT_MERGEPOPUP, options->bMergePopup);
- DBWriteContactSettingDword(NULL, MODULE, OPT_DELAY_MESSAGE, (DWORD)options->iDelayMsg);
- DBWriteContactSettingDword(NULL, MODULE, OPT_DELAY_URL, (DWORD)options->iDelayUrl);
- DBWriteContactSettingDword(NULL, MODULE, OPT_DELAY_FILE, (DWORD)options->iDelayFile);
- DBWriteContactSettingDword(NULL, MODULE, OPT_DELAY_OTHERS, (DWORD)options->iDelayOthers);
- DBWriteContactSettingByte(NULL, MODULE, OPT_SHOW_DATE, options->bShowDate);
- DBWriteContactSettingByte(NULL, MODULE, OPT_SHOW_TIME, options->bShowTime);
- DBWriteContactSettingByte(NULL, MODULE, OPT_SHOW_HEADERS, options->bShowHeaders);
- DBWriteContactSettingByte(NULL, MODULE, OPT_NUMBER_MSG, (BYTE)options->iNumberMsg);
- DBWriteContactSettingByte(NULL, MODULE, OPT_SHOW_ON, options->bShowON);
- DBWriteContactSettingByte(NULL, MODULE, OPT_HIDESEND, options->bHideSend);
- DBWriteContactSettingByte(NULL, MODULE, OPT_NORSS, options->bNoRSS);
- DBWriteContactSettingByte(NULL, MODULE, OPT_READCHECK, options->bReadCheck);
+ db_set_b(NULL, MODULE, OPT_DISABLE, options->bDisable);
+ db_set_b(NULL, MODULE, OPT_PREVIEW, options->bPreview);
+ db_set_b(NULL, MODULE, OPT_MENUITEM, options->bMenuitem);
+ db_set_b(NULL, MODULE, OPT_COLDEFAULT_MESSAGE, options->bDefaultColorMsg);
+ db_set_b(NULL, MODULE, OPT_COLDEFAULT_URL, options->bDefaultColorUrl);
+ db_set_b(NULL, MODULE, OPT_COLDEFAULT_FILE, options->bDefaultColorFile);
+ db_set_b(NULL, MODULE, OPT_COLDEFAULT_OTHERS, options->bDefaultColorOthers);
+ db_set_dw(NULL, MODULE, OPT_COLBACK_MESSAGE, (DWORD)options->colBackMsg);
+ db_set_dw(NULL, MODULE, OPT_COLTEXT_MESSAGE, (DWORD)options->colTextMsg);
+ db_set_dw(NULL, MODULE, OPT_COLBACK_URL, (DWORD)options->colBackUrl);
+ db_set_dw(NULL, MODULE, OPT_COLTEXT_URL, (DWORD)options->colTextUrl);
+ db_set_dw(NULL, MODULE, OPT_COLBACK_FILE, (DWORD)options->colBackFile);
+ db_set_dw(NULL, MODULE, OPT_COLTEXT_FILE, (DWORD)options->colTextFile);
+ db_set_dw(NULL, MODULE, OPT_COLBACK_OTHERS, (DWORD)options->colBackOthers);
+ db_set_dw(NULL, MODULE, OPT_COLTEXT_OTHERS, (DWORD)options->colTextOthers);
+ db_set_b(NULL, MODULE, OPT_MASKNOTIFY, (BYTE)options->maskNotify);
+ db_set_b(NULL, MODULE, OPT_MASKACTL, (BYTE)options->maskActL);
+ db_set_b(NULL, MODULE, OPT_MASKACTR, (BYTE)options->maskActR);
+ db_set_b(NULL, MODULE, OPT_MASKACTTE, (BYTE)options->maskActTE);
+ db_set_b(NULL, MODULE, OPT_MSGWINDOWCHECK, options->bMsgWindowCheck);
+ db_set_b(NULL, MODULE, OPT_MSGREPLYWINDOW, options->bMsgReplyWindow);
+ db_set_b(NULL, MODULE, OPT_MERGEPOPUP, options->bMergePopup);
+ db_set_dw(NULL, MODULE, OPT_DELAY_MESSAGE, (DWORD)options->iDelayMsg);
+ db_set_dw(NULL, MODULE, OPT_DELAY_URL, (DWORD)options->iDelayUrl);
+ db_set_dw(NULL, MODULE, OPT_DELAY_FILE, (DWORD)options->iDelayFile);
+ db_set_dw(NULL, MODULE, OPT_DELAY_OTHERS, (DWORD)options->iDelayOthers);
+ db_set_b(NULL, MODULE, OPT_SHOW_DATE, options->bShowDate);
+ db_set_b(NULL, MODULE, OPT_SHOW_TIME, options->bShowTime);
+ db_set_b(NULL, MODULE, OPT_SHOW_HEADERS, options->bShowHeaders);
+ db_set_b(NULL, MODULE, OPT_NUMBER_MSG, (BYTE)options->iNumberMsg);
+ db_set_b(NULL, MODULE, OPT_SHOW_ON, options->bShowON);
+ db_set_b(NULL, MODULE, OPT_HIDESEND, options->bHideSend);
+ db_set_b(NULL, MODULE, OPT_NORSS, options->bNoRSS);
+ db_set_b(NULL, MODULE, OPT_READCHECK, options->bReadCheck);
return 0;
}
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index 4a7dd0e047..29f6cc5c5a 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -741,7 +741,7 @@ void PlayChangeSound(HANDLE hContact, WORD oldStatus, WORD newStatus) db_free(&dbv);
}
else if (!db_get_b(0, "SkinSoundsOff", StatusList[Index(newStatus)].lpzSkinSoundName, 0) &&
- !DBGetContactSetting(0, "SkinSounds", StatusList[Index(newStatus)].lpzSkinSoundName, &dbv))
+ !db_get(0, "SkinSounds", StatusList[Index(newStatus)].lpzSkinSoundName, &dbv))
{
strcpy(szSoundFile, StatusList[Index(newStatus)].lpzSkinSoundName);
db_free(&dbv);
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index f40fcec786..af83770a2d 100755 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -67,35 +67,35 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l); void init_vars()
{
- bAppendTags = DBGetContactSettingByte(NULL, szGPGModuleName, "bAppendTags", 0);
- bStripTags = DBGetContactSettingByte(NULL, szGPGModuleName, "bStripTags", 0);
+ bAppendTags = db_get_b(NULL, szGPGModuleName, "bAppendTags", 0);
+ bStripTags = db_get_b(NULL, szGPGModuleName, "bStripTags", 0);
inopentag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInOpenTag", _T("<GPGdec>"));
inclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInCloseTag", _T("</GPGdec>"));
outopentag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutOpenTag", _T("<GPGenc>"));
outclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutCloseTag", _T("</GPGenc>"));
- bDebugLog = DBGetContactSettingByte(NULL, szGPGModuleName, "bDebugLog", 0);
- bAutoExchange = DBGetContactSettingByte(NULL, szGPGModuleName, "bAutoExchange", 0);
- bSameAction = DBGetContactSettingByte(NULL, szGPGModuleName, "bSameAction", 0);
+ bDebugLog = db_get_b(NULL, szGPGModuleName, "bDebugLog", 0);
+ bAutoExchange = db_get_b(NULL, szGPGModuleName, "bAutoExchange", 0);
+ bSameAction = db_get_b(NULL, szGPGModuleName, "bSameAction", 0);
password = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", _T(""));
debuglog.init();
bIsMiranda09 = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00090001?true:false;
- bJabberAPI = DBGetContactSettingByte(NULL, szGPGModuleName, "bJabberAPI", bIsMiranda09?1:0);
- bPresenceSigning = DBGetContactSettingByte(NULL, szGPGModuleName, "bPresenceSigning", 0);
- bFileTransfers = DBGetContactSettingByte(NULL, szGPGModuleName, "bFileTransfers", 0);
- firstrun_rect.left = DBGetContactSettingDword(NULL, szGPGModuleName, "FirstrunWindowX", 0);
- firstrun_rect.top = DBGetContactSettingDword(NULL, szGPGModuleName, "FirstrunWindowY", 0);
- key_password_rect.left = DBGetContactSettingDword(NULL, szGPGModuleName, "PasswordWindowX", 0);
- key_password_rect.top = DBGetContactSettingDword(NULL, szGPGModuleName, "PasswordWindowY", 0);
- key_gen_rect.left = DBGetContactSettingDword(NULL, szGPGModuleName, "KeyGenWindowX", 0);
- key_gen_rect.top = DBGetContactSettingDword(NULL, szGPGModuleName, "KeyGenWindowY", 0);
- load_key_rect.left = DBGetContactSettingDword(NULL, szGPGModuleName, "LoadKeyWindowX", 0);
- load_key_rect.top = DBGetContactSettingDword(NULL, szGPGModuleName, "LoadKeyWindowY", 0);
- import_key_rect.left = DBGetContactSettingDword(NULL, szGPGModuleName, "ImportKeyWindowX", 0);
- import_key_rect.top = DBGetContactSettingDword(NULL, szGPGModuleName, "ImportKeyWindowY", 0);
- new_key_rect.left = DBGetContactSettingDword(NULL, szGPGModuleName, "NewKeyWindowX", 0);
- new_key_rect.top = DBGetContactSettingDword(NULL, szGPGModuleName, "NewKeyWindowY", 0);
- load_existing_key_rect.left = DBGetContactSettingDword(NULL, szGPGModuleName, "LoadExistingKeyWindowX", 0);
- load_existing_key_rect.top = DBGetContactSettingDword(NULL, szGPGModuleName, "LoadExistingKeyWindowY", 0);
+ bJabberAPI = db_get_b(NULL, szGPGModuleName, "bJabberAPI", bIsMiranda09?1:0);
+ bPresenceSigning = db_get_b(NULL, szGPGModuleName, "bPresenceSigning", 0);
+ bFileTransfers = db_get_b(NULL, szGPGModuleName, "bFileTransfers", 0);
+ firstrun_rect.left = db_get_dw(NULL, szGPGModuleName, "FirstrunWindowX", 0);
+ firstrun_rect.top = db_get_dw(NULL, szGPGModuleName, "FirstrunWindowY", 0);
+ key_password_rect.left = db_get_dw(NULL, szGPGModuleName, "PasswordWindowX", 0);
+ key_password_rect.top = db_get_dw(NULL, szGPGModuleName, "PasswordWindowY", 0);
+ key_gen_rect.left = db_get_dw(NULL, szGPGModuleName, "KeyGenWindowX", 0);
+ key_gen_rect.top = db_get_dw(NULL, szGPGModuleName, "KeyGenWindowY", 0);
+ load_key_rect.left = db_get_dw(NULL, szGPGModuleName, "LoadKeyWindowX", 0);
+ load_key_rect.top = db_get_dw(NULL, szGPGModuleName, "LoadKeyWindowY", 0);
+ import_key_rect.left = db_get_dw(NULL, szGPGModuleName, "ImportKeyWindowX", 0);
+ import_key_rect.top = db_get_dw(NULL, szGPGModuleName, "ImportKeyWindowY", 0);
+ new_key_rect.left = db_get_dw(NULL, szGPGModuleName, "NewKeyWindowX", 0);
+ new_key_rect.top = db_get_dw(NULL, szGPGModuleName, "NewKeyWindowY", 0);
+ load_existing_key_rect.left = db_get_dw(NULL, szGPGModuleName, "LoadExistingKeyWindowX", 0);
+ load_existing_key_rect.top = db_get_dw(NULL, szGPGModuleName, "LoadExistingKeyWindowY", 0);
tabsrmm_used = isTabsrmmUsed();
bold_font = CreateFont(14, 0, 0, 0, 600, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 0, _T("Arial"));
}
@@ -120,7 +120,7 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) void InitCheck();
void FirstRun();
FirstRun();
- if(!DBGetContactSettingByte(NULL, szGPGModuleName, "FirstRun", 1))
+ if(!db_get_b(NULL, szGPGModuleName, "FirstRun", 1))
InitCheck();
InitIconLib();
if(ServiceExists(MS_MSG_ADDICON))
@@ -244,7 +244,7 @@ extern list<wstring> transfers; extern "C" int __declspec(dllexport) Unload(void)
{
// for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
-// DBDeleteContactSetting(hContact, szGPGModuleName, "KeyID_Prescense");
+// db_unset(hContact, szGPGModuleName, "KeyID_Prescense");
if(!transfers.empty())
{
for(list<wstring>::iterator p = transfers.begin(); p != transfers.end(); p++)
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index 80a2b2837d..072b64a26e 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -323,21 +323,21 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR GetDlgItemTextA(hwndDlg, IDC_ACCOUNT, buf, 63); if(!strcmp(buf, Translate("Default"))) { - DBWriteContactSettingString(NULL, szGPGModuleName, "GPGPubKey", out.c_str()); - DBWriteContactSettingTString(NULL, szGPGModuleName, "KeyMainName", name); - DBWriteContactSettingTString(NULL, szGPGModuleName, "KeyID", fp); + db_set_s(NULL, szGPGModuleName, "GPGPubKey", out.c_str()); + db_set_ts(NULL, szGPGModuleName, "KeyMainName", name); + db_set_ts(NULL, szGPGModuleName, "KeyID", fp); } else { std::string acc_str = buf; acc_str += "_GPGPubKey"; - DBWriteContactSettingString(NULL, szGPGModuleName, acc_str.c_str(), out.c_str()); + db_set_s(NULL, szGPGModuleName, acc_str.c_str(), out.c_str()); acc_str = buf; acc_str += "_KeyMainName"; - DBWriteContactSettingTString(NULL, szGPGModuleName, acc_str.c_str(), name); + db_set_ts(NULL, szGPGModuleName, acc_str.c_str(), name); acc_str = buf; acc_str += "_KeyID"; - DBWriteContactSettingTString(NULL, szGPGModuleName, acc_str.c_str(), fp); + db_set_ts(NULL, szGPGModuleName, acc_str.c_str(), fp); } if(!strcmp(buf, Translate("Default"))) { @@ -357,7 +357,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR dbsetting += keyid; mir_free(keyid); dbsetting += "_Password"; - DBWriteContactSettingTString(NULL, szGPGModuleName, dbsetting.c_str(), passwd); + db_set_ts(NULL, szGPGModuleName, dbsetting.c_str(), passwd); } delete [] name; } @@ -500,33 +500,33 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR GetDlgItemTextA(hwndDlg, IDC_ACCOUNT, buf, 63); if(!strcmp(buf, Translate("Default"))) { - DBDeleteContactSetting(NULL, szGPGModuleName, "GPGPubKey"); - DBDeleteContactSetting(NULL, szGPGModuleName, "KeyID"); - DBDeleteContactSetting(NULL, szGPGModuleName, "KeyComment"); - DBDeleteContactSetting(NULL, szGPGModuleName, "KeyMainName"); - DBDeleteContactSetting(NULL, szGPGModuleName, "KeyMainEmail"); - DBDeleteContactSetting(NULL, szGPGModuleName, "KeyType"); + db_unset(NULL, szGPGModuleName, "GPGPubKey"); + db_unset(NULL, szGPGModuleName, "KeyID"); + db_unset(NULL, szGPGModuleName, "KeyComment"); + db_unset(NULL, szGPGModuleName, "KeyMainName"); + db_unset(NULL, szGPGModuleName, "KeyMainEmail"); + db_unset(NULL, szGPGModuleName, "KeyType"); } else { std::string acc_str = buf; acc_str += "_GPGPubKey"; - DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str()); + db_unset(NULL, szGPGModuleName, acc_str.c_str()); acc_str = buf; acc_str += "_KeyMainName"; - DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str()); + db_unset(NULL, szGPGModuleName, acc_str.c_str()); acc_str = buf; acc_str += "_KeyID"; - DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str()); + db_unset(NULL, szGPGModuleName, acc_str.c_str()); acc_str = buf; acc_str += "_KeyComment"; - DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str()); + db_unset(NULL, szGPGModuleName, acc_str.c_str()); acc_str = buf; acc_str += "_KeyMainEmail"; - DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str()); + db_unset(NULL, szGPGModuleName, acc_str.c_str()); acc_str = buf; acc_str += "_KeyType"; - DBDeleteContactSetting(NULL, szGPGModuleName, acc_str.c_str()); + db_unset(NULL, szGPGModuleName, acc_str.c_str()); } } ListView_DeleteItem(hwndList, itemnum); @@ -628,17 +628,17 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR GetDlgItemTextA(hwndDlg, IDC_ACCOUNT, buf, 63); if(!strcmp(buf, Translate("Default"))) { - DBWriteContactSettingString(NULL, szGPGModuleName, "GPGPubKey", out.c_str()); - DBWriteContactSettingTString(NULL, szGPGModuleName, "KeyID", fp); + db_set_s(NULL, szGPGModuleName, "GPGPubKey", out.c_str()); + db_set_ts(NULL, szGPGModuleName, "KeyID", fp); } else { std::string acc_str = buf; acc_str += "_GPGPubKey"; - DBWriteContactSettingString(NULL, szGPGModuleName, acc_str.c_str(), out.c_str()); + db_set_s(NULL, szGPGModuleName, acc_str.c_str(), out.c_str()); acc_str = buf; acc_str += "_KeyID"; - DBWriteContactSettingTString(NULL, szGPGModuleName, acc_str.c_str(), fp); + db_set_ts(NULL, szGPGModuleName, acc_str.c_str(), fp); } } extern HWND hwndCurKey_p; @@ -835,8 +835,8 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR case WM_DESTROY: { GetWindowRect(hwndDlg, &firstrun_rect); - DBWriteContactSettingDword(NULL, szGPGModuleName, "FirstrunWindowX", firstrun_rect.left); - DBWriteContactSettingDword(NULL, szGPGModuleName, "FirstrunWindowY", firstrun_rect.top); + db_set_dw(NULL, szGPGModuleName, "FirstrunWindowX", firstrun_rect.left); + db_set_dw(NULL, szGPGModuleName, "FirstrunWindowY", firstrun_rect.top); } hwndFirstRun = NULL; break; @@ -898,7 +898,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, bool bad_version = false; if(gpg_exists/* && lang_exists*/) { - DBWriteContactSettingTString(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); string out; DWORD code; std::vector<wstring> cmd; @@ -911,7 +911,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, gpg_valid = true; gpg_launcher(params); gpg_valid = false; - DBDeleteContactSetting(NULL, szGPGModuleName, "szGpgBinPath"); + db_unset(NULL, szGPGModuleName, "szGpgBinPath"); string::size_type p1 = out.find("(GnuPG) "); if(p1 != string::npos) { @@ -1023,7 +1023,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, } { bool bad_version = false; - DBWriteContactSettingTString(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); string out; DWORD code; std::vector<wstring> cmd; @@ -1036,7 +1036,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, gpg_valid = true; gpg_launcher(params); gpg_valid = false; - DBDeleteContactSetting(NULL, szGPGModuleName, "szGpgBinPath"); + db_unset(NULL, szGPGModuleName, "szGpgBinPath"); string::size_type p1 = out.find("(GnuPG) "); if(p1 != string::npos) { @@ -1052,7 +1052,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if(bad_version) MessageBox(0, TranslateT("Unsupported gnupg version found, use at you own risk!\nrecommended to use GnuPG v1.x.x with this plugn."), TranslateT("Warning"), MB_OK); } - DBWriteContactSettingTString(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, 512); while(tmp[_tcslen(tmp)-1] == '\\') tmp[_tcslen(tmp)-1] = '\0'; @@ -1061,7 +1061,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, MessageBox(0, TranslateT("please set keyring's home directory"), TranslateT("Warning"), MB_OK); break; } - DBWriteContactSettingTString(NULL, szGPGModuleName, "szHomePath", tmp); + db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp); { TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T("")); DWORD dwFileAttr = GetFileAttributes(path); @@ -1073,7 +1073,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, mir_free(path); } gpg_valid = true; - DBWriteContactSettingByte(NULL, szGPGModuleName, "FirstRun", 0); + db_set_b(NULL, szGPGModuleName, "FirstRun", 0); DestroyWindow(hwndDlg); ShowFirstRunDialog(); } @@ -1101,7 +1101,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, } { bool bad_version = false; - DBWriteContactSettingTString(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); string out; DWORD code; std::vector<wstring> cmd; @@ -1114,7 +1114,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, gpg_valid = true; gpg_launcher(params); gpg_valid = false; - DBDeleteContactSetting(NULL, szGPGModuleName, "szGpgBinPath"); + db_unset(NULL, szGPGModuleName, "szGpgBinPath"); string::size_type p1 = out.find("(GnuPG) "); if(p1 != string::npos) { @@ -1130,7 +1130,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if(bad_version) MessageBox(0, TranslateT("Unsupported gnupg version found, use at you own risk!\nrecommended to use GnuPG v1.x.x with this plugn."), TranslateT("Warning"), MB_OK); } - DBWriteContactSettingTString(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, 512); while(tmp[_tcslen(tmp)-1] == '\\') tmp[_tcslen(tmp)-1] = '\0'; @@ -1139,7 +1139,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, MessageBox(0, TranslateT("please set keyring's home directory"), TranslateT("Warning"), MB_OK); break; } - DBWriteContactSettingTString(NULL, szGPGModuleName, "szHomePath", tmp); + db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp); { TCHAR *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T("")); DWORD dwFileAttr = GetFileAttributes(path); @@ -1239,15 +1239,15 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, { out.erase(s, 1); } - DBWriteContactSettingString(NULL, szGPGModuleName, "GPGPubKey", out.c_str()); - DBWriteContactSettingTString(NULL, szGPGModuleName, "KeyID", path.c_str()); + db_set_s(NULL, szGPGModuleName, "GPGPubKey", out.c_str()); + db_set_ts(NULL, szGPGModuleName, "KeyID", path.c_str()); extern HWND hwndCurKey_p; SetWindowText(hwndCurKey_p, path.c_str()); } } bAutoExchange = CheckStateStoreDB(hwndDlg, IDC_AUTO_EXCHANGE, "bAutoExchange"); gpg_valid = true; - DBWriteContactSettingByte(NULL, szGPGModuleName, "FirstRun", 0); + db_set_b(NULL, szGPGModuleName, "FirstRun", 0); DestroyWindow(hwndDlg); break; default: @@ -1296,7 +1296,7 @@ static INT_PTR CALLBACK DlgProcNewKeyDialog(HWND hwndDlg, UINT msg, WPARAM wPara TranslateDialogDefault(hwndDlg); TCHAR *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); SetDlgItemText(hwndDlg, IDC_MESSAGE, tmp[0]?TranslateT("There is existing key for contact, would you like to replace with new key ?"):TranslateT("New public key was received, do you want to import it?")); - EnableWindow(GetDlgItem(hwndDlg, IDC_IMPORT_AND_USE), DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0)?0:1); + EnableWindow(GetDlgItem(hwndDlg, IDC_IMPORT_AND_USE), db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0)?0:1); SetDlgItemText(hwndDlg, ID_IMPORT, tmp[0]?TranslateT("Replace"):TranslateT("Accept")); mir_free(tmp); tmp = new TCHAR [256]; @@ -1318,7 +1318,7 @@ static INT_PTR CALLBACK DlgProcNewKeyDialog(HWND hwndDlg, UINT msg, WPARAM wPara break; case IDC_IMPORT_AND_USE: ImportKey(); - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 1); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1); void setSrmmIcon(HANDLE hContact); void setClistIcon(HANDLE hContact); setSrmmIcon(hContact); @@ -1350,8 +1350,8 @@ static INT_PTR CALLBACK DlgProcNewKeyDialog(HWND hwndDlg, UINT msg, WPARAM wPara case WM_DESTROY: { GetWindowRect(hwndDlg, &new_key_rect); - DBWriteContactSettingDword(NULL, szGPGModuleName, "NewKeyWindowX", new_key_rect.left); - DBWriteContactSettingDword(NULL, szGPGModuleName, "NewKeyWindowY", new_key_rect.top); + db_set_dw(NULL, szGPGModuleName, "NewKeyWindowX", new_key_rect.left); + db_set_dw(NULL, szGPGModuleName, "NewKeyWindowY", new_key_rect.top); } hwndNewKey = NULL; break; @@ -1653,8 +1653,8 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara case WM_DESTROY: { GetWindowRect(hwndDlg, &key_gen_rect); - DBWriteContactSettingDword(NULL, szGPGModuleName, "KeyGenWindowX", key_gen_rect.left); - DBWriteContactSettingDword(NULL, szGPGModuleName, "KeyGenWindowY", key_gen_rect.top); + db_set_dw(NULL, szGPGModuleName, "KeyGenWindowX", key_gen_rect.left); + db_set_dw(NULL, szGPGModuleName, "KeyGenWindowY", key_gen_rect.top); } hwndKeyGen = NULL; break; @@ -1902,8 +1902,8 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wPar case WM_DESTROY: { GetWindowRect(hwndDlg, &load_existing_key_rect); - DBWriteContactSettingDword(NULL, szGPGModuleName, "LoadExistingKeyWindowX", load_existing_key_rect.left); - DBWriteContactSettingDword(NULL, szGPGModuleName, "LoadExistingKeyWindowY", load_existing_key_rect.top); + db_set_dw(NULL, szGPGModuleName, "LoadExistingKeyWindowX", load_existing_key_rect.left); + db_set_dw(NULL, szGPGModuleName, "LoadExistingKeyWindowY", load_existing_key_rect.top); } hwndSelectExistingKey = NULL; break; @@ -1981,8 +1981,8 @@ static INT_PTR CALLBACK DlgProcImportKeyDialog(HWND hwndDlg, UINT msg, WPARAM wP case WM_DESTROY: { GetWindowRect(hwndDlg, &import_key_rect); - DBWriteContactSettingDword(NULL, szGPGModuleName, "ImportKeyWindowX", import_key_rect.left); - DBWriteContactSettingDword(NULL, szGPGModuleName, "ImportKeyWindowY", import_key_rect.top); + db_set_dw(NULL, szGPGModuleName, "ImportKeyWindowX", import_key_rect.left); + db_set_dw(NULL, szGPGModuleName, "ImportKeyWindowY", import_key_rect.top); } break; @@ -2048,7 +2048,7 @@ void ShowImportKeyDialog() void FirstRun() { DWORD pid = 0; - if(!DBGetContactSettingByte(NULL, szGPGModuleName, "FirstRun", 1)) + if(!db_get_b(NULL, szGPGModuleName, "FirstRun", 1)) return; ShowSetDirsDialog(); } @@ -2204,7 +2204,7 @@ void InitCheck() keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", ""); key = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", ""); void ShowFirstRunDialog(); - if(!DBGetContactSettingByte(NULL, szGPGModuleName, "FirstRun", 1) && (!keyid[0] || !key[0])) + if(!db_get_b(NULL, szGPGModuleName, "FirstRun", 1) && (!keyid[0] || !key[0])) { question = Translate("You didn't set a private key.\nWould you like to set it now?"); if(MessageBoxA(0, question.c_str(), Translate("Own private key warning"), MB_YESNO) == IDYES) @@ -2337,14 +2337,14 @@ void ImportKey() { hcnt = metaGetSubcontact(hContact, i); if(hcnt) - DBWriteContactSettingTString(hcnt, szGPGModuleName, "GPGPubKey", new_key.c_str()); + db_set_ts(hcnt, szGPGModuleName, "GPGPubKey", new_key.c_str()); } } else - DBWriteContactSettingTString(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", new_key.c_str()); + db_set_ts(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", new_key.c_str()); } else - DBWriteContactSettingTString(hContact, szGPGModuleName, "GPGPubKey", new_key.c_str()); + db_set_ts(hContact, szGPGModuleName, "GPGPubKey", new_key.c_str()); new_key.clear(); { //gpg execute block std::vector<wstring> cmd; @@ -2396,7 +2396,7 @@ void ImportKey() char *tmp = NULL; string::size_type s = output.find("gpg: key ") + strlen("gpg: key "); string::size_type s2 = output.find(":", s); - DBWriteContactSettingString(hcnt, szGPGModuleName, "KeyID", output.substr(s,s2-s).c_str()); + db_set_s(hcnt, szGPGModuleName, "KeyID", output.substr(s,s2-s).c_str()); s = output.find("“", s2); if(s == string::npos) { @@ -2421,7 +2421,7 @@ void ImportKey() tmp = (char*)mir_alloc(sizeof(char)*(output.substr(s,s2-s-(uncommon?1:0)).length()+1)); strcpy(tmp, output.substr(s,s2-s-(uncommon?1:0)).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(hcnt, szGPGModuleName, "KeyMainName", tmp); + db_set_s(hcnt, szGPGModuleName, "KeyMainName", tmp); mir_free(tmp); } @@ -2437,7 +2437,7 @@ void ImportKey() tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1)); strcpy(tmp, output.substr(s2,s-s2).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(hcnt, szGPGModuleName, "KeyComment", tmp); + db_set_s(hcnt, szGPGModuleName, "KeyComment", tmp); mir_free(tmp); s+=3; s2 = output.find(">", s); @@ -2446,7 +2446,7 @@ void ImportKey() tmp = (char*) mir_alloc(sizeof(char)*(output.substr(s,s2-s).length()+1)); strcpy(tmp, output.substr(s,s2-s).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(hcnt, szGPGModuleName, "KeyMainEmail", tmp); + db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", tmp); mir_free(tmp); } } @@ -2455,11 +2455,11 @@ void ImportKey() tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1)); strcpy(tmp, output.substr(s2,s-s2).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); + db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); mir_free(tmp); } } - DBDeleteContactSetting(hcnt, szGPGModuleName, "bAlwatsTrust"); + db_unset(hcnt, szGPGModuleName, "bAlwatsTrust"); } } } @@ -2468,7 +2468,7 @@ void ImportKey() char *tmp = NULL; string::size_type s = output.find("gpg: key ") + strlen("gpg: key "); string::size_type s2 = output.find(":", s); - DBWriteContactSettingString(metaGetMostOnline(hContact), szGPGModuleName, "KeyID", output.substr(s,s2-s).c_str()); + db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyID", output.substr(s,s2-s).c_str()); s = output.find("“", s2); if(s == string::npos) { @@ -2493,7 +2493,7 @@ void ImportKey() tmp = (char*)mir_alloc(sizeof(char)*(output.substr(s,s2-s-(uncommon?1:0)).length()+1)); strcpy(tmp, output.substr(s,s2-s-(uncommon?1:0)).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainName", tmp); + db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainName", tmp); mir_free(tmp); } if((s = output.find(")", s2)) == string::npos) @@ -2508,7 +2508,7 @@ void ImportKey() tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1)); strcpy(tmp, output.substr(s2,s-s2).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(metaGetMostOnline(hContact), szGPGModuleName, "KeyComment", tmp); + db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyComment", tmp); mir_free(tmp); s+=3; s2 = output.find(">", s); @@ -2517,7 +2517,7 @@ void ImportKey() tmp = (char*) mir_alloc(sizeof(char)*(output.substr(s,s2-s).length()+1)); strcpy(tmp, output.substr(s,s2-s).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", tmp); + db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", tmp); mir_free(tmp); } } @@ -2526,11 +2526,11 @@ void ImportKey() tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1)); strcpy(tmp, output.substr(s2,s-s2).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); + db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); mir_free(tmp); } } - DBDeleteContactSetting(metaGetMostOnline(hContact), szGPGModuleName, "bAlwatsTrust"); + db_unset(metaGetMostOnline(hContact), szGPGModuleName, "bAlwatsTrust"); } } else @@ -2538,7 +2538,7 @@ void ImportKey() char *tmp = NULL; string::size_type s = output.find("gpg: key ") + strlen("gpg: key "); string::size_type s2 = output.find(":", s); - DBWriteContactSettingString(hContact, szGPGModuleName, "KeyID", output.substr(s,s2-s).c_str()); + db_set_s(hContact, szGPGModuleName, "KeyID", output.substr(s,s2-s).c_str()); s = output.find("“", s2); if(s == string::npos) { @@ -2563,7 +2563,7 @@ void ImportKey() tmp = (char*)mir_alloc(sizeof(char)*(output.substr(s,s2-s-(uncommon?1:0)).length()+1)); strcpy(tmp, output.substr(s,s2-s-(uncommon?1:0)).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainName", tmp); + db_set_s(hContact, szGPGModuleName, "KeyMainName", tmp); mir_free(tmp); } if((s = output.find(")", s2)) == string::npos) @@ -2578,7 +2578,7 @@ void ImportKey() tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1)); strcpy(tmp, output.substr(s2,s-s2).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(hContact, szGPGModuleName, "KeyComment", tmp); + db_set_s(hContact, szGPGModuleName, "KeyComment", tmp); mir_free(tmp); s+=3; s2 = output.find(">", s); @@ -2587,7 +2587,7 @@ void ImportKey() tmp = (char*) mir_alloc(sizeof(char)*(output.substr(s,s2-s).length()+1)); strcpy(tmp, output.substr(s,s2-s).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainEmail", tmp); + db_set_s(hContact, szGPGModuleName, "KeyMainEmail", tmp); mir_free(tmp); } } @@ -2596,11 +2596,11 @@ void ImportKey() tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1)); strcpy(tmp, output.substr(s2,s-s2).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); + db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); mir_free(tmp); } } - DBDeleteContactSetting(hContact, szGPGModuleName, "bAlwatsTrust"); + db_unset(hContact, szGPGModuleName, "bAlwatsTrust"); } } ptmp = mir_wstrdup(toUTF16(output).c_str()); diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index b9c87a5595..7ad33d4cc6 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -55,13 +55,13 @@ void RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, } else { - DBWriteContactSettingByte(metaIsProtoMetaContacts(hContact)?metaGetMostOnline(hContact):hContact, szGPGModuleName, "GPGEncryption", 1); + db_set_b(metaIsProtoMetaContacts(hContact)?metaGetMostOnline(hContact):hContact, szGPGModuleName, "GPGEncryption", 1); setSrmmIcon(hContact); setClistIcon(hContact); } if(isContactHaveKey(hContact)) { - DBWriteContactSettingByte(metaIsProtoMetaContacts(hContact)?metaGetMostOnline(hContact):hContact, szGPGModuleName, "GPGEncryption", 1); + db_set_b(metaIsProtoMetaContacts(hContact)?metaGetMostOnline(hContact):hContact, szGPGModuleName, "GPGEncryption", 1); setSrmmIcon(hContact); setClistIcon(hContact); } @@ -154,11 +154,11 @@ void RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, { boost::filesystem::remove(path); HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags)); - BYTE enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); CallContactService(hContact, PSS_MESSAGE, (WPARAM)PREF_UTF, (LPARAM)"Unable to decrypt PGP encrypted message"); HistoryLog(hContact, db_event("Error message sent", 0, 0, DBEF_SENT)); - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", enc); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc); return; } if(result == pxNotFound) @@ -183,11 +183,11 @@ void RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, debuglog<<std::string(time_str()+": info: failed to decrypt messaage from "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR))+" password needed, trying to get one"); if(_terminate) { - BYTE enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); CallContactService(hContact, PSS_MESSAGE, (WPARAM)PREF_UTF, (LPARAM)"Unable to decrypt PGP encrypted message"); HistoryLog(hContact, db_event("Error message sent", 0, 0, DBEF_SENT)); - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", enc); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc); break; } { //save inkey id @@ -195,7 +195,7 @@ void RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, s = out.find(" ID ", s); s += strlen(" ID "); string::size_type s2 = out.find(",",s); - DBWriteContactSettingString(metaIsProtoMetaContacts(hContact)?metaGetMostOnline(hContact):hContact, szGPGModuleName, "InKeyID", out.substr(s, s2-s).c_str()); + db_set_s(metaIsProtoMetaContacts(hContact)?metaGetMostOnline(hContact):hContact, szGPGModuleName, "InKeyID", out.substr(s, s2-s).c_str()); } void ShowLoadKeyPasswordWindow(); new_key_hcnt_mutex.lock(); @@ -221,11 +221,11 @@ void RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, { boost::filesystem::remove(path); HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags)); - BYTE enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); CallContactService(hContact, PSS_MESSAGE, (WPARAM)PREF_UTF, (LPARAM)"Unable to decrypt PGP encrypted message"); HistoryLog(hContact, db_event("Error message sent", 0, 0, DBEF_SENT)); - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", enc); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc); return; } if(result == pxNotFound) @@ -240,11 +240,11 @@ void RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, { boost::filesystem::remove(path); HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags)); - BYTE enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); CallContactService(hContact, PSS_MESSAGE, (WPARAM)PREF_UTF, (LPARAM)"Unable to decrypt PGP encrypted message"); HistoryLog(hContact, db_event("Error message sent", 0, 0, DBEF_SENT)); - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", enc); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc); return; } if(result == pxNotFound) @@ -271,11 +271,11 @@ void RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, char *tmp = (char*)mir_alloc(sizeof(char)*(str.length()+1)); strcpy(tmp, str.c_str()); HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags)); - BYTE enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); CallContactService(hContact, PSS_MESSAGE, (WPARAM)PREF_UTF, (LPARAM)"Unable to decrypt PGP encrypted message"); HistoryLog(hContact, db_event("Error message sent", 0, 0, DBEF_SENT)); - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", enc); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc); mir_free(tmp); return; } @@ -308,11 +308,11 @@ void RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, debuglog<<std::string(time_str()+": info: Failed to decrypt GPG encrypted message."); char *tmp = mir_strdup(str.c_str()); HistoryLog(hContact, db_event(msg, timestamp, 0, dbflags)); - BYTE enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); + BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); CallContactService(hContact, PSS_MESSAGE, (WPARAM)PREF_UTF, (LPARAM)"Unable to decrypt PGP encrypted message"); HistoryLog(hContact, db_event("Error message sent", 0, 0, DBEF_SENT)); - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", enc); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc); mir_free(tmp); return; } @@ -341,7 +341,7 @@ void RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, } } } - if(DBGetContactSettingByte(metaIsProtoMetaContacts(hContact)?metaGetMostOnline(hContact):hContact, szGPGModuleName, "GPGEncryption", 0)) + if(db_get_b(metaIsProtoMetaContacts(hContact)?metaGetMostOnline(hContact):hContact, szGPGModuleName, "GPGEncryption", 0)) { if(metaIsSubcontact(hContact)) { @@ -392,7 +392,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l) if(bDebugLog) debuglog<<std::string(time_str()+": info(autoexchange): found pubkey block:"+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ccs->hContact, GCDNF_TCHAR))); s2 += _tcslen(_T("-----END PGP PUBLIC KEY BLOCK-----")); - DBWriteContactSettingTString(ccs->hContact, szGPGModuleName, "GPGPubKey", str.substr(s1,s2-s1).c_str()); + db_set_ts(ccs->hContact, szGPGModuleName, "GPGPubKey", str.substr(s1,s2-s1).c_str()); { //gpg execute block std::vector<wstring> cmd; TCHAR tmp2[MAX_PATH] = {0}; @@ -441,7 +441,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l) char *tmp = NULL; string::size_type s = output.find("gpg: key ") + strlen("gpg: key "); string::size_type s2 = output.find(":", s); - DBWriteContactSettingString(ccs->hContact, szGPGModuleName, "KeyID", output.substr(s,s2-s).c_str()); + db_set_s(ccs->hContact, szGPGModuleName, "KeyID", output.substr(s,s2-s).c_str()); s2+=2; s = output.find("“", s2); if(s == string::npos) @@ -458,7 +458,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l) tmp = (char*)mir_alloc(output.substr(s,s2-s-1).length()+1); strcpy(tmp, output.substr(s,s2-s-1).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(ccs->hContact, szGPGModuleName, "KeyMainName", tmp); + db_set_s(ccs->hContact, szGPGModuleName, "KeyMainName", tmp); mir_free(tmp); if((s = output.find(")", s2)) == string::npos) s = output.find(">", s2); @@ -470,14 +470,14 @@ int RecvMsgSvc(WPARAM w, LPARAM l) tmp = (char*)mir_alloc(output.substr(s2,s-s2).length()+1); strcpy(tmp, output.substr(s2,s-s2).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(ccs->hContact, szGPGModuleName, "KeyComment", tmp); + db_set_s(ccs->hContact, szGPGModuleName, "KeyComment", tmp); mir_free(tmp); s+=3; s2 = output.find(">", s); tmp = (char*)mir_alloc(output.substr(s,s2-s).length()+1); strcpy(tmp, output.substr(s,s2-s).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(ccs->hContact, szGPGModuleName, "KeyMainEmail", tmp); + db_set_s(ccs->hContact, szGPGModuleName, "KeyMainEmail", tmp); mir_free(tmp); } else @@ -485,11 +485,11 @@ int RecvMsgSvc(WPARAM w, LPARAM l) tmp = (char*)mir_alloc(output.substr(s2,s-s2).length()+1); strcpy(tmp, output.substr(s2,s-s2).c_str()); mir_utf8decode(tmp, 0); - DBWriteContactSettingString(ccs->hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); + db_set_s(ccs->hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); mir_free(tmp); } - DBWriteContactSettingByte(ccs->hContact, szGPGModuleName, "GPGEncryption", 1); - DBWriteContactSettingByte(ccs->hContact, szGPGModuleName, "bAlwatsTrust", 1); + db_set_b(ccs->hContact, szGPGModuleName, "GPGEncryption", 1); + db_set_b(ccs->hContact, szGPGModuleName, "bAlwatsTrust", 1); void setSrmmIcon(HANDLE); void setClistIcon(HANDLE); setSrmmIcon(ccs->hContact); @@ -541,14 +541,14 @@ int RecvMsgSvc(WPARAM w, LPARAM l) char *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", ""); if(tmp[0]) { - int enc_state = DBGetContactSettingByte(ccs->hContact, szGPGModuleName, "GPGEncryption", 0); + int enc_state = db_get_b(ccs->hContact, szGPGModuleName, "GPGEncryption", 0); if(enc_state) - DBWriteContactSettingByte(ccs->hContact, szGPGModuleName, "GPGEncryption", 0); + db_set_b(ccs->hContact, szGPGModuleName, "GPGEncryption", 0); string str = "-----PGP KEY RESPONSE-----"; str.append(tmp); CallContactService(ccs->hContact, PSS_MESSAGE, (WPARAM)PREF_UTF, (LPARAM)str.c_str()); if(enc_state) - DBWriteContactSettingByte(ccs->hContact, szGPGModuleName, "GPGEncryption", 1); + db_set_b(ccs->hContact, szGPGModuleName, "GPGEncryption", 1); } mir_free(tmp); return 0; @@ -556,7 +556,7 @@ int RecvMsgSvc(WPARAM w, LPARAM l) else if(!isContactHaveKey(ccs->hContact) && bAutoExchange && gpg_valid && gpg_keyexist) { char *proto = GetContactProto(ccs->hContact); - DWORD uin = DBGetContactSettingDword(ccs->hContact, proto, "UIN", 0); + DWORD uin = db_get_dw(ccs->hContact, proto, "UIN", 0); if(uin) { char svc[64]; strcpy(svc, proto); @@ -645,7 +645,7 @@ void SendMsgSvc_func(HANDLE hContact, char *msg, DWORD flags) cmd.push_back(L"\"\""); cmd.push_back(L"--no-version"); } - if(DBGetContactSettingByte(hContact, szGPGModuleName, "bAlwaysTrust", 0)) + if(db_get_b(hContact, szGPGModuleName, "bAlwaysTrust", 0)) { cmd.push_back(L"--trust-model"); cmd.push_back(L"always"); @@ -696,7 +696,7 @@ void SendMsgSvc_func(HANDLE hContact, char *msg, DWORD flags) out.clear(); if(MessageBox(0, TranslateT("We trying to encrypt with untrusted key, do you want to trust this key permanently ?"), TranslateT("Warning"), MB_YESNO) == IDYES) { - DBWriteContactSettingByte(hContact, szGPGModuleName, "bAlwaysTrust", 1); + db_set_b(hContact, szGPGModuleName, "bAlwaysTrust", 1); std::vector<std::wstring> tmp; tmp.push_back(L"--trust-model"); tmp.push_back(L"always"); @@ -833,7 +833,7 @@ int SendMsgSvc(WPARAM w, LPARAM l) debuglog<<std::string(time_str()+": info: checking for autoexchange possibility, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ccs->hContact, GCDNF_TCHAR))); void send_encrypted_msgs_thread(HANDLE hContact); LPSTR proto = GetContactProto(ccs->hContact); - DWORD uin = DBGetContactSettingDword(ccs->hContact, proto, "UIN", 0); + DWORD uin = db_get_dw(ccs->hContact, proto, "UIN", 0); if(uin) { if(bDebugLog) @@ -959,7 +959,7 @@ int HookSendMsg(WPARAM w, LPARAM l) debuglog<<std::string(time_str()+": info: checking for autoexchange possibility, name: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR))); void send_encrypted_msgs_thread(HANDLE hContact); LPSTR proto = GetContactProto(hContact); - DWORD uin = DBGetContactSettingDword(hContact, proto, "UIN", 0); + DWORD uin = db_get_dw(hContact, proto, "UIN", 0); if(uin) { if(bDebugLog) @@ -1138,10 +1138,10 @@ static INT_PTR CALLBACK DlgProcKeyPassword(HWND hwndDlg, UINT msg, WPARAM wParam string dbsetting = "szKey_"; dbsetting += inkeyid; dbsetting += "_Password"; - DBWriteContactSettingTString(NULL, szGPGModuleName, dbsetting.c_str(), tmp); + db_set_ts(NULL, szGPGModuleName, dbsetting.c_str(), tmp); } else - DBWriteContactSettingTString(NULL, szGPGModuleName, "szKeyPassword", tmp); + db_set_ts(NULL, szGPGModuleName, "szKeyPassword", tmp); } if(password) mir_free(password); @@ -1182,8 +1182,8 @@ static INT_PTR CALLBACK DlgProcKeyPassword(HWND hwndDlg, UINT msg, WPARAM wParam case WM_DESTROY: { GetWindowRect(hwndDlg, &key_password_rect); - DBWriteContactSettingDword(NULL, szGPGModuleName, "PasswordWindowX", key_password_rect.left); - DBWriteContactSettingDword(NULL, szGPGModuleName, "PasswordWindowY", key_password_rect.top); + db_set_dw(NULL, szGPGModuleName, "PasswordWindowX", key_password_rect.left); + db_set_dw(NULL, szGPGModuleName, "PasswordWindowY", key_password_rect.top); } break; diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index 3f378fa70f..26c7fd010e 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -25,7 +25,7 @@ static INT_PTR CALLBACK DlgProcGpgAdvOpts(HWND hwndDlg, UINT msg, WPARAM wParam, BOOL CheckStateLoadDB(HWND hwndDlg, int idCtrl, const char* szSetting, BYTE bDef) { - BOOL state = DBGetContactSettingByte(NULL, szGPGModuleName, szSetting, bDef); + BOOL state = db_get_b(NULL, szGPGModuleName, szSetting, bDef); CheckDlgButton(hwndDlg, idCtrl, state); return state; } @@ -33,7 +33,7 @@ BOOL CheckStateLoadDB(HWND hwndDlg, int idCtrl, const char* szSetting, BYTE bDef BOOL CheckStateStoreDB(HWND hwndDlg, int idCtrl, const char* szSetting) { BOOL state = IsDlgButtonChecked(hwndDlg, idCtrl); - DBWriteContactSettingByte(NULL, szGPGModuleName, szSetting, (BYTE)state); + db_set_b(NULL, szGPGModuleName, szSetting, (BYTE)state); return state; } @@ -180,7 +180,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP mir_free(tmp2); ListView_SetItemText(hwndList, iRow, 3, (_tcslen(tmp) > 1)?tmp:_T("not set")); mir_free(tmp); - if(DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0)) + if(db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0)) ListView_SetCheckState(hwndList, iRow, 1); user_data[i] = hContact; ZeroMemory(&item,sizeof(item)); @@ -299,12 +299,12 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP hcnt = metaGetSubcontact(meta, i); if(hcnt) { - DBDeleteContactSetting(hcnt, szGPGModuleName, "KeyID"); - DBDeleteContactSetting(hcnt, szGPGModuleName, "GPGPubKey"); - DBDeleteContactSetting(hcnt, szGPGModuleName, "KeyMainName"); - DBDeleteContactSetting(hcnt, szGPGModuleName, "KeyType"); - DBDeleteContactSetting(hcnt, szGPGModuleName, "KeyMainEmail"); - DBDeleteContactSetting(hcnt, szGPGModuleName, "KeyComment"); + db_unset(hcnt, szGPGModuleName, "KeyID"); + db_unset(hcnt, szGPGModuleName, "GPGPubKey"); + db_unset(hcnt, szGPGModuleName, "KeyMainName"); + db_unset(hcnt, szGPGModuleName, "KeyType"); + db_unset(hcnt, szGPGModuleName, "KeyMainEmail"); + db_unset(hcnt, szGPGModuleName, "KeyComment"); setClistIcon(hcnt); setSrmmIcon(hcnt); } @@ -312,24 +312,24 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP } else { - DBDeleteContactSetting(hContact, szGPGModuleName, "KeyID"); - DBDeleteContactSetting(hContact, szGPGModuleName, "GPGPubKey"); - DBDeleteContactSetting(hContact, szGPGModuleName, "KeyMainName"); - DBDeleteContactSetting(hContact, szGPGModuleName, "KeyType"); - DBDeleteContactSetting(hContact, szGPGModuleName, "KeyMainEmail"); - DBDeleteContactSetting(hContact, szGPGModuleName, "KeyComment"); + db_unset(hContact, szGPGModuleName, "KeyID"); + db_unset(hContact, szGPGModuleName, "GPGPubKey"); + db_unset(hContact, szGPGModuleName, "KeyMainName"); + db_unset(hContact, szGPGModuleName, "KeyType"); + db_unset(hContact, szGPGModuleName, "KeyMainEmail"); + db_unset(hContact, szGPGModuleName, "KeyComment"); setClistIcon(hContact); setSrmmIcon(hContact); } } else { - DBDeleteContactSetting(user_data[item_num+1], szGPGModuleName, "KeyID"); - DBDeleteContactSetting(user_data[item_num+1], szGPGModuleName, "GPGPubKey"); - DBDeleteContactSetting(user_data[item_num+1], szGPGModuleName, "KeyMainName"); - DBDeleteContactSetting(user_data[item_num+1], szGPGModuleName, "KeyType"); - DBDeleteContactSetting(user_data[item_num+1], szGPGModuleName, "KeyMainEmail"); - DBDeleteContactSetting(user_data[item_num+1], szGPGModuleName, "KeyComment"); + db_unset(user_data[item_num+1], szGPGModuleName, "KeyID"); + db_unset(user_data[item_num+1], szGPGModuleName, "GPGPubKey"); + db_unset(user_data[item_num+1], szGPGModuleName, "KeyMainName"); + db_unset(user_data[item_num+1], szGPGModuleName, "KeyType"); + db_unset(user_data[item_num+1], szGPGModuleName, "KeyMainEmail"); + db_unset(user_data[item_num+1], szGPGModuleName, "KeyComment"); setClistIcon(user_data[item_num+1]); setSrmmIcon(user_data[item_num+1]); } @@ -440,9 +440,9 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP void setClistIcon(HANDLE hContact); void setSrmmIcon(HANDLE hContact); if(ListView_GetCheckState(hwndList, item_num)) - DBWriteContactSettingByte(user_data[item_num+1], szGPGModuleName, "GPGEncryption", 1); + db_set_b(user_data[item_num+1], szGPGModuleName, "GPGEncryption", 1); else - DBWriteContactSettingByte(user_data[item_num+1], szGPGModuleName, "GPGEncryption", 0); + db_set_b(user_data[item_num+1], szGPGModuleName, "GPGEncryption", 0); setClistIcon(user_data[item_num+1]); setSrmmIcon(user_data[item_num+1]); } @@ -457,18 +457,18 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP if(bDebugLog) debuglog.init(); bJabberAPI = CheckStateStoreDB(hwndDlg, IDC_JABBER_API, "bJabberAPI"); - bool old_bFileTransfers = DBGetContactSettingByte(NULL, szGPGModuleName, "bFileTransfers", 0); + bool old_bFileTransfers = db_get_b(NULL, szGPGModuleName, "bFileTransfers", 0); bFileTransfers = CheckStateStoreDB(hwndDlg, IDC_FILE_TRANSFERS, "bFileTransfers"); if(bFileTransfers != old_bFileTransfers) { - DBWriteContactSettingByte(NULL, szGPGModuleName, "bSameAction", 0); + db_set_b(NULL, szGPGModuleName, "bSameAction", 0); bSameAction = false; } bAutoExchange = CheckStateStoreDB(hwndDlg, IDC_AUTO_EXCHANGE, "bAutoExchange"); { TCHAR tmp[512]; GetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, tmp, 512); - DBWriteContactSettingTString(NULL, szGPGModuleName, "szLogFilePath", tmp); + db_set_ts(NULL, szGPGModuleName, "szLogFilePath", tmp); } return TRUE; } @@ -516,7 +516,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, { bool bad_version = false; TCHAR *tmp_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", _T("")); - DBWriteContactSettingTString(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); string out; DWORD code; std::vector<wstring> cmd; @@ -527,7 +527,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, params.code = &code; params.result = &result; gpg_launcher(params); - DBWriteContactSettingTString(NULL, szGPGModuleName, "szGpgBinPath", tmp_path); + db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp_path); mir_free(tmp_path); string::size_type p1 = out.find("(GnuPG) "); if(p1 != string::npos) @@ -593,11 +593,11 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, { TCHAR tmp[512]; GetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp, 512); - DBWriteContactSettingTString(NULL, szGPGModuleName, "szGpgBinPath", tmp); + db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, 512); while(tmp[_tcslen(tmp)-1] == '\\') tmp[_tcslen(tmp)-1] = '\0'; - DBWriteContactSettingTString(NULL, szGPGModuleName, "szHomePath", tmp); + db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp); return TRUE; } } @@ -660,22 +660,22 @@ static INT_PTR CALLBACK DlgProcGpgMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, { TCHAR tmp[128]; GetDlgItemText(hwndDlg, IDC_IN_OPEN_TAG, tmp, 128); - DBWriteContactSettingTString(NULL, szGPGModuleName, "szInOpenTag", tmp); + db_set_ts(NULL, szGPGModuleName, "szInOpenTag", tmp); mir_free(inopentag); inopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (_tcslen(tmp)+1)); _tcscpy(inopentag, tmp); GetDlgItemText(hwndDlg, IDC_IN_CLOSE_TAG, tmp, 128); - DBWriteContactSettingTString(NULL, szGPGModuleName, "szInCloseTag", tmp); + db_set_ts(NULL, szGPGModuleName, "szInCloseTag", tmp); mir_free(inclosetag); inclosetag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (_tcslen(tmp)+1)); _tcscpy(inclosetag, tmp); GetDlgItemText(hwndDlg, IDC_OUT_OPEN_TAG, tmp, 128); - DBWriteContactSettingTString(NULL, szGPGModuleName, "szOutOpenTag", tmp); + db_set_ts(NULL, szGPGModuleName, "szOutOpenTag", tmp); mir_free(outopentag); outopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (_tcslen(tmp)+1)); _tcscpy(outopentag, tmp); GetDlgItemText(hwndDlg, IDC_OUT_CLOSE_TAG, tmp, 128); - DBWriteContactSettingTString(NULL, szGPGModuleName, "szOutCloseTag", tmp); + db_set_ts(NULL, szGPGModuleName, "szOutCloseTag", tmp); mir_free(outclosetag); outclosetag = (TCHAR*)mir_alloc(sizeof(TCHAR)*(_tcslen(tmp)+1)); _tcscpy(outclosetag, tmp); @@ -927,14 +927,14 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam { hcnt = metaGetSubcontact(hContact, i); if(hcnt) - DBWriteContactSettingTString(hcnt, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1,ws2-ws1).c_str()); + db_set_ts(hcnt, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1,ws2-ws1).c_str()); } } else - DBWriteContactSettingTString(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", key_buf.substr(ws1,ws2-ws1).c_str()); + db_set_ts(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", key_buf.substr(ws1,ws2-ws1).c_str()); } else - DBWriteContactSettingTString(hContact, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1,ws2-ws1).c_str()); + db_set_ts(hContact, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1,ws2-ws1).c_str()); } tmp = (TCHAR*)mir_alloc(sizeof( TCHAR) * (key_buf.length()+1)); _tcscpy(tmp, key_buf.substr(ws1,ws2-ws1).c_str()); @@ -992,14 +992,14 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam { hcnt = metaGetSubcontact(hContact, i); if(hcnt) - DBDeleteContactSetting(hcnt, szGPGModuleName, "bAlwatsTrust"); + db_unset(hcnt, szGPGModuleName, "bAlwatsTrust"); } } else - DBDeleteContactSetting(metaGetMostOnline(hContact), szGPGModuleName, "bAlwatsTrust"); + db_unset(metaGetMostOnline(hContact), szGPGModuleName, "bAlwatsTrust"); } else - DBDeleteContactSetting(hContact, szGPGModuleName, "bAlwatsTrust"); + db_unset(hContact, szGPGModuleName, "bAlwatsTrust"); } { TCHAR *tmp; @@ -1026,14 +1026,14 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam { hcnt = metaGetSubcontact(hContact, i); if(hcnt) - DBWriteContactSettingString(hcnt, szGPGModuleName, "KeyID", tmp2); + db_set_s(hcnt, szGPGModuleName, "KeyID", tmp2); } } else - DBWriteContactSettingString(metaGetMostOnline(hContact), szGPGModuleName, "KeyID", tmp2); + db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyID", tmp2); } else - DBWriteContactSettingString(hContact, szGPGModuleName, "KeyID", tmp2); + db_set_s(hContact, szGPGModuleName, "KeyID", tmp2); } mir_free(tmp2); tmp = mir_wstrdup(toUTF16(output.substr(s,s2-s)).c_str()); @@ -1076,14 +1076,14 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam { hcnt = metaGetSubcontact(hContact, i); if(hcnt) - DBWriteContactSettingString(hcnt, szGPGModuleName, "KeyMainName", output.substr(s,s2-s-1).c_str()); + db_set_s(hcnt, szGPGModuleName, "KeyMainName", output.substr(s,s2-s-1).c_str()); } } else - DBWriteContactSettingString(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainName", output.substr(s,s2-s-1).c_str()); + db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainName", output.substr(s,s2-s-1).c_str()); } else - DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainName", output.substr(s,s2-s-1).c_str()); + db_set_s(hContact, szGPGModuleName, "KeyMainName", output.substr(s,s2-s-1).c_str()); } mir_free(tmp2); tmp = mir_wstrdup(toUTF16(output.substr(s,s2-s-1)).c_str()); @@ -1114,14 +1114,14 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam { hcnt = metaGetSubcontact(hContact, i); if(hcnt) - DBWriteContactSettingString(hcnt, szGPGModuleName, "KeyComment", output.substr(s2,s-s2).c_str()); + db_set_s(hcnt, szGPGModuleName, "KeyComment", output.substr(s2,s-s2).c_str()); } } else - DBWriteContactSettingString(metaGetMostOnline(hContact), szGPGModuleName, "KeyComment", output.substr(s2,s-s2).c_str()); + db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyComment", output.substr(s2,s-s2).c_str()); } else - DBWriteContactSettingString(hContact, szGPGModuleName, "KeyComment", output.substr(s2,s-s2).c_str()); + db_set_s(hContact, szGPGModuleName, "KeyComment", output.substr(s2,s-s2).c_str()); } mir_free(tmp2); s+=3; @@ -1141,14 +1141,14 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam { hcnt = metaGetSubcontact(hContact, i); if(hcnt) - DBWriteContactSettingString(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str()); + db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str()); } } else - DBWriteContactSettingString(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str()); + db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str()); } else - DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str()); + db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str()); } mir_free(tmp2); tmp = mir_wstrdup(toUTF16(output.substr(s,s2-s)).c_str()); @@ -1173,14 +1173,14 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam { hcnt = metaGetSubcontact(hContact, i); if(hcnt) - DBWriteContactSettingString(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); + db_set_s(hcnt, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); } } else - DBWriteContactSettingString(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); + db_set_s(metaGetMostOnline(hContact), szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); } else - DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); + db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); } mir_free(tmp2); tmp = mir_wstrdup(toUTF16(output.substr(s2,s-s2)).c_str()); @@ -1224,7 +1224,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam { out.erase(s, 1); } - DBWriteContactSettingString(hContact, szGPGModuleName, "GPGPubKey", out.c_str()); + db_set_s(hContact, szGPGModuleName, "GPGPubKey", out.c_str()); } } tmp = mir_wstrdup(toUTF16(output).c_str()); @@ -1251,23 +1251,23 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam if(hcnt) { if(!isContactSecured(hcnt)) - DBWriteContactSettingByte(hcnt, szGPGModuleName, "GPGEncryption", 1); + db_set_b(hcnt, szGPGModuleName, "GPGEncryption", 1); else - DBWriteContactSettingByte(hcnt, szGPGModuleName, "GPGEncryption", 0); + db_set_b(hcnt, szGPGModuleName, "GPGEncryption", 0); setSrmmIcon(hContact); setClistIcon(hContact); } } } else if(!isContactSecured(hContact)) - DBWriteContactSettingByte(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", 1); + db_set_b(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", 1); else - DBWriteContactSettingByte(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", 0); + db_set_b(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", 0); } else if(!isContactSecured(hContact)) - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 1); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1); else - DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); + db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); } } DestroyWindow(hwndDlg); @@ -1351,8 +1351,8 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam case WM_DESTROY: GetWindowRect(hwndDlg, &load_key_rect); - DBWriteContactSettingDword(NULL, szGPGModuleName, "LoadKeyWindowX", load_key_rect.left); - DBWriteContactSettingDword(NULL, szGPGModuleName, "LoadKeyWindowY", load_key_rect.top); + db_set_dw(NULL, szGPGModuleName, "LoadKeyWindowX", load_key_rect.left); + db_set_dw(NULL, szGPGModuleName, "LoadKeyWindowY", load_key_rect.top); break; } diff --git a/plugins/New_GPG/src/srmm.cpp b/plugins/New_GPG/src/srmm.cpp index 6fc204a9a9..85e149214e 100755 --- a/plugins/New_GPG/src/srmm.cpp +++ b/plugins/New_GPG/src/srmm.cpp @@ -49,11 +49,11 @@ int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam) { void setSrmmIcon(HANDLE);
void setClistIcon(HANDLE);
bool isContactHaveKey(HANDLE hContact);
- BYTE enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0);
+ BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0);
if(enc)
{
- DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0);
- hMeta?DBWriteContactSettingByte(hMeta, szGPGModuleName, "GPGEncryption", 0):0;
+ db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0);
+ hMeta?db_set_b(hMeta, szGPGModuleName, "GPGEncryption", 0):0;
setSrmmIcon(hContact);
setClistIcon(hContact);
}
@@ -70,16 +70,16 @@ int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam) { }
else
{
- DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 1);
- hMeta?DBWriteContactSettingByte(hMeta, szGPGModuleName, "GPGEncryption", 1):0;
+ db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1);
+ hMeta?db_set_b(hMeta, szGPGModuleName, "GPGEncryption", 1):0;
setSrmmIcon(hContact);
setClistIcon(hContact);
return 0;
}
if(isContactHaveKey(hContact))
{
- DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 1);
- hMeta?DBWriteContactSettingByte(hMeta, szGPGModuleName, "GPGEncryption", 1):0;
+ db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1);
+ hMeta?db_set_b(hMeta, szGPGModuleName, "GPGEncryption", 1):0;
setSrmmIcon(hContact);
setClistIcon(hContact);
}
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 82976fa50d..4dd31b3a1a 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -22,11 +22,11 @@ TCHAR* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,c {
DBVARIANT dbv = {DBVT_DELETED};
TCHAR* szRes;
- if (DBGetContactSettingTString(hContact, szModule, szSetting, &dbv))
+ if (db_get_ts(hContact, szModule, szSetting, &dbv))
return mir_tstrdup(szDef);
if(dbv.pszVal)
szRes = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return szRes;
}
@@ -34,11 +34,11 @@ char* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,co {
DBVARIANT dbv = {DBVT_DELETED};
char* szRes;
- if (DBGetContactSettingString(hContact, szModule, szSetting, &dbv))
+ if (db_get_s(hContact, szModule, szSetting, &dbv))
return mir_strdup(szDef);
if(dbv.pszVal)
szRes = mir_strdup(dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return szRes;
}
@@ -66,7 +66,7 @@ void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szEx ofn.nMaxFileTitle=MAX_PATH;
if(!GetOpenFileName(&ofn))
return;
- DBWriteContactSettingTString(0, szGPGModuleName, szSetting, str);
+ db_set_ts(0, szGPGModuleName, szSetting, str);
}
TCHAR *GetFilePath(TCHAR *WindowTittle, TCHAR *szExt, TCHAR *szExtDesc, bool save_file)
@@ -119,7 +119,7 @@ void GetFolderPath(TCHAR *WindowTittle, char *szSetting) TCHAR path[MAX_PATH];
if (SHGetPathFromIDList(pidl, path))
{
- DBWriteContactSettingTString(NULL, szGPGModuleName, "szHomePath", path);
+ db_set_ts(NULL, szGPGModuleName, "szHomePath", path);
}
IMalloc * imalloc = 0;
if (SUCCEEDED(SHGetMalloc(&imalloc)))
@@ -169,8 +169,8 @@ INT_PTR SendKey(WPARAM w, LPARAM l) }
if(szMessage[0])
{
- BYTE enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0);
- DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0);
+ BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0);
+ db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0);
CallContactService(hContact, PSS_MESSAGE, (WPARAM)PREF_UTF, (LPARAM)szMessage);
std::string msg = "Public key ";
char *keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, key_id_str.c_str(), "");
@@ -185,7 +185,7 @@ INT_PTR SendKey(WPARAM w, LPARAM l) mir_free(szMessage);
szMessage = mir_strdup(msg.c_str());
HistoryLog(hContact, db_event(szMessage, 0, 0, DBEF_SENT));
- DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", enc);
+ db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc);
}
else
mir_free(szMessage);
@@ -199,9 +199,9 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l) HANDLE hContact = (HANDLE)w;
BYTE enc = 0;
if(metaIsProtoMetaContacts(hContact))
- enc = DBGetContactSettingByte(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", 0);
+ enc = db_get_b(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", 0);
else
- enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0);
+ enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0);
if(metaIsProtoMetaContacts(hContact))
{
HANDLE hcnt = NULL;
@@ -212,13 +212,13 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l) {
hcnt = metaGetSubcontact(hContact, i);
if(hcnt)
- DBWriteContactSettingByte(hcnt, szGPGModuleName, "GPGEncryption", enc?0:1);
+ db_set_b(hcnt, szGPGModuleName, "GPGEncryption", enc?0:1);
}
- DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", enc?0:1);
+ db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc?0:1);
}
}
else
- DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", enc?0:1);
+ db_set_b(hContact, szGPGModuleName, "GPGEncryption", enc?0:1);
void setSrmmIcon(HANDLE hContact);
void setClistIcon(HANDLE hContact);
setSrmmIcon(hContact);
@@ -267,12 +267,12 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM l) TCHAR *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T(""));
if(_tcslen(tmp) < 1)
{
- DBDeleteContactSetting(hContact, szGPGModuleName, "GPGEncryption");
+ db_unset(hContact, szGPGModuleName, "GPGEncryption");
mi.flags += CMIM_FLAGS | CMIF_GRAYED;
}
else
mi.flags = CMIM_NAME | CMIM_FLAGS;
- mi.pszName = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0)?"Turn off GPG encryption":"Turn on GPG encryption";
+ mi.pszName = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0)?"Turn off GPG encryption":"Turn on GPG encryption";
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hToggleEncryption, (LPARAM)&mi);
return 0;
}
@@ -401,9 +401,9 @@ int onProtoAck(WPARAM w, LPARAM l) s += strlen(" ID ");
string::size_type s2 = out.find(",",s);
if(metaIsProtoMetaContacts(ack->hContact))
- DBWriteContactSettingString(metaGetMostOnline(ack->hContact), szGPGModuleName, "InKeyID", out.substr(s, s2-s).c_str());
+ db_set_s(metaGetMostOnline(ack->hContact), szGPGModuleName, "InKeyID", out.substr(s, s2-s).c_str());
else
- DBWriteContactSettingString(ack->hContact, szGPGModuleName, "InKeyID", out.substr(s, s2-s).c_str());
+ db_set_s(ack->hContact, szGPGModuleName, "InKeyID", out.substr(s, s2-s).c_str());
}
void ShowLoadKeyPasswordWindow();
new_key_hcnt_mutex.lock();
@@ -490,7 +490,7 @@ std::wstring encrypt_file(HANDLE hContact, TCHAR *filename) TCHAR *file_out = new TCHAR [_tcslen(filename)+4];
mir_sntprintf(file_out, _tcslen(name)+7, _T("%s.gpg"), name);
cmd.push_back(szKeyid);
- if(DBGetContactSettingByte(hcnt, szGPGModuleName, "bAlwaysTrust", 0))
+ if(db_get_b(hcnt, szGPGModuleName, "bAlwaysTrust", 0))
{
cmd.push_back(L"--trust-model");
cmd.push_back(L"always");
@@ -518,7 +518,7 @@ std::wstring encrypt_file(HANDLE hContact, TCHAR *filename) out.clear();
if(MessageBox(0, TranslateT("We trying to encrypt with untrusted key, do you want to trust this key permanently ?"), TranslateT("Warning"), MB_YESNO) == IDYES)
{
- DBWriteContactSettingByte(hcnt, szGPGModuleName, "bAlwaysTrust", 1);
+ db_set_b(hcnt, szGPGModuleName, "bAlwaysTrust", 1);
std::vector<std::wstring> tmp;
tmp.push_back(L"--trust-model");
tmp.push_back(L"always");
@@ -541,7 +541,7 @@ int onSendFile(WPARAM w, LPARAM l) if(isContactSecured(ccs->hContact))
{
char *proto = GetContactProto(ccs->hContact);
- DWORD uin = DBGetContactSettingDword(ccs->hContact, proto, "UIN", 0);
+ DWORD uin = db_get_dw(ccs->hContact, proto, "UIN", 0);
bool cap_found = false, supported_proto = false;
if(uin)
{
@@ -1072,7 +1072,7 @@ void AddHandlers() bool isContactSecured(HANDLE hContact)
{
- BYTE gpg_enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0);
+ BYTE gpg_enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0);
if(!gpg_enc)
{
if(bDebugLog)
@@ -1155,7 +1155,7 @@ bool isGPGValid() DWORD len = MAX_PATH;
if(gpg_exists)
{
- DBWriteContactSettingTString(NULL, szGPGModuleName, "szGpgBinPath", tmp);
+ db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
string out;
DWORD code;
std::vector<wstring> cmd;
@@ -1206,7 +1206,7 @@ const bool StriStr(const char *str, const char *substr) bool IsOnline(HANDLE hContact)
{
- if(DBGetContactSettingByte(hContact, szGPGModuleName, "Status", 0) == ID_STATUS_OFFLINE)
+ if(db_get_b(hContact, szGPGModuleName, "Status", 0) == ID_STATUS_OFFLINE)
return false;
return true;
}
@@ -1354,7 +1354,7 @@ int handleEnum(const char *szSetting, LPARAM lParam) if(!*(bool*)lParam && szSetting[0] && StriStr(szSetting, "tabsrmm"))
{
bool f = false, *found = (bool*)lParam;
- f = !DBGetContactSettingByte(NULL, "PluginDisable", szSetting, 0);
+ f = !db_get_b(NULL, "PluginDisable", szSetting, 0);
if(f)
*found = f;
}
@@ -1810,7 +1810,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) tmp2 = (char*)mir_alloc((output.substr(s,s2-s).length()+1) * sizeof(char));
strcpy(tmp2, output.substr(s,s2-s).c_str());
mir_utf8decode(tmp2, 0);
- DBWriteContactSettingString(hContact, szGPGModuleName, "KeyID", tmp2);
+ db_set_s(hContact, szGPGModuleName, "KeyID", tmp2);
mir_free(tmp2);
s = output.find("“", s2);
if(s == string::npos)
@@ -1831,7 +1831,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) mir_utf8decode(tmp2, 0);
if(hContact)
{
- DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainName", output.substr(s,s2-s-1).c_str());
+ db_set_s(hContact, szGPGModuleName, "KeyMainName", output.substr(s,s2-s-1).c_str());
}
mir_free(tmp2);
if((s = output.find(")", s2)) == string::npos)
@@ -1845,7 +1845,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) strcpy(tmp2, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp2, 0);
if(hContact)
- DBWriteContactSettingString(hContact, szGPGModuleName, "KeyComment", output.substr(s2,s-s2).c_str());
+ db_set_s(hContact, szGPGModuleName, "KeyComment", output.substr(s2,s-s2).c_str());
mir_free(tmp2);
s+=3;
s2 = output.find(">", s);
@@ -1853,7 +1853,7 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) strcpy(tmp2, output.substr(s,s2-s).c_str());
mir_utf8decode(tmp2, 0);
if(hContact)
- DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str());
+ db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s,s2-s).c_str());
mir_free(tmp2);
}
else
@@ -1862,12 +1862,12 @@ INT_PTR ImportGpGKeys(WPARAM w, LPARAM l) strcpy(tmp2, output.substr(s2,s-s2).c_str());
mir_utf8decode(tmp2, 0);
if(hContact)
- DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());
+ db_set_s(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str());
mir_free(tmp2);
}
}
- DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 1);
- DBWriteContactSettingTString(hContact, szGPGModuleName, "GPGPubKey", toUTF16(key).c_str());
+ db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1);
+ db_set_ts(hContact, szGPGModuleName, "GPGPubKey", toUTF16(key).c_str());
}
boost::filesystem::remove(path);
break;
@@ -1983,7 +1983,7 @@ static INT_PTR CALLBACK DlgProcEncryptedFileMsgBox(HWND hwndDlg, UINT msg, WPARA case IDC_IGNORE:
if(IsDlgButtonChecked(hwndDlg, IDC_REMEMBER))
{
- DBWriteContactSettingByte(NULL, szGPGModuleName, "bSameAction", 1);
+ db_set_b(NULL, szGPGModuleName, "bSameAction", 1);
bSameAction = true;
}
DestroyWindow(hwndDlg);
@@ -1993,9 +1993,9 @@ static INT_PTR CALLBACK DlgProcEncryptedFileMsgBox(HWND hwndDlg, UINT msg, WPARA file_msg_state = 1;
if(IsDlgButtonChecked(hwndDlg, IDC_REMEMBER))
{
- DBWriteContactSettingByte(NULL, szGPGModuleName, "bFileTransfers", 1);
+ db_set_b(NULL, szGPGModuleName, "bFileTransfers", 1);
bFileTransfers = true;
- DBWriteContactSettingByte(NULL, szGPGModuleName, "bSameAction", 0);
+ db_set_b(NULL, szGPGModuleName, "bSameAction", 0);
bSameAction = false;
}
diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index 67555f686f..eb894a776b 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -63,13 +63,13 @@ INT_PTR CALLBACK DlgProcAddFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA HWND hwndList = (HWND)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_FEEDURL, str, SIZEOF(str));
db_set_ts(hContact, MODULE, "URL", str);
- DBWriteContactSettingByte(hContact, MODULE, "CheckState", 1);
- DBWriteContactSettingDword(hContact, MODULE, "UpdateTime", GetDlgItemInt(hwndDlg, IDC_CHECKTIME, false, false));
+ db_set_b(hContact, MODULE, "CheckState", 1);
+ db_set_dw(hContact, MODULE, "UpdateTime", GetDlgItemInt(hwndDlg, IDC_CHECKTIME, false, false));
GetDlgItemText(hwndDlg, IDC_TAGSEDIT, str, SIZEOF(str));
db_set_ts(hContact, MODULE, "MsgFormat", str);
db_set_w(hContact, MODULE, "Status", CallProtoService(MODULE, PS_GETSTATUS, 0, 0));
if (IsDlgButtonChecked(hwndDlg, IDC_USEAUTH)) {
- DBWriteContactSettingByte(hContact, MODULE, "UseAuth", 1);
+ db_set_b(hContact, MODULE, "UseAuth", 1);
GetDlgItemText(hwndDlg, IDC_LOGIN, str, SIZEOF(str));
db_set_ts(hContact, MODULE, "Login", str);
GetDlgItemText(hwndDlg, IDC_PASSWORD, str, SIZEOF(str));
@@ -231,11 +231,11 @@ INT_PTR CALLBACK DlgProcChangeFeedOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP db_set_ts(SelItem->hContact, MODULE, "URL", str);
GetDlgItemText(hwndDlg, IDC_FEEDTITLE, str, SIZEOF(str));
db_set_ts(SelItem->hContact, MODULE, "Nick", str);
- DBWriteContactSettingDword(SelItem->hContact, MODULE, "UpdateTime", GetDlgItemInt(hwndDlg, IDC_CHECKTIME, false, false));
+ db_set_dw(SelItem->hContact, MODULE, "UpdateTime", GetDlgItemInt(hwndDlg, IDC_CHECKTIME, false, false));
GetDlgItemText(hwndDlg, IDC_TAGSEDIT, str, SIZEOF(str));
db_set_ts(SelItem->hContact, MODULE, "MsgFormat", str);
if (IsDlgButtonChecked(hwndDlg, IDC_USEAUTH)) {
- DBWriteContactSettingByte(SelItem->hContact, MODULE, "UseAuth", 1);
+ db_set_b(SelItem->hContact, MODULE, "UseAuth", 1);
GetDlgItemText(hwndDlg, IDC_LOGIN, str, SIZEOF(str));
db_set_ts(SelItem->hContact, MODULE, "Login", str);
GetDlgItemText(hwndDlg, IDC_PASSWORD, str, SIZEOF(str));
@@ -381,11 +381,11 @@ INT_PTR CALLBACK DlgProcChangeFeedMenu(HWND hwndDlg, UINT msg, WPARAM wParam, LP db_set_ts(hContact, MODULE, "URL", str);
GetDlgItemText(hwndDlg, IDC_FEEDTITLE, str, SIZEOF(str));
db_set_ts(hContact, MODULE, "Nick", str);
- DBWriteContactSettingDword(hContact, MODULE, "UpdateTime", GetDlgItemInt(hwndDlg, IDC_CHECKTIME, false, false));
+ db_set_dw(hContact, MODULE, "UpdateTime", GetDlgItemInt(hwndDlg, IDC_CHECKTIME, false, false));
GetDlgItemText(hwndDlg, IDC_TAGSEDIT, str, SIZEOF(str));
db_set_ts(hContact, MODULE, "MsgFormat", str);
if (IsDlgButtonChecked(hwndDlg, IDC_USEAUTH)) {
- DBWriteContactSettingByte(hContact, MODULE, "UseAuth", 1);
+ db_set_b(hContact, MODULE, "UseAuth", 1);
GetDlgItemText(hwndDlg, IDC_LOGIN, str, SIZEOF(str));
db_set_ts(hContact, MODULE, "Login", str);
GetDlgItemText(hwndDlg, IDC_PASSWORD, str, SIZEOF(str));
@@ -795,11 +795,11 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA {
if(IsMyContact(hContact))
{
- DBWriteContactSettingByte(hContact, MODULE, "CheckState", ListView_GetCheckState(hwndList, i));
+ db_set_b(hContact, MODULE, "CheckState", ListView_GetCheckState(hwndList, i));
if (!ListView_GetCheckState(hwndList, i))
- DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
+ db_set_b(hContact, "CList", "Hidden", 1);
else
- DBDeleteContactSetting(hContact,"CList","Hidden");
+ db_unset(hContact,"CList","Hidden");
i += 1;
}
hContact = db_find_next(hContact);
diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp index 9d72fe9077..d7efc461b6 100644 --- a/plugins/NewsAggregator/Src/Utils.cpp +++ b/plugins/NewsAggregator/Src/Utils.cpp @@ -819,7 +819,7 @@ VOID CheckCurrentFeed(HANDLE hContact) double deltaupd = difftime(time(NULL), stamp);
double deltacheck = difftime(time(NULL), db_get_dw(hContact, MODULE, "LastCheck", 0));
if (deltaupd - deltacheck >= 0) {
- DBWriteContactSettingDword(hContact, MODULE, "LastCheck", time(NULL));
+ db_set_dw(hContact, MODULE, "LastCheck", time(NULL));
xi.destroyNode(hXml);
return;
}
@@ -1058,7 +1058,7 @@ VOID CheckCurrentFeed(HANDLE hContact) double deltaupd = difftime(time(NULL), stamp);
double deltacheck = difftime(time(NULL), db_get_dw(hContact, MODULE, "LastCheck", 0));
if (deltaupd - deltacheck >= 0) {
- DBWriteContactSettingDword(hContact, MODULE, "LastCheck", time(NULL));
+ db_set_dw(hContact, MODULE, "LastCheck", time(NULL));
xi.destroyNode(hXml);
return;
}
@@ -1220,7 +1220,7 @@ VOID CheckCurrentFeed(HANDLE hContact) xi.destroyNode(hXml);
}
}
- DBWriteContactSettingDword(hContact, MODULE, "LastCheck", time(NULL));
+ db_set_dw(hContact, MODULE, "LastCheck", time(NULL));
}
}
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index c2f571526e..babf696ccf 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -8,7 +8,8 @@ static void SrmmMenu_UpdateIcon(HANDLE hContact); static int SrmmMenu_ProcessEvent(WPARAM wParam, LPARAM lParam);
static int SrmmMenu_ProcessIconClick(WPARAM wParam, LPARAM lParam);
-HANDLE hMenuToggle, hMenuClear, hServiceToggle, hServiceClear;
+HGENMENU hMenuToggle, hMenuClear;
+HANDLE hServiceToggle, hServiceClear;
CRITICAL_SECTION list_cs;
@@ -154,7 +155,7 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS|CMIF_TCHAR;
+ mi.flags = CMIM_FLAGS | CMIF_TCHAR;
if (chat_room) mi.flags |= CMIF_HIDDEN;
else {
mi.flags |= (CMIM_NAME | CMIM_ICON);
@@ -163,11 +164,7 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) }
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuToggle, (LPARAM)&mi);
- mi.flags = CMIM_FLAGS;
- if (chat_room || db_event_count(hContact) <= 0)
- mi.flags |= CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuClear, (LPARAM)&mi);
+ Menu_ShowItem(hMenuClear, !chat_room && db_event_count(hContact) > 0);
return 0;
}
@@ -283,9 +280,6 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) mi.hIcon = hIconClear;
hMenuClear = Menu_AddMainMenuItem(&mi);
- // kill read events once in a minute
- // SetTimer(NULL, 0, 60000, TimerProc);
-
// add icon to srmm status icons
SrmmMenu_Load();
return 0;
diff --git a/plugins/Non-IM Contact/src/contactinfo.cpp b/plugins/Non-IM Contact/src/contactinfo.cpp index 002f7fe1ad..76a774f567 100644 --- a/plugins/Non-IM Contact/src/contactinfo.cpp +++ b/plugins/Non-IM Contact/src/contactinfo.cpp @@ -165,7 +165,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP }
else i = -1;
}
- if (!DBGetContactSetting(hContact, "CList", "Group", &dbv))
+ if (!db_get(hContact, "CList", "Group", &dbv))
SetDlgItemTextA(hwnd, IDC_GROUP, dbv.pszVal);
/* icons */
diff --git a/plugins/Non-IM Contact/src/services.cpp b/plugins/Non-IM Contact/src/services.cpp index d3aff868ba..b81372adb9 100644 --- a/plugins/Non-IM Contact/src/services.cpp +++ b/plugins/Non-IM Contact/src/services.cpp @@ -6,7 +6,7 @@ int db_get_static(HANDLE hContact, const char *szModule, const char *szSetting, char *value)
{
DBVARIANT dbv;
- if (!DBGetContactSetting(hContact, szModule, szSetting, &dbv))
+ if (!db_get(hContact, szModule, szSetting, &dbv))
{
strcpy(value, dbv.pszVal);
db_free(&dbv);
diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp index efd0dc77df..58e809738e 100644 --- a/plugins/NotesAndReminders/src/notes.cpp +++ b/plugins/NotesAndReminders/src/notes.cpp @@ -695,7 +695,7 @@ void PurgeNotes(void) for(I = 0; I < NotesCount; I++)
{
sprintf(ValueName, "NotesData%d", I);
- DBDeleteContactSetting(0,MODULENAME,ValueName);
+ db_unset(0,MODULENAME,ValueName);
}
}
@@ -957,7 +957,7 @@ static void JustSaveNotesEx(STICKYNOTE *pModified) for(; I < OldNotesCount; I++)
{
sprintf(ValueName, "NotesData%d", I);
- DBDeleteContactSetting(0,MODULENAME,ValueName);
+ db_unset(0,MODULENAME,ValueName);
}
NOTIFY_LIST();
diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp index 3f3b889409..9ade55870f 100644 --- a/plugins/NotesAndReminders/src/options.cpp +++ b/plugins/NotesAndReminders/src/options.cpp @@ -216,7 +216,7 @@ static int FS_ColorChanged(WPARAM wParam, LPARAM lParam) LoadNRFont(NR_FONTID_CAPTION, &lfCaption, (COLORREF*)&CaptionFontColor);
LoadNRFont(NR_FONTID_BODY, &lfBody, (COLORREF*)&BodyFontColor);
- BodyColor = DBGetContactSettingDword(NULL, MODULENAME, colourOptionsList[0].szSettingName, colourOptionsList[0].defColour);
+ BodyColor = db_get_dw(NULL, MODULENAME, colourOptionsList[0].szSettingName, colourOptionsList[0].defColour);
SaveNotes();
LoadNotes(FALSE);
@@ -440,9 +440,9 @@ INT_PTR CALLBACK DlgProcOptions(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPar }
SetDlgItemText(hdlg,IDC_EDIT_ALTBROWSER,g_lpszAltBrowser ? g_lpszAltBrowser : _T(""));
if (g_lpszAltBrowser)
- DBWriteContactSettingString(0,MODULENAME,"AltBrowser",g_lpszAltBrowser);
+ db_set_s(0,MODULENAME,"AltBrowser",g_lpszAltBrowser);
else
- DBDeleteContactSetting(0,MODULENAME,"AltBrowser");
+ db_unset(0,MODULENAME,"AltBrowser");
WriteSettingInt(0,MODULENAME,"ShowNotesAtStart",g_ShowNotesAtStart);
WriteSettingInt(0,MODULENAME,"ShowNoteButtons",g_ShowNoteButtons);
@@ -593,7 +593,7 @@ void InitSettings(void) ReadSettingIntArray(0,MODULENAME,"NotesListGeom",g_notesListGeom,SIZEOF(g_notesListGeom));
ReadSettingIntArray(0,MODULENAME,"NotesListColGeom",g_notesListColGeom,SIZEOF(g_notesListColGeom));
- BodyColor = DBGetContactSettingDword(NULL, MODULENAME, colourOptionsList[0].szSettingName, colourOptionsList[0].defColour);
+ BodyColor = db_get_dw(NULL, MODULENAME, colourOptionsList[0].szSettingName, colourOptionsList[0].defColour);
InitFonts();
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index 82f4d1aece..234aea3e6e 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -459,7 +459,7 @@ void JustSaveReminders(void) for(; I < OldReminderCount; I++)
{
sprintf(ValueName, "RemindersData%d", I);
- DBDeleteContactSetting(0,MODULENAME,ValueName);
+ db_unset(0,MODULENAME,ValueName);
}
}
@@ -852,10 +852,10 @@ static void SkinPlaySoundPoly(LPCSTR pszSoundName) return;
}
- if (DBGetContactSettingByte(NULL, "SkinSoundsOff", pszSoundName, 0)==0) {
+ if (db_get_b(NULL, "SkinSoundsOff", pszSoundName, 0)==0) {
DBVARIANT dbv;
- if (DBGetContactSettingString(NULL, "SkinSounds", pszSoundName, &dbv)==0) {
+ if (db_get_s(NULL, "SkinSounds", pszSoundName, &dbv)==0) {
char szFull[MAX_PATH];
PathToAbsolute(dbv.pszVal, szFull);
@@ -871,7 +871,7 @@ static void SkinPlaySoundPoly(LPCSTR pszSoundName) mciSendStringA(s, NULL, 0, NULL);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
diff --git a/plugins/NotifyAnything/src/options.cpp b/plugins/NotifyAnything/src/options.cpp index 5b02963ec7..69468f95e5 100644 --- a/plugins/NotifyAnything/src/options.cpp +++ b/plugins/NotifyAnything/src/options.cpp @@ -176,14 +176,14 @@ void load_settings() g_settings.port = db_get_dw(NULL, PlugName, "port", 12001);
DBVARIANT dbv;
- if(!DBGetContactSetting(NULL, PlugName, "password", &dbv)) {
+ if(!db_get(NULL, PlugName, "password", &dbv)) {
g_settings.password = dbv.pszVal;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if(!DBGetContactSetting(NULL, PlugName, "log_filename", &dbv)) {
+ if(!db_get(NULL, PlugName, "log_filename", &dbv)) {
g_settings.log_filename = dbv.pszVal;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
g_settings.log_filename = g_mirandaDir + "\\"+LOG_ID+".log";
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index d94994b68a..73caaf1db3 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -31,8 +31,10 @@ PLUGININFOEX pluginInfo={ INT_PTR NudgeShowMenu(WPARAM wParam,LPARAM lParam)
{
for(NudgeElementList *n = NudgeList;n != NULL; n = n->next)
- if (!strcmp((char *) wParam,n->item.ProtocolName))
- return n->item.ShowContactMenu(lParam != 0);
+ if (!strcmp((char *) wParam,n->item.ProtocolName)) {
+ Menu_ShowItem(n->item.hContactMenu, lParam != 0);
+ break;
+ }
return 0;
}
@@ -40,7 +42,7 @@ INT_PTR NudgeShowMenu(WPARAM wParam,LPARAM lParam) INT_PTR NudgeSend(WPARAM wParam,LPARAM lParam)
{
char *protoName = GetContactProto((HANDLE)wParam);
- int diff = time(NULL) - DBGetContactSettingDword((HANDLE) wParam, "Nudge", "LastSent", time(NULL)-30);
+ int diff = time(NULL) - db_get_dw((HANDLE) wParam, "Nudge", "LastSent", time(NULL)-30);
if(diff < GlobalNudge.sendTimeSec)
{
@@ -85,8 +87,8 @@ int NudgeReceived(WPARAM wParam,LPARAM lParam) DWORD currentTimestamp = time(NULL);
DWORD nudgeSentTimestamp = lParam ? (DWORD)lParam : currentTimestamp;
- int diff = currentTimestamp - DBGetContactSettingDword((HANDLE) wParam, "Nudge", "LastReceived", currentTimestamp-30);
- int diff2 = nudgeSentTimestamp - DBGetContactSettingDword((HANDLE) wParam, "Nudge", "LastReceived2", nudgeSentTimestamp-30);
+ int diff = currentTimestamp - db_get_dw((HANDLE) wParam, "Nudge", "LastReceived", currentTimestamp-30);
+ int diff2 = nudgeSentTimestamp - db_get_dw((HANDLE) wParam, "Nudge", "LastReceived2", nudgeSentTimestamp-30);
if(diff >= GlobalNudge.recvTimeSec)
db_set_dw((HANDLE) wParam, "Nudge", "LastReceived", currentTimestamp);
diff --git a/plugins/Nudge/src/nudge.cpp b/plugins/Nudge/src/nudge.cpp index 51b6af9824..5c83b6cfe9 100644 --- a/plugins/Nudge/src/nudge.cpp +++ b/plugins/Nudge/src/nudge.cpp @@ -4,7 +4,7 @@ void CNudge::Save(void) {
char SectionName[512];
mir_snprintf(SectionName,512,"useByProtocol");
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->useByProtocol);
+ db_set_b(NULL, "Nudge", SectionName, this->useByProtocol);
mir_snprintf(SectionName,512,"RecvTimeSec");
db_set_dw(NULL, "Nudge", SectionName, this->recvTimeSec);
mir_snprintf(SectionName,512,"SendTimeSec");
@@ -18,51 +18,42 @@ void CNudge::Load(void) {
char SectionName[512];
mir_snprintf(SectionName,512,"useByProtocol");
- this->useByProtocol = DBGetContactSettingByte(NULL, "Nudge", SectionName, FALSE) != 0;
+ this->useByProtocol = db_get_b(NULL, "Nudge", SectionName, FALSE) != 0;
mir_snprintf(SectionName,512,"RecvTimeSec");
- this->recvTimeSec = DBGetContactSettingDword(NULL, "Nudge", SectionName, 30);
+ this->recvTimeSec = db_get_dw(NULL, "Nudge", SectionName, 30);
mir_snprintf(SectionName,512,"SendTimeSec");
- this->sendTimeSec = DBGetContactSettingDword(NULL, "Nudge", SectionName, 30);
+ this->sendTimeSec = db_get_dw(NULL, "Nudge", SectionName, 30);
mir_snprintf(SectionName,512,"ResendDelaySec");
- this->resendDelaySec = DBGetContactSettingDword(NULL, "Nudge", SectionName, 3);
-}
-
-int CNudgeElement::ShowContactMenu(bool show)
-{
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = show? CMIM_FLAGS : CMIM_FLAGS | CMIF_HIDDEN ;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenu, (LPARAM)&mi);
-
- return 0;
+ this->resendDelaySec = db_get_dw(NULL, "Nudge", SectionName, 3);
}
void CNudgeElement::Save(void)
{
char SectionName[512];
mir_snprintf(SectionName,512,"%s-openMessageWindow", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->openMessageWindow);
+ db_set_b(NULL, "Nudge", SectionName, this->openMessageWindow);
mir_snprintf(SectionName,512,"%s-openContactList", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->openContactList);
+ db_set_b(NULL, "Nudge", SectionName, this->openContactList);
mir_snprintf(SectionName,512,"%s-useIgnore", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->useIgnoreSettings);
+ db_set_b(NULL, "Nudge", SectionName, this->useIgnoreSettings);
mir_snprintf(SectionName,512,"%s-showStatus", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->showStatus);
+ db_set_b(NULL, "Nudge", SectionName, this->showStatus);
mir_snprintf(SectionName,512,"%s-showPopup", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->showPopup);
+ db_set_b(NULL, "Nudge", SectionName, this->showPopup);
mir_snprintf(SectionName,512,"%s-shakeClist", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->shakeClist);
+ db_set_b(NULL, "Nudge", SectionName, this->shakeClist);
mir_snprintf(SectionName,512,"%s-shakeChat", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->shakeChat);
+ db_set_b(NULL, "Nudge", SectionName, this->shakeChat);
mir_snprintf(SectionName,512,"%s-enabled", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->enabled);
+ db_set_b(NULL, "Nudge", SectionName, this->enabled);
mir_snprintf(SectionName,512,"%s-autoResend", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->autoResend);
+ db_set_b(NULL, "Nudge", SectionName, this->autoResend);
mir_snprintf(SectionName,512,"%s-statusFlags", ProtocolName);
db_set_dw(NULL, "Nudge", SectionName, this->statusFlags);
mir_snprintf(SectionName,512,"%s-recText", ProtocolName);
- DBWriteContactSettingTString(NULL, "Nudge", SectionName, this->recText);
+ db_set_ts(NULL, "Nudge", SectionName, this->recText);
mir_snprintf(SectionName,512,"%s-senText", ProtocolName);
- DBWriteContactSettingTString(NULL, "Nudge", SectionName, this->senText);
+ db_set_ts(NULL, "Nudge", SectionName, this->senText);
}
@@ -71,42 +62,42 @@ void CNudgeElement::Load(void) DBVARIANT dbv;
char SectionName[512];
mir_snprintf(SectionName,512,"%s-openMessageWindow", ProtocolName);
- this->openMessageWindow = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->openMessageWindow = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-openContactList", ProtocolName);
- this->openContactList = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->openContactList = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-useIgnore", ProtocolName);
- this->useIgnoreSettings = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->useIgnoreSettings = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-showStatus", ProtocolName);
- this->showStatus = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->showStatus = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-showPopup", ProtocolName);
- this->showPopup = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->showPopup = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-shakeClist", ProtocolName);
- this->shakeClist = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->shakeClist = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-shakeChat", ProtocolName);
- this->shakeChat = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->shakeChat = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-enabled", ProtocolName);
- this->enabled = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ this->enabled = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-autoResend", ProtocolName);
- this->autoResend = DBGetContactSettingByte(NULL, "Nudge", SectionName, FALSE) != 0;
+ this->autoResend = db_get_b(NULL, "Nudge", SectionName, FALSE) != 0;
mir_snprintf(SectionName,512,"%s-statusFlags", ProtocolName);
- this->statusFlags = DBGetContactSettingDword(NULL, "Nudge", SectionName, 967);
+ this->statusFlags = db_get_dw(NULL, "Nudge", SectionName, 967);
mir_snprintf(SectionName,512,"%s-recText", ProtocolName);
- if (!DBGetContactSettingTString(NULL,"Nudge",SectionName,&dbv))
+ if (!db_get_ts(NULL,"Nudge",SectionName,&dbv))
{
_tcsncpy(this->recText,dbv.ptszVal,TEXT_LEN);
if(_tcsclen(this->recText) < 1)
_tcsncpy(this->recText,TranslateT("You received a nudge"),TEXT_LEN);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
_tcsncpy(this->recText,TranslateT("You received a nudge"),TEXT_LEN);
mir_snprintf(SectionName,512,"%s-senText", ProtocolName);
- if (!DBGetContactSettingTString(NULL,"Nudge",SectionName,&dbv))
+ if (!db_get_ts(NULL,"Nudge",SectionName,&dbv))
{
_tcsncpy(this->senText,dbv.ptszVal,TEXT_LEN);
if(_tcsclen(this->senText) < 1)
_tcsncpy(this->senText,TranslateT("You sent a nudge"),TEXT_LEN);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
_tcsncpy(this->senText,TranslateT("You sent a nudge"),TEXT_LEN);
diff --git a/plugins/Nudge/src/nudge.h b/plugins/Nudge/src/nudge.h index 8a531639ca..8a6c39e5d5 100644 --- a/plugins/Nudge/src/nudge.h +++ b/plugins/Nudge/src/nudge.h @@ -51,11 +51,10 @@ public: int iProtoNumber;
HANDLE hIcoLibItem;
HANDLE hEvent;
- HANDLE hContactMenu;
+ HGENMENU hContactMenu;
void Load(void);
void Save(void);
- int ShowContactMenu(bool show);
};
typedef struct NudgeElementList
diff --git a/plugins/Nudge/src/shake.cpp b/plugins/Nudge/src/shake.cpp index 7976d8fe88..f1a4c4a46e 100644 --- a/plugins/Nudge/src/shake.cpp +++ b/plugins/Nudge/src/shake.cpp @@ -5,10 +5,10 @@ void CShake::Load(void) Shaking = false;
ShakingChat = false;
- nScaleClist = DBGetContactSettingDword(NULL, "Nudge", "ScaleClist", 5);
- nScaleChat = DBGetContactSettingDword(NULL, "Nudge", "ScaleChat", 2);
- nMoveClist = DBGetContactSettingDword(NULL, "Nudge", "MoveClist", 15);
- nMoveChat = DBGetContactSettingDword(NULL, "Nudge", "MoveChat", 15);
+ nScaleClist = db_get_dw(NULL, "Nudge", "ScaleClist", 5);
+ nScaleChat = db_get_dw(NULL, "Nudge", "ScaleChat", 2);
+ nMoveClist = db_get_dw(NULL, "Nudge", "MoveClist", 15);
+ nMoveChat = db_get_dw(NULL, "Nudge", "MoveChat", 15);
}
void CShake::Save(void)
{
diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp index 20ba80c0d7..facaec4b49 100644 --- a/plugins/PackUpdater/Src/Notifications.cpp +++ b/plugins/PackUpdater/Src/Notifications.cpp @@ -176,9 +176,9 @@ INT_PTR CALLBACK DlgDownloadPop(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar static void __stdcall CreateDownloadDialog(void*)
{
- if ( ServiceExists(MS_POPUP_ADDPOPUP) && DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1) && DBGetContactSettingByte(NULL,MODNAME, "Popups3", DEFAULT_POPUP_ENABLED))
+ if ( ServiceExists(MS_POPUP_ADDPOPUP) && db_get_b(NULL, "PopUp", "ModuleIsEnabled", 1) && db_get_b(NULL,MODNAME, "Popups3", DEFAULT_POPUP_ENABLED))
hDlgDld = CreateDialog(hInst, MAKEINTRESOURCE(IDD_POPUPDUMMI), NULL, DlgDownloadPop);
- else if (DBGetContactSettingByte(NULL,MODNAME, "Popups3M", DEFAULT_MESSAGE_ENABLED)) {
+ else if (db_get_b(NULL,MODNAME, "Popups3M", DEFAULT_MESSAGE_ENABLED)) {
lstrcpyn(tszDialogMsg, Text, SIZEOF(tszDialogMsg));
hDlgDld = CreateDialog(hInst, MAKEINTRESOURCE(IDD_DOWNLOAD), NULL, DlgDownload);
}
@@ -195,11 +195,11 @@ void DlgDownloadProc() if (!DownloadFile(pFileUrl->tszDownloadURL, pFileUrl->tszDiskPath)) {
Title = TranslateT("Pack Updater");
Text = TranslateT("An error occured while downloading the update.");
- if ( ServiceExists(MS_POPUP_ADDPOPUP) && DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1) && DBGetContactSettingByte(NULL, MODNAME, "Popups1", DEFAULT_POPUP_ENABLED)) {
+ if ( ServiceExists(MS_POPUP_ADDPOPUP) && db_get_b(NULL, "PopUp", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups1", DEFAULT_POPUP_ENABLED)) {
Number = 1;
show_popup(0, Title, Text, Number, 0);
}
- else if (DBGetContactSettingByte(NULL, MODNAME, "Popups1M", DEFAULT_MESSAGE_ENABLED))
+ else if (db_get_b(NULL, MODNAME, "Popups1M", DEFAULT_MESSAGE_ENABLED))
MessageBox(NULL, Text, Title, MB_ICONSTOP);
}
CallFunctionAsync(DestroyDownloadDialog, 0);
@@ -402,7 +402,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam }
lstrcpyn(todo[i].tszCurVer, todo[i].tszNewVer, SIZEOF(todo[i].tszCurVer));
mir_snprintf(szKey, SIZEOF(szKey), "File_%d_CurrentVersion", todo[i].FileNum);
- DBWriteContactSettingTString(NULL, MODNAME, szKey, todo[i].tszCurVer);
+ db_set_ts(NULL, MODNAME, szKey, todo[i].tszCurVer);
arFileType.push_back(todo[i].FileType);
arFilePath.push_back(todo[i].File.tszDiskPath);
arFileName.push_back(tszFileName);
@@ -421,7 +421,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam INT rc = -1;
Title = TranslateT("Pack Updater");
Text = tszBuff;
- if ( ServiceExists(MS_POPUP_ADDPOPUP) && ServiceExists(MS_POPUP_REGISTERACTIONS) && DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1) && DBGetContactSettingByte(NULL,MODNAME, "Popups0", DEFAULT_POPUP_ENABLED) && (DBGetContactSettingDword(NULL, "PopUp", "Actions", 0) & 1))
+ if ( ServiceExists(MS_POPUP_ADDPOPUP) && ServiceExists(MS_POPUP_REGISTERACTIONS) && db_get_b(NULL, "PopUp", "ModuleIsEnabled", 1) && db_get_b(NULL,MODNAME, "Popups0", DEFAULT_POPUP_ENABLED) && (db_get_dw(NULL, "PopUp", "Actions", 0) & 1))
rc = DialogBox(hInst, MAKEINTRESOURCE(IDD_POPUPDUMMI), NULL, DlgMsgPop);
else
rc = MessageBox(NULL, tszBuff, Title, MB_YESNO | MB_ICONQUESTION);
@@ -436,7 +436,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam break;
case 1:
if (Reminder == 2)
- DBWriteContactSettingByte(NULL, MODNAME, "Reminder", 1);
+ db_set_b(NULL, MODNAME, "Reminder", 1);
memset(&si, 0, sizeof(STARTUPINFO));
memset(&pi, 0, sizeof(PROCESS_INFORMATION));
si.cb = sizeof(STARTUPINFO);
@@ -499,16 +499,16 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam }
else { //reminder for not installed pack update
if (Reminder && (UpdatesCount == 1) && (arFileType[0] == 1))
- DBWriteContactSettingByte(NULL, MODNAME, "Reminder", 2);
+ db_set_b(NULL, MODNAME, "Reminder", 2);
mir_sntprintf(tszBuff, SIZEOF(tszBuff), TranslateT("You have chosen not to install the pack update immediately.\nYou can install it manually from this location:\n\n%s"), arFilePath[0].c_str());
Title = TranslateT("Pack Updater");
Text = tszBuff;
- if ( ServiceExists(MS_POPUP_ADDPOPUP) && DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1) && DBGetContactSettingByte(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED))
+ if ( ServiceExists(MS_POPUP_ADDPOPUP) && db_get_b(NULL, "PopUp", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED))
{
Number = 2;
show_popup(0, Title, Text, Number, 0);
}
- else if (DBGetContactSettingByte(NULL, MODNAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
+ else if (db_get_b(NULL, MODNAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
MessageBox(NULL, Text, Title, MB_ICONINFORMATION);
}
}
diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp index 3460ef1dcb..3b16bb0565 100644 --- a/plugins/PackUpdater/Src/Options.cpp +++ b/plugins/PackUpdater/Src/Options.cpp @@ -65,7 +65,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA else {
for (int i = 1; i < POPUPS; i++) {
mir_snprintf(str, SIZEOF(str), "Popups%dM", i);
- CheckDlgButton(hwndDlg, (i+1029), (DBGetContactSettingByte(NULL, MODNAME, str, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED: BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, (i+1029), (db_get_b(NULL, MODNAME, str, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED: BST_UNCHECKED);
}
}
return TRUE;
@@ -139,17 +139,17 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA InitTimer();
- DBWriteContactSettingByte(NULL, MODNAME, "UpdateOnStartup", UpdateOnStartup);
- DBWriteContactSettingByte(NULL, MODNAME, "OnlyOnceADay", OnlyOnceADay);
- DBWriteContactSettingByte(NULL, MODNAME, "UpdateOnPeriod", UpdateOnPeriod);
- DBWriteContactSettingDword(NULL, MODNAME, "Period", Period);
- DBWriteContactSettingByte(NULL, MODNAME, "PeriodMeasure", PeriodMeasure);
+ db_set_b(NULL, MODNAME, "UpdateOnStartup", UpdateOnStartup);
+ db_set_b(NULL, MODNAME, "OnlyOnceADay", OnlyOnceADay);
+ db_set_b(NULL, MODNAME, "UpdateOnPeriod", UpdateOnPeriod);
+ db_set_dw(NULL, MODNAME, "Period", Period);
+ db_set_b(NULL, MODNAME, "PeriodMeasure", PeriodMeasure);
Reminder = IsDlgButtonChecked(hwndDlg, IDC_REMINDER);
- DBWriteContactSettingByte(NULL, MODNAME, "Reminder", Reminder);
+ db_set_b(NULL, MODNAME, "Reminder", Reminder);
if ( !ServiceExists(MS_POPUP_ADDPOPUP)) {
for (int i = 1; i < POPUPS; i++) {
mir_snprintf(str, SIZEOF(str), "Popups%dM", i);
- DBWriteContactSettingByte(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hwndDlg, (i+1029))));
+ db_set_b(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hwndDlg, (i+1029))));
}
}
}
@@ -212,14 +212,14 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) {
mir_snprintf(str, SIZEOF(str), "Popups%d", i);
mir_snprintf(str2, SIZEOF(str2), "Popups%dM", i);
- CheckDlgButton(hdlg, (i+40071), (DBGetContactSettingByte(NULL, MODNAME, str, DEFAULT_POPUP_ENABLED)) ? BST_CHECKED: BST_UNCHECKED);
- CheckDlgButton(hdlg, (i+1024), (DBGetContactSettingByte(NULL, MODNAME, str2, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED: BST_UNCHECKED);
+ CheckDlgButton(hdlg, (i+40071), (db_get_b(NULL, MODNAME, str, DEFAULT_POPUP_ENABLED)) ? BST_CHECKED: BST_UNCHECKED);
+ CheckDlgButton(hdlg, (i+1024), (db_get_b(NULL, MODNAME, str2, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED: BST_UNCHECKED);
if (IsDlgButtonChecked(hdlg, (i+40071)))
EnableWindow(GetDlgItem(hdlg, (i+1024)), FALSE);
else if (i > 0)
EnableWindow(GetDlgItem(hdlg, (i+1024)), TRUE);
}
- if (!(DBGetContactSettingDword(NULL, "PopUp", "Actions", 0) & 1) || !ServiceExists(MS_POPUP_REGISTERACTIONS))
+ if (!(db_get_dw(NULL, "PopUp", "Actions", 0) & 1) || !ServiceExists(MS_POPUP_REGISTERACTIONS))
EnableWindow(GetDlgItem(hdlg, (40071)), FALSE);
else
EnableWindow(GetDlgItem(hdlg, (40071)), TRUE);
@@ -227,7 +227,7 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) return TRUE;
}
case WM_SHOWWINDOW:
- if (!(DBGetContactSettingDword(NULL, "PopUp", "Actions", 0) & 1) || !ServiceExists(MS_POPUP_REGISTERACTIONS))
+ if (!(db_get_dw(NULL, "PopUp", "Actions", 0) & 1) || !ServiceExists(MS_POPUP_REGISTERACTIONS))
EnableWindow(GetDlgItem(hdlg, (40071)), FALSE);
else
EnableWindow(GetDlgItem(hdlg, (40071)), TRUE);
@@ -387,28 +387,28 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) ctlColor = SendDlgItemMessage(hdlg, (i+42071), CPM_GETCOLOUR, 0, 0);
PopupsList[i].colorBack = ctlColor;
mir_snprintf(szSetting, SIZEOF(szSetting), "Popups%iBg", i);
- DBWriteContactSettingDword(NULL, MODNAME, szSetting, ctlColor);
+ db_set_dw(NULL, MODNAME, szSetting, ctlColor);
ctlColor = SendDlgItemMessage(hdlg, (i+41071), CPM_GETCOLOUR, 0, 0);
PopupsList[i].colorText = ctlColor;
mir_snprintf(szSetting, SIZEOF(szSetting), "Popups%iTx", i);
- DBWriteContactSettingDword(NULL, MODNAME, szSetting, ctlColor);
+ db_set_dw(NULL, MODNAME, szSetting, ctlColor);
}
//Colors
- DBWriteContactSettingByte(NULL, MODNAME, "DefColors", MyOptions.DefColors);
+ db_set_b(NULL, MODNAME, "DefColors", MyOptions.DefColors);
//Timeout
MyOptions.Timeout = GetDlgItemInt(hdlg, IDC_TIMEOUT_VALUE, 0, TRUE);
- DBWriteContactSettingDword(NULL, MODNAME, "Timeout", MyOptions.Timeout);
+ db_set_dw(NULL, MODNAME, "Timeout", MyOptions.Timeout);
//Left mouse click
- DBWriteContactSettingByte(NULL, MODNAME, "LeftClickAction", MyOptions.LeftClickAction);
+ db_set_b(NULL, MODNAME, "LeftClickAction", MyOptions.LeftClickAction);
//Right mouse click
- DBWriteContactSettingByte(NULL, MODNAME, "RightClickAction", MyOptions.RightClickAction);
+ db_set_b(NULL, MODNAME, "RightClickAction", MyOptions.RightClickAction);
//Notified popups
for (i = 0; i < POPUPS; i++)
{
mir_snprintf(str, SIZEOF(str), "Popups%d", i);
- DBWriteContactSettingByte(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hdlg, (i+40071))));
+ db_set_b(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hdlg, (i+40071))));
mir_snprintf(str2, SIZEOF(str2), "Popups%dM", i);
- DBWriteContactSettingByte(NULL, MODNAME, str2, (BYTE)(IsDlgButtonChecked(hdlg, (i+1024))));
+ db_set_b(NULL, MODNAME, str2, (BYTE)(IsDlgButtonChecked(hdlg, (i+1024))));
}
return TRUE;
} //case PSN_APPLY
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index 3b322ab4be..5717178a6c 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -69,41 +69,41 @@ VOID InitPopupList() int index = 0;
PopupsList[index].ID = index;
PopupsList[index].Icon = SKINICON_OTHER_MIRANDA;
- PopupsList[index].colorBack = DBGetContactSettingDword(NULL, MODNAME, "Popups0Bg", COLOR_BG_FIRSTDEFAULT);
- PopupsList[index].colorText = DBGetContactSettingDword(NULL, MODNAME, "Popups0Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups0Bg", COLOR_BG_FIRSTDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups0Tx", COLOR_TX_DEFAULT);
index = 1;
PopupsList[index].ID = index;
PopupsList[index].Icon = SKINICON_OTHER_MIRANDA;
- PopupsList[index].colorBack = DBGetContactSettingDword(NULL, MODNAME, "Popups1Bg", COLOR_BG_SECONDDEFAULT);
- PopupsList[index].colorText = DBGetContactSettingDword(NULL, MODNAME, "Popups1Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups1Bg", COLOR_BG_SECONDDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups1Tx", COLOR_TX_DEFAULT);
index = 2;
PopupsList[index].ID = index;
PopupsList[index].Icon = SKINICON_OTHER_MIRANDA;
- PopupsList[index].colorBack = DBGetContactSettingDword(NULL, MODNAME, "Popups2Bg", COLOR_BG_FIRSTDEFAULT);
- PopupsList[index].colorText = DBGetContactSettingDword(NULL, MODNAME, "Popups2Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups2Bg", COLOR_BG_FIRSTDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups2Tx", COLOR_TX_DEFAULT);
index = 3;
PopupsList[index].ID = index;
PopupsList[index].Icon = SKINICON_OTHER_MIRANDA;
- PopupsList[index].colorBack = DBGetContactSettingDword(NULL, MODNAME, "Popups3Bg", COLOR_BG_SECONDDEFAULT);
- PopupsList[index].colorText = DBGetContactSettingDword(NULL, MODNAME, "Popups3Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups3Bg", COLOR_BG_SECONDDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups3Tx", COLOR_TX_DEFAULT);
}
VOID LoadOptions()
{
- MyOptions.DefColors = DBGetContactSettingByte(NULL, MODNAME, "DefColors", DEFAULT_COLORS);
- MyOptions.LeftClickAction= DBGetContactSettingByte(NULL, MODNAME, "LeftClickAction", DEFAULT_POPUP_LCLICK);
- MyOptions.RightClickAction = DBGetContactSettingByte(NULL, MODNAME, "RightClickAction", DEFAULT_POPUP_RCLICK);
- MyOptions.Timeout = DBGetContactSettingDword(NULL, MODNAME, "Timeout", DEFAULT_TIMEOUT_VALUE);
- UpdateOnStartup = DBGetContactSettingByte(NULL, MODNAME, "UpdateOnStartup", DEFAULT_UPDATEONSTARTUP);
- OnlyOnceADay = DBGetContactSettingByte(NULL, MODNAME, "OnlyOnceADay", DEFAULT_ONLYONCEADAY);
- UpdateOnPeriod = DBGetContactSettingByte(NULL, MODNAME, "UpdateOnPeriod", DEFAULT_UPDATEONPERIOD);
- Period = DBGetContactSettingDword(NULL, MODNAME, "Period", DEFAULT_PERIOD);
- PeriodMeasure = DBGetContactSettingByte(NULL, MODNAME, "PeriodMeasure", DEFAULT_PERIODMEASURE);
- Reminder = DBGetContactSettingByte(NULL, MODNAME, "Reminder", DEFAULT_REMINDER);
- FileCount = DBGetContactSettingDword(NULL, MODNAME, "FileCount", DEFAULT_FILECOUNT);
+ MyOptions.DefColors = db_get_b(NULL, MODNAME, "DefColors", DEFAULT_COLORS);
+ MyOptions.LeftClickAction= db_get_b(NULL, MODNAME, "LeftClickAction", DEFAULT_POPUP_LCLICK);
+ MyOptions.RightClickAction = db_get_b(NULL, MODNAME, "RightClickAction", DEFAULT_POPUP_RCLICK);
+ MyOptions.Timeout = db_get_dw(NULL, MODNAME, "Timeout", DEFAULT_TIMEOUT_VALUE);
+ UpdateOnStartup = db_get_b(NULL, MODNAME, "UpdateOnStartup", DEFAULT_UPDATEONSTARTUP);
+ OnlyOnceADay = db_get_b(NULL, MODNAME, "OnlyOnceADay", DEFAULT_ONLYONCEADAY);
+ UpdateOnPeriod = db_get_b(NULL, MODNAME, "UpdateOnPeriod", DEFAULT_UPDATEONPERIOD);
+ Period = db_get_dw(NULL, MODNAME, "Period", DEFAULT_PERIOD);
+ PeriodMeasure = db_get_b(NULL, MODNAME, "PeriodMeasure", DEFAULT_PERIODMEASURE);
+ Reminder = db_get_b(NULL, MODNAME, "Reminder", DEFAULT_REMINDER);
+ FileCount = db_get_dw(NULL, MODNAME, "FileCount", DEFAULT_FILECOUNT);
}
BOOL DownloadFile(LPCTSTR tszURL, LPCTSTR tszLocal)
@@ -170,7 +170,7 @@ BOOL Exists(LPCTSTR strName) BOOL IsPluginDisabled(TCHAR* filename)
{
char* fname = mir_t2a(filename);
- int res = DBGetContactSettingByte(NULL, "PluginDisable", fname, 0);
+ int res = db_get_b(NULL, "PluginDisable", fname, 0);
mir_free(fname);
return res;
}
@@ -193,23 +193,23 @@ static void CheckUpdates(void *) if (!Exists(tszRoot))
CreateDirectory(tszRoot, NULL);
Files.clear();
- Reminder = DBGetContactSettingByte(NULL, MODNAME, "Reminder", DEFAULT_REMINDER);
- FileCount = DBGetContactSettingDword(NULL, MODNAME, "FileCount", DEFAULT_FILECOUNT);
+ Reminder = db_get_b(NULL, MODNAME, "Reminder", DEFAULT_REMINDER);
+ FileCount = db_get_dw(NULL, MODNAME, "FileCount", DEFAULT_FILECOUNT);
// Load files info
- DBGetContactSettingTString(NULL, MODNAME, "File_VersionURL", &dbVar);
+ db_get_ts(NULL, MODNAME, "File_VersionURL", &dbVar);
if (lstrcmp(dbVar.ptszVal, NULL) == 0)// URL is not set
{
Title=TranslateT("Pack Updater");
Text = TranslateT("URL for checking updates not found.");
- if ( ServiceExists(MS_POPUP_ADDPOPUP) && DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1) && DBGetContactSettingByte(NULL, MODNAME, "Popups1", DEFAULT_POPUP_ENABLED))
+ if ( ServiceExists(MS_POPUP_ADDPOPUP) && db_get_b(NULL, "PopUp", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups1", DEFAULT_POPUP_ENABLED))
{
Number = 1;
show_popup(0, Title, Text, Number, 0);
}
- else if (DBGetContactSettingByte(NULL, MODNAME, "Popups1M", DEFAULT_MESSAGE_ENABLED))
+ else if (db_get_b(NULL, MODNAME, "Popups1M", DEFAULT_MESSAGE_ENABLED))
MessageBox(NULL, Text, Title, MB_ICONSTOP);
- DBFreeVariant(&dbVar);
+ db_free(&dbVar);
hCheckThread = NULL;
return;
}
@@ -235,20 +235,20 @@ static void CheckUpdates(void *) dbVar.ptszVal = NULL;
mir_snprintf(szKey, SIZEOF(szKey), "File_%d_CurrentVersion", CurrentFile + 1);
- DBGetContactSettingTString(NULL, MODNAME, szKey, &dbVar);
+ db_get_ts(NULL, MODNAME, szKey, &dbVar);
if (lstrcmp(dbVar.ptszVal, NULL) == 0)
{
- DBFreeVariant(&dbVar);
+ db_free(&dbVar);
lstrcpyn(FileInfo.tszCurVer, _T(""), SIZEOF(FileInfo.tszCurVer));
}
else
lstrcpyn(FileInfo.tszCurVer, dbVar.ptszVal, SIZEOF(FileInfo.tszCurVer));
dbVar.ptszVal = NULL;
mir_snprintf(szKey, SIZEOF(szKey), "File_%d_LastVersion", CurrentFile + 1);
- DBGetContactSettingTString(NULL, MODNAME, szKey, &dbVar);
+ db_get_ts(NULL, MODNAME, szKey, &dbVar);
if (lstrcmp(dbVar.ptszVal, NULL) == 0)
{
- DBFreeVariant(&dbVar);
+ db_free(&dbVar);
lstrcpyn(FileInfo.tszLastVer, _T(""), SIZEOF(FileInfo.tszLastVer));
}
else
@@ -268,12 +268,12 @@ static void CheckUpdates(void *) {
Title = TranslateT("Pack Updater");
Text = TranslateT("Name of Update's file is not supported.");
- if ( ServiceExists(MS_POPUP_ADDPOPUP) && DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1) && DBGetContactSettingByte(NULL, MODNAME, "Popups1", DEFAULT_POPUP_ENABLED))
+ if ( ServiceExists(MS_POPUP_ADDPOPUP) && db_get_b(NULL, "PopUp", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups1", DEFAULT_POPUP_ENABLED))
{
Number = 1;
show_popup(0, Title, Text, Number, 0);
}
- else if (DBGetContactSettingByte(NULL, MODNAME, "Popups1M", DEFAULT_MESSAGE_ENABLED))
+ else if (db_get_b(NULL, MODNAME, "Popups1M", DEFAULT_MESSAGE_ENABLED))
MessageBox(NULL, Text, Title, MB_ICONINFORMATION);
continue;
} // end check update name
@@ -352,7 +352,7 @@ static void CheckUpdates(void *) // Save last version
lstrcpyn(Files[CurrentFile].tszLastVer, Files[CurrentFile].tszNewVer, SIZEOF(Files[CurrentFile].tszLastVer));
mir_snprintf(szKey, SIZEOF(szKey), "File_%d_LastVersion", CurrentFile + 1);
- DBWriteContactSettingTString(NULL, MODNAME, szKey, Files[CurrentFile].tszLastVer);
+ db_set_ts(NULL, MODNAME, szKey, Files[CurrentFile].tszLastVer);
} // user have admin's rights
mir_free(tszSysRoot);
mir_free(tszProgFiles);
@@ -372,24 +372,24 @@ static void CheckUpdates(void *) {
Title = TranslateT("Pack Updater");
Text = TranslateT("No updates found.");
- if ( ServiceExists(MS_POPUP_ADDPOPUP) && DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1) && DBGetContactSettingByte(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED))
+ if ( ServiceExists(MS_POPUP_ADDPOPUP) && db_get_b(NULL, "PopUp", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED))
{
Number = 2;
show_popup(0, Title, Text, Number, 0);
}
- else if (DBGetContactSettingByte(NULL, MODNAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
+ else if (db_get_b(NULL, MODNAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
MessageBox(NULL, Text, Title, MB_ICONINFORMATION);
}
if (!FileCount)
{
Title = TranslateT("Pack Updater");
Text = TranslateT("No files for update.");
- if ( ServiceExists(MS_POPUP_ADDPOPUP) && DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1) && DBGetContactSettingByte(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED))
+ if ( ServiceExists(MS_POPUP_ADDPOPUP) && db_get_b(NULL, "PopUp", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED))
{
Number = 2;
show_popup(0, Title, Text, Number, 0);
}
- else if (DBGetContactSettingByte(NULL, MODNAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
+ else if (db_get_b(NULL, MODNAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
MessageBox(NULL, Text, Title, MB_ICONINFORMATION);
}
hCheckThread = NULL;
@@ -401,18 +401,18 @@ void DoCheck(int iFlag) {
Title = TranslateT("Pack Updater");
Text = TranslateT("Update checking already started!");
- if ( ServiceExists(MS_POPUP_ADDPOPUP) && DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1) && DBGetContactSettingByte(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED))
+ if ( ServiceExists(MS_POPUP_ADDPOPUP) && db_get_b(NULL, "PopUp", "ModuleIsEnabled", 1) && db_get_b(NULL, MODNAME, "Popups2", DEFAULT_POPUP_ENABLED))
{
Number = 2;
show_popup(0, Title, Text, Number, 0);
}
- else if (DBGetContactSettingByte(NULL, MODNAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
+ else if (db_get_b(NULL, MODNAME, "Popups2M", DEFAULT_MESSAGE_ENABLED))
MessageBox(NULL, Text, Title, MB_ICONINFORMATION);
}
else if (iFlag)
{
hCheckThread = mir_forkthread(CheckUpdates, 0);
- DBWriteContactSettingDword(NULL, MODNAME, "LastUpdate", time(NULL));
+ db_set_dw(NULL, MODNAME, "LastUpdate", time(NULL));
}
}
@@ -421,7 +421,7 @@ BOOL AllowUpdateOnStartup() if(OnlyOnceADay)
{
time_t now = time(NULL);
- time_t was = DBGetContactSettingDword(NULL, MODNAME, "LastUpdate", 0);
+ time_t was = db_get_dw(NULL, MODNAME, "LastUpdate", 0);
if((now - was) < 86400)
return FALSE;
diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp index 6fc6439e40..a5c4fb5359 100644 --- a/plugins/PasteIt/src/Options.cpp +++ b/plugins/PasteIt/src/Options.cpp @@ -708,7 +708,7 @@ unsigned int Options::GetCodepageCB(HWND hwndCB, bool errorReport, unsigned int void Options::SetDefWeb(int web)
{
defWeb = web;
- DBWriteContactSettingWString(0, MODULE, "defWeb", pasteToWebs[web]->GetName());
+ db_set_ws(0, MODULE, "defWeb", pasteToWebs[web]->GetName());
DefWebPageChanged();
}
@@ -785,11 +785,11 @@ int Options::InitOptions(WPARAM wParam, LPARAM lParam) void Options::Save()
{
- DBWriteContactSettingWString(0, MODULE, "defWeb", pasteToWebs[defWeb]->GetName());
- DBWriteContactSettingDword(0, MODULE, "codepage", codepage);
- DBWriteContactSettingByte(0, MODULE, "autoUTF", autoUTF ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "confDlg", confDlg ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "autoSend", autoSend ? 1 : 0);
+ db_set_ws(0, MODULE, "defWeb", pasteToWebs[defWeb]->GetName());
+ db_set_dw(0, MODULE, "codepage", codepage);
+ db_set_b(0, MODULE, "autoUTF", autoUTF ? 1 : 0);
+ db_set_b(0, MODULE, "confDlg", confDlg ? 1 : 0);
+ db_set_b(0, MODULE, "autoSend", autoSend ? 1 : 0);
for(int i = 0 ; i < PasteToWeb::pages; ++i)
{
char buf[256];
@@ -809,33 +809,33 @@ void Options::Save() forms += it->id + L'=' + it->name + L';';
}
- DBWriteContactSettingWString(0, MODULE, buf, forms.c_str());
+ db_set_ws(0, MODULE, buf, forms.c_str());
strcpy_s(buf + j, 256 - j, "defFormatId");
- DBWriteContactSettingWString(0, MODULE, buf, webOptions[i]->defFormatId.c_str());
+ db_set_ws(0, MODULE, buf, webOptions[i]->defFormatId.c_str());
if(webOptions[i]->isSendFileName)
{
strcpy_s(buf + j, 256 - j, "sendFileName");
- DBWriteContactSettingByte(0, MODULE, buf, webOptions[i]->sendFileName ? 1 : 0);
+ db_set_b(0, MODULE, buf, webOptions[i]->sendFileName ? 1 : 0);
}
if(webOptions[i]->isPublicPaste)
{
strcpy_s(buf + j, 256 - j, "publicPaste");
- DBWriteContactSettingByte(0, MODULE, buf, webOptions[i]->publicPaste ? 1 : 0);
+ db_set_b(0, MODULE, buf, webOptions[i]->publicPaste ? 1 : 0);
}
if(webOptions[i]->isCombo1)
{
strcpy_s(buf + j, 256 - j, "combo1");
- DBWriteContactSettingWString(0, MODULE, buf, webOptions[i]->combo1.c_str());
+ db_set_ws(0, MODULE, buf, webOptions[i]->combo1.c_str());
}
if(webOptions[i]->isPastebin)
{
strcpy_s(buf + j, 256 - j, "pastebinUserKey");
- DBWriteContactSettingWString(0, MODULE, buf, webOptions[i]->pastebinUserKey.c_str());
+ db_set_ws(0, MODULE, buf, webOptions[i]->pastebinUserKey.c_str());
}
}
}
@@ -843,7 +843,7 @@ void Options::Save() void Options::Load()
{
DBVARIANT defWebV;
- if(!DBGetContactSettingWString(0, MODULE, "defWeb", &defWebV))
+ if(!db_get_ws(0, MODULE, "defWeb", &defWebV))
{
for(int i = 0; i < PasteToWeb::pages; ++i)
{
@@ -853,12 +853,12 @@ void Options::Load() break;
}
}
- DBFreeVariant(&defWebV);
+ db_free(&defWebV);
}
- codepage = DBGetContactSettingDword(0, MODULE, "codepage", CP_ACP);
- autoUTF = DBGetContactSettingByte(0, MODULE, "autoUTF", 1) ? true : false;
- confDlg = DBGetContactSettingByte(0, MODULE, "confDlg", 1) ? true : false;
- autoSend = DBGetContactSettingByte(0, MODULE, "autoSend", 0) ? true : false;
+ codepage = db_get_dw(0, MODULE, "codepage", CP_ACP);
+ autoUTF = db_get_b(0, MODULE, "autoUTF", 1) ? true : false;
+ confDlg = db_get_b(0, MODULE, "confDlg", 1) ? true : false;
+ autoSend = db_get_b(0, MODULE, "autoSend", 0) ? true : false;
for(int i = 0 ; i < PasteToWeb::pages; ++i)
{
char buf[256];
@@ -873,7 +873,7 @@ void Options::Load() strcpy_s(buf + j, 256 - j, "formats");
DBVARIANT forms;
- if(!DBGetContactSettingWString(0, MODULE, buf, &forms))
+ if(!db_get_ws(0, MODULE, buf, &forms))
{
webOptions[i]->formats.clear();
int k = 0;
@@ -899,37 +899,37 @@ void Options::Load() ++k;
}
- DBFreeVariant(&forms);
+ db_free(&forms);
}
strcpy_s(buf + j, 256 - j, "defFormatId");
DBVARIANT defForm;
- if(!DBGetContactSettingWString(0, MODULE, buf, &defForm))
+ if(!db_get_ws(0, MODULE, buf, &defForm))
{
webOptions[i]->defFormatId = defForm.pwszVal;
- DBFreeVariant(&defForm);
+ db_free(&defForm);
}
if(webOptions[i]->isSendFileName)
{
strcpy_s(buf + j, 256 - j, "sendFileName");
- webOptions[i]->sendFileName = DBGetContactSettingByte(0, MODULE, buf, 1) ? true : false;
+ webOptions[i]->sendFileName = db_get_b(0, MODULE, buf, 1) ? true : false;
}
if(webOptions[i]->isPublicPaste)
{
strcpy_s(buf + j, 256 - j, "publicPaste");
- webOptions[i]->publicPaste = DBGetContactSettingByte(0, MODULE, buf, 0) ? true : false;
+ webOptions[i]->publicPaste = db_get_b(0, MODULE, buf, 0) ? true : false;
}
if(webOptions[i]->isCombo1)
{
strcpy_s(buf + j, 256 - j, "combo1");
DBVARIANT combo1;
- if(!DBGetContactSettingWString(0, MODULE, buf, &combo1))
+ if(!db_get_ws(0, MODULE, buf, &combo1))
{
webOptions[i]->combo1 = combo1.pwszVal;
- DBFreeVariant(&combo1);
+ db_free(&combo1);
}
}
@@ -937,10 +937,10 @@ void Options::Load() {
strcpy_s(buf + j, 256 - j, "pastebinUserKey");
DBVARIANT pastebinUserKey;
- if(!DBGetContactSettingWString(0, MODULE, buf, &pastebinUserKey))
+ if(!db_get_ws(0, MODULE, buf, &pastebinUserKey))
{
webOptions[i]->pastebinUserKey = pastebinUserKey.pwszVal;
- DBFreeVariant(&pastebinUserKey);
+ db_free(&pastebinUserKey);
}
}
}
diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index 7600d2a4bb..b2a5196a94 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -124,7 +124,7 @@ void PasteIt(HANDLE hContact, int mode) char *szProto = GetContactProto(hContact);
if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND)
{
- BOOL isChat = DBGetContactSettingByte(hContact, szProto, "ChatRoom", 0);
+ BOOL isChat = db_get_b(hContact, szProto, "ChatRoom", 0);
if(Options::instance->autoSend)
{
if(!isChat)
@@ -328,26 +328,17 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) char *szProto = GetContactProto((HANDLE)wParam);
if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND)
- bIsContact = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) ? true : false;
-
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS;
-
- if (!bIsContact) mi.flags |= CMIF_HIDDEN;
- else mi.flags &= ~CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenu, (LPARAM)&mi);
+ bIsContact = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM) != 0;
+ Menu_ShowItem(hContactMenu, bIsContact);
return 0;
}
INT_PTR ContactMenuService(WPARAM wParam, LPARAM lParam)
{
if(lParam >= DEF_PAGES_START)
- {
Options::instance->SetDefWeb(lParam - DEF_PAGES_START);
- }
- else
- {
+ else {
HANDLE hContact = (HANDLE)wParam;
PasteIt(hContact, lParam);
}
@@ -437,7 +428,7 @@ int WindowEvent(WPARAM wParam, MessageWindowEventData* lParam) char *szProto = GetContactProto(lParam->hContact);
if (szProto && (INT_PTR)szProto != CALLSERVICE_NOTFOUND)
{
- if(DBGetContactSettingByte(lParam->hContact, szProto, "ChatRoom", 0))
+ if(db_get_b(lParam->hContact, szProto, "ChatRoom", 0))
{
(*contactWindows)[lParam->hContact] = lParam->hwndInput;
}
diff --git a/plugins/Ping/src/icmp.cpp b/plugins/Ping/src/icmp.cpp index bdf8776d22..eeab3cf567 100644 --- a/plugins/Ping/src/icmp.cpp +++ b/plugins/Ping/src/icmp.cpp @@ -25,9 +25,9 @@ ICMP::ICMP(): if (hDLL == 0 || pIcmpCreateFile == 0 || pIcmpCloseHandle == 0 || pIcmpSendEcho2 == 0)
return;
else
- DBWriteContactSettingString(0, PLUG, "PingLib", "ICMP.DLL"); // for debugging
+ db_set_s(0, PLUG, "PingLib", "ICMP.DLL"); // for debugging
} else
- DBWriteContactSettingString(0, PLUG, "PingLib", "IPHLPAPI.DLL"); // for debugging
+ db_set_s(0, PLUG, "PingLib", "IPHLPAPI.DLL"); // for debugging
WSAData wsaData;
if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0) {
diff --git a/plugins/Ping/src/log.cpp b/plugins/Ping/src/log.cpp index c95c49a910..ce4d90d752 100644 --- a/plugins/Ping/src/log.cpp +++ b/plugins/Ping/src/log.cpp @@ -31,13 +31,13 @@ INT_PTR Log(WPARAM wParam, LPARAM lParam) { INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv;
char *filename = (char *)lParam;
- if(DBGetContactSetting(0, PLUG, "LogFilename", &dbv)) {
+ if(db_get(0, PLUG, "LogFilename", &dbv)) {
CallService(MS_DB_GETPROFILEPATH, (WPARAM)wParam, (LPARAM)filename);
strcat(filename, "\\");
strcat(filename, "ping_log.txt");
} else {
strncpy(filename, dbv.pszVal, wParam);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
((char *)lParam)[wParam - 1] = 0;
@@ -46,7 +46,7 @@ INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) { }
INT_PTR SetLogFilename(WPARAM wParam, LPARAM lParam) {
- DBWriteContactSettingString(0, PLUG, "LogFilename", (char *)lParam);
+ db_set_s(0, PLUG, "LogFilename", (char *)lParam);
return 0;
}
diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index c4433e7a9d..34e93a4c0e 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -580,50 +580,50 @@ int PingOptInit(WPARAM wParam,LPARAM lParam) }
void LoadOptions() {
- options.ping_period = DBGetContactSettingDword(NULL, PLUG, "PingPeriod", DEFAULT_PING_PERIOD);
+ options.ping_period = db_get_dw(NULL, PLUG, "PingPeriod", DEFAULT_PING_PERIOD);
- options.ping_timeout = DBGetContactSettingDword(NULL, PLUG, "PingTimeout", DEFAULT_PING_TIMEOUT);
+ options.ping_timeout = db_get_dw(NULL, PLUG, "PingTimeout", DEFAULT_PING_TIMEOUT);
CallService(PLUG "/SetPingTimeout", (WPARAM)options.ping_timeout, 0);
- options.show_popup = (DBGetContactSettingByte(NULL, PLUG, "ShowPopup", DEFAULT_SHOW_POPUP ? 1 : 0) == 1);
- options.show_popup2 = (DBGetContactSettingByte(NULL, PLUG, "ShowPopup2", DEFAULT_SHOW_POPUP2 ? 1 : 0) == 1);
- options.block_reps = (DBGetContactSettingByte(NULL, PLUG, "BlockReps", DEFAULT_BLOCK_REPS ? 1 : 0) == 1);
- options.logging = (DBGetContactSettingByte(NULL, PLUG, "LoggingEnabled", DEFAULT_LOGGING_ENABLED ? 1 : 0) == 1);
+ options.show_popup = (db_get_b(NULL, PLUG, "ShowPopup", DEFAULT_SHOW_POPUP ? 1 : 0) == 1);
+ options.show_popup2 = (db_get_b(NULL, PLUG, "ShowPopup2", DEFAULT_SHOW_POPUP2 ? 1 : 0) == 1);
+ options.block_reps = (db_get_b(NULL, PLUG, "BlockReps", DEFAULT_BLOCK_REPS ? 1 : 0) == 1);
+ options.logging = (db_get_b(NULL, PLUG, "LoggingEnabled", DEFAULT_LOGGING_ENABLED ? 1 : 0) == 1);
- options.no_test_icon = (DBGetContactSettingByte(NULL, PLUG, "NoTestStatus", DEFAULT_NO_TEST_ICON ? 1 : 0) == 1);
+ options.no_test_icon = (db_get_b(NULL, PLUG, "NoTestStatus", DEFAULT_NO_TEST_ICON ? 1 : 0) == 1);
- options.indent = DBGetContactSettingWord(NULL, PLUG, "Indent", 0);
- options.row_height = DBGetContactSettingWord(NULL, PLUG, "RowHeight", GetSystemMetrics(SM_CYSMICON));
+ options.indent = db_get_w(NULL, PLUG, "Indent", 0);
+ options.row_height = db_get_w(NULL, PLUG, "RowHeight", GetSystemMetrics(SM_CYSMICON));
- options.retries = DBGetContactSettingDword(NULL, PLUG, "Retries", 0);
+ options.retries = db_get_dw(NULL, PLUG, "Retries", 0);
CallService(PLUG "/GetLogFilename", (WPARAM)MAX_PATH, (LPARAM)options.log_filename);
ICMP::get_instance()->set_timeout(options.ping_timeout * 1000);
- options.attach_to_clist = (DBGetContactSettingByte(NULL, PLUG, "AttachToClist", DEFAULT_ATTACH_TO_CLIST ? 1 : 0) == 1);
- options.log_csv = (DBGetContactSettingByte(NULL, PLUG, "LogCSV", 0) == 1);
+ options.attach_to_clist = (db_get_b(NULL, PLUG, "AttachToClist", DEFAULT_ATTACH_TO_CLIST ? 1 : 0) == 1);
+ options.log_csv = (db_get_b(NULL, PLUG, "LogCSV", 0) == 1);
}
void SaveOptions() {
- DBWriteContactSettingDword(NULL, PLUG, "PingPeriod", options.ping_period);
- DBWriteContactSettingDword(NULL, PLUG, "PingTimeout", options.ping_timeout);
+ db_set_dw(NULL, PLUG, "PingPeriod", options.ping_period);
+ db_set_dw(NULL, PLUG, "PingTimeout", options.ping_timeout);
CallService(PLUG "/SetPingTimeout", (WPARAM)options.ping_timeout, 0);
- DBWriteContactSettingByte(NULL, PLUG, "ShowPopup", options.show_popup ? 1 : 0);
- DBWriteContactSettingByte(NULL, PLUG, "ShowPopup2", options.show_popup2 ? 1 : 0);
- DBWriteContactSettingByte(NULL, PLUG, "BlockReps", options.block_reps ? 1 : 0);
- DBWriteContactSettingByte(NULL, PLUG, "LoggingEnabled", options.logging ? 1 : 0);
+ db_set_b(NULL, PLUG, "ShowPopup", options.show_popup ? 1 : 0);
+ db_set_b(NULL, PLUG, "ShowPopup2", options.show_popup2 ? 1 : 0);
+ db_set_b(NULL, PLUG, "BlockReps", options.block_reps ? 1 : 0);
+ db_set_b(NULL, PLUG, "LoggingEnabled", options.logging ? 1 : 0);
- DBWriteContactSettingByte(NULL, PLUG, "NoTestStatus", options.no_test_icon ? 1 : 0);
+ db_set_b(NULL, PLUG, "NoTestStatus", options.no_test_icon ? 1 : 0);
- DBWriteContactSettingWord(NULL, PLUG, "Indent", options.indent);
- DBWriteContactSettingWord(NULL, PLUG, "RowHeight", options.row_height);
+ db_set_w(NULL, PLUG, "Indent", options.indent);
+ db_set_w(NULL, PLUG, "RowHeight", options.row_height);
- DBWriteContactSettingDword(NULL, PLUG, "Retries", (DWORD)options.retries);
+ db_set_dw(NULL, PLUG, "Retries", (DWORD)options.retries);
CallService(PLUG "/SetLogFilename", (WPARAM)MAX_PATH, (LPARAM)options.log_filename);
ICMP::get_instance()->set_timeout(options.ping_timeout * 1000);
- DBWriteContactSettingByte(NULL, PLUG, "AttachToClist", options.attach_to_clist ? 1 : 0);
- DBWriteContactSettingByte(NULL, PLUG, "LogCSV", options.log_csv ? 1 : 0);
+ db_set_b(NULL, PLUG, "AttachToClist", options.attach_to_clist ? 1 : 0);
+ db_set_b(NULL, PLUG, "LogCSV", options.log_csv ? 1 : 0);
}
diff --git a/plugins/Ping/src/ping.cpp b/plugins/Ping/src/ping.cpp index 7a2ba0a188..f107f5a9d3 100644 --- a/plugins/Ping/src/ping.cpp +++ b/plugins/Ping/src/ping.cpp @@ -101,10 +101,10 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) { hFillListEvent = HookEvent(PLUG "/ListReload", FillList);
- if(!DBGetContactSettingByte(0, PLUG, "PingPlugImport", 0)) {
- if(DBGetContactSettingDword(0, "PingPlug", "NumEntries", 0)) {
+ if(!db_get_b(0, PLUG, "PingPlugImport", 0)) {
+ if(db_get_dw(0, "PingPlug", "NumEntries", 0)) {
import_ping_addresses();
- DBWriteContactSettingByte(0, PLUG, "PingPlugImport", 1);
+ db_set_b(0, PLUG, "PingPlugImport", 1);
}
}
@@ -126,7 +126,7 @@ extern "C" __declspec(dllexport) int Load(void) //return 1;
use_raw_ping = false;
//}
- DBWriteContactSettingByte(0, PLUG, "UsingRawSockets", (BYTE)use_raw_ping);
+ db_set_b(0, PLUG, "UsingRawSockets", (BYTE)use_raw_ping);
DuplicateHandle( GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &mainThread, THREAD_SET_CONTEXT, FALSE, 0 );
hWakeEvent = CreateEvent(NULL, FALSE, FALSE, _T("Local\\ThreadWaitEvent"));
diff --git a/plugins/Ping/src/pinggraph.cpp b/plugins/Ping/src/pinggraph.cpp index c7edf260ef..b655cdc24f 100644 --- a/plugins/Ping/src/pinggraph.cpp +++ b/plugins/Ping/src/pinggraph.cpp @@ -243,7 +243,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar {
char buff[30];
sprintf(buff, "WindowHandle%d", wd->item_id);
- DBWriteContactSettingDword(0, PLUG, buff, 0);
+ db_set_dw(0, PLUG, buff, 0);
}
delete wd;
}
@@ -256,7 +256,7 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) {
char buff[30];
sprintf(buff, "WindowHandle%d", (DWORD)wParam);
- HWND hGraphWnd = (HWND)DBGetContactSettingDword(0, PLUG, buff, 0);
+ HWND hGraphWnd = (HWND)db_get_dw(0, PLUG, buff, 0);
if(hGraphWnd) {
ShowWindow(hGraphWnd, SW_SHOW);
SetWindowPos(hGraphWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
@@ -292,10 +292,10 @@ INT_PTR ShowGraph(WPARAM wParam, LPARAM lParam) { wd->item_id = (DWORD)wParam; // wParam is destination id
wd->hwnd_chk_grid = 0;
wd->hwnd_chk_stat = 0;
- wd->show_grid = DBGetContactSettingByte(0, PLUG, "ShowGridLines", 0) ? true : false;
- wd->show_stat = DBGetContactSettingByte(0, PLUG, "ShowStats", 1) ? true : false;
+ wd->show_grid = db_get_b(0, PLUG, "ShowGridLines", 0) ? true : false;
+ wd->show_stat = db_get_b(0, PLUG, "ShowStats", 1) ? true : false;
- DBWriteContactSettingDword(0, PLUG, buff, (DWORD)hGraphWnd);
+ db_set_dw(0, PLUG, buff, (DWORD)hGraphWnd);
SetWindowLongPtr(hGraphWnd, GWLP_USERDATA, (LONG_PTR)wd);
@@ -316,11 +316,11 @@ void graphs_cleanup() { for(int i = 0; i < list_size; i++) {
sprintf(buff, "WindowHandle%d", i);
- if(hwnd = (HWND)DBGetContactSettingDword(0, PLUG, buff, 0)) {
+ if(hwnd = (HWND)db_get_dw(0, PLUG, buff, 0)) {
DestroyWindow(hwnd);
- DBWriteContactSettingDword(0, PLUG, buff, 0);
+ db_set_dw(0, PLUG, buff, 0);
sprintf(buff, "WindowWasOpen%d", i);
- DBWriteContactSettingByte(0, PLUG, buff, 1);
+ db_set_b(0, PLUG, buff, 1);
}
}
}
@@ -332,10 +332,10 @@ void graphs_init() { CallService(PLUG "/GetPingList", 0, (LPARAM)&pl);
for(pinglist_it i = pl.begin(); i != pl.end(); ++i) {
sprintf(buff, "WindowHandle%d", i->item_id); // clean up from possible crash
- DBWriteContactSettingDword(0, PLUG, buff, 0);
+ db_set_dw(0, PLUG, buff, 0);
sprintf(buff, "WindowWasOpen%d", i->item_id); // restore windows that were open on shutdown
- if(DBGetContactSettingByte(0, PLUG, buff, 0)) {
- DBWriteContactSettingByte(0, PLUG, buff, 0);
+ if(db_get_b(0, PLUG, buff, 0)) {
+ db_set_b(0, PLUG, buff, 0);
ShowGraph((WPARAM)i->item_id, (LPARAM)i->pszLabel);
}
}
diff --git a/plugins/Ping/src/pinglist.cpp b/plugins/Ping/src/pinglist.cpp index 45873da685..517e984490 100644 --- a/plugins/Ping/src/pinglist.cpp +++ b/plugins/Ping/src/pinglist.cpp @@ -61,26 +61,26 @@ void write_ping_address(PINGADDRESS &i) if(i.item_id == 0) {
i.item_id = NextID++;
- DBWriteContactSettingDword(0, PLUG, "NextID", NextID);
+ db_set_dw(0, PLUG, "NextID", NextID);
}
- DBWriteContactSettingDword(0, buff, "Id", i.item_id);
- DBWriteContactSettingString(0, buff, "Address", i.pszName);
- DBWriteContactSettingString(0, buff, "Label", i.pszLabel);
- DBWriteContactSettingWord(0, buff, "Status", i.status);
- DBWriteContactSettingDword(0, buff, "Port", i.port);
- DBWriteContactSettingString(0, buff, "Proto", i.pszProto);
+ db_set_dw(0, buff, "Id", i.item_id);
+ db_set_s(0, buff, "Address", i.pszName);
+ db_set_s(0, buff, "Label", i.pszLabel);
+ db_set_w(0, buff, "Status", i.status);
+ db_set_dw(0, buff, "Port", i.port);
+ db_set_s(0, buff, "Proto", i.pszProto);
if(strlen(i.pszCommand))
- DBWriteContactSettingString(0, buff, "Command", i.pszCommand);
+ db_set_s(0, buff, "Command", i.pszCommand);
else
- DBDeleteContactSetting(0, buff, "Command");
+ db_unset(0, buff, "Command");
if(strlen(i.pszParams))
- DBWriteContactSettingString(0, buff, "CommandParams", i.pszParams);
+ db_set_s(0, buff, "CommandParams", i.pszParams);
else
- DBDeleteContactSetting(0, buff, "CommandParams");
- DBWriteContactSettingWord(0, buff, "SetStatus", i.set_status);
- DBWriteContactSettingWord(0, buff, "GetStatus", i.get_status);
- DBWriteContactSettingWord(0, buff, "Index", i.index);
+ db_unset(0, buff, "CommandParams");
+ db_set_w(0, buff, "SetStatus", i.set_status);
+ db_set_w(0, buff, "GetStatus", i.get_status);
+ db_set_w(0, buff, "Index", i.index);
}
// call with list_cs locked
@@ -100,9 +100,9 @@ void write_ping_addresses() do {
found = false;
sprintf(buff, "PING_DEST_%d", index++);
- if(DBGetContactSettingDword(0, buff, "Id", 0) != 0) {
+ if(db_get_dw(0, buff, "Id", 0) != 0) {
found = true;
- DBWriteContactSettingDword(0, buff, "Id", 0);
+ db_set_dw(0, buff, "Id", 0);
}
} while(found);
}
@@ -114,52 +114,52 @@ bool read_ping_address(PINGADDRESS &pa) { sprintf(buff, "PING_DEST_%d", index);
// return if not more contacts, or only deleted contacts remaining
- if((pa.item_id = DBGetContactSettingDword(0, buff, "Id", 0)) == 0) return false;
+ if((pa.item_id = db_get_dw(0, buff, "Id", 0)) == 0) return false;
DBVARIANT dbv;
- if(!DBGetContactSetting(0, buff, "Address", &dbv)) {
+ if(!db_get(0, buff, "Address", &dbv)) {
strncpy(pa.pszName, dbv.pszVal, MAX_PINGADDRESS_STRING_LENGTH);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else return false;
- if(!DBGetContactSetting(0, buff, "Label", &dbv)) {
+ if(!db_get(0, buff, "Label", &dbv)) {
strncpy(pa.pszLabel, dbv.pszVal, MAX_PINGADDRESS_STRING_LENGTH);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else return false;
- pa.status = DBGetContactSettingWord(0, buff, "Status", PS_NOTRESPONDING);
+ pa.status = db_get_w(0, buff, "Status", PS_NOTRESPONDING);
if(pa.status != PS_DISABLED) pa.status = PS_NOTRESPONDING;
- pa.port = (int)DBGetContactSettingDword(0, buff, "Port", -1);
+ pa.port = (int)db_get_dw(0, buff, "Port", -1);
- if(!DBGetContactSetting(0, buff, "Proto", &dbv)) {
+ if(!db_get(0, buff, "Proto", &dbv)) {
strncpy(pa.pszProto, dbv.pszVal, MAX_PINGADDRESS_STRING_LENGTH);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else pa.pszProto[0] = '\0';
- if(!DBGetContactSetting(0, buff, "Command", &dbv)) {
+ if(!db_get(0, buff, "Command", &dbv)) {
strncpy(pa.pszCommand, dbv.pszVal, MAX_PATH);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else
pa.pszCommand[0] = '\0';
- if(!DBGetContactSetting(0, buff, "CommandParams", &dbv)) {
+ if(!db_get(0, buff, "CommandParams", &dbv)) {
strncpy(pa.pszParams, dbv.pszVal, MAX_PATH);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else
pa.pszParams[0] = '\0';
- pa.set_status = DBGetContactSettingWord(0, buff, "SetStatus", ID_STATUS_ONLINE);
- pa.get_status = DBGetContactSettingWord(0, buff, "GetStatus", ID_STATUS_OFFLINE);
+ pa.set_status = db_get_w(0, buff, "SetStatus", ID_STATUS_ONLINE);
+ pa.get_status = db_get_w(0, buff, "GetStatus", ID_STATUS_OFFLINE);
pa.responding = false;
pa.round_trip_time = 0;
pa.miss_count = 0;
- pa.index = DBGetContactSettingWord(0, buff, "Index", 0);
+ pa.index = db_get_w(0, buff, "Index", 0);
pa.index = index;
if(pa.item_id >= NextID) {
NextID = pa.item_id + 1;
- DBWriteContactSettingDword(0, PLUG, "NextID", NextID);
+ db_set_dw(0, PLUG, "NextID", NextID);
}
return true;
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index bf2e0053c8..41ed11239a 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -399,18 +399,18 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if((dis->itemState & ODS_SELECTED && dis->itemState & ODS_FOCUS)
|| (context_point_valid && (x >= dis->rcItem.left && x <= dis->rcItem.right) && (y >= dis->rcItem.top && y <= dis->rcItem.bottom)))
{
- tcol = DBGetContactSettingDword(NULL,"CLC","SelBkColour", GetSysColor(COLOR_HIGHLIGHT));
+ tcol = db_get_dw(NULL,"CLC","SelBkColour", GetSysColor(COLOR_HIGHLIGHT));
SetBkColor(dis->hDC, tcol);
FillRect(dis->hDC, &dis->rcItem, (ttbrush = CreateSolidBrush(tcol)));
- tcol = DBGetContactSettingDword(NULL,"CLC","SelTextColour", GetSysColor(COLOR_HIGHLIGHTTEXT));
+ tcol = db_get_dw(NULL,"CLC","SelTextColour", GetSysColor(COLOR_HIGHLIGHTTEXT));
SetTextColor(dis->hDC, tcol);
} else {
tcol = bk_col;
SetBkColor(dis->hDC, tcol);
FillRect(dis->hDC, &dis->rcItem, (ttbrush = CreateSolidBrush(tcol)));
- tcol = DBGetContactSettingDword(NULL, PLUG, "FontCol", GetSysColor(COLOR_WINDOWTEXT));
+ tcol = db_get_dw(NULL, PLUG, "FontCol", GetSysColor(COLOR_WINDOWTEXT));
SetTextColor(dis->hDC, tcol);
}
@@ -527,7 +527,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar (WS_VISIBLE | WS_CHILD | LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_NOTIFY)
& ~WS_BORDER, 0, 0, 0, 0, hwnd, NULL, hInst,0);
- if (DBGetContactSettingByte(NULL,"CList","Transparent",0))
+ if (db_get_b(NULL,"CList","Transparent",0))
{
if(ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
@@ -536,7 +536,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
#endif
#ifdef LWA_ALPHA
- if (MySetLayeredWindowAttributes) MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), (BYTE)DBGetContactSettingByte(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
+ if (MySetLayeredWindowAttributes) MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), (BYTE)db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
#endif
}
}
@@ -551,15 +551,15 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_ACTIVATE:
if(wParam==WA_INACTIVE) {
if((HWND)wParam!=hwnd)
- if(DBGetContactSettingByte(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT))
+ if(db_get_b(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT))
if(transparentFocus)
SetTimer(hwnd, TM_AUTOALPHA,250,NULL);
}
else {
- if(DBGetContactSettingByte(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT)) {
+ if(db_get_b(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT)) {
KillTimer(hwnd,TM_AUTOALPHA);
#ifdef LWA_ALPHA
- if (MySetLayeredWindowAttributes) MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), (BYTE)DBGetContactSettingByte(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
+ if (MySetLayeredWindowAttributes) MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), (BYTE)db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
#endif
transparentFocus=1;
}
@@ -567,10 +567,10 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar return DefWindowProc(hwnd,msg,wParam,lParam);
case WM_SETCURSOR:
- if(DBGetContactSettingByte(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT)) {
+ if(db_get_b(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT)) {
if (!transparentFocus && GetForegroundWindow()!=hwnd && MySetLayeredWindowAttributes) {
#ifdef LWA_ALPHA
- MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), (BYTE)DBGetContactSettingByte(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
+ MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), (BYTE)db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
#endif
transparentFocus=1;
SetTimer(hwnd, TM_AUTOALPHA,250,NULL);
@@ -598,8 +598,8 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar { //change
transparentFocus=inwnd;
#ifdef LWA_ALPHA
- if(transparentFocus) MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), (BYTE)DBGetContactSettingByte(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
- else MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), (BYTE)DBGetContactSettingByte(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
+ if(transparentFocus) MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), (BYTE)db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
+ else MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), (BYTE)db_get_b(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
#endif
}
if(!transparentFocus) KillTimer(hwnd,TM_AUTOALPHA);
@@ -612,14 +612,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar static int noRecurse=0;
if(lParam) break;
if(noRecurse) break;
- if(!DBGetContactSettingByte(NULL,"CLUI","FadeInOut",0) || !IsWinVer2000Plus()) break;
+ if(!db_get_b(NULL,"CLUI","FadeInOut",0) || !IsWinVer2000Plus()) break;
#ifdef WS_EX_LAYERED
if(GetWindowLong(hwnd,GWL_EXSTYLE)&WS_EX_LAYERED) {
DWORD thisTick,startTick;
int sourceAlpha,destAlpha;
if(wParam) {
sourceAlpha=0;
- destAlpha=(BYTE)DBGetContactSettingByte(NULL,"CList","Alpha",SETTING_AUTOALPHA_DEFAULT);
+ destAlpha=(BYTE)db_get_b(NULL,"CList","Alpha",SETTING_AUTOALPHA_DEFAULT);
#ifdef LWA_ALPHA
MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), 0, LWA_ALPHA);
#endif
@@ -628,7 +628,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar noRecurse=0;
}
else {
- sourceAlpha=(BYTE)DBGetContactSettingByte(NULL,"CList","Alpha",SETTING_AUTOALPHA_DEFAULT);
+ sourceAlpha=(BYTE)db_get_b(NULL,"CList","Alpha",SETTING_AUTOALPHA_DEFAULT);
destAlpha=0;
}
for(startTick=GetTickCount();;) {
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index c87793fee8..9372f22eb0 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -240,30 +240,30 @@ void import_ping_address(int index, PINGADDRESS &pa) { DBVARIANT dbv;
char buf[256];
mir_snprintf(buf, 256, "Address%d", index);
- if(!DBGetContactSetting(0, "PingPlug", buf, &dbv)) {
+ if(!db_get(0, "PingPlug", buf, &dbv)) {
strncpy(pa.pszName, dbv.pszVal, MAX_PINGADDRESS_STRING_LENGTH);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else
strcpy(pa.pszName, Translate("Unknown Address"));
mir_snprintf(buf, 256, "Label%d", index);
- if(!DBGetContactSetting(0, "PingPlug", buf, &dbv)) {
+ if(!db_get(0, "PingPlug", buf, &dbv)) {
strncpy(pa.pszLabel, dbv.pszVal, MAX_PINGADDRESS_STRING_LENGTH);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else
strcpy(pa.pszLabel, Translate("Unknown"));
mir_snprintf(buf, 256, "Port%d", index);
- pa.port = (int)DBGetContactSettingDword(0, "PingPlug", buf, -1);
+ pa.port = (int)db_get_dw(0, "PingPlug", buf, -1);
mir_snprintf(buf, 256, "Proto%d", index);
- if(!DBGetContactSetting(0, "PingPlug", buf, &dbv)) {
+ if(!db_get(0, "PingPlug", buf, &dbv)) {
strncpy(pa.pszProto, dbv.pszVal, MAX_PINGADDRESS_STRING_LENGTH);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(buf, 256, "Status%d", index);
- pa.set_status = DBGetContactSettingWord(0, "PingPlug", buf, ID_STATUS_ONLINE);
+ pa.set_status = db_get_w(0, "PingPlug", buf, ID_STATUS_ONLINE);
mir_snprintf(buf, 256, "Status2%d", index);
- pa.get_status = DBGetContactSettingWord(0, "PingPlug", buf, ID_STATUS_OFFLINE);
+ pa.get_status = db_get_w(0, "PingPlug", buf, ID_STATUS_OFFLINE);
} else
pa.pszProto[0] = '\0';
@@ -277,7 +277,7 @@ void import_ping_address(int index, PINGADDRESS &pa) { pa.item_id = 0;
mir_snprintf(buf, 256, "Enabled%d", index);
- if(DBGetContactSettingByte(0, "PingPlug", buf, 1) == 1)
+ if(db_get_b(0, "PingPlug", buf, 1) == 1)
pa.status = PS_NOTRESPONDING;
else
pa.status = PS_DISABLED;
@@ -286,7 +286,7 @@ void import_ping_address(int index, PINGADDRESS &pa) { // read in addresses from old pingplug
void import_ping_addresses()
{
- int count = DBGetContactSettingDword(0, "PingPlug", "NumEntries", 0);
+ int count = db_get_dw(0, "PingPlug", "NumEntries", 0);
PINGADDRESS pa;
EnterCriticalSection(&list_cs);
diff --git a/plugins/PluginUpdater/src/Common.h b/plugins/PluginUpdater/src/Common.h index f0ffa25310..0ec714323c 100644 --- a/plugins/PluginUpdater/src/Common.h +++ b/plugins/PluginUpdater/src/Common.h @@ -163,9 +163,9 @@ int SafeCreateFilePath(TCHAR *pFolder); #if MIRANDA_VER < 0x0A00
-#define db_free(A) DBFreeVariant(A)
-#define db_get_b(A,B,C,D) DBGetContactSettingByte(A,B,C,D)
-#define db_set_s(A,B,C,D) DBWriteContactSettingString(A,B,C,D)
+#define db_free(A) db_free(A)
+#define db_get_b(A,B,C,D) db_get_b(A,B,C,D)
+#define db_set_s(A,B,C,D) db_set_s(A,B,C,D)
template<class T> class mir_ptr
{
diff --git a/plugins/PluginUpdater/src/Events.cpp b/plugins/PluginUpdater/src/Events.cpp index 4e2eb89ca1..a82e0261b8 100644 --- a/plugins/PluginUpdater/src/Events.cpp +++ b/plugins/PluginUpdater/src/Events.cpp @@ -36,9 +36,9 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) opts.bSilent = true;
- int iRestartCount = DBGetContactSettingByte(NULL, MODNAME, "RestartCount", 2);
+ int iRestartCount = db_get_b(NULL, MODNAME, "RestartCount", 2);
if (iRestartCount > 0)
- DBWriteContactSettingByte(NULL, MODNAME, "RestartCount", iRestartCount-1);
+ db_set_b(NULL, MODNAME, "RestartCount", iRestartCount-1);
else
EmptyFolder(0, TRUE); // silently
diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp index 1170b44f1e..0816172bf8 100644 --- a/plugins/PluginUpdater/src/Notifications.cpp +++ b/plugins/PluginUpdater/src/Notifications.cpp @@ -116,10 +116,10 @@ static void MakePopupAction(POPUPACTION &pa, int id) void ShowPopup(HWND hDlg, LPCTSTR ptszTitle, LPCTSTR ptszText, int Number, int ActType)
{
- if ( !ServiceExists(MS_POPUP_ADDPOPUP) || !DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1) ) {
+ if ( !ServiceExists(MS_POPUP_ADDPOPUP) || !db_get_b(NULL, "PopUp", "ModuleIsEnabled", 1) ) {
char setting[100];
mir_snprintf(setting, SIZEOF(setting), "Popups%dM", Number);
- if (DBGetContactSettingByte(NULL, MODNAME, setting, DEFAULT_MESSAGE_ENABLED)) {
+ if (db_get_b(NULL, MODNAME, setting, DEFAULT_MESSAGE_ENABLED)) {
int iMsgType;
switch( Number ) {
case 1: iMsgType = MB_ICONSTOP; break;
@@ -372,7 +372,7 @@ LBL_Exit: SafeDeleteFile(p.File.tszDiskPath); // remove .zip after successful update
}
- DBWriteContactSettingByte(NULL, MODNAME, "RestartCount", 2);
+ db_set_b(NULL, MODNAME, "RestartCount", 2);
CallFunctionAsync(RestartMe, 0);
goto LBL_Exit;
}
diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index 32ef2068ab..35970f383c 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -60,7 +60,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA CheckDlgButton(hwndDlg, IDC_UPDATEICONS, opts.bUpdateIcons);
EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMURL), FALSE);
- if ( DBGetContactSettingString(NULL, MODNAME, "UpdateURL", &dbv)) {
+ if ( db_get_s(NULL, MODNAME, "UpdateURL", &dbv)) {
SetDlgItemText(hwndDlg, IDC_CUSTOMURL, _T(DEFAULT_UPDATE_URL));
CheckDlgButton(hwndDlg, IDC_STABLE, TRUE);
}
@@ -147,13 +147,13 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA InitTimer();
- DBWriteContactSettingByte(NULL, MODNAME, "UpdateOnStartup", opts.bUpdateOnStartup);
- DBWriteContactSettingByte(NULL, MODNAME, "OnlyOnceADay", opts.bOnlyOnceADay);
- DBWriteContactSettingByte(NULL, MODNAME, "UpdateOnPeriod", opts.bUpdateOnPeriod);
- DBWriteContactSettingByte(NULL, MODNAME, "PeriodMeasure", opts.bPeriodMeasure);
- DBWriteContactSettingDword(NULL, MODNAME, "Period", opts.Period);
+ db_set_b(NULL, MODNAME, "UpdateOnStartup", opts.bUpdateOnStartup);
+ db_set_b(NULL, MODNAME, "OnlyOnceADay", opts.bOnlyOnceADay);
+ db_set_b(NULL, MODNAME, "UpdateOnPeriod", opts.bUpdateOnPeriod);
+ db_set_b(NULL, MODNAME, "PeriodMeasure", opts.bPeriodMeasure);
+ db_set_dw(NULL, MODNAME, "Period", opts.Period);
opts.bUpdateIcons = IsDlgButtonChecked(hwndDlg, IDC_UPDATEICONS);
- DBWriteContactSettingByte(NULL, MODNAME, "UpdateIcons", opts.bUpdateIcons);
+ db_set_b(NULL, MODNAME, "UpdateIcons", opts.bUpdateIcons);
if ( IsDlgButtonChecked(hwndDlg, IDC_STABLE))
db_set_s(NULL, MODNAME, "UpdateURL", DEFAULT_UPDATE_URL);
@@ -218,8 +218,8 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) for (i = 0; i < POPUPS; i++) {
mir_snprintf(str, SIZEOF(str), "Popups%d", i);
mir_snprintf(str2, SIZEOF(str2), "Popups%dM", i);
- CheckDlgButton(hdlg, (i+40071), (DBGetContactSettingByte(NULL, MODNAME, str, DEFAULT_POPUP_ENABLED)) ? BST_CHECKED: BST_UNCHECKED);
- CheckDlgButton(hdlg, (i+1024), (DBGetContactSettingByte(NULL, MODNAME, str2, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED: BST_UNCHECKED);
+ CheckDlgButton(hdlg, (i+40071), (db_get_b(NULL, MODNAME, str, DEFAULT_POPUP_ENABLED)) ? BST_CHECKED: BST_UNCHECKED);
+ CheckDlgButton(hdlg, (i+1024), (db_get_b(NULL, MODNAME, str2, DEFAULT_MESSAGE_ENABLED)) ? BST_CHECKED: BST_UNCHECKED);
if (IsDlgButtonChecked(hdlg, (i+40071)))
EnableWindow(GetDlgItem(hdlg, (i+1024)), FALSE);
else if (i > 0)
@@ -359,27 +359,27 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) ctlColor = SendDlgItemMessage(hdlg, (i+42071), CPM_GETCOLOUR, 0, 0);
PopupsList[i].colorBack = ctlColor;
mir_snprintf(szSetting, SIZEOF(szSetting), "Popups%iBg", i);
- DBWriteContactSettingDword(NULL, MODNAME, szSetting, ctlColor);
+ db_set_dw(NULL, MODNAME, szSetting, ctlColor);
ctlColor = SendDlgItemMessage(hdlg, (i+41071), CPM_GETCOLOUR, 0, 0);
PopupsList[i].colorText = ctlColor;
mir_snprintf(szSetting, SIZEOF(szSetting), "Popups%iTx", i);
- DBWriteContactSettingDword(NULL, MODNAME, szSetting, ctlColor);
+ db_set_dw(NULL, MODNAME, szSetting, ctlColor);
}
//Colors
- DBWriteContactSettingByte(NULL, MODNAME, "DefColors", PopupOptions.DefColors);
+ db_set_b(NULL, MODNAME, "DefColors", PopupOptions.DefColors);
//Timeout
PopupOptions.Timeout = GetDlgItemInt(hdlg, IDC_TIMEOUT_VALUE, 0, TRUE);
- DBWriteContactSettingDword(NULL, MODNAME, "Timeout", PopupOptions.Timeout);
+ db_set_dw(NULL, MODNAME, "Timeout", PopupOptions.Timeout);
//Left mouse click
- DBWriteContactSettingByte(NULL, MODNAME, "LeftClickAction", PopupOptions.LeftClickAction);
+ db_set_b(NULL, MODNAME, "LeftClickAction", PopupOptions.LeftClickAction);
//Right mouse click
- DBWriteContactSettingByte(NULL, MODNAME, "RightClickAction", PopupOptions.RightClickAction);
+ db_set_b(NULL, MODNAME, "RightClickAction", PopupOptions.RightClickAction);
//Notified popups
for (i = 0; i < POPUPS; i++) {
mir_snprintf(str, SIZEOF(str), "Popups%d", i);
- DBWriteContactSettingByte(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hdlg, (i+40071))));
+ db_set_b(NULL, MODNAME, str, (BYTE)(IsDlgButtonChecked(hdlg, (i+40071))));
mir_snprintf(str2, SIZEOF(str2), "Popups%dM", i);
- DBWriteContactSettingByte(NULL, MODNAME, str2, (BYTE)(IsDlgButtonChecked(hdlg, (i+1024))));
+ db_set_b(NULL, MODNAME, str2, (BYTE)(IsDlgButtonChecked(hdlg, (i+1024))));
}
return TRUE;
} //case PSN_APPLY
diff --git a/plugins/PluginUpdater/src/Scanner.cpp b/plugins/PluginUpdater/src/Scanner.cpp index bb9f7e339b..7855a12b7a 100644 --- a/plugins/PluginUpdater/src/Scanner.cpp +++ b/plugins/PluginUpdater/src/Scanner.cpp @@ -23,7 +23,7 @@ int CalculateModuleHash(const TCHAR *tszFileName, char *dest); static BYTE IsPluginDisabled(const char *filename)
{
- return DBGetContactSettingByte(NULL, "PluginDisable", filename, 0);
+ return db_get_b(NULL, "PluginDisable", filename, 0);
}
static bool Exists(LPCTSTR strName)
@@ -269,9 +269,9 @@ static void CheckUpdates(void *) tszTempPath[dwLen-1] = 0;
// Load files info
- if (DBGetContactSettingTString(NULL, MODNAME, "UpdateURL", &dbVar)) { // URL is not set
- DBWriteContactSettingTString(NULL, MODNAME, "UpdateURL", _T(DEFAULT_UPDATE_URL));
- DBGetContactSettingTString(NULL, MODNAME, "UpdateURL", &dbVar);
+ if (db_get_ts(NULL, MODNAME, "UpdateURL", &dbVar)) { // URL is not set
+ db_set_ts(NULL, MODNAME, "UpdateURL", _T(DEFAULT_UPDATE_URL));
+ db_get_ts(NULL, MODNAME, "UpdateURL", &dbVar);
}
REPLACEVARSARRAY vars[2];
@@ -287,7 +287,7 @@ static void CheckUpdates(void *) dat.dwFlags = RVF_TCHAR;
dat.variables = vars;
mir_ptr<TCHAR> tszBaseUrl((TCHAR*)CallService(MS_UTILS_REPLACEVARS, (WPARAM)dbVar.ptszVal, (LPARAM)&dat));
- DBFreeVariant(&dbVar);
+ db_free(&dbVar);
// Download version info
ShowPopup(NULL, TranslateT("Plugin Updater"), TranslateT("Downloading version info..."), 4, 0);
@@ -365,6 +365,6 @@ void DoCheck(int iFlag) }
else if (iFlag) {
hCheckThread = mir_forkthread(CheckUpdates, 0);
- DBWriteContactSettingDword(NULL, MODNAME, "LastUpdate", time(NULL));
+ db_set_dw(NULL, MODNAME, "LastUpdate", time(NULL));
}
}
diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index bb2ee1380a..87f7cbedb7 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -85,41 +85,41 @@ void InitPopupList() int index = 0;
PopupsList[index].ID = index;
PopupsList[index].Icon = SKINICON_OTHER_MIRANDA;
- PopupsList[index].colorBack = DBGetContactSettingDword(NULL, MODNAME, "Popups0Bg", COLOR_BG_FIRSTDEFAULT);
- PopupsList[index].colorText = DBGetContactSettingDword(NULL, MODNAME, "Popups0Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups0Bg", COLOR_BG_FIRSTDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups0Tx", COLOR_TX_DEFAULT);
index = 1;
PopupsList[index].ID = index;
PopupsList[index].Icon = SKINICON_OTHER_MIRANDA;
- PopupsList[index].colorBack = DBGetContactSettingDword(NULL, MODNAME, "Popups1Bg", COLOR_BG_SECONDDEFAULT);
- PopupsList[index].colorText = DBGetContactSettingDword(NULL, MODNAME, "Popups1Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups1Bg", COLOR_BG_SECONDDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups1Tx", COLOR_TX_DEFAULT);
index = 2;
PopupsList[index].ID = index;
PopupsList[index].Icon = SKINICON_OTHER_MIRANDA;
- PopupsList[index].colorBack = DBGetContactSettingDword(NULL, MODNAME, "Popups2Bg", COLOR_BG_FIRSTDEFAULT);
- PopupsList[index].colorText = DBGetContactSettingDword(NULL, MODNAME, "Popups2Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups2Bg", COLOR_BG_FIRSTDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups2Tx", COLOR_TX_DEFAULT);
index = 3;
PopupsList[index].ID = index;
PopupsList[index].Icon = SKINICON_OTHER_MIRANDA;
- PopupsList[index].colorBack = DBGetContactSettingDword(NULL, MODNAME, "Popups3Bg", COLOR_BG_SECONDDEFAULT);
- PopupsList[index].colorText = DBGetContactSettingDword(NULL, MODNAME, "Popups3Tx", COLOR_TX_DEFAULT);
+ PopupsList[index].colorBack = db_get_dw(NULL, MODNAME, "Popups3Bg", COLOR_BG_SECONDDEFAULT);
+ PopupsList[index].colorText = db_get_dw(NULL, MODNAME, "Popups3Tx", COLOR_TX_DEFAULT);
}
void LoadOptions()
{
- PopupOptions.DefColors = DBGetContactSettingByte(NULL, MODNAME, "DefColors", DEFAULT_COLORS);
- PopupOptions.LeftClickAction= DBGetContactSettingByte(NULL, MODNAME, "LeftClickAction", DEFAULT_POPUP_LCLICK);
- PopupOptions.RightClickAction = DBGetContactSettingByte(NULL, MODNAME, "RightClickAction", DEFAULT_POPUP_RCLICK);
- PopupOptions.Timeout = DBGetContactSettingDword(NULL, MODNAME, "Timeout", DEFAULT_TIMEOUT_VALUE);
+ PopupOptions.DefColors = db_get_b(NULL, MODNAME, "DefColors", DEFAULT_COLORS);
+ PopupOptions.LeftClickAction= db_get_b(NULL, MODNAME, "LeftClickAction", DEFAULT_POPUP_LCLICK);
+ PopupOptions.RightClickAction = db_get_b(NULL, MODNAME, "RightClickAction", DEFAULT_POPUP_RCLICK);
+ PopupOptions.Timeout = db_get_dw(NULL, MODNAME, "Timeout", DEFAULT_TIMEOUT_VALUE);
- opts.bUpdateOnStartup = DBGetContactSettingByte(NULL, MODNAME, "UpdateOnStartup", DEFAULT_UPDATEONSTARTUP);
- opts.bOnlyOnceADay = DBGetContactSettingByte(NULL, MODNAME, "OnlyOnceADay", DEFAULT_ONLYONCEADAY);
- opts.bUpdateOnPeriod = DBGetContactSettingByte(NULL, MODNAME, "UpdateOnPeriod", DEFAULT_UPDATEONPERIOD);
- opts.Period = DBGetContactSettingDword(NULL, MODNAME, "Period", DEFAULT_PERIOD);
- opts.bPeriodMeasure = DBGetContactSettingByte(NULL, MODNAME, "PeriodMeasure", DEFAULT_PERIODMEASURE);
- opts.bUpdateIcons = DBGetContactSettingByte(NULL, MODNAME, "UpdateIcons", DEFAULT_UPDATEICONS);
+ opts.bUpdateOnStartup = db_get_b(NULL, MODNAME, "UpdateOnStartup", DEFAULT_UPDATEONSTARTUP);
+ opts.bOnlyOnceADay = db_get_b(NULL, MODNAME, "OnlyOnceADay", DEFAULT_ONLYONCEADAY);
+ opts.bUpdateOnPeriod = db_get_b(NULL, MODNAME, "UpdateOnPeriod", DEFAULT_UPDATEONPERIOD);
+ opts.Period = db_get_dw(NULL, MODNAME, "Period", DEFAULT_PERIOD);
+ opts.bPeriodMeasure = db_get_b(NULL, MODNAME, "PeriodMeasure", DEFAULT_PERIODMEASURE);
+ opts.bUpdateIcons = db_get_b(NULL, MODNAME, "UpdateIcons", DEFAULT_UPDATEICONS);
}
ULONG crc32_table[256];
@@ -252,7 +252,7 @@ BOOL AllowUpdateOnStartup() {
if (opts.bOnlyOnceADay) {
time_t now = time(NULL);
- time_t was = DBGetContactSettingDword(NULL, MODNAME, "LastUpdate", 0);
+ time_t was = db_get_dw(NULL, MODNAME, "LastUpdate", 0);
if ((now - was) < 86400)
return FALSE;
diff --git a/plugins/Popup/src/actions.cpp b/plugins/Popup/src/actions.cpp index 1affca7df3..09f8b3d6fd 100644 --- a/plugins/Popup/src/actions.cpp +++ b/plugins/Popup/src/actions.cpp @@ -148,13 +148,13 @@ DWORD MouseOverride(HWND hCombo, int number) void LoadOption_Actions() {
- PopUpOptions.actions = DBGetContactSettingDword(NULL, MODULNAME, "Actions",
+ PopUpOptions.actions = db_get_dw(NULL, MODULNAME, "Actions",
ACT_ENABLE|ACT_RIGHTICONS|ACT_DEF_KEEPWND|ACT_DEF_IMONLY|
ACT_DEF_NOGLOBAL|ACT_DEF_MESSAGE|ACT_DEF_DETAILS|ACT_DEF_MENU|
ACT_DEF_ADD|ACT_DEF_DISMISS|ACT_DEF_PIN);
- PopUpOptions.overrideLeft = DBGetContactSettingDword(NULL,MODULNAME, "OverrideLeft", 0);
- PopUpOptions.overrideMiddle = DBGetContactSettingDword(NULL,MODULNAME, "OverrideMiddle", 0);
- PopUpOptions.overrideRight = DBGetContactSettingDword(NULL,MODULNAME, "OverrideRight", 0);
+ PopUpOptions.overrideLeft = db_get_dw(NULL,MODULNAME, "OverrideLeft", 0);
+ PopUpOptions.overrideMiddle = db_get_dw(NULL,MODULNAME, "OverrideMiddle", 0);
+ PopUpOptions.overrideRight = db_get_dw(NULL,MODULNAME, "OverrideRight", 0);
}
static UINT controls[] =
diff --git a/plugins/Popup/src/common.h b/plugins/Popup/src/common.h index 3bce58077f..6ad87ea594 100644 --- a/plugins/Popup/src/common.h +++ b/plugins/Popup/src/common.h @@ -51,7 +51,7 @@ inline int Byte2Percentile(int vByte) { return (vByte*100)/255; } inline int Percentile2Byte(int vPerc) { return (vPerc*255)/100; }
//===== Strings & MirandaDB ==================
-inline char *DBGetContactSettingString(HANDLE hContact, const char *ModuleName, const char *SettingName, const char *Default)
+inline char *db_get_s(HANDLE hContact, const char *ModuleName, const char *SettingName, const char *Default)
{
DBVARIANT dbv;
DBCONTACTGETSETTING dbcgs;
diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp index d4c88ff200..811bead19a 100644 --- a/plugins/Popup/src/config.cpp +++ b/plugins/Popup/src/config.cpp @@ -108,7 +108,7 @@ void PopUpPreview() for (HANDLE hContact = db_find_first(); hContact;
hContact = db_find_next(hContact))
{
- if (DBGetContactSettingDword(hContact, "ICQ", "UIN", 0) == 256771455)
+ if (db_get_dw(hContact, "ICQ", "UIN", 0) == 256771455)
{
ppd.lchContact = hContact;
break;
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp index 723c3f29bd..fca4c1cf12 100644 --- a/plugins/Popup/src/font.cpp +++ b/plugins/Popup/src/font.cpp @@ -136,10 +136,10 @@ void ReloadFonts() if (gTreeData[i]->typ == 2) {
mir_snprintf(setting, 256, "%s/TextCol", gTreeData[i]->pupClass.pszName);
gTreeData[i]->colorText = gTreeData[i]->pupClass.colorText =
- (COLORREF)DBGetContactSettingDword(0, PU_MODULCLASS, setting, (DWORD)fonts.clText);
+ (COLORREF)db_get_dw(0, PU_MODULCLASS, setting, (DWORD)fonts.clText);
mir_snprintf(setting, 256, "%s/BgCol", gTreeData[i]->pupClass.pszName);
gTreeData[i]->colorBack = gTreeData[i]->pupClass.colorBack =
- (COLORREF)DBGetContactSettingDword(0, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
+ (COLORREF)db_get_dw(0, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
}
}
}
diff --git a/plugins/Popup/src/headers.h b/plugins/Popup/src/headers.h index 593389b765..d10e2cd9ca 100644 --- a/plugins/Popup/src/headers.h +++ b/plugins/Popup/src/headers.h @@ -69,7 +69,7 @@ http://miranda-ng.org/distr/ #include <m_skin.h>
#include <m_langpack.h>
#include <m_database.h>
-#undef DBGetContactSettingString
+#undef db_get_s
#include <m_protosvc.h>
#include <m_button.h>
#include <m_message.h>
diff --git a/plugins/Popup/src/history.cpp b/plugins/Popup/src/history.cpp index b5620c99d3..a44af22401 100644 --- a/plugins/Popup/src/history.cpp +++ b/plugins/Popup/src/history.cpp @@ -57,7 +57,7 @@ void PopupHistoryResize() void PopupHistoryLoad()
{
InitializeCriticalSection(&csPopupHistory);
- popupHistoryBuffer = DBGetContactSettingWord(NULL, MODULNAME, "HistorySize", SETTING_HISTORYSIZE_DEFAULT);
+ popupHistoryBuffer = db_get_w(NULL, MODULNAME, "HistorySize", SETTING_HISTORYSIZE_DEFAULT);
}
void PopupHistoryUnload()
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index 2c5e60743b..5ccb4ac13d 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -370,9 +370,9 @@ MIRAPI int Load(void) // Register in DBEditor++
DBVARIANT dbv;
- if (DBGetContactSetting(NULL, "KnownModules", MODULNAME, &dbv))
- DBWriteContactSettingString(NULL, "KnownModules", pluginInfoEx.shortName, MODULNAME);
- DBFreeVariant(&dbv);
+ if (db_get(NULL, "KnownModules", MODULNAME, &dbv))
+ db_set_s(NULL, "KnownModules", pluginInfoEx.shortName, MODULNAME);
+ db_free(&dbv);
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
HookEvent(ME_OPT_INITIALISE, OptionsInitialize);
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index 40b971e160..e9c70d8c79 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -97,7 +97,7 @@ void SaveNotificationSettings(POPUPTREEDATA *ptd, char* szModul) mir_snprintf(setting, sizeof(setting), "{%s/%s}Timeout",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
- DBWriteContactSettingWord(NULL, szModul, setting, ptd->notification.iSeconds);
+ db_set_w(NULL, szModul, setting, ptd->notification.iSeconds);
mir_snprintf(setting, sizeof(setting), "{%s/%s}enabled",
ptd->notification.lpzGroup,
@@ -107,7 +107,7 @@ void SaveNotificationSettings(POPUPTREEDATA *ptd, char* szModul) mir_snprintf(setting, sizeof(setting), "{%s/%s}TimeoutVal",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
- DBWriteContactSettingWord(NULL, szModul, setting, ptd->timeoutValue);
+ db_set_w(NULL, szModul, setting, ptd->timeoutValue);
mir_snprintf(setting, sizeof(setting), "{%s/%s}disableWhen",
ptd->notification.lpzGroup,
@@ -117,12 +117,12 @@ void SaveNotificationSettings(POPUPTREEDATA *ptd, char* szModul) mir_snprintf(setting, sizeof(setting), "{%s/%s}leftAction",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
- DBWriteContactSettingString(NULL, szModul, setting, ptd->leftAction);
+ db_set_s(NULL, szModul, setting, ptd->leftAction);
mir_snprintf(setting, sizeof(setting), "{%s/%s}rightAction",
ptd->notification.lpzGroup,
ptd->notification.lpzName);
- DBWriteContactSettingString(NULL, szModul, setting, ptd->rightAction);
+ db_set_s(NULL, szModul, setting, ptd->rightAction);
for (int i=0; i < ptd->notification.actionCount; ++i)
{
@@ -158,11 +158,11 @@ void LoadNotificationSettings(POPUPTREEDATA *ptd, char* szModul) mir_snprintf(setting, sizeof(setting), "{%s/%s}Timeout", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->notification.iSeconds =
- (signed char)DBGetContactSettingWord(NULL, szModul, setting, ptd->notification.iSeconds);
+ (signed char)db_get_w(NULL, szModul, setting, ptd->notification.iSeconds);
mir_snprintf(setting, sizeof(setting), "{%s/%s}TimeoutVal", ptd->notification.lpzGroup, ptd->notification.lpzName);
ptd->timeoutValue =
- (signed char)DBGetContactSettingWord(NULL, szModul, setting,
+ (signed char)db_get_w(NULL, szModul, setting,
ptd->notification.iSeconds ? ptd->notification.iSeconds : 0);
mir_snprintf(setting, sizeof(setting), "{%s/%s}disableWhen", ptd->notification.lpzGroup, ptd->notification.lpzName);
@@ -170,12 +170,12 @@ void LoadNotificationSettings(POPUPTREEDATA *ptd, char* szModul) db_get_b(NULL, szModul, setting, 0);
mir_snprintf(setting, sizeof(setting), "{%s/%s}leftAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
- szTmp = DBGetContactSettingString(NULL, szModul, setting, ptd->notification.lpzLAction);
+ szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzLAction);
lstrcpynA(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
mir_free(szTmp); szTmp = NULL;
mir_snprintf(setting, sizeof(setting), "{%s/%s}rightAction", ptd->notification.lpzGroup, ptd->notification.lpzName);
- szTmp = DBGetContactSettingString(NULL, szModul, setting, ptd->notification.lpzRAction);
+ szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzRAction);
lstrcpynA(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
mir_free(szTmp); szTmp = NULL;
}
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index bc2c5db587..3c7e4ce579 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -44,13 +44,13 @@ void OptAdv_UnregisterVfx() { void LoadOption_AdvOpts() {
//History
PopUpOptions.EnableHistory = db_get_b (NULL,MODULNAME, "EnableHistory", TRUE);
- PopUpOptions.HistorySize = DBGetContactSettingWord (NULL,MODULNAME, "HistorySize", SETTING_HISTORYSIZE_DEFAULT);
+ PopUpOptions.HistorySize = db_get_w (NULL,MODULNAME, "HistorySize", SETTING_HISTORYSIZE_DEFAULT);
PopUpOptions.UseHppHistoryLog = db_get_b (NULL,MODULNAME, "UseHppHistoryLog", TRUE);
//Avatars
PopUpOptions.avatarBorders = db_get_b (NULL,MODULNAME, "AvatarBorders", TRUE);
PopUpOptions.avatarPNGBorders = db_get_b (NULL,MODULNAME, "AvatarPNGBorders", FALSE);
PopUpOptions.avatarRadius = db_get_b (NULL,MODULNAME, "AvatarRadius", 2);
- PopUpOptions.avatarSize = DBGetContactSettingWord (NULL,MODULNAME, "AvatarSize", SETTING_AVTSIZE_DEFAULT);
+ PopUpOptions.avatarSize = db_get_w (NULL,MODULNAME, "AvatarSize", SETTING_AVTSIZE_DEFAULT);
PopUpOptions.EnableAvatarUpdates = db_get_b (NULL,MODULNAME, "EnableAvatarUpdates", FALSE);
//Monitor
PopUpOptions.Monitor = db_get_b (NULL,MODULNAME, "Monitor", SETTING_MONITOR_DEFAULT);
@@ -63,10 +63,10 @@ void LoadOption_AdvOpts() { PopUpOptions.UseAnimations = db_get_b (NULL,MODULNAME, "UseAnimations", TRUE);
PopUpOptions.UseEffect = db_get_b (NULL,MODULNAME, "Fade", TRUE);
PopUpOptions.Effect = (LPTSTR)DBGetContactSettingStringX(NULL,MODULNAME, "Effect", "", DBVT_TCHAR);
- PopUpOptions.FadeIn = DBGetContactSettingDword(NULL,MODULNAME, "FadeInTime", SETTING_FADEINTIME_DEFAULT);
- PopUpOptions.FadeOut = DBGetContactSettingDword(NULL,MODULNAME, "FadeOutTime",SETTING_FADEOUTTIME_DEFAULT);
+ PopUpOptions.FadeIn = db_get_dw(NULL,MODULNAME, "FadeInTime", SETTING_FADEINTIME_DEFAULT);
+ PopUpOptions.FadeOut = db_get_dw(NULL,MODULNAME, "FadeOutTime",SETTING_FADEOUTTIME_DEFAULT);
//other old stuff
- PopUpOptions.MaxPopups = DBGetContactSettingWord (NULL,MODULNAME, "MaxPopups", 20);
+ PopUpOptions.MaxPopups = db_get_w (NULL,MODULNAME, "MaxPopups", 20);
}
INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
@@ -527,31 +527,31 @@ INT_PTR CALLBACK DlgProcPopUpAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM {
//History
db_set_b (NULL,MODULNAME, "EnableHistory", (BYTE)PopUpOptions.EnableHistory);
- DBWriteContactSettingWord (NULL,MODULNAME, "HistorySize", PopUpOptions.HistorySize);
+ db_set_w(NULL,MODULNAME, "HistorySize", PopUpOptions.HistorySize);
PopupHistoryResize();
- db_set_b (NULL,MODULNAME, "UseHppHistoryLog", PopUpOptions.UseHppHistoryLog);
+ db_set_b(NULL,MODULNAME, "UseHppHistoryLog", PopUpOptions.UseHppHistoryLog);
//Avatars
- db_set_b (NULL,MODULNAME, "AvatarBorders", PopUpOptions.avatarBorders);
- db_set_b (NULL,MODULNAME, "AvatarPNGBorders", PopUpOptions.avatarPNGBorders);
- db_set_b (NULL,MODULNAME, "AvatarRadius", PopUpOptions.avatarRadius);
- DBWriteContactSettingWord (NULL,MODULNAME, "AvatarSize", PopUpOptions.avatarSize);
- db_set_b (NULL,MODULNAME, "EnableAvatarUpdates", PopUpOptions.EnableAvatarUpdates);
+ db_set_b(NULL,MODULNAME, "AvatarBorders", PopUpOptions.avatarBorders);
+ db_set_b(NULL,MODULNAME, "AvatarPNGBorders", PopUpOptions.avatarPNGBorders);
+ db_set_b(NULL,MODULNAME, "AvatarRadius", PopUpOptions.avatarRadius);
+ db_set_w(NULL,MODULNAME, "AvatarSize", PopUpOptions.avatarSize);
+ db_set_b(NULL,MODULNAME, "EnableAvatarUpdates", PopUpOptions.EnableAvatarUpdates);
//Monitor
- db_set_b (NULL,MODULNAME, "Monitor", PopUpOptions.Monitor);
+ db_set_b(NULL,MODULNAME, "Monitor", PopUpOptions.Monitor);
//Transparency
- db_set_b (NULL,MODULNAME, "EnableRegionTransparency", PopUpOptions.Enable9xTransparency);
- db_set_b (NULL,MODULNAME, "UseTransparency", PopUpOptions.UseTransparency);
- db_set_b (NULL,MODULNAME, "Alpha", PopUpOptions.Alpha);
- db_set_b (NULL,MODULNAME, "OpaqueOnHover", PopUpOptions.OpaqueOnHover);
+ db_set_b(NULL,MODULNAME, "EnableRegionTransparency", PopUpOptions.Enable9xTransparency);
+ db_set_b(NULL,MODULNAME, "UseTransparency", PopUpOptions.UseTransparency);
+ db_set_b(NULL,MODULNAME, "Alpha", PopUpOptions.Alpha);
+ db_set_b(NULL,MODULNAME, "OpaqueOnHover", PopUpOptions.OpaqueOnHover);
//Effects
db_set_b (NULL,MODULNAME, "UseAnimations", PopUpOptions.UseAnimations);
db_set_b (NULL,MODULNAME, "Fade", PopUpOptions.UseEffect);
- DBWriteContactSettingTString(NULL, MODULNAME, "Effect", PopUpOptions.Effect);
+ db_set_ts(NULL, MODULNAME, "Effect", PopUpOptions.Effect);
db_set_dw(NULL,MODULNAME, "FadeInTime", PopUpOptions.FadeIn);
db_set_dw(NULL,MODULNAME, "FadeOutTime", PopUpOptions.FadeOut);
//other old stuff
- DBWriteContactSettingWord (NULL,MODULNAME, "MaxPopups", (BYTE)PopUpOptions.MaxPopups);
+ db_set_w(NULL,MODULNAME, "MaxPopups", (BYTE)PopUpOptions.MaxPopups);
}
return TRUE;
default:
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp index eb4978b1d6..d39877f8b8 100644 --- a/plugins/Popup/src/opt_class.cpp +++ b/plugins/Popup/src/opt_class.cpp @@ -504,20 +504,20 @@ void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul) mir_snprintf(setting, sizeof(setting), "%s/Timeout", ptd->pupClass.pszName);
ptd->pupClass.iSeconds =
- (signed char)DBGetContactSettingWord(NULL, szModul, setting, 0);
+ (signed char)db_get_w(NULL, szModul, setting, 0);
mir_snprintf(setting, sizeof(setting), "%s/TimeoutVal", ptd->pupClass.pszName);
ptd->timeoutValue =
- (signed char)DBGetContactSettingWord(NULL, szModul, setting,
+ (signed char)db_get_w(NULL, szModul, setting,
ptd->pupClass.iSeconds ? ptd->pupClass.iSeconds : PopUpOptions.Seconds);
mir_snprintf(setting, sizeof(setting), "%s/leftAction", ptd->pupClass.pszName);
- szTmp = DBGetContactSettingString(NULL, szModul, setting, POPUP_ACTION_NOTHING); //standart ??
+ szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_NOTHING); //standart ??
lstrcpynA(ptd->leftAction, szTmp, sizeof(ptd->leftAction));
mir_free(szTmp); szTmp = NULL;
mir_snprintf(setting, sizeof(setting), "%s/rightAction", ptd->pupClass.pszName);
- szTmp = DBGetContactSettingString(NULL, szModul, setting, POPUP_ACTION_DISMISS); //standart ??
+ szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_DISMISS); //standart ??
lstrcpynA(ptd->rightAction, szTmp, sizeof(ptd->rightAction));
mir_free(szTmp); szTmp = NULL;
@@ -530,14 +530,14 @@ void SaveClassSettings(POPUPTREEDATA *ptd, char* szModul) db_set_b(NULL, szModul, setting, ptd->enabled);
mir_snprintf(setting, sizeof(setting), "%s/Timeout", ptd->pupClass.pszName);
- DBWriteContactSettingWord(NULL, szModul, setting, ptd->pupClass.iSeconds);
+ db_set_w(NULL, szModul, setting, ptd->pupClass.iSeconds);
mir_snprintf(setting, sizeof(setting), "%s/TimeoutVal",ptd->pupClass.pszName);
- DBWriteContactSettingWord(NULL, szModul, setting, ptd->timeoutValue);
+ db_set_w(NULL, szModul, setting, ptd->timeoutValue);
mir_snprintf(setting, sizeof(setting), "%s/leftAction",ptd->pupClass.pszName);
- DBWriteContactSettingString(NULL, szModul, setting, ptd->leftAction);
+ db_set_s(NULL, szModul, setting, ptd->leftAction);
mir_snprintf(setting, sizeof(setting), "%s/rightAction",ptd->pupClass.pszName);
- DBWriteContactSettingString(NULL, szModul, setting, ptd->rightAction);
+ db_set_s(NULL, szModul, setting, ptd->rightAction);
}
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index 9fc6001e8e..21716c3d33 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -94,18 +94,18 @@ void LoadOption_General() { //Dynamic Resize
PopUpOptions.DynamicResize = db_get_b(NULL, MODULNAME, "DynamicResize", FALSE);
PopUpOptions.UseMinimumWidth = db_get_b(NULL, MODULNAME, "UseMinimumWidth", TRUE);
- PopUpOptions.MinimumWidth = DBGetContactSettingWord(NULL, MODULNAME, "MinimumWidth", 160);
+ PopUpOptions.MinimumWidth = db_get_w(NULL, MODULNAME, "MinimumWidth", 160);
PopUpOptions.UseMaximumWidth = db_get_b(NULL, MODULNAME, "UseMaximumWidth", TRUE);
- PopUpOptions.MaximumWidth = DBGetContactSettingWord(NULL, MODULNAME, "MaximumWidth", 300);
+ PopUpOptions.MaximumWidth = db_get_w(NULL, MODULNAME, "MaximumWidth", 300);
//Position
PopUpOptions.Position = DBGetContactSettingRangedByte(NULL, MODULNAME, "Position",
POS_LOWERRIGHT, POS_MINVALUE, POS_MAXVALUE);
//Configure popup area
- PopUpOptions.gapTop = DBGetContactSettingWord(NULL, MODULNAME, "gapTop", 5);
- PopUpOptions.gapBottom = DBGetContactSettingWord(NULL, MODULNAME, "gapBottom", 5);
- PopUpOptions.gapLeft = DBGetContactSettingWord(NULL, MODULNAME, "gapLeft", 5);
- PopUpOptions.gapRight = DBGetContactSettingWord(NULL, MODULNAME, "gapRight", 5);
- PopUpOptions.spacing = DBGetContactSettingWord(NULL, MODULNAME, "spacing", 5);
+ PopUpOptions.gapTop = db_get_w(NULL, MODULNAME, "gapTop", 5);
+ PopUpOptions.gapBottom = db_get_w(NULL, MODULNAME, "gapBottom", 5);
+ PopUpOptions.gapLeft = db_get_w(NULL, MODULNAME, "gapLeft", 5);
+ PopUpOptions.gapRight = db_get_w(NULL, MODULNAME, "gapRight", 5);
+ PopUpOptions.spacing = db_get_w(NULL, MODULNAME, "spacing", 5);
//Spreading
PopUpOptions.Spreading = DBGetContactSettingRangedByte(NULL, MODULNAME, "Spreading",
SPREADING_VERTICAL, SPREADING_MINVALUE, SPREADING_MAXVALUE);
@@ -514,22 +514,22 @@ INT_PTR CALLBACK DlgProcPopUpGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case PSN_APPLY: {
//Seconds
db_set_b(NULL, MODULNAME, "InfiniteDelay", PopUpOptions.InfiniteDelay);
- DBWriteContactSettingWord(NULL, MODULNAME, "Seconds", (WORD)PopUpOptions.Seconds);
+ db_set_w(NULL, MODULNAME, "Seconds", (WORD)PopUpOptions.Seconds);
db_set_b(NULL, MODULNAME, "LeaveHovered", PopUpOptions.LeaveHovered);
//Dynamic Resize
db_set_b(NULL, MODULNAME, "DynamicResize", PopUpOptions.DynamicResize);
db_set_b(NULL, MODULNAME, "UseMinimumWidth", PopUpOptions.UseMinimumWidth);
- DBWriteContactSettingWord(NULL, MODULNAME, "MinimumWidth", PopUpOptions.MinimumWidth);
+ db_set_w(NULL, MODULNAME, "MinimumWidth", PopUpOptions.MinimumWidth);
db_set_b(NULL, MODULNAME, "UseMaximumWidth", PopUpOptions.UseMaximumWidth);
- DBWriteContactSettingWord(NULL, MODULNAME, "MaximumWidth", PopUpOptions.MaximumWidth);
+ db_set_w(NULL, MODULNAME, "MaximumWidth", PopUpOptions.MaximumWidth);
//Position
db_set_b(NULL, MODULNAME, "Position", (BYTE)PopUpOptions.Position);
//Configure popup area
- DBWriteContactSettingWord(NULL, MODULNAME, "gapTop", (WORD)PopUpOptions.gapTop);
- DBWriteContactSettingWord(NULL, MODULNAME, "gapBottom", (WORD)PopUpOptions.gapBottom);
- DBWriteContactSettingWord(NULL, MODULNAME, "gapLeft", (WORD)PopUpOptions.gapLeft);
- DBWriteContactSettingWord(NULL, MODULNAME, "gapRight", (WORD)PopUpOptions.gapRight);
- DBWriteContactSettingWord(NULL, MODULNAME, "spacing", (WORD)PopUpOptions.spacing);
+ db_set_w(NULL, MODULNAME, "gapTop", (WORD)PopUpOptions.gapTop);
+ db_set_w(NULL, MODULNAME, "gapBottom", (WORD)PopUpOptions.gapBottom);
+ db_set_w(NULL, MODULNAME, "gapLeft", (WORD)PopUpOptions.gapLeft);
+ db_set_w(NULL, MODULNAME, "gapRight", (WORD)PopUpOptions.gapRight);
+ db_set_w(NULL, MODULNAME, "spacing", (WORD)PopUpOptions.spacing);
//Spreading
db_set_b(NULL, MODULNAME, "Spreading", (BYTE)PopUpOptions.Spreading);
//miscellaneous
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index ab8e518835..faca667577 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -286,7 +286,7 @@ bool SkinOptionList_Update (OPTTREE_OPTION* &options, int *OptionsCount, HWND hw char prefix[128];
mir_snprintf(prefix, sizeof(prefix),"skin.%S", PopUpOptions.SkinPack);
OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount,
- DBGetContactSettingDword(NULL, MODULNAME, prefix, dwSkinOptions), _T("Skin options"));
+ db_get_dw(NULL, MODULNAME, prefix, dwSkinOptions), _T("Skin options"));
//check "Global Settings"
OptTree_SetOptions(hwndDlg, IDC_SKIN_LIST_OPT, options, *OptionsCount,
@@ -492,7 +492,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case PSN_APPLY:
{
//skin pack
- DBWriteContactSettingTString(NULL, MODULNAME, "SkinPack", PopUpOptions.SkinPack);
+ db_set_ts(NULL, MODULNAME, "SkinPack", PopUpOptions.SkinPack);
//skin options
const PopupSkin *skin = 0;
if (skin = skins.getSkin(PopUpOptions.SkinPack))
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index befd0638a1..b1f2dde562 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -203,7 +203,7 @@ INT_PTR PopUp_AddPopUp2(WPARAM wParam, LPARAM lParam) if (PopUpOptions.DisableWhenFullscreen && (bShowMode != PU_SHOWMODE_FULLSCREEN) && isFullScreen())
return -1;
- if (DBGetContactSettingDword(NULL, MODULNAME, LPGEN("Global Status"), 0) &
+ if (db_get_dw(NULL, MODULNAME, LPGEN("Global Status"), 0) &
Proto_Status2Flag_My(CallService(MS_CLIST_GETSTATUSMODE, 0, 0)))
return -1;
@@ -214,7 +214,7 @@ INT_PTR PopUp_AddPopUp2(WPARAM wParam, LPARAM lParam) {
char prefix[128];
mir_snprintf(prefix, sizeof(prefix), LPGEN("Protocol Status") "/%s", GetContactProto(ppd->lchContact));
- if (DBGetContactSettingDword(NULL, MODULNAME, prefix, 0) &
+ if (db_get_dw(NULL, MODULNAME, prefix, 0) &
Proto_Status2Flag_My(CallProtoService(proto, PS_GETSTATUS, 0, 0)))
return -1;
if (((disableWhen >> 16) & 0xFFFF0000) & Proto_Status2Flag_My(CallProtoService(proto, PS_GETSTATUS, 0, 0)))
@@ -480,7 +480,7 @@ INT_PTR PopUp_RegisterPopupClass(WPARAM wParam, LPARAM lParam) //we ignore pc->colorText and use fonts.text as default (if no setting found in DB)
mir_snprintf(setting, 256, "%s/TextCol", ptd->pupClass.pszName);
- ptd->pupClass.colorText = (COLORREF)DBGetContactSettingDword(NULL, PU_MODULCLASS, setting, fonts.clText/*pc->colorText*/);
+ ptd->pupClass.colorText = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, fonts.clText/*pc->colorText*/);
FontID fid = {0};
fid.cbSize = sizeof(FontID);
mir_snprintf(fid.group, sizeof(fid.group), "%s/%s", PU_FNT_AND_COLOR, ptd->pupClass.pszName);
@@ -498,7 +498,7 @@ INT_PTR PopUp_RegisterPopupClass(WPARAM wParam, LPARAM lParam) //we ignore pc->colorBack and use fonts.clBack as default (if no setting found in DB)
mir_snprintf(setting, 256, "%s/BgCol", ptd->pupClass.pszName);
- ptd->pupClass.colorBack = (COLORREF)DBGetContactSettingDword(NULL, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
+ ptd->pupClass.colorBack = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/);
ColourID cid = {0};
cid.cbSize = sizeof(ColourID);
mir_snprintf(cid.group, sizeof(cid.group), "%s/%s", PU_FNT_AND_COLOR, ptd->pupClass.pszName);
diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp index cee1bfe592..864d6c4c59 100644 --- a/plugins/Popup/src/skin.cpp +++ b/plugins/Popup/src/skin.cpp @@ -1278,7 +1278,7 @@ void PopupSkin::loadOpts() const mir_snprintf(buf, sizeof(buf), "skin.%.120S", m_name);
- m_flags = DBGetContactSettingDword(NULL, MODULNAME, buf, m_flags);
+ m_flags = db_get_dw(NULL, MODULNAME, buf, m_flags);
}
// Skins
diff --git a/plugins/QuickContacts/src/options.cpp b/plugins/QuickContacts/src/options.cpp index 8e9edec9af..69e6b0968e 100644 --- a/plugins/QuickContacts/src/options.cpp +++ b/plugins/QuickContacts/src/options.cpp @@ -37,14 +37,14 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // Initializations needed by options
void LoadOptions()
{
- opts.last_sent_enable = DBGetContactSettingByte(NULL, MODULE_NAME, "EnableLastSentTo", TRUE);
- opts.last_sent_msg_type = DBGetContactSettingWord(NULL, MODULE_NAME, "MsgTypeRec", TYPE_GLOBAL);
- opts.hide_from_offline_proto = DBGetContactSettingByte(NULL, MODULE_NAME, "HideOfflineFromOfflineProto", TRUE);
- opts.group_append = DBGetContactSettingByte(NULL, MODULE_NAME, "AppendGroupName", FALSE);
- opts.group_column = DBGetContactSettingByte(NULL, MODULE_NAME, "GroupColumn", FALSE);
- opts.group_column_left = DBGetContactSettingByte(NULL, MODULE_NAME, "GroupColumnLeft", FALSE);
- opts.hide_subcontacts = DBGetContactSettingByte(NULL, MODULE_NAME, "HideSubcontacts", TRUE);
- opts.keep_subcontacts_from_offline = DBGetContactSettingByte(NULL, MODULE_NAME, "KeepSubcontactsFromOffline", TRUE);
+ opts.last_sent_enable = db_get_b(NULL, MODULE_NAME, "EnableLastSentTo", TRUE);
+ opts.last_sent_msg_type = db_get_w(NULL, MODULE_NAME, "MsgTypeRec", TYPE_GLOBAL);
+ opts.hide_from_offline_proto = db_get_b(NULL, MODULE_NAME, "HideOfflineFromOfflineProto", TRUE);
+ opts.group_append = db_get_b(NULL, MODULE_NAME, "AppendGroupName", FALSE);
+ opts.group_column = db_get_b(NULL, MODULE_NAME, "GroupColumn", FALSE);
+ opts.group_column_left = db_get_b(NULL, MODULE_NAME, "GroupColumnLeft", FALSE);
+ opts.hide_subcontacts = db_get_b(NULL, MODULE_NAME, "HideSubcontacts", TRUE);
+ opts.keep_subcontacts_from_offline = db_get_b(NULL, MODULE_NAME, "KeepSubcontactsFromOffline", TRUE);
}
int InitOptionsCallback(WPARAM wParam,LPARAM lParam)
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 2a653dbd21..100cfe9b69 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -220,11 +220,11 @@ int EventAdded(WPARAM wparam, LPARAM lparam) DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get((HANDLE)lparam, &dbei);
if ( !(dbei.flags & DBEF_SENT) || (dbei.flags & DBEF_READ)
- || !DBGetContactSettingByte(NULL, MODULE_NAME, "EnableLastSentTo", 0)
- || DBGetContactSettingWord(NULL, MODULE_NAME, "MsgTypeRec", TYPE_GLOBAL) != TYPE_GLOBAL)
+ || !db_get_b(NULL, MODULE_NAME, "EnableLastSentTo", 0)
+ || db_get_w(NULL, MODULE_NAME, "MsgTypeRec", TYPE_GLOBAL) != TYPE_GLOBAL)
return 0;
- DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD)(HANDLE)wparam);
+ db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD)(HANDLE)wparam);
return 0;
}
@@ -332,7 +332,7 @@ int GetStatus(HANDLE hContact, char *proto = NULL) if (proto == NULL)
return ID_STATUS_OFFLINE;
- return DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE);
+ return db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE);
}
@@ -349,10 +349,10 @@ void FreeContacts() void LoadContacts(HWND hwndDlg, BOOL show_all)
{
BOOL metacontactsEnabled = (metacontacts_proto != NULL
- && DBGetContactSettingByte(0, metacontacts_proto, "Enabled", 1));
+ && db_get_b(0, metacontacts_proto, "Enabled", 1));
// Read last-sent-to contact from db and set handle as window-userdata
- HANDLE hlastsent = (HANDLE)DBGetContactSettingDword(NULL, MODULE_NAME, "LastSentTo", -1);
+ HANDLE hlastsent = (HANDLE)db_get_dw(NULL, MODULE_NAME, "LastSentTo", -1);
SetWindowLongPtr(hwndMain, GWLP_USERDATA, (LONG)hlastsent);
// enumerate all contacts and write them to the array
@@ -388,7 +388,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) char setting[128];
mir_snprintf(setting, sizeof(setting), "ShowOffline%s", pszProto);
- if (!DBGetContactSettingByte(NULL, MODULE_NAME, setting, FALSE))
+ if (!db_get_b(NULL, MODULE_NAME, setting, FALSE))
continue;
// Check if proto offline
@@ -412,7 +412,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) {
char setting[128];
mir_snprintf(setting, sizeof(setting), "ShowOffline%s", metacontacts_proto);
- if (DBGetContactSettingByte(NULL, MODULE_NAME, setting, FALSE))
+ if (db_get_b(NULL, MODULE_NAME, setting, FALSE))
continue;
}
}
@@ -426,12 +426,12 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) if (opts.group_append)
{
DBVARIANT dbv;
- if (DBGetContactSettingTString(hMeta == NULL ? hContact : hMeta, "CList", "Group", &dbv) == 0)
+ if (db_get_ts(hMeta == NULL ? hContact : hMeta, "CList", "Group", &dbv) == 0)
{
if (dbv.ptszVal != NULL)
lstrcpyn(contact->szgroup, dbv.ptszVal, SIZEOF(contact->szgroup));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -831,9 +831,9 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA LoadContacts(hwndDlg, FALSE);
EnableButtons(hwndDlg, NULL);
- if (DBGetContactSettingByte(NULL, MODULE_NAME, "EnableLastSentTo", 0))
+ if (db_get_b(NULL, MODULE_NAME, "EnableLastSentTo", 0))
{
- int pos = GetItemPos((HANDLE) DBGetContactSettingDword(NULL, MODULE_NAME, "LastSentTo", -1));
+ int pos = GetItemPos((HANDLE) db_get_dw(NULL, MODULE_NAME, "LastSentTo", -1));
if (pos != -1)
{
@@ -868,7 +868,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM) hContact, 0);
- DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
break;
}
@@ -888,7 +888,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CallService(MS_MSG_SENDMESSAGET, (WPARAM) hContact, 0);
- DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
break;
}
@@ -912,7 +912,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CallService(MS_VOICESERVICE_CALL, (WPARAM) hContact, 0);
- DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
break;
}
@@ -933,7 +933,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CallService(MS_FILE_SENDFILE, (WPARAM) hContact, 0);
- DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
break;
}
@@ -954,7 +954,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CallService(MS_URL_SENDURL, (WPARAM) hContact, 0);
- DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
break;
}
@@ -975,7 +975,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CallService(MS_USERINFO_SHOWDIALOG, (WPARAM) hContact, 0);
- DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
break;
}
@@ -996,7 +996,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CallService(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM) hContact, 0);
- DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
break;
}
@@ -1027,7 +1027,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(ret),MPCF_CONTACTMENU),(LPARAM) hContact);
}
- DBWriteContactSettingDword(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
+ db_set_dw(NULL, MODULE_NAME, "LastSentTo", (DWORD) hContact);
break;
}
case HOTKEY_ALL_CONTACTS:
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 ) {
diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp index 009403872d..8162c110d5 100644 --- a/plugins/QuickReplies/src/events.cpp +++ b/plugins/QuickReplies/src/events.cpp @@ -42,8 +42,8 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) iNumber = 0;
hQuickRepliesService = CreateServiceFunction(MS_QUICKREPLIES_SERVICE, QuickRepliesService);
}
- else iNumber = DBGetContactSettingByte(NULL, MODULE_NAME, "InstancesCount", 0);
- DBWriteContactSettingByte(NULL, MODULE_NAME, "InstancesCount", iNumber + 1);
+ else iNumber = db_get_b(NULL, MODULE_NAME, "InstancesCount", 0);
+ db_set_b(NULL, MODULE_NAME, "InstancesCount", iNumber + 1);
hOnOptInitialized = HookEvent(ME_OPT_INITIALISE, OnOptInitialized);
hOnButtonPressed = HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed);
@@ -89,7 +89,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) return 1;
mir_snprintf(key, 64, "RepliesCount_%x", iNumber);
- count = DBGetContactSettingWord(NULL, MODULE_NAME, key, 0);
+ count = db_get_w(NULL, MODULE_NAME, key, 0);
{
if (count == 0 || cbcd->flags & BBCF_RIGHTBUTTON)
@@ -112,7 +112,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) for (int i = 0; i < count; i++)
{
mir_snprintf(key, 64, "Reply_%x_%x", iNumber, i);
- DBGetContactSettingTString(NULL, MODULE_NAME, key, &dbv);
+ db_get_ts(NULL, MODULE_NAME, key, &dbv);
if (dbv.ptszVal == NULL)
replyList.push_back(_T(""));
@@ -125,7 +125,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) AppendMenu((HMENU)hMenu, MF_SEPARATOR, i + 1, NULL);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
{
@@ -140,7 +140,7 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) SendMessage(hEdit, EM_REPLACESEL, TRUE, (LPARAM)replyList.at(index - 1).c_str());
mir_snprintf(key, 64, "ImmediatelySend_%x", iNumber);
- if ((BYTE)DBGetContactSettingByte(NULL, MODULE_NAME, key, 1) || cbcd->flags & BBCF_CONTROLPRESSED)
+ if ((BYTE)db_get_b(NULL, MODULE_NAME, key, 1) || cbcd->flags & BBCF_CONTROLPRESSED)
SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0);
}
}
diff --git a/plugins/QuickReplies/src/options.cpp b/plugins/QuickReplies/src/options.cpp index 57b8535cc6..6cb7798b74 100644 --- a/plugins/QuickReplies/src/options.cpp +++ b/plugins/QuickReplies/src/options.cpp @@ -74,15 +74,15 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR mir_subclassWindow( GetDlgItem(hwndDlg, IDC_REPLIES), MessageEditSubclassProc);
mir_snprintf(key, 64, "ImmediatelySend_%x", iNumber);
- CheckDlgButton(hwndDlg, IDC_IMMEDIATELY, (BYTE)DBGetContactSettingWord(NULL, MODULE_NAME, key, 1));
+ CheckDlgButton(hwndDlg, IDC_IMMEDIATELY, (BYTE)db_get_w(NULL, MODULE_NAME, key, 1));
mir_snprintf(key, 64, "RepliesCount_%x", iNumber);
- count = DBGetContactSettingWord(NULL, MODULE_NAME, key, 0);
+ count = db_get_w(NULL, MODULE_NAME, key, 0);
for (int i = 0; i < count; i++)
{
mir_snprintf(key, 64, "Reply_%x_%x", iNumber, i);
- if (!DBGetContactSettingTString(NULL, MODULE_NAME, key, &dbv))
+ if (!db_get_ts(NULL, MODULE_NAME, key, &dbv))
if(dbv.ptszVal != NULL)
replies.append(dbv.ptszVal);
if (i < count - 1)
@@ -90,7 +90,7 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR }
SetDlgItemText(hwndDlg, IDC_REPLIES, replies.c_str());
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return TRUE;
@@ -120,12 +120,12 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR TCHAR tszReplies[TEXT_LIMIT];
mir_snprintf(key, 64, "RepliesCount_%x", iNumber);
- count = DBGetContactSettingByte(NULL, MODULE_NAME, key, 0);
+ count = db_get_b(NULL, MODULE_NAME, key, 0);
for (int i = 0; i < count; i++)
{
mir_snprintf(key, 64, "Reply_%x_%x", iNumber, i);
- DBDeleteContactSetting(NULL, MODULE_NAME, key);
+ db_unset(NULL, MODULE_NAME, key);
}
GetDlgItemText(hwndDlg, IDC_REPLIES, tszReplies, TEXT_LIMIT);
@@ -140,16 +140,16 @@ INT_PTR CALLBACK DlgProcOptionsPage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR while ((pos = replies.find(_T("\r\n"))) != tString::npos)
{
mir_snprintf(key, 64, "Reply_%x_%x", iNumber, count++);
- DBWriteContactSettingTString(NULL, MODULE_NAME, key, replies.substr(0, pos).c_str());
+ db_set_ts(NULL, MODULE_NAME, key, replies.substr(0, pos).c_str());
replies = replies.substr(pos + 2);
}
}
mir_snprintf(key, 64, "RepliesCount_%x", iNumber);
- DBWriteContactSettingWord(NULL, MODULE_NAME, key, count);
+ db_set_w(NULL, MODULE_NAME, key, count);
mir_snprintf(key, 64, "ImmediatelySend_%x", iNumber);
- DBWriteContactSettingByte(NULL, MODULE_NAME, key, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IMMEDIATELY));
+ db_set_b(NULL, MODULE_NAME, key, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IMMEDIATELY));
mir_free(key);
diff --git a/plugins/Quotes/src/CommonOptionDlg.cpp b/plugins/Quotes/src/CommonOptionDlg.cpp index 55315c3947..54606b7613 100644 --- a/plugins/Quotes/src/CommonOptionDlg.cpp +++ b/plugins/Quotes/src/CommonOptionDlg.cpp @@ -72,13 +72,13 @@ void CommonOptionDlgProc(HWND hWnd,UINT msg,WPARAM wp,LPARAM lp,CCommonDlgProcDa ::SendMessage(hwndCombo,CB_ADDSTRING,0,reinterpret_cast<LPARAM>(pszRefreshRateTypes[i]));
}
- int nRefreshRateType = DBGetContactSettingWord(NULL,QUOTES_MODULE_NAME,visitor.m_pszDbRefreshRateType,RRT_MINUTES);
+ int nRefreshRateType = db_get_w(NULL,QUOTES_MODULE_NAME,visitor.m_pszDbRefreshRateType,RRT_MINUTES);
if(nRefreshRateType < RRT_SECONDS || nRefreshRateType > RRT_HOURS)
{
nRefreshRateType = RRT_MINUTES;
}
- UINT nRate = DBGetContactSettingWord(NULL,QUOTES_MODULE_NAME,visitor.m_pszDbRefreshRateValue,1);
+ UINT nRate = db_get_w(NULL,QUOTES_MODULE_NAME,visitor.m_pszDbRefreshRateValue,1);
switch(nRefreshRateType)
{
default:
@@ -235,17 +235,17 @@ void CommonOptionDlgProc(HWND hWnd,UINT msg,WPARAM wp,LPARAM lp,CCommonDlgProcDa assert(visitor.m_pszDbStatusMsgFormat);
rData.m_bFireSetingsChangedEvent = true;
- DBWriteContactSettingWord(NULL,QUOTES_MODULE_NAME,visitor.m_pszDbRefreshRateType,nType);
- DBWriteContactSettingWord(NULL,QUOTES_MODULE_NAME,visitor.m_pszDbRefreshRateValue,nRefreshRate);
+ db_set_w(NULL,QUOTES_MODULE_NAME,visitor.m_pszDbRefreshRateType,nType);
+ db_set_w(NULL,QUOTES_MODULE_NAME,visitor.m_pszDbRefreshRateValue,nRefreshRate);
tstring s = get_window_text(::GetDlgItem(hWnd,IDC_EDIT_CONTACT_LIST_FORMAT));
- DBWriteContactSettingTString(NULL,QUOTES_MODULE_NAME,visitor.m_pszDbDisplayNameFormat,s.c_str());
+ db_set_ts(NULL,QUOTES_MODULE_NAME,visitor.m_pszDbDisplayNameFormat,s.c_str());
s = get_window_text(::GetDlgItem(hWnd,IDC_EDIT_STATUS_MESSAGE_FORMAT));
- DBWriteContactSettingTString(NULL,QUOTES_MODULE_NAME,visitor.m_pszDbStatusMsgFormat,s.c_str());
+ db_set_ts(NULL,QUOTES_MODULE_NAME,visitor.m_pszDbStatusMsgFormat,s.c_str());
s = get_window_text(::GetDlgItem(hWnd,IDC_EDIT_TENDENCY_FORMAT));
- DBWriteContactSettingTString(NULL,QUOTES_MODULE_NAME,visitor.m_pszDbTendencyFormat,s.c_str());
+ db_set_ts(NULL,QUOTES_MODULE_NAME,visitor.m_pszDbTendencyFormat,s.c_str());
CAdvProviderSettings* pAdvSet = get_adv_settings(rData.m_pQuotesProvider,false);
if(pAdvSet)
diff --git a/plugins/Quotes/src/CurrencyConverter.cpp b/plugins/Quotes/src/CurrencyConverter.cpp index a586bb3e77..f1253bf01f 100644 --- a/plugins/Quotes/src/CurrencyConverter.cpp +++ b/plugins/Quotes/src/CurrencyConverter.cpp @@ -217,8 +217,8 @@ namespace CQuotesProviderGoogle::CQuote from = rSection.GetQuote(nFrom);
CQuotesProviderGoogle::CQuote to = rSection.GetQuote(nTo);
- DBWriteContactSettingTString(NULL,QUOTES_MODULE_NAME,DB_STR_CC_QUOTE_FROM_ID,from.GetID().c_str());
- DBWriteContactSettingTString(NULL,QUOTES_MODULE_NAME,DB_STR_CC_QUOTE_TO_ID,to.GetID().c_str());
+ db_set_ts(NULL,QUOTES_MODULE_NAME,DB_STR_CC_QUOTE_FROM_ID,from.GetID().c_str());
+ db_set_ts(NULL,QUOTES_MODULE_NAME,DB_STR_CC_QUOTE_TO_ID,to.GetID().c_str());
const CQuotesProviderGoogle* pProvider = get_google_provider();
assert(pProvider);
diff --git a/plugins/Quotes/src/DBUtils.cpp b/plugins/Quotes/src/DBUtils.cpp index 462abb38a5..65ac8b180c 100644 --- a/plugins/Quotes/src/DBUtils.cpp +++ b/plugins/Quotes/src/DBUtils.cpp @@ -63,7 +63,7 @@ bool Quotes_DBReadDouble(HANDLE hContact,const char* szModule,const char* szSett rdValue = *reinterpret_cast<double*>(dbv.pbVal);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return bResult;
}
diff --git a/plugins/Quotes/src/ImportExport.cpp b/plugins/Quotes/src/ImportExport.cpp index c50e2f3cbf..edcd5806ab 100644 --- a/plugins/Quotes/src/ImportExport.cpp +++ b/plugins/Quotes/src/ImportExport.cpp @@ -28,7 +28,7 @@ namespace struct mir_safety_dbvar
{
mir_safety_dbvar(DBVARIANT* p) : m_p(p){}
- ~mir_safety_dbvar(){DBFreeVariant(m_p);}
+ ~mir_safety_dbvar(){db_free(m_p);}
DBVARIANT* m_p;
};
diff --git a/plugins/Quotes/src/Log.cpp b/plugins/Quotes/src/Log.cpp index 46fb0cc325..250ca58497 100644 --- a/plugins/Quotes/src/Log.cpp +++ b/plugins/Quotes/src/Log.cpp @@ -14,7 +14,7 @@ namespace #ifdef _DEBUG
return true;
#else
- return (1 == DBGetContactSettingByte(NULL,QUOTES_PROTOCOL_NAME,DB_STR_ENABLE_LOG,false));
+ return (1 == db_get_b(NULL,QUOTES_PROTOCOL_NAME,DB_STR_ENABLE_LOG,false));
#endif
}
diff --git a/plugins/Quotes/src/ModuleInfo.cpp b/plugins/Quotes/src/ModuleInfo.cpp index e166adc6ea..1d453d2b5c 100644 --- a/plugins/Quotes/src/ModuleInfo.cpp +++ b/plugins/Quotes/src/ModuleInfo.cpp @@ -8,7 +8,7 @@ namespace }
CModuleInfo::CModuleInfo()
- : m_bExtendedStatusInfo(1 == DBGetContactSettingByte(NULL,QUOTES_MODULE_NAME,"ExtendedStatus",false))
+ : m_bExtendedStatusInfo(1 == db_get_b(NULL,QUOTES_MODULE_NAME,"ExtendedStatus",false))
{
}
diff --git a/plugins/Quotes/src/QuoteChart.cpp b/plugins/Quotes/src/QuoteChart.cpp index 4f717f1275..123c8c1a4f 100644 --- a/plugins/Quotes/src/QuoteChart.cpp +++ b/plugins/Quotes/src/QuoteChart.cpp @@ -226,7 +226,7 @@ namespace ::SendDlgItemMessage(hDlg,IDC_COMBO_DATA_SOURCE,CB_INSERTSTRING,-1,reinterpret_cast<LPARAM>(p));
}
- int nSel = DBGetContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,"Chart_Source",srcLogFile);
+ int nSel = db_get_b(hContact,QUOTES_PROTOCOL_NAME,"Chart_Source",srcLogFile);
::SendDlgItemMessage(hDlg,IDC_COMBO_DATA_SOURCE,CB_SETCURSEL,nSel,0);
for(int i = 0;i < sizeof(szFilters)/sizeof(szFilters[0]);++i)
@@ -235,7 +235,7 @@ namespace ::SendDlgItemMessage(hDlg,IDC_COMBO_FILTER,CB_INSERTSTRING,-1,reinterpret_cast<LPARAM>(szFilters[i]));
}
- nSel = DBGetContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,"Chart_Filter",filterAll);
+ nSel = db_get_b(hContact,QUOTES_PROTOCOL_NAME,"Chart_Filter",filterAll);
::SendDlgItemMessage(hDlg,IDC_COMBO_FILTER,CB_SETCURSEL,nSel,0);
update_filter_controls(hDlg);
diff --git a/plugins/Quotes/src/QuotesProviderBase.cpp b/plugins/Quotes/src/QuotesProviderBase.cpp Binary files differindex 92f9203e39..84698140b1 100644 --- a/plugins/Quotes/src/QuotesProviderBase.cpp +++ b/plugins/Quotes/src/QuotesProviderBase.cpp diff --git a/plugins/Quotes/src/QuotesProviderDukasCopy.cpp b/plugins/Quotes/src/QuotesProviderDukasCopy.cpp Binary files differindex 3d8ac08a7b..a89a1482ed 100644 --- a/plugins/Quotes/src/QuotesProviderDukasCopy.cpp +++ b/plugins/Quotes/src/QuotesProviderDukasCopy.cpp diff --git a/plugins/Quotes/src/QuotesProviderFinance.cpp b/plugins/Quotes/src/QuotesProviderFinance.cpp index 0dcfe6db54..e7c9a16d06 100644 --- a/plugins/Quotes/src/QuotesProviderFinance.cpp +++ b/plugins/Quotes/src/QuotesProviderFinance.cpp @@ -49,10 +49,10 @@ bool CQuotesProviderFinance::WatchForQuote(const CQuote& rQuote,bool bWatch) HANDLE hContact = CreateNewContact(rQuote.GetSymbol());
if(hContact)
{
- DBWriteContactSettingTString(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_ID,sQuoteID.c_str());
+ db_set_ts(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_ID,sQuoteID.c_str());
if(false == rQuote.GetName().empty())
{
- DBWriteContactSettingTString(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_DESCRIPTION,rQuote.GetName().c_str());
+ db_set_ts(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_DESCRIPTION,rQuote.GetName().c_str());
}
return true;
diff --git a/plugins/Quotes/src/QuotesProviderGoogle.cpp b/plugins/Quotes/src/QuotesProviderGoogle.cpp index a873a58b23..bc07ec0f80 100644 --- a/plugins/Quotes/src/QuotesProviderGoogle.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogle.cpp @@ -39,15 +39,15 @@ bool CQuotesProviderGoogle::WatchForRate(const CRateInfo& ri, HANDLE hContact = CreateNewContact(sName);
if(hContact)
{
- DBWriteContactSettingTString(hContact,QUOTES_PROTOCOL_NAME,DB_STR_FROM_ID,ri.m_from.GetID().c_str());
- DBWriteContactSettingTString(hContact,QUOTES_PROTOCOL_NAME,DB_STR_TO_ID,ri.m_to.GetID().c_str());
+ db_set_ts(hContact,QUOTES_PROTOCOL_NAME,DB_STR_FROM_ID,ri.m_from.GetID().c_str());
+ db_set_ts(hContact,QUOTES_PROTOCOL_NAME,DB_STR_TO_ID,ri.m_to.GetID().c_str());
if(false == ri.m_from.GetName().empty())
{
- DBWriteContactSettingTString(hContact,QUOTES_PROTOCOL_NAME,DB_STR_FROM_DESCRIPTION,ri.m_from.GetName().c_str());
+ db_set_ts(hContact,QUOTES_PROTOCOL_NAME,DB_STR_FROM_DESCRIPTION,ri.m_from.GetName().c_str());
}
if(false == ri.m_to.GetName().empty())
{
- DBWriteContactSettingTString(hContact,QUOTES_PROTOCOL_NAME,DB_STR_TO_DESCRIPTION,ri.m_to.GetName().c_str());
+ db_set_ts(hContact,QUOTES_PROTOCOL_NAME,DB_STR_TO_DESCRIPTION,ri.m_to.GetName().c_str());
}
return true;
diff --git a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp index 729cc57b94..5150610ed5 100644 --- a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp +++ b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp @@ -328,7 +328,7 @@ void CQuotesProviderGoogleFinance::RefreshQuotes(TContracts& anContacts) }
if(false == Info.m_sCmpName.empty())
{
- DBWriteContactSettingTString(hContact,QUOTES_MODULE_NAME,DB_STR_QUOTE_DESCRIPTION,Info.m_sCmpName.c_str());
+ db_set_ts(hContact,QUOTES_MODULE_NAME,DB_STR_QUOTE_DESCRIPTION,Info.m_sCmpName.c_str());
}
WriteContactRate(hContact,Info.m_dRate);
diff --git a/plugins/Quotes/src/QuotesProviderYahoo.cpp b/plugins/Quotes/src/QuotesProviderYahoo.cpp index 567cb6423d..f34a21523b 100644 --- a/plugins/Quotes/src/QuotesProviderYahoo.cpp +++ b/plugins/Quotes/src/QuotesProviderYahoo.cpp @@ -61,7 +61,7 @@ namespace }
}
- DBWriteContactSettingTString(hContact,QUOTES_MODULE_NAME,pszDbName,_T(""));
+ db_set_ts(hContact,QUOTES_MODULE_NAME,pszDbName,_T(""));
return false;
}
}
@@ -155,7 +155,7 @@ void CQuotesProviderYahoo::RefreshQuotes(TContracts& anContacts) double dRate = 0.0;
if(true == t2d(asStrings[indexLastTrade],dRate))
{
- DBWriteContactSettingTString(hContact,QUOTES_MODULE_NAME,DB_STR_QUOTE_DESCRIPTION,asStrings[indexName].c_str());
+ db_set_ts(hContact,QUOTES_MODULE_NAME,DB_STR_QUOTE_DESCRIPTION,asStrings[indexName].c_str());
get_double_from_parsed_line(hContact,asStrings,indexOpen,DB_STR_YAHOO_OPEN_VALUE);
get_double_from_parsed_line(hContact,asStrings,indexDayHigh,DB_STR_YAHOO_DAY_HIGH);
diff --git a/plugins/Quotes/src/QuotesProviders.cpp b/plugins/Quotes/src/QuotesProviders.cpp index 5867b12a87..8047977983 100644 --- a/plugins/Quotes/src/QuotesProviders.cpp +++ b/plugins/Quotes/src/QuotesProviders.cpp @@ -46,10 +46,10 @@ namespace {
void convert_contact_settings(HANDLE hContact)
{
- WORD dwLogMode = DBGetContactSettingWord(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG,static_cast<WORD>(lmDisabled));
+ WORD dwLogMode = db_get_w(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG,static_cast<WORD>(lmDisabled));
if ((dwLogMode&lmInternalHistory) || (dwLogMode&lmExternalFile))
{
- DBWriteContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,DB_STR_CONTACT_SPEC_SETTINGS,1);
+ db_set_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_CONTACT_SPEC_SETTINGS,1);
}
}
}
@@ -58,7 +58,7 @@ void CQuotesProviders::InitProviders() CreateProviders();
const WORD nCurrentVersion = 17;
- WORD nVersion = DBGetContactSettingWord(NULL,QUOTES_MODULE_NAME,LAST_RUN_VERSION,1);
+ WORD nVersion = db_get_w(NULL,QUOTES_MODULE_NAME,LAST_RUN_VERSION,1);
for(HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
{
@@ -73,7 +73,7 @@ void CQuotesProviders::InitProviders() }
}
- DBWriteContactSettingWord(NULL,QUOTES_MODULE_NAME,LAST_RUN_VERSION,nCurrentVersion);
+ db_set_w(NULL,QUOTES_MODULE_NAME,LAST_RUN_VERSION,nCurrentVersion);
}
CQuotesProviders::TQuotesProviderPtr CQuotesProviders::GetContactProviderPtr(HANDLE hContact)const
diff --git a/plugins/Quotes/src/SettingsDlg.cpp b/plugins/Quotes/src/SettingsDlg.cpp index 108a77554c..e03ec3c83e 100644 --- a/plugins/Quotes/src/SettingsDlg.cpp +++ b/plugins/Quotes/src/SettingsDlg.cpp @@ -294,19 +294,19 @@ namespace CQuotesProviders::TQuotesProviderPtr pProvider = CModuleInfo::GetQuoteProvidersPtr()->GetContactProviderPtr(hContact);
- BYTE bUseContactSpecific = DBGetContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,DB_STR_CONTACT_SPEC_SETTINGS,0);
+ BYTE bUseContactSpecific = db_get_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_CONTACT_SPEC_SETTINGS,0);
::CheckDlgButton(hWnd,IDC_CHECK_CONTACT_SPECIFIC,bUseContactSpecific);
CAdvProviderSettings setGlobal(pProvider.get());
// log to history
- WORD dwLogMode = DBGetContactSettingWord(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG,setGlobal.GetLogMode());
+ WORD dwLogMode = db_get_w(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG,setGlobal.GetLogMode());
UINT nCheck = (dwLogMode&lmInternalHistory) ? 1 : 0;
::CheckDlgButton(hWnd,IDC_CHECK_INTERNAL_HISTORY,nCheck);
tstring sHistoryFrmt = Quotes_DBGetStringT(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_FORMAT_HISTORY,setGlobal.GetHistoryFormat().c_str());
::SetDlgItemText(hWnd,IDC_EDIT_HISTORY_FORMAT,sHistoryFrmt.c_str());
- WORD wOnlyIfChanged = DBGetContactSettingWord(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_HISTORY_CONDITION,setGlobal.GetHistoryOnlyChangedFlag());
+ WORD wOnlyIfChanged = db_get_w(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_HISTORY_CONDITION,setGlobal.GetHistoryOnlyChangedFlag());
::CheckDlgButton(hWnd,IDC_CHECK_HISTORY_CONDITION,(1 == wOnlyIfChanged) ? 1 : 0);
// log to file
@@ -323,7 +323,7 @@ namespace tstring sLogFileFrmt = Quotes_DBGetStringT(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_FORMAT_LOG_FILE,setGlobal.GetLogFormat().c_str());
::SetDlgItemText(hWnd,IDC_EDIT_LOG_FILE_FORMAT,sLogFileFrmt.c_str());
- wOnlyIfChanged = DBGetContactSettingWord(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG_FILE_CONDITION,setGlobal.GetLogOnlyChangedFlag());
+ wOnlyIfChanged = db_get_w(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG_FILE_CONDITION,setGlobal.GetLogOnlyChangedFlag());
::CheckDlgButton(hWnd,IDC_CHECK_LOG_FILE_CONDITION,(1 == wOnlyIfChanged) ? 1 : 0);
// popup
@@ -331,7 +331,7 @@ namespace ::CheckDlgButton(hWnd,IDC_CHECK_SHOW_POPUP,nCheck);
tstring sPopupFrmt = Quotes_DBGetStringT(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_FORMAT_POPUP,setGlobal.GetPopupFormat().c_str());
::SetDlgItemText(hWnd,IDC_EDIT_POPUP_FORMAT,sPopupFrmt.c_str());
- bool bOnlyIfChanged = 1 == DBGetContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_CONDITION,setGlobal.GetShowPopupIfValueChangedFlag());
+ bool bOnlyIfChanged = 1 == db_get_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_CONDITION,setGlobal.GetShowPopupIfValueChangedFlag());
::CheckDlgButton(hWnd,IDC_CHECK_SHOW_POPUP_ONLY_VALUE_CHANGED,(true == bOnlyIfChanged) ? 1 : 0);
update_all_controls(hWnd);
@@ -475,15 +475,15 @@ namespace UINT nIfChangedFile = IsDlgButtonChecked(hWnd,IDC_CHECK_LOG_FILE_CONDITION);
bool bIfChangedPopup = (1 == IsDlgButtonChecked(hWnd,IDC_CHECK_SHOW_POPUP_ONLY_VALUE_CHANGED));
- DBWriteContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,DB_STR_CONTACT_SPEC_SETTINGS,bUseContactSpec);
- DBWriteContactSettingWord(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG,nLogMode);
- DBWriteContactSettingWord(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG_FILE_CONDITION,nIfChangedFile);
- DBWriteContactSettingWord(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_HISTORY_CONDITION,nIfChangedHistory);
- DBWriteContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_CONDITION,bIfChangedPopup);
- DBWriteContactSettingTString(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG_FILE,sLogFile.c_str());
- DBWriteContactSettingTString(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_FORMAT_LOG_FILE,sLogFileFormat.c_str());
- DBWriteContactSettingTString(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_FORMAT_HISTORY,sHistoryFormat.c_str());
- DBWriteContactSettingTString(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_FORMAT_POPUP,sPopupFormat.c_str());
+ db_set_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_CONTACT_SPEC_SETTINGS,bUseContactSpec);
+ db_set_w(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG,nLogMode);
+ db_set_w(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG_FILE_CONDITION,nIfChangedFile);
+ db_set_w(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_HISTORY_CONDITION,nIfChangedHistory);
+ db_set_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_CONDITION,bIfChangedPopup);
+ db_set_ts(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG_FILE,sLogFile.c_str());
+ db_set_ts(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_FORMAT_LOG_FILE,sLogFileFormat.c_str());
+ db_set_ts(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_FORMAT_HISTORY,sHistoryFormat.c_str());
+ db_set_ts(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_FORMAT_POPUP,sPopupFormat.c_str());
if(pParam->m_pPopupSettings)
{
@@ -740,9 +740,9 @@ CAdvProviderSettings::CAdvProviderSettings(const IQuotesProvider* pQuotesProvide assert(visitor.m_pszDbLogFormat);
assert(visitor.m_pszDbLogCondition);
- m_wLogMode = DBGetContactSettingWord(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbLogMode,static_cast<WORD>(lmDisabled));
+ m_wLogMode = db_get_w(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbLogMode,static_cast<WORD>(lmDisabled));
m_sFormatHistory = Quotes_DBGetStringT(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbHistoryFormat,visitor.m_pszDefHistoryFormat);
- m_bIsOnlyChangedHistory = 1 == DBGetContactSettingByte(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbHistoryCondition,0);
+ m_bIsOnlyChangedHistory = 1 == db_get_b(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbHistoryCondition,0);
m_sLogFileName = Quotes_DBGetStringT(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbLogFile);
if(true == m_sLogFileName.empty())
@@ -754,10 +754,10 @@ CAdvProviderSettings::CAdvProviderSettings(const IQuotesProvider* pQuotesProvide }
m_sFormatLogFile = Quotes_DBGetStringT(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbLogFormat,visitor.m_pszDefLogFileFormat);
- m_bIsOnlyChangedLogFile = (1 == DBGetContactSettingByte(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbLogCondition,0));
+ m_bIsOnlyChangedLogFile = (1 == db_get_b(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbLogCondition,0));
m_sPopupFormat = Quotes_DBGetStringT(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupFormat,visitor.m_pszDefPopupFormat);
- m_bShowPopupIfValueChanged = (1 == DBGetContactSettingByte(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupCondition,0));
+ m_bShowPopupIfValueChanged = (1 == db_get_b(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupCondition,0));
}
CAdvProviderSettings::~CAdvProviderSettings()
@@ -788,23 +788,23 @@ void CAdvProviderSettings::SaveToDb()const assert(visitor.m_pszDbPopupDelayTimeout);
assert(visitor.m_pszDbPopupHistoryFlag);
- DBWriteContactSettingWord(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbLogMode,m_wLogMode);
- DBWriteContactSettingTString(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbHistoryFormat,m_sFormatHistory.c_str());
- DBWriteContactSettingByte(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbHistoryCondition,m_bIsOnlyChangedHistory);
- DBWriteContactSettingTString(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbLogFile,m_sLogFileName.c_str());
- DBWriteContactSettingTString(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbLogFormat,m_sFormatLogFile.c_str());
- DBWriteContactSettingByte(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbLogCondition,m_bIsOnlyChangedLogFile);
- DBWriteContactSettingTString(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupFormat,m_sPopupFormat.c_str());
- DBWriteContactSettingByte(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupCondition,m_bShowPopupIfValueChanged);
+ db_set_w(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbLogMode,m_wLogMode);
+ db_set_ts(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbHistoryFormat,m_sFormatHistory.c_str());
+ db_set_b(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbHistoryCondition,m_bIsOnlyChangedHistory);
+ db_set_ts(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbLogFile,m_sLogFileName.c_str());
+ db_set_ts(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbLogFormat,m_sFormatLogFile.c_str());
+ db_set_b(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbLogCondition,m_bIsOnlyChangedLogFile);
+ db_set_ts(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupFormat,m_sPopupFormat.c_str());
+ db_set_b(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupCondition,m_bShowPopupIfValueChanged);
if(nullptr != m_pPopupSettings)
{
- DBWriteContactSettingByte(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupColourMode,static_cast<BYTE>(m_pPopupSettings->GetColourMode()));
- DBWriteContactSettingDword(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupBkColour,m_pPopupSettings->GetColourBk());
- DBWriteContactSettingDword(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupTextColour,m_pPopupSettings->GetColourText());
- DBWriteContactSettingByte(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupDelayMode,static_cast<BYTE>(m_pPopupSettings->GetDelayMode()));
- DBWriteContactSettingWord(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupDelayTimeout,m_pPopupSettings->GetDelayTimeout());
- DBWriteContactSettingByte(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupHistoryFlag,m_pPopupSettings->GetHistoryFlag());
+ db_set_b(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupColourMode,static_cast<BYTE>(m_pPopupSettings->GetColourMode()));
+ db_set_dw(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupBkColour,m_pPopupSettings->GetColourBk());
+ db_set_dw(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupTextColour,m_pPopupSettings->GetColourText());
+ db_set_b(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupDelayMode,static_cast<BYTE>(m_pPopupSettings->GetDelayMode()));
+ db_set_w(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupDelayTimeout,m_pPopupSettings->GetDelayTimeout());
+ db_set_b(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupHistoryFlag,m_pPopupSettings->GetHistoryFlag());
}
}
@@ -917,22 +917,22 @@ CPopupSettings::CPopupSettings(const IQuotesProvider* pQuotesProvider) assert(visitor.m_pszDbPopupDelayTimeout);
assert(visitor.m_pszDbPopupHistoryFlag);
- BYTE m = DBGetContactSettingByte(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupColourMode,static_cast<BYTE>(m_modeColour));
+ BYTE m = db_get_b(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupColourMode,static_cast<BYTE>(m_modeColour));
if(m >= colourDefault && m <= colourUserDefined)
{
m_modeColour = static_cast<EColourMode>(m);
}
- m_rgbBkg = DBGetContactSettingDword(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupBkColour,m_rgbBkg);
- m_rgbText = DBGetContactSettingDword(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupTextColour,m_rgbText);
+ m_rgbBkg = db_get_dw(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupBkColour,m_rgbBkg);
+ m_rgbText = db_get_dw(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupTextColour,m_rgbText);
- m = DBGetContactSettingByte(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupDelayMode,static_cast<BYTE>(m_modeDelay));
+ m = db_get_b(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupDelayMode,static_cast<BYTE>(m_modeDelay));
if(m >= delayFromPopup && m <= delayPermanent)
{
m_modeDelay = static_cast<EDelayMode>(m);
}
- m_wDelay = DBGetContactSettingWord(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupDelayTimeout,m_wDelay);
- m_bUseHistory = (1 == DBGetContactSettingByte(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupHistoryFlag,m_bUseHistory));
+ m_wDelay = db_get_w(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupDelayTimeout,m_wDelay);
+ m_bUseHistory = (1 == db_get_b(NULL,QUOTES_PROTOCOL_NAME,visitor.m_pszDbPopupHistoryFlag,m_bUseHistory));
}
/*static */
@@ -949,32 +949,32 @@ COLORREF CPopupSettings::GetDefColourText() void CPopupSettings::InitForContact(HANDLE hContact)
{
- BYTE m = DBGetContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_MODE,static_cast<BYTE>(m_modeColour));
+ BYTE m = db_get_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_MODE,static_cast<BYTE>(m_modeColour));
if(m >= CPopupSettings::colourDefault && m <= CPopupSettings::colourUserDefined)
{
m_modeColour = static_cast<CPopupSettings::EColourMode>(m);
}
- m_rgbBkg = DBGetContactSettingDword(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_BK,m_rgbBkg);
- m_rgbText = DBGetContactSettingDword(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_TEXT,m_rgbText);
+ m_rgbBkg = db_get_dw(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_BK,m_rgbBkg);
+ m_rgbText = db_get_dw(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_TEXT,m_rgbText);
- m = DBGetContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_DELAY_MODE,static_cast<BYTE>(m_modeDelay));
+ m = db_get_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_DELAY_MODE,static_cast<BYTE>(m_modeDelay));
if(m >= CPopupSettings::delayFromPopup && m <= CPopupSettings::delayPermanent)
{
m_modeDelay = static_cast<CPopupSettings::EDelayMode>(m);
}
- m_wDelay = DBGetContactSettingWord(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_DELAY_TIMEOUT,m_wDelay);
- m_bUseHistory = 1 == DBGetContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_HISTORY_FLAG,m_bUseHistory);
+ m_wDelay = db_get_w(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_DELAY_TIMEOUT,m_wDelay);
+ m_bUseHistory = 1 == db_get_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_HISTORY_FLAG,m_bUseHistory);
}
void CPopupSettings::SaveForContact(HANDLE hContact)const
{
- DBWriteContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_MODE,static_cast<BYTE>(m_modeColour));
- DBWriteContactSettingDword(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_BK,m_rgbBkg);
- DBWriteContactSettingDword(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_TEXT,m_rgbText);
- DBWriteContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_DELAY_MODE,static_cast<BYTE>(m_modeDelay));
- DBWriteContactSettingWord(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_DELAY_TIMEOUT,m_wDelay);
- DBWriteContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_HISTORY_FLAG,m_bUseHistory);
+ db_set_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_MODE,static_cast<BYTE>(m_modeColour));
+ db_set_dw(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_BK,m_rgbBkg);
+ db_set_dw(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_COLOUR_TEXT,m_rgbText);
+ db_set_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_DELAY_MODE,static_cast<BYTE>(m_modeDelay));
+ db_set_w(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_DELAY_TIMEOUT,m_wDelay);
+ db_set_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_POPUP_HISTORY_FLAG,m_bUseHistory);
}
CPopupSettings::EColourMode CPopupSettings::GetColourMode()const
@@ -1110,7 +1110,7 @@ tstring GetContactLogFileName(HANDLE hContact) if(pProvider)
{
tstring sPattern;
- bool bUseContactSpecific = (DBGetContactSettingByte(hContact,QUOTES_PROTOCOL_NAME,DB_STR_CONTACT_SPEC_SETTINGS,0) > 0);
+ bool bUseContactSpecific = (db_get_b(hContact,QUOTES_PROTOCOL_NAME,DB_STR_CONTACT_SPEC_SETTINGS,0) > 0);
if(bUseContactSpecific)
{
sPattern = Quotes_DBGetStringT(hContact,QUOTES_PROTOCOL_NAME,DB_STR_QUOTE_LOG_FILE);
diff --git a/plugins/Rate/src/main.cpp b/plugins/Rate/src/main.cpp index ea9fc78763..f3d0c8c21d 100644 --- a/plugins/Rate/src/main.cpp +++ b/plugins/Rate/src/main.cpp @@ -75,7 +75,7 @@ static void setExtraIcon(HANDLE hContact, int bRate = -1, BOOL clear = TRUE) return;
if (bRate < 0)
- bRate = DBGetContactSettingByte(hContact, "CList", "Rate", 0);
+ bRate = db_get_b(hContact, "CList", "Rate", 0);
const char *icon = NULL;
switch(bRate) {
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index 8099152f09..1952c4557a 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -59,15 +59,15 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda void LoadDBSettings()
{
ZeroMemory(&LastUCOpt, sizeof(LastUCOpt));
- LastUCOpt.MaxShownContacts = (INT)DBGetContactSettingByte( NULL, dbLastUC_ModuleName, dbLastUC_MaxShownContacts, 0 );
- LastUCOpt.HideOffline = DBGetContactSettingByte( NULL, dbLastUC_ModuleName, dbLastUC_HideOfflineContacts, 0 );
+ LastUCOpt.MaxShownContacts = (INT)db_get_b( NULL, dbLastUC_ModuleName, dbLastUC_MaxShownContacts, 0 );
+ LastUCOpt.HideOffline = db_get_b( NULL, dbLastUC_ModuleName, dbLastUC_HideOfflineContacts, 0 );
DBVARIANT dbv;
dbv.type = DBVT_ASCIIZ;
dbv.pszVal = NULL;
if ( db_get(NULL, dbLastUC_ModuleName, dbLastUC_DateTimeFormat, &dbv) == 0 && dbv.pszVal[0]!=0 ) {
LastUCOpt.DateTimeFormat = dbv.pszVal;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else LastUCOpt.DateTimeFormat = "(%Y-%m-%d %H:%M) ";
}
@@ -230,7 +230,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM dbv.pszVal = NULL;
if (db_get(NULL, dbLastUC_ModuleName, dbLastUC_DateTimeFormat, &dbv) == 0) {
strtimformat = dbv.pszVal;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else strtimformat = dbLastUC_DateTimeFormatDefault;
@@ -242,7 +242,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM if (LastUCOpt.HideOffline == 1) {
szProto = GetContactProto(curContact->second);
- if (szProto != NULL && DBGetContactSettingWord((HANDLE)curContact->second, szProto, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
+ if (szProto != NULL && db_get_w((HANDLE)curContact->second, szProto, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
continue;
}
@@ -486,7 +486,7 @@ static int OnPrebuildContactMenu (WPARAM wParam, LPARAM lParam) CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME | CMIF_TCHAR;
- if ( DBGetContactSettingByte((HANDLE)wParam, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0)
+ if ( db_get_b((HANDLE)wParam, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0)
clmi.ptszName = TranslateT("Ignore Contact");
else
clmi.ptszName = TranslateT("Show Contact");
@@ -518,8 +518,8 @@ INT_PTR ToggleIgnore (WPARAM wParam, LPARAM lParam) {
if (wParam != NULL) {
HANDLE hContact = ( HANDLE )wParam;
- int state = DBGetContactSettingByte(hContact, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0 ? 1 : 0 ;
- DBWriteContactSettingByte(hContact, dbLastUC_ModuleName, dbLastUC_IgnoreContact, state);
+ int state = db_get_b(hContact, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0 ? 1 : 0 ;
+ db_set_b(hContact, dbLastUC_ModuleName, dbLastUC_IgnoreContact, state);
return state;
}
diff --git a/plugins/RecentContacts/src/options.cpp b/plugins/RecentContacts/src/options.cpp index e8dd226a37..4e082f85f0 100644 --- a/plugins/RecentContacts/src/options.cpp +++ b/plugins/RecentContacts/src/options.cpp @@ -39,14 +39,14 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP BOOL bSuccess = FALSE;
LastUCOpt.HideOffline = (BOOL)IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE);
- DBWriteContactSettingByte(NULL, dbLastUC_ModuleName, dbLastUC_HideOfflineContacts, (BYTE)LastUCOpt.HideOffline);
+ db_set_b(NULL, dbLastUC_ModuleName, dbLastUC_HideOfflineContacts, (BYTE)LastUCOpt.HideOffline);
GetDlgItemTextA(hwndDlg, IDC_SHOWNCONTACTS, str, SIZEOF(str));
LastUCOpt.MaxShownContacts= atoi(str);
- DBWriteContactSettingByte(0,dbLastUC_ModuleName, dbLastUC_MaxShownContacts, LastUCOpt.MaxShownContacts);
+ db_set_b(0,dbLastUC_ModuleName, dbLastUC_MaxShownContacts, LastUCOpt.MaxShownContacts);
GetDlgItemTextA(hwndDlg, IDC_DATETIME, str, SIZEOF(str));
- DBWriteContactSettingString(0,dbLastUC_ModuleName, dbLastUC_DateTimeFormat, str );
+ db_set_s(0,dbLastUC_ModuleName, dbLastUC_DateTimeFormat, str );
LoadDBSettings();
return TRUE;
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index 4a60c271fd..cff9a72946 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -98,7 +98,7 @@ void UnloadServices() int SmsRebuildContactMenu(WPARAM wParam,LPARAM lParam)
{
- CListShowMenuItem(ssSMSSettings.hContactMenuItems[0],(BOOL)GetContactPhonesCount((HANDLE)wParam));
+ Menu_ShowItem(ssSMSSettings.hContactMenuItems[0], GetContactPhonesCount((HANDLE)wParam));
return 0;
}
diff --git a/plugins/SMS/src/common.h b/plugins/SMS/src/common.h index 14e04c614d..b0c3366480 100644 --- a/plugins/SMS/src/common.h +++ b/plugins/SMS/src/common.h @@ -40,10 +40,10 @@ extern HINSTANCE hInst; // ñòðóêòóðà ñîäåðæàùàÿ èíôîðìàöèþ ïî ïîñòðîåíèþ ìåíþ èëè ðàñøèðåíûõ èêîíîê
struct GUI_DISPLAY_ITEM
{
- LPSTR lpszName; // èìÿ ñåðâèñà, îíî æå èìÿ â èêîëèáå
- LPWSTR lpwszDescr; // òåêñòîâîå îïèñàíèå îòîáðàæàåìîå þçåðó
- LONG defIcon; // èêîíêà èç ðåñóðñîâ
- LPVOID lpFunc; // ôóíêöèÿ âûçûâàåìàÿ ìåíþ
+ LPSTR lpszName; // èìÿ ñåðâèñà, îíî æå èìÿ â èêîëèáå
+ LPWSTR lpwszDescr; // òåêñòîâîå îïèñàíèå îòîáðàæàåìîå þçåðó
+ LONG defIcon; // èêîíêà èç ðåñóðñîâ
+ LPVOID lpFunc; // ôóíêöèÿ âûçûâàåìàÿ ìåíþ
};
@@ -53,28 +53,25 @@ struct GUI_DISPLAY_ITEM typedef struct
{
- HANDLE hHeap;
- HINSTANCE hInstance;
+ HANDLE hHeap;
+ HINSTANCE hInstance;
- //HANDLE hMainMenuIcons[MAIN_MENU_ITEMS_COUNT+1];
- HANDLE hMainMenuItems[MAIN_MENU_ITEMS_COUNT+1];
+ HGENMENU hMainMenuItems[MAIN_MENU_ITEMS_COUNT+1];
+ HGENMENU hContactMenuItems[CONTACT_MENU_ITEMS_COUNT+1];
- //HANDLE hContactMenuIcons[CONTACT_MENU_ITEMS_COUNT+1];
- HANDLE hContactMenuItems[CONTACT_MENU_ITEMS_COUNT+1];
+ HANDLE hHookModulesLoaded;
+ HANDLE hHookPreShutdown;
+ HANDLE hHookOptInitialize;
+ HANDLE hHookRebuildCMenu;
+ HANDLE hHookDbAdd;
+ HANDLE hHookProtoAck;
+ HANDLE hHookAccListChanged;
- HANDLE hHookModulesLoaded;
- HANDLE hHookPreShutdown;
- HANDLE hHookOptInitialize;
- HANDLE hHookRebuildCMenu;
- HANDLE hHookDbAdd;
- HANDLE hHookProtoAck;
- HANDLE hHookAccListChanged;
+ LIST_MT lmtSendSMSWindowsListMT;
+ LIST_MT lmtRecvSMSWindowsListMT;
- LIST_MT lmtSendSMSWindowsListMT;
- LIST_MT lmtRecvSMSWindowsListMT;
-
- PROTOACCOUNT **ppaSMSAccounts;
- SIZE_T dwSMSAccountsCount;
+ PROTOACCOUNT **ppaSMSAccounts;
+ SIZE_T dwSMSAccountsCount;
} SMS_SETTINGS;
@@ -115,25 +112,24 @@ extern SMS_SETTINGS ssSMSSettings; #define GetContactNameA(Contact) (LPSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)Contact,0)
#define GetContactNameW(Contact) (LPWSTR)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)Contact,GCDNF_UNICODE)
-#define DB_SMS_DeleteValue(Contact,valueName) DBDeleteContactSetting(Contact,PROTOCOL_NAMEA,valueName)
-#define DB_SMS_GetDword(Contact,valueName,parDefltValue) DBGetContactSettingDword(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
-#define DB_SMS_SetDword(Contact,valueName,parValue) DBWriteContactSettingDword(Contact,PROTOCOL_NAMEA,valueName,parValue)
-#define DB_SMS_GetWord(Contact,valueName,parDefltValue) DBGetContactSettingWord(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
-#define DB_SMS_SetWord(Contact,valueName,parValue) DBWriteContactSettingWord(Contact,PROTOCOL_NAMEA,valueName,parValue)
-#define DB_SMS_GetByte(Contact,valueName,parDefltValue) DBGetContactSettingByte(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
-#define DB_SMS_SetByte(Contact,valueName,parValue) DBWriteContactSettingByte(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define DB_SMS_DeleteValue(Contact,valueName) db_unset(Contact,PROTOCOL_NAMEA,valueName)
+#define DB_SMS_GetDword(Contact,valueName,parDefltValue) db_get_dw(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
+#define DB_SMS_SetDword(Contact,valueName,parValue) db_set_dw(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define DB_SMS_GetWord(Contact,valueName,parDefltValue) db_get_w(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
+#define DB_SMS_SetWord(Contact,valueName,parValue) db_set_w(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define DB_SMS_GetByte(Contact,valueName,parDefltValue) db_get_b(Contact,PROTOCOL_NAMEA,valueName,parDefltValue)
+#define DB_SMS_SetByte(Contact,valueName,parValue) db_set_b(Contact,PROTOCOL_NAMEA,valueName,parValue)
BOOL DB_GetStaticStringW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpszRetBuff,SIZE_T dwRetBuffSize,SIZE_T *pdwRetBuffSize);
#define DB_SMS_GetStaticStringW(Contact,ValueName,Ret,RetBuffSize,pRetBuffSize) DB_GetStaticStringW(Contact,PROTOCOL_NAMEA,ValueName,Ret,RetBuffSize,pRetBuffSize)
BOOL DB_SetStringExW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpwszValue,SIZE_T dwValueSize);
-#define DB_SetStringW(Contact,Module,valueName,parValue) DBWriteContactSettingWString(Contact,Module,valueName,parValue)
-#define DB_SMS_SetStringW(Contact,valueName,parValue) DBWriteContactSettingWString(Contact,PROTOCOL_NAMEA,valueName,parValue)
+#define DB_SetStringW(Contact,Module,valueName,parValue) db_set_ws(Contact,Module,valueName,parValue)
+#define DB_SMS_SetStringW(Contact,valueName,parValue) db_set_ws(Contact,PROTOCOL_NAMEA,valueName,parValue)
#define DB_SMS_SetStringExW(Contact,valueName,parValue,parValueSize) DB_SetStringExW(Contact,PROTOCOL_NAMEA,valueName,parValue,parValueSize)
LRESULT CALLBACK MessageSubclassProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
LPSTR GetModuleName(HANDLE hContact);
void EnableControlsArray(HWND hWndDlg,WORD *pwControlsList,SIZE_T dwControlsListCount,BOOL bEnabled);
-void CListShowMenuItem(HANDLE hMenuItem,BOOL bShow);
// Declaration of function that returns received string with only numbers
SIZE_T CopyNumberA(LPSTR lpszOutBuff,LPSTR lpszBuff,SIZE_T dwLen);
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index 0bdb9ce46e..5110270f3c 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -24,7 +24,7 @@ BOOL DB_GetStaticStringW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LP }
if (pdwRetBuffSize) (*pdwRetBuffSize)=dwReadedStringLen;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}else{
if (lpwszRetBuff && dwRetBuffSize>=sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff))=0;
if (pdwRetBuffSize) (*pdwRetBuffSize)=0;
@@ -56,7 +56,7 @@ BOOL DB_SetStringExW(HANDLE hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR }
}else{
bRet=TRUE;
- DBDeleteContactSetting(hContact,lpszModule,lpszValueName);
+ db_unset(hContact,lpszModule,lpszValueName);
}
return(bRet);
}
@@ -81,19 +81,6 @@ void EnableControlsArray(HWND hWndDlg,WORD *pwControlsList,SIZE_T dwControlsList for(SIZE_T i=0;i<dwControlsListCount;i++) EnableWindow(GetDlgItem(hWndDlg,pwControlsList[i]),bEnabled);
}
-
-void CListShowMenuItem(HANDLE hMenuItem,BOOL bShow)
-{
- CLISTMENUITEM mi={0};
-
- mi.cbSize=sizeof(mi);
- mi.flags=CMIM_FLAGS;
- if (bShow==FALSE) mi.flags|=CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hMenuItem,(LPARAM)&mi);
-}
-
-
//This function gets a Cellular string szPhone and clean it from symbools.
SIZE_T CopyNumberA(LPSTR lpszOutBuff,LPSTR lpszBuff,SIZE_T dwLen)
{
@@ -570,32 +557,32 @@ void LoadMsgDlgFont(int i,LOGFONT *lf,COLORREF *colour) if (colour)
{
mir_snprintf(str,sizeof(str),"Font%dCol",i);
- (*colour)=DBGetContactSettingDword(NULL,SRMMMOD,str,fontOptionsList[0].defColour);
+ (*colour)=db_get_dw(NULL,SRMMMOD,str,fontOptionsList[0].defColour);
}
if (lf)
{
- if (DBGetContactSetting(NULL,SRMMMOD,str,&dbv))
+ if (db_get(NULL,SRMMMOD,str,&dbv))
{
lstrcpyn(lf->lfFaceName,fontOptionsList[0].szDefFace,SIZEOF(lf->lfFaceName));
}else{
lstrcpyn(lf->lfFaceName,dbv.ptszVal,SIZEOF(lf->lfFaceName));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
mir_snprintf(str,sizeof(str),"Font%dSize",i);
- lf->lfHeight=(char)DBGetContactSettingByte(NULL,SRMMMOD,str,fontOptionsList[0].defSize);
+ lf->lfHeight=(char)db_get_b(NULL,SRMMMOD,str,fontOptionsList[0].defSize);
lf->lfWidth=0;
lf->lfEscapement=0;
lf->lfOrientation=0;
mir_snprintf(str,sizeof(str),"Font%dSty",i);
- style=DBGetContactSettingByte(NULL,SRMMMOD,str,fontOptionsList[0].defStyle);
+ style=db_get_b(NULL,SRMMMOD,str,fontOptionsList[0].defStyle);
lf->lfWeight=style&FONTF_BOLD?FW_BOLD:FW_NORMAL;
lf->lfItalic=style&FONTF_ITALIC?1:0;
lf->lfUnderline=0;
lf->lfStrikeOut=0;
mir_snprintf(str,sizeof(str),"Font%dSet",i);
- lf->lfCharSet=DBGetContactSettingByte(NULL,SRMMMOD,str,MsgDlgGetFontDefaultCharset(lf->lfFaceName));
+ lf->lfCharSet=db_get_b(NULL,SRMMMOD,str,MsgDlgGetFontDefaultCharset(lf->lfFaceName));
lf->lfOutPrecision=OUT_DEFAULT_PRECIS;
lf->lfClipPrecision=CLIP_DEFAULT_PRECIS;
lf->lfQuality=DEFAULT_QUALITY;
diff --git a/plugins/SMS/src/recvdlg.cpp b/plugins/SMS/src/recvdlg.cpp index 24464c29bd..40d52cde6f 100644 --- a/plugins/SMS/src/recvdlg.cpp +++ b/plugins/SMS/src/recvdlg.cpp @@ -83,7 +83,7 @@ INT_PTR CALLBACK RecvSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l hFont=CreateFontIndirect(&lf);
SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_MESSAGE,WM_SETFONT,(WPARAM)hFont,MAKELPARAM(TRUE,0));
- COLORREF colour=DBGetContactSettingDword(NULL,SRMMMOD,SRMSGSET_BKGCOLOUR,SRMSGDEFSET_BKGCOLOUR);
+ COLORREF colour=db_get_dw(NULL,SRMMMOD,SRMSGSET_BKGCOLOUR,SRMSGDEFSET_BKGCOLOUR);
prswdWindowData->hBkgBrush=CreateSolidBrush(colour);
}
@@ -100,7 +100,7 @@ INT_PTR CALLBACK RecvSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l LoadMsgDlgFont(MSGFONTID_YOURMSG,NULL,&colour);
SetTextColor((HDC)wParam,colour);
- SetBkColor((HDC)wParam,DBGetContactSettingDword(NULL,SRMMMOD,SRMSGSET_BKGCOLOUR,SRMSGDEFSET_BKGCOLOUR));
+ SetBkColor((HDC)wParam,db_get_dw(NULL,SRMMMOD,SRMSGSET_BKGCOLOUR,SRMSGDEFSET_BKGCOLOUR));
return((BOOL)prswdWindowData->hBkgBrush);
}
break;
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp index 965e7fcb6e..ce85e08ecc 100644 --- a/plugins/SMS/src/senddlg.cpp +++ b/plugins/SMS/src/senddlg.cpp @@ -105,7 +105,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l hFont=CreateFontIndirect(&lf);
SEND_DLG_ITEM_MESSAGE(hWndDlg,IDC_MESSAGE,WM_SETFONT,(WPARAM)hFont,MAKELPARAM(TRUE,0));
- COLORREF colour=DBGetContactSettingDword(NULL,SRMMMOD,SRMSGSET_INPBKGCOLOUR,SRMSGDEFSET_BKGCOLOUR);
+ COLORREF colour=db_get_dw(NULL,SRMMMOD,SRMSGSET_INPBKGCOLOUR,SRMSGDEFSET_BKGCOLOUR);
psswdWindowData->hBkgBrush=CreateSolidBrush(colour);
}
{
@@ -235,7 +235,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l LoadMsgDlgFont(MSGFONTID_MESSAGEAREA,NULL,&colour);
SetTextColor((HDC)wParam,colour);
- SetBkColor((HDC)wParam,DBGetContactSettingDword(NULL,SRMMMOD,SRMSGSET_INPBKGCOLOUR,SRMSGDEFSET_BKGCOLOUR));
+ SetBkColor((HDC)wParam,db_get_dw(NULL,SRMMMOD,SRMSGSET_INPBKGCOLOUR,SRMSGDEFSET_BKGCOLOUR));
return((BOOL)psswdWindowData->hBkgBrush);
}
break;
@@ -410,8 +410,8 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l for(DWORD i=0;bCont;i++)
{
mir_snprintf(szBuff,SIZEOF(szBuff),"MyPhone%d",i);
- if (DBGetContactSetting(psswdWindowData->hMyContact,"UserInfo",szBuff,&dbv)) bCont=FALSE;
- DBFreeVariant(&dbv);
+ if (db_get(psswdWindowData->hMyContact,"UserInfo",szBuff,&dbv)) bCont=FALSE;
+ db_free(&dbv);
}
DB_SetStringW(psswdWindowData->hMyContact,"UserInfo",szBuff,wszPhone);
}
diff --git a/plugins/Scriver/src/chat/clist.cpp b/plugins/Scriver/src/chat/clist.cpp index 697d46c94d..9cb2f09b09 100644 --- a/plugins/Scriver/src/chat/clist.cpp +++ b/plugins/Scriver/src/chat/clist.cpp @@ -30,7 +30,7 @@ HANDLE CList_AddRoom(const char* pszModule, const TCHAR* pszRoom, const TCHAR* p TCHAR pszGroup[50];
*pszGroup = '\0';
- if ( !DBGetContactSettingTString(NULL, "Chat", "AddToGroup", &dbv)) {
+ if ( !db_get_ts(NULL, "Chat", "AddToGroup", &dbv)) {
if ( lstrlen(dbv.ptszVal) > 0 )
lstrcpyn( pszGroup, dbv.ptszVal, 50);
db_free(&dbv);
@@ -47,12 +47,12 @@ HANDLE CList_AddRoom(const char* pszModule, const TCHAR* pszRoom, const TCHAR* p _itoa(i, str, 10);
DBVARIANT dbv, dbv2;
- if (DBGetContactSettingTString( NULL, "CListGroups", str, &dbv)) {
+ if (db_get_ts( NULL, "CListGroups", str, &dbv)) {
db_set_ts(hContact, "CList", "Group", pszGroup);
goto END_GROUPLOOP;
}
- if ( !DBGetContactSettingTString( hContact, "CList", "Group", &dbv2 )) {
+ if ( !db_get_ts( hContact, "CList", "Group", &dbv2 )) {
if ( dbv.ptszVal[0] != '\0' && dbv2.ptszVal[0] != '\0' && !lstrcmpi( dbv.ptszVal + 1, dbv2.ptszVal )) {
db_free(&dbv);
db_free(&dbv2);
@@ -129,7 +129,7 @@ int CList_RoomDoubleclicked(WPARAM wParam,LPARAM lParam) if (db_get_b(hContact, szProto, "ChatRoom", 0) == 0)
return 0;
- if ( !DBGetContactSettingTString( hContact, szProto, "ChatRoomID", &dbv )) {
+ if ( !db_get_ts( hContact, szProto, "ChatRoomID", &dbv )) {
SESSION_INFO* si = SM_FindSession( dbv.ptszVal, szProto );
if ( si ) {
// is the "toggle visibility option set, so we need to close the window?
@@ -233,7 +233,7 @@ void CList_CreateGroup(TCHAR* group) for (i = 0;; i++) {
_itoa(i, str, 10);
- if ( DBGetContactSettingTString( NULL, "CListGroups", str, &dbv ))
+ if ( db_get_ts( NULL, "CListGroups", str, &dbv ))
break;
if ( dbv.pszVal[0] != '\0' && !lstrcmpi(dbv.ptszVal + 1, group)) {
@@ -289,7 +289,7 @@ HANDLE CList_FindRoom ( const char* pszModule, const TCHAR* pszRoom) if (szProto && !lstrcmpiA(szProto, pszModule)) {
if ( db_get_b( hContact, szProto, "ChatRoom", 0) != 0) {
DBVARIANT dbv;
- if ( !DBGetContactSettingTString( hContact, szProto, "ChatRoomID", &dbv)) {
+ if ( !db_get_ts( hContact, szProto, "ChatRoomID", &dbv)) {
if ( !lstrcmpi(dbv.ptszVal, pszRoom)) {
db_free(&dbv);
return hContact;
diff --git a/plugins/Scriver/src/chat/log.cpp b/plugins/Scriver/src/chat/log.cpp index ac05d01576..07ad481eea 100644 --- a/plugins/Scriver/src/chat/log.cpp +++ b/plugins/Scriver/src/chat/log.cpp @@ -928,7 +928,7 @@ void LoadMsgLogBitmaps(void) int rtfHeaderSize;
PBYTE pBmpBits;
- hBkgBrush = CreateSolidBrush(DBGetContactSettingDword(NULL, "Chat", "ColorLogBG", GetSysColor(COLOR_WINDOW)));
+ hBkgBrush = CreateSolidBrush(db_get_dw(NULL, "Chat", "ColorLogBG", GetSysColor(COLOR_WINDOW)));
bih.biSize = sizeof(bih);
bih.biBitCount = 24;
bih.biCompression = BI_RGB;
diff --git a/plugins/Scriver/src/chat/manager.cpp b/plugins/Scriver/src/chat/manager.cpp index 5d1ef90de1..50bb2287fe 100644 --- a/plugins/Scriver/src/chat/manager.cpp +++ b/plugins/Scriver/src/chat/manager.cpp @@ -119,8 +119,8 @@ int SM_RemoveSession(const TCHAR* pszID, const char* pszModule, BOOL removeConta /* if (pTemp->iType != GCW_SERVER)
db_set_b(pTemp->windowData.hContact, "CList", "Hidden", 1);*/
}
- DBWriteContactSettingString(pTemp->windowData.hContact, pTemp->pszModule , "Topic", "");
- DBWriteContactSettingString(pTemp->windowData.hContact, pTemp->pszModule, "StatusBar", "");
+ db_set_s(pTemp->windowData.hContact, pTemp->pszModule , "Topic", "");
+ db_set_s(pTemp->windowData.hContact, pTemp->pszModule, "StatusBar", "");
db_unset(pTemp->windowData.hContact, "CList", "StatusMsg");
if (removeContact)
@@ -681,9 +681,9 @@ BOOL SM_RemoveAll (void) DoEventHook(m_WndList->ptszID, m_WndList->pszModule, GC_SESSION_TERMINATE, NULL, NULL, (DWORD)m_WndList->dwItemData);
if (m_WndList->windowData.hContact)
CList_SetOffline(m_WndList->windowData.hContact, m_WndList->iType == GCW_CHATROOM?TRUE:FALSE);
- DBWriteContactSettingString(m_WndList->windowData.hContact, m_WndList->pszModule , "Topic", "");
+ db_set_s(m_WndList->windowData.hContact, m_WndList->pszModule , "Topic", "");
db_unset(m_WndList->windowData.hContact, "CList", "StatusMsg");
- DBWriteContactSettingString(m_WndList->windowData.hContact, m_WndList->pszModule, "StatusBar", "");
+ db_set_s(m_WndList->windowData.hContact, m_WndList->pszModule, "StatusBar", "");
UM_RemoveAll(&m_WndList->pUsers);
TM_RemoveAll(&m_WndList->pStatuses);
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp index e2826f56f1..f465caeea7 100644 --- a/plugins/Scriver/src/chat/options.cpp +++ b/plugins/Scriver/src/chat/options.cpp @@ -131,7 +131,7 @@ static void FillBranch(HWND hwndTree, HTREEITEM hParent, struct branch_t *branch tvis.item.pszText = TranslateTS(branch[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
if (branch[i].iMode)
- iState = ((DBGetContactSettingDword(NULL, "Chat", branch[i].szDBName, defaultval)&branch[i].iMode)&branch[i].iMode)!=0?2:1;
+ iState = ((db_get_dw(NULL, "Chat", branch[i].szDBName, defaultval)&branch[i].iMode)&branch[i].iMode)!=0?2:1;
else
iState = db_get_b(NULL, "Chat", branch[i].szDBName, branch[i].bDefault)!=0?2:1;
tvis.item.state=INDEXTOSTATEIMAGEMASK(iState);
@@ -156,7 +156,7 @@ static void SaveBranch(HWND hwndTree, struct branch_t *branch, int nValues) iState |= branch[i].iMode;
if (iState&GC_EVENT_ADDSTATUS)
iState |= GC_EVENT_REMOVESTATUS;
- DBWriteContactSettingDword(NULL, "Chat", branch[i].szDBName, (DWORD)iState);
+ db_set_dw(NULL, "Chat", branch[i].szDBName, (DWORD)iState);
}
else db_set_b(NULL, "Chat", branch[i].szDBName, bChecked);
} }
@@ -234,7 +234,7 @@ void LoadLogFonts(void) static void InitSetting(TCHAR** ppPointer, char* pszSetting, TCHAR* pszDefault)
{
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, "Chat", pszSetting, &dbv )) {
+ if ( !db_get_ts(NULL, "Chat", pszSetting, &dbv )) {
replaceStr( ppPointer, dbv.ptszVal );
db_free(&dbv);
}
@@ -329,9 +329,9 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa {
pszText = (char *)mir_realloc(pszText, iLen+1);
GetDlgItemTextA(hwndDlg, IDC_CHAT_GROUP, pszText,iLen+1);
- DBWriteContactSettingString(NULL, "Chat", "AddToGroup", pszText);
+ db_set_s(NULL, "Chat", "AddToGroup", pszText);
}
- else DBWriteContactSettingString(NULL, "Chat", "AddToGroup", "");
+ else db_set_s(NULL, "Chat", "AddToGroup", "");
mir_free(pszText);
iLen = SendDlgItemMessage(hwndDlg,IDC_CHAT_SPIN2,UDM_GETPOS,0,0);
@@ -569,7 +569,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa if ( iLen > 0 ) {
pszText = (char *)mir_realloc(pszText, iLen+1);
GetDlgItemTextA(hwndDlg, IDC_CHAT_LOGTIMESTAMP, pszText,iLen+1);
- DBWriteContactSettingString(NULL, "Chat", "LogTimestamp", pszText);
+ db_set_s(NULL, "Chat", "LogTimestamp", pszText);
}
else db_unset(NULL, "Chat", "LogTimestamp");
@@ -577,7 +577,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa if ( iLen > 0 ) {
pszText = (char *)mir_realloc(pszText, iLen+1);
GetDlgItemTextA(hwndDlg, IDC_CHAT_TIMESTAMP, pszText,iLen+1);
- DBWriteContactSettingString(NULL, "Chat", "HeaderTime", pszText);
+ db_set_s(NULL, "Chat", "HeaderTime", pszText);
}
else db_unset(NULL, "Chat", "HeaderTime");
@@ -585,7 +585,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa if ( iLen > 0 ) {
pszText = (char *)mir_realloc(pszText, iLen+1);
GetDlgItemTextA(hwndDlg, IDC_CHAT_INSTAMP, pszText,iLen+1);
- DBWriteContactSettingString(NULL, "Chat", "HeaderIncoming", pszText);
+ db_set_s(NULL, "Chat", "HeaderIncoming", pszText);
}
else db_unset(NULL, "Chat", "HeaderIncoming");
@@ -593,7 +593,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa if ( iLen > 0 ) {
pszText = (char *)mir_realloc(pszText, iLen+1);
GetDlgItemTextA(hwndDlg, IDC_CHAT_OUTSTAMP, pszText,iLen+1);
- DBWriteContactSettingString(NULL, "Chat", "HeaderOutgoing", pszText);
+ db_set_s(NULL, "Chat", "HeaderOutgoing", pszText);
}
else db_unset(NULL, "Chat", "HeaderOutgoing");
@@ -613,9 +613,9 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa mir_free(pszText);
- g_Settings.dwIconFlags = DBGetContactSettingDword(NULL, "Chat", "IconFlags", 0x0000);
- g_Settings.dwTrayIconFlags = DBGetContactSettingDword(NULL, "Chat", "TrayIconFlags", 0x1000);
- g_Settings.dwPopupFlags = DBGetContactSettingDword(NULL, "Chat", "PopupFlags", 0x0000);
+ g_Settings.dwIconFlags = db_get_dw(NULL, "Chat", "IconFlags", 0x0000);
+ g_Settings.dwTrayIconFlags = db_get_dw(NULL, "Chat", "TrayIconFlags", 0x1000);
+ g_Settings.dwPopupFlags = db_get_dw(NULL, "Chat", "PopupFlags", 0x0000);
g_Settings.StripFormat = (BOOL)db_get_b(NULL, "Chat", "TrimFormatting", 0);
g_Settings.TrayIconInactiveOnly = (BOOL)db_get_b(NULL, "Chat", "TrayIconInactiveOnly", 1);
g_Settings.PopUpInactiveOnly = (BOOL)db_get_b(NULL, "Chat", "PopUpInactiveOnly", 1);
@@ -732,9 +732,9 @@ static INT_PTR CALLBACK DlgProcOptionsPopup(HWND hwndDlg,UINT uMsg,WPARAM wParam db_set_w(NULL, "Chat", "PopupTimeout", (WORD)iLen);
g_Settings.crPUBkgColour = SendDlgItemMessage(hwndDlg,IDC_CHAT_BKG,CPM_GETCOLOUR,0,0);
- DBWriteContactSettingDword(NULL, "Chat", "PopupColorBG", (DWORD)SendDlgItemMessage(hwndDlg,IDC_CHAT_BKG,CPM_GETCOLOUR,0,0));
+ db_set_dw(NULL, "Chat", "PopupColorBG", (DWORD)SendDlgItemMessage(hwndDlg,IDC_CHAT_BKG,CPM_GETCOLOUR,0,0));
g_Settings.crPUTextColour = SendDlgItemMessage(hwndDlg,IDC_CHAT_TEXT,CPM_GETCOLOUR,0,0);
- DBWriteContactSettingDword(NULL, "Chat", "PopupColorText", (DWORD)SendDlgItemMessage(hwndDlg,IDC_CHAT_TEXT,CPM_GETCOLOUR,0,0));
+ db_set_dw(NULL, "Chat", "PopupColorText", (DWORD)SendDlgItemMessage(hwndDlg,IDC_CHAT_TEXT,CPM_GETCOLOUR,0,0));
SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch6, SIZEOF(branch6));
}
return TRUE;
@@ -779,26 +779,26 @@ void LoadGlobalSettings(void) g_Settings.ShowTimeIfChanged = (BOOL)db_get_b(NULL, "Chat", "ShowTimeStampIfChanged", 0);
g_Settings.TimeStampEventColour = (BOOL)db_get_b(NULL, "Chat", "TimeStampEventColour", 0);
g_Settings.iEventLimit = db_get_w(NULL, "Chat", "LogLimit", 100);
- g_Settings.dwIconFlags = DBGetContactSettingDword(NULL, "Chat", "IconFlags", 0x0000);
- g_Settings.dwTrayIconFlags = DBGetContactSettingDword(NULL, "Chat", "TrayIconFlags", 0x1000);
- g_Settings.dwPopupFlags = DBGetContactSettingDword(NULL, "Chat", "PopupFlags", 0x0000);
+ g_Settings.dwIconFlags = db_get_dw(NULL, "Chat", "IconFlags", 0x0000);
+ g_Settings.dwTrayIconFlags = db_get_dw(NULL, "Chat", "TrayIconFlags", 0x1000);
+ g_Settings.dwPopupFlags = db_get_dw(NULL, "Chat", "PopupFlags", 0x0000);
g_Settings.LoggingLimit = db_get_w(NULL, "Chat", "LoggingLimit", 100);
g_Settings.LoggingEnabled = (BOOL)db_get_b(NULL, "Chat", "LoggingEnabled", 0);
g_Settings.FlashWindow = (BOOL)db_get_b(NULL, "Chat", "FlashWindow", 0);
g_Settings.HighlightEnabled = (BOOL)db_get_b(NULL, "Chat", "HighlightEnabled", 1);
- g_Settings.crUserListColor = DBGetContactSettingDword(NULL, "ChatFonts", "Font18Col", RGB(0,0,0));
- g_Settings.crUserListBGColor = DBGetContactSettingDword(NULL, "Chat", "ColorNicklistBG", GetSysColor(COLOR_WINDOW));
- g_Settings.crUserListSelectedBGColor = DBGetContactSettingDword(NULL, "Chat", "ColorNicklistSelectedBG", GetSysColor(COLOR_HIGHLIGHT));
- g_Settings.crUserListHeadingsColor = DBGetContactSettingDword(NULL, "ChatFonts", "Font19Col", RGB(170,170,170));
- g_Settings.crLogBackground = DBGetContactSettingDword(NULL, "Chat", "ColorLogBG", GetSysColor(COLOR_WINDOW));
+ g_Settings.crUserListColor = db_get_dw(NULL, "ChatFonts", "Font18Col", RGB(0,0,0));
+ g_Settings.crUserListBGColor = db_get_dw(NULL, "Chat", "ColorNicklistBG", GetSysColor(COLOR_WINDOW));
+ g_Settings.crUserListSelectedBGColor = db_get_dw(NULL, "Chat", "ColorNicklistSelectedBG", GetSysColor(COLOR_HIGHLIGHT));
+ g_Settings.crUserListHeadingsColor = db_get_dw(NULL, "ChatFonts", "Font19Col", RGB(170,170,170));
+ g_Settings.crLogBackground = db_get_dw(NULL, "Chat", "ColorLogBG", GetSysColor(COLOR_WINDOW));
g_Settings.StripFormat = (BOOL)db_get_b(NULL, "Chat", "StripFormatting", 0);
g_Settings.TrayIconInactiveOnly = (BOOL)db_get_b(NULL, "Chat", "TrayIconInactiveOnly", 1);
g_Settings.PopUpInactiveOnly = (BOOL)db_get_b(NULL, "Chat", "PopUpInactiveOnly", 1);
g_Settings.AddColonToAutoComplete = (BOOL)db_get_b(NULL, "Chat", "AddColonToAutoComplete", 1);
g_Settings.iPopupStyle = db_get_b(NULL, "Chat", "PopupStyle", 1);
g_Settings.iPopupTimeout = db_get_w(NULL, "Chat", "PopupTimeout", 3);
- g_Settings.crPUBkgColour = DBGetContactSettingDword(NULL, "Chat", "PopupColorBG", GetSysColor(COLOR_WINDOW));
- g_Settings.crPUTextColour = DBGetContactSettingDword(NULL, "Chat", "PopupColorText", 0);
+ g_Settings.crPUBkgColour = db_get_dw(NULL, "Chat", "PopupColorBG", GetSysColor(COLOR_WINDOW));
+ g_Settings.crPUTextColour = db_get_dw(NULL, "Chat", "PopupColorText", 0);
g_Settings.ShowContactStatus = db_get_b(NULL, "Chat", "ShowContactStatus", 0);
g_Settings.ContactStatusFirst = db_get_b(NULL, "Chat", "ContactStatusFirst", 0);
@@ -810,7 +810,7 @@ void LoadGlobalSettings(void) DBVARIANT dbv;
g_Settings.pszLogDir = (TCHAR *)mir_realloc(g_Settings.pszLogDir, MAX_PATH*sizeof(TCHAR));
- if ( !DBGetContactSettingTString(NULL, "Chat", "LogDirectory", &dbv)) {
+ if ( !db_get_ts(NULL, "Chat", "LogDirectory", &dbv)) {
lstrcpyn(g_Settings.pszLogDir, dbv.ptszVal, MAX_PATH);
db_free(&dbv);
}
@@ -835,11 +835,11 @@ void LoadGlobalSettings(void) if (hListBkgBrush != NULL)
DeleteObject(hListBkgBrush);
- hListBkgBrush = CreateSolidBrush(DBGetContactSettingDword(NULL, "Chat", "ColorNicklistBG", GetSysColor(COLOR_WINDOW)));
+ hListBkgBrush = CreateSolidBrush(db_get_dw(NULL, "Chat", "ColorNicklistBG", GetSysColor(COLOR_WINDOW)));
if (hListSelectedBkgBrush != NULL)
DeleteObject(hListSelectedBkgBrush);
- hListSelectedBkgBrush = CreateSolidBrush(DBGetContactSettingDword(NULL, "Chat", "ColorNicklistSelectedBG", GetSysColor(COLOR_HIGHLIGHT)));
+ hListSelectedBkgBrush = CreateSolidBrush(db_get_dw(NULL, "Chat", "ColorNicklistSelectedBG", GetSysColor(COLOR_HIGHLIGHT)));
}
static void FreeGlobalSettings(void)
diff --git a/plugins/Scriver/src/chat/services.cpp b/plugins/Scriver/src/chat/services.cpp index c9a578e76d..9c2bbbe244 100644 --- a/plugins/Scriver/src/chat/services.cpp +++ b/plugins/Scriver/src/chat/services.cpp @@ -221,7 +221,7 @@ static INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam) si->ptszStatusbarText = a2tf( gcw->ptszStatusbarText, gcw->dwFlags );
si->iSplitterX = g_Settings.iSplitterX;
si->iSplitterY = g_Settings.iSplitterY;
- si->iLogFilterFlags = (int)DBGetContactSettingDword(NULL, "Chat", "FilterFlags", 0x03E0);
+ si->iLogFilterFlags = (int)db_get_dw(NULL, "Chat", "FilterFlags", 0x03E0);
si->bFilterEnabled = db_get_b(NULL, "Chat", "FilterEnabled", 0);
si->bNicklistEnabled = db_get_b(NULL, "Chat", "ShowNicklist", 1);
@@ -246,12 +246,12 @@ static INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam) si->windowData.hContact = CList_AddRoom( gcw->pszModule, ptszID, szTemp, si->iType);
si->windowData.codePage = db_get_w(si->windowData.hContact, si->pszModule, "CodePage", (WORD) CP_ACP);
si->pszHeader = Log_CreateRtfHeader(mi, si);
- DBWriteContactSettingString(si->windowData.hContact, si->pszModule , "Topic", "");
+ db_set_s(si->windowData.hContact, si->pszModule , "Topic", "");
db_unset(si->windowData.hContact, "CList", "StatusMsg");
if (si->ptszStatusbarText)
db_set_ts(si->windowData.hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
- DBWriteContactSettingString(si->windowData.hContact, si->pszModule, "StatusBar", "");
+ db_set_s(si->windowData.hContact, si->pszModule, "StatusBar", "");
}
else {
SESSION_INFO* si2 = SM_FindSession( ptszID, gcw->pszModule );
@@ -370,7 +370,7 @@ static INT_PTR DoControl(GCEVENT * gce, WPARAM wp) if ( si->ptszStatusbarText )
db_set_ts(si->windowData.hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
- DBWriteContactSettingString(si->windowData.hContact, si->pszModule, "StatusBar", "");
+ db_set_s(si->windowData.hContact, si->pszModule, "StatusBar", "");
if (si->hWnd)
{
SendMessage(si->hWnd, DM_UPDATESTATUSBAR, 0, 0);
diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp index f30fefb135..a09a1d290a 100644 --- a/plugins/Scriver/src/chat/tools.cpp +++ b/plugins/Scriver/src/chat/tools.cpp @@ -385,7 +385,7 @@ void CheckColorsInModule(const char* pszModule) MODULEINFO * pMod = MM_FindModule( pszModule );
int i = 0;
COLORREF crFG;
- COLORREF crBG = (COLORREF)DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
+ COLORREF crBG = (COLORREF)db_get_dw(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, NULL, &crFG, FALSE);
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index fa803330ce..a384eeb7e4 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -494,7 +494,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, if (MM_FindModule(Parentsi->pszModule) && MM_FindModule(Parentsi->pszModule)->bBkgColor) {
int index = GetColorIndex(Parentsi->pszModule, cf.crBackColor);
- COLORREF crB = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
+ COLORREF crB = db_get_dw(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
u = IsDlgButtonChecked(GetParent(hwnd), IDC_CHAT_BKGCOLOR);
if (index >= 0) {
@@ -1178,8 +1178,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) cf.dwMask = CFM_COLOR|CFM_BOLD|CFM_UNDERLINE|CFM_BACKCOLOR;
cf.dwEffects = 0;
cf.crTextColor = crFore;
- cf.crBackColor = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
- SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_SETBKGNDCOLOR , 0, DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR));
+ cf.crBackColor = db_get_dw(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
+ SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_SETBKGNDCOLOR , 0, db_get_dw(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR));
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, WM_SETFONT, (WPARAM) g_Settings.MessageBoxFont, MAKELPARAM(TRUE, 0));
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_SETCHARFORMAT, (WPARAM)SCF_ALL , (LPARAM)&cf);
}
@@ -1933,7 +1933,7 @@ LABEL_SHOWWINDOW: } }
else {
cf.dwMask = CFM_BACKCOLOR;
- cf.crBackColor = (COLORREF)DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
+ cf.crBackColor = (COLORREF)db_get_dw(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
if (pInfo->bSingleFormat) {
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf);
} else {
@@ -2066,7 +2066,7 @@ LABEL_SHOWWINDOW: i = TrackPopupMenu(hToolbarMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
if (i > 0) {
g_dat.chatBbuttonVisibility ^= (1 << (i - 1));
- DBWriteContactSettingDword(NULL, SRMMMOD, SRMSGSET_CHATBUTTONVISIBILITY, g_dat.chatBbuttonVisibility);
+ db_set_dw(NULL, SRMMMOD, SRMSGSET_CHATBUTTONVISIBILITY, g_dat.chatBbuttonVisibility);
SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE);
}
DestroyMenu(hToolbarMenu);
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index e01fb19a9e..0f8d96f139 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -238,11 +238,11 @@ void LoadInfobarFonts() {
LOGFONT lf;
LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, &lf, NULL, FALSE);
- g_dat.minInputAreaHeight = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_AUTORESIZELINES, SRMSGDEFSET_AUTORESIZELINES) * abs(lf.lfHeight) * g_dat.logPixelSY / 72;
+ g_dat.minInputAreaHeight = db_get_dw(NULL, SRMMMOD, SRMSGSET_AUTORESIZELINES, SRMSGDEFSET_AUTORESIZELINES) * abs(lf.lfHeight) * g_dat.logPixelSY / 72;
if (g_dat.hInfobarBrush != NULL)
DeleteObject(g_dat.hInfobarBrush);
- g_dat.hInfobarBrush = CreateSolidBrush(DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_INFOBARBKGCOLOUR, SRMSGDEFSET_INFOBARBKGCOLOUR));
+ g_dat.hInfobarBrush = CreateSolidBrush(db_get_dw(NULL, SRMMMOD, SRMSGSET_INFOBARBKGCOLOUR, SRMSGDEFSET_INFOBARBKGCOLOUR));
}
void InitGlobals()
@@ -343,9 +343,9 @@ void ReloadGlobals() if (db_get_b(NULL, SRMMMOD, SRMSGSET_INDENTTEXT, SRMSGDEFSET_INDENTTEXT))
g_dat.flags |= SMF_INDENTTEXT;
- g_dat.openFlags = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_POPFLAGS, SRMSGDEFSET_POPFLAGS);
+ g_dat.openFlags = db_get_dw(NULL, SRMMMOD, SRMSGSET_POPFLAGS, SRMSGDEFSET_POPFLAGS);
g_dat.indentSize = db_get_w(NULL, SRMMMOD, SRMSGSET_INDENTSIZE, SRMSGDEFSET_INDENTSIZE);
- g_dat.logLineColour = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_LINECOLOUR, SRMSGDEFSET_LINECOLOUR);
+ g_dat.logLineColour = db_get_dw(NULL, SRMMMOD, SRMSGSET_LINECOLOUR, SRMSGDEFSET_LINECOLOUR);
if (db_get_b(NULL, SRMMMOD, SRMSGSET_USETABS, SRMSGDEFSET_USETABS))
g_dat.flags2 |= SMF2_USETABS;
@@ -391,18 +391,18 @@ void ReloadGlobals() if (LOBYTE(LOWORD(GetVersion())) >= 5 && pSetLayeredWindowAttributes != NULL) {
if (db_get_b(NULL, SRMMMOD, SRMSGSET_USETRANSPARENCY, SRMSGDEFSET_USETRANSPARENCY))
g_dat.flags2 |= SMF2_USETRANSPARENCY;
- g_dat.activeAlpha = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_ACTIVEALPHA, SRMSGDEFSET_ACTIVEALPHA);
- g_dat.inactiveAlpha = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_INACTIVEALPHA, SRMSGDEFSET_INACTIVEALPHA);
+ g_dat.activeAlpha = db_get_dw(NULL, SRMMMOD, SRMSGSET_ACTIVEALPHA, SRMSGDEFSET_ACTIVEALPHA);
+ g_dat.inactiveAlpha = db_get_dw(NULL, SRMMMOD, SRMSGSET_INACTIVEALPHA, SRMSGDEFSET_INACTIVEALPHA);
}
if (db_get_b(NULL, SRMMMOD, SRMSGSET_USEIEVIEW, SRMSGDEFSET_USEIEVIEW))
g_dat.flags |= SMF_USEIEVIEW;
- g_dat.buttonVisibility = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_BUTTONVISIBILITY, SRMSGDEFSET_BUTTONVISIBILITY);
- g_dat.chatBbuttonVisibility = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_CHATBUTTONVISIBILITY, SRMSGDEFSET_CHATBUTTONVISIBILITY);
+ g_dat.buttonVisibility = db_get_dw(NULL, SRMMMOD, SRMSGSET_BUTTONVISIBILITY, SRMSGDEFSET_BUTTONVISIBILITY);
+ g_dat.chatBbuttonVisibility = db_get_dw(NULL, SRMMMOD, SRMSGSET_CHATBUTTONVISIBILITY, SRMSGDEFSET_CHATBUTTONVISIBILITY);
- g_dat.limitNamesLength = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_LIMITNAMESLEN, SRMSGDEFSET_LIMITNAMESLEN);
- g_dat.limitTabsNum = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_LIMITTABSNUM, SRMSGDEFSET_LIMITTABSNUM);
- g_dat.limitChatsTabsNum = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_LIMITCHATSTABSNUM, SRMSGDEFSET_LIMITCHATSTABSNUM);
+ g_dat.limitNamesLength = db_get_dw(NULL, SRMMMOD, SRMSGSET_LIMITNAMESLEN, SRMSGDEFSET_LIMITNAMESLEN);
+ g_dat.limitTabsNum = db_get_dw(NULL, SRMMMOD, SRMSGSET_LIMITTABSNUM, SRMSGDEFSET_LIMITTABSNUM);
+ g_dat.limitChatsTabsNum = db_get_dw(NULL, SRMMMOD, SRMSGSET_LIMITCHATSTABSNUM, SRMSGDEFSET_LIMITCHATSTABSNUM);
}
static int ackevent(WPARAM wParam, LPARAM lParam)
diff --git a/plugins/Scriver/src/infobar.cpp b/plugins/Scriver/src/infobar.cpp index 0c59d7fc0f..9ffe857006 100644 --- a/plugins/Scriver/src/infobar.cpp +++ b/plugins/Scriver/src/infobar.cpp @@ -28,7 +28,7 @@ void SetupInfobar(InfobarWindowData* idat) { CHARFORMAT2 cf2;
memset(&cf2, 0, sizeof(cf2));
LOGFONT lf;
- DWORD colour = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_INFOBARBKGCOLOUR, SRMSGDEFSET_INFOBARBKGCOLOUR);
+ DWORD colour = db_get_dw(NULL, SRMMMOD, SRMSGSET_INFOBARBKGCOLOUR, SRMSGDEFSET_INFOBARBKGCOLOUR);
SendDlgItemMessage(hwnd, IDC_INFOBAR_NAME, EM_SETBKGNDCOLOR, 0, colour);
SendDlgItemMessage(hwnd, IDC_INFOBAR_STATUS, EM_SETBKGNDCOLOR, 0, colour);
LoadMsgDlgFont(MSGFONTID_INFOBAR_NAME, &lf, &colour, FALSE);
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index b1419dff25..75d5fb77f2 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -1014,7 +1014,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP i = TrackPopupMenu(hToolbarMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
if (i > 0) {
g_dat.buttonVisibility ^= (1 << (i - 1));
- DBWriteContactSettingDword(NULL, SRMMMOD, SRMSGSET_BUTTONVISIBILITY, g_dat.buttonVisibility);
+ db_set_dw(NULL, SRMMMOD, SRMSGSET_BUTTONVISIBILITY, g_dat.buttonVisibility);
WindowList_Broadcast(g_dat.hMessageWindowList, DM_OPTIONSAPPLIED, 0, 0);
}
DestroyMenu(hToolbarMenu);
@@ -1191,9 +1191,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SendMessage(hwndDlg, DM_GETAVATAR, 0, 0);
SetDialogToType(hwndDlg);
- colour = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR);
+ colour = db_get_dw(NULL, SRMMMOD, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR);
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETBKGNDCOLOR, 0, colour);
- colour = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
+ colour = db_get_dw(NULL, SRMMMOD, SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR);
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETBKGNDCOLOR, 0, colour);
InvalidateRect(GetDlgItem(hwndDlg, IDC_MESSAGE), NULL, FALSE);
LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, &lf, &colour, FALSE);
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 83f142d87b..6d6be46791 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -394,11 +394,11 @@ static char *CreateRTFHeader(struct SrmmWindowData *dat, struct GlobalMessageDat else
colour = GetSysColor(COLOR_HOTLIGHT);
AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "\\red%u\\green%u\\blue%u;", GetRValue(colour), GetGValue(colour), GetBValue(colour));
- colour = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR);
+ colour = db_get_dw(NULL, SRMMMOD, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR);
AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "\\red%u\\green%u\\blue%u;", GetRValue(colour), GetGValue(colour), GetBValue(colour));
- colour = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_INCOMINGBKGCOLOUR, SRMSGDEFSET_INCOMINGBKGCOLOUR);
+ colour = db_get_dw(NULL, SRMMMOD, SRMSGSET_INCOMINGBKGCOLOUR, SRMSGDEFSET_INCOMINGBKGCOLOUR);
AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "\\red%u\\green%u\\blue%u;", GetRValue(colour), GetGValue(colour), GetBValue(colour));
- colour = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_OUTGOINGBKGCOLOUR, SRMSGDEFSET_OUTGOINGBKGCOLOUR);
+ colour = db_get_dw(NULL, SRMMMOD, SRMSGSET_OUTGOINGBKGCOLOUR, SRMSGDEFSET_OUTGOINGBKGCOLOUR);
AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "\\red%u\\green%u\\blue%u;", GetRValue(colour), GetGValue(colour), GetBValue(colour));
colour = gdat->logLineColour;
AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "\\red%u\\green%u\\blue%u;", GetRValue(colour), GetGValue(colour), GetBValue(colour));
@@ -992,9 +992,9 @@ void LoadMsgLogIcons(void) PBYTE pBmpBits;
g_hImageList = ImageList_Create(10, 10, IsWinVerXPPlus()? ILC_COLOR32 | ILC_MASK : ILC_COLOR8 | ILC_MASK, sizeof(pLogIconBmpBits) / sizeof(pLogIconBmpBits[0]), 0);
- hBkgBrush = CreateSolidBrush(DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR));
- hInBkgBrush = CreateSolidBrush(DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_INCOMINGBKGCOLOUR, SRMSGDEFSET_INCOMINGBKGCOLOUR));
- hOutBkgBrush = CreateSolidBrush(DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_OUTGOINGBKGCOLOUR, SRMSGDEFSET_OUTGOINGBKGCOLOUR));
+ hBkgBrush = CreateSolidBrush(db_get_dw(NULL, SRMMMOD, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR));
+ hInBkgBrush = CreateSolidBrush(db_get_dw(NULL, SRMMMOD, SRMSGSET_INCOMINGBKGCOLOUR, SRMSGDEFSET_INCOMINGBKGCOLOUR));
+ hOutBkgBrush = CreateSolidBrush(db_get_dw(NULL, SRMMMOD, SRMSGSET_OUTGOINGBKGCOLOUR, SRMSGDEFSET_OUTGOINGBKGCOLOUR));
bih.biSize = sizeof(bih);
bih.biBitCount = 24;
bih.biCompression = BI_RGB;
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index da590c3acf..4997af2a44 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -258,7 +258,7 @@ void LoadMsgDlgFont(int i, LOGFONT * lf, COLORREF * colour, BOOL chatMode) if (colour) {
wsprintfA(str, "%s%dCol", prefix, i);
- *colour = DBGetContactSettingDword(NULL, module, str, fontList[i].defColour);
+ *colour = db_get_dw(NULL, module, str, fontList[i].defColour);
}
if (lf) {
wsprintfA(str, "%s%dSize", prefix, i);
@@ -277,7 +277,7 @@ void LoadMsgDlgFont(int i, LOGFONT * lf, COLORREF * colour, BOOL chatMode) lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
wsprintfA(str, "%s%d", prefix, i);
- if (DBGetContactSettingTString(NULL, module, str, &dbv))
+ if (db_get_ts(NULL, module, str, &dbv))
lstrcpy(lf->lfFaceName, fontList[i].szDefFace);
else {
_tcsncpy(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
@@ -372,15 +372,15 @@ static INT_PTR CALLBACK DlgProcTabsOptions(HWND hwndDlg, UINT msg, WPARAM wParam CheckDlgButton(hwndDlg, IDC_SWITCHTOACTIVE, db_get_b(NULL, SRMMMOD, SRMSGSET_SWITCHTOACTIVE, SRMSGDEFSET_SWITCHTOACTIVE));
CheckDlgButton(hwndDlg, IDC_TABCLOSEBUTTON, db_get_b(NULL, SRMMMOD, SRMSGSET_TABCLOSEBUTTON, SRMSGDEFSET_TABCLOSEBUTTON));
CheckDlgButton(hwndDlg, IDC_LIMITNAMES, db_get_b(NULL, SRMMMOD, SRMSGSET_LIMITNAMES, SRMSGDEFSET_LIMITNAMES));
- limitLength = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_LIMITNAMESLEN, SRMSGDEFSET_LIMITNAMESLEN);
+ limitLength = db_get_dw(NULL, SRMMMOD, SRMSGSET_LIMITNAMESLEN, SRMSGDEFSET_LIMITNAMESLEN);
(int)SetDlgItemInt(hwndDlg, IDC_LIMITNAMESLEN, limitLength >= SRMSGSET_LIMITNAMESLEN_MIN ? limitLength : SRMSGDEFSET_LIMITNAMESLEN, FALSE);
CheckDlgButton(hwndDlg, IDC_LIMITTABS, db_get_b(NULL, SRMMMOD, SRMSGSET_LIMITTABS, SRMSGDEFSET_LIMITTABS));
- limitLength = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_LIMITTABSNUM, SRMSGDEFSET_LIMITTABSNUM);
+ limitLength = db_get_dw(NULL, SRMMMOD, SRMSGSET_LIMITTABSNUM, SRMSGDEFSET_LIMITTABSNUM);
SetDlgItemInt(hwndDlg, IDC_LIMITTABSNUM, limitLength >= 1 ? limitLength : 1, FALSE);
CheckDlgButton(hwndDlg, IDC_LIMITCHATSTABS, db_get_b(NULL, SRMMMOD, SRMSGSET_LIMITCHATSTABS, SRMSGDEFSET_LIMITCHATSTABS));
- limitLength = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_LIMITCHATSTABSNUM, SRMSGDEFSET_LIMITCHATSTABSNUM);
+ limitLength = db_get_dw(NULL, SRMMMOD, SRMSGSET_LIMITCHATSTABSNUM, SRMSGDEFSET_LIMITCHATSTABSNUM);
SetDlgItemInt(hwndDlg, IDC_LIMITCHATSTABSNUM, limitLength >= 1 ? limitLength : 1, FALSE);
CheckDlgButton(hwndDlg, IDC_SEPARATECHATSCONTAINERS, db_get_b(NULL, SRMMMOD, SRMSGSET_SEPARATECHATSCONTAINERS, SRMSGDEFSET_SEPARATECHATSCONTAINERS));
@@ -460,14 +460,14 @@ static INT_PTR CALLBACK DlgProcTabsOptions(HWND hwndDlg, UINT msg, WPARAM wParam db_set_b(NULL, SRMMMOD, SRMSGSET_TABSATBOTTOM, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TABSATBOTTOM));
db_set_b(NULL, SRMMMOD, SRMSGSET_LIMITNAMES, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_LIMITNAMES));
(limitLength = GetDlgItemInt(hwndDlg, IDC_LIMITNAMESLEN, NULL, TRUE)) >= SRMSGSET_LIMITNAMESLEN_MIN ? GetDlgItemInt(hwndDlg, IDC_LIMITNAMESLEN, NULL, TRUE) : SRMSGSET_LIMITNAMESLEN_MIN;
- DBWriteContactSettingDword(NULL, SRMMMOD, SRMSGSET_LIMITNAMESLEN, limitLength);
+ db_set_dw(NULL, SRMMMOD, SRMSGSET_LIMITNAMESLEN, limitLength);
db_set_b(NULL, SRMMMOD, SRMSGSET_LIMITTABS, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_LIMITTABS));
limitLength = GetDlgItemInt(hwndDlg, IDC_LIMITTABSNUM, NULL, TRUE) >= 1 ? GetDlgItemInt(hwndDlg, IDC_LIMITTABSNUM, NULL, TRUE) : 1;
- DBWriteContactSettingDword(NULL, SRMMMOD, SRMSGSET_LIMITTABSNUM, limitLength);
+ db_set_dw(NULL, SRMMMOD, SRMSGSET_LIMITTABSNUM, limitLength);
db_set_b(NULL, SRMMMOD, SRMSGSET_LIMITCHATSTABS, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_LIMITCHATSTABS));
limitLength = GetDlgItemInt(hwndDlg, IDC_LIMITCHATSTABSNUM, NULL, TRUE) >= 1 ? GetDlgItemInt(hwndDlg, IDC_LIMITCHATSTABSNUM, NULL, TRUE) : 1;
- DBWriteContactSettingDword(NULL, SRMMMOD, SRMSGSET_LIMITCHATSTABSNUM, limitLength);
+ db_set_dw(NULL, SRMMMOD, SRMSGSET_LIMITCHATSTABSNUM, limitLength);
db_set_b(NULL, SRMMMOD, SRMSGSET_HIDEONETAB, (BYTE) !IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSHOWTABS));
db_set_b(NULL, SRMMMOD, SRMSGSET_SWITCHTOACTIVE, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SWITCHTOACTIVE));
@@ -499,16 +499,16 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar CheckDlgButton(hwndDlg, IDC_SHOWINFOBAR, db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWINFOBAR, SRMSGDEFSET_SHOWINFOBAR));
CheckDlgButton(hwndDlg, IDC_TRANSPARENCY, db_get_b(NULL, SRMMMOD, SRMSGSET_USETRANSPARENCY, SRMSGDEFSET_USETRANSPARENCY));
SendDlgItemMessage(hwndDlg,IDC_ATRANSPARENCYVALUE,TBM_SETRANGE, FALSE, MAKELONG(0,255));
- SendDlgItemMessage(hwndDlg,IDC_ATRANSPARENCYVALUE,TBM_SETPOS, TRUE, DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_ACTIVEALPHA, SRMSGDEFSET_ACTIVEALPHA));
+ SendDlgItemMessage(hwndDlg,IDC_ATRANSPARENCYVALUE,TBM_SETPOS, TRUE, db_get_dw(NULL, SRMMMOD, SRMSGSET_ACTIVEALPHA, SRMSGDEFSET_ACTIVEALPHA));
SendDlgItemMessage(hwndDlg,IDC_ITRANSPARENCYVALUE,TBM_SETRANGE, FALSE, MAKELONG(0,255));
- SendDlgItemMessage(hwndDlg,IDC_ITRANSPARENCYVALUE,TBM_SETPOS, TRUE, DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_INACTIVEALPHA, SRMSGDEFSET_INACTIVEALPHA));
+ SendDlgItemMessage(hwndDlg,IDC_ITRANSPARENCYVALUE,TBM_SETPOS, TRUE, db_get_dw(NULL, SRMMMOD, SRMSGSET_INACTIVEALPHA, SRMSGDEFSET_INACTIVEALPHA));
sprintf(str,"%d%%",(int)(100*SendDlgItemMessage(hwndDlg,IDC_ATRANSPARENCYVALUE,TBM_GETPOS,0,0)/255));
SetDlgItemTextA(hwndDlg, IDC_ATRANSPARENCYPERC, str);
sprintf(str,"%d%%",(int)(100*SendDlgItemMessage(hwndDlg,IDC_ITRANSPARENCYVALUE,TBM_GETPOS,0,0)/255));
SetDlgItemTextA(hwndDlg, IDC_ITRANSPARENCYPERC, str);
- SetDlgItemInt(hwndDlg, IDC_INPUTLINES, DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_AUTORESIZELINES, SRMSGDEFSET_AUTORESIZELINES), FALSE);
+ SetDlgItemInt(hwndDlg, IDC_INPUTLINES, db_get_dw(NULL, SRMMMOD, SRMSGSET_AUTORESIZELINES, SRMSGDEFSET_AUTORESIZELINES), FALSE);
SendDlgItemMessage(hwndDlg, IDC_INPUTLINESSPIN, UDM_SETRANGE, 0, MAKELONG(100, 1));
- SendDlgItemMessage(hwndDlg, IDC_INPUTLINESSPIN, UDM_SETPOS, 0, DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_AUTORESIZELINES, SRMSGDEFSET_AUTORESIZELINES));
+ SendDlgItemMessage(hwndDlg, IDC_INPUTLINESSPIN, UDM_SETPOS, 0, db_get_dw(NULL, SRMMMOD, SRMSGSET_AUTORESIZELINES, SRMSGDEFSET_AUTORESIZELINES));
if (pSetLayeredWindowAttributes == NULL) {
EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENCY), FALSE);
@@ -581,8 +581,8 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar db_set_b(NULL, SRMMMOD, SRMSGSET_SHOWINFOBAR, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWINFOBAR));
db_set_b(NULL, SRMMMOD, SRMSGSET_USETRANSPARENCY, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENCY));
- DBWriteContactSettingDword(NULL, SRMMMOD, SRMSGSET_ACTIVEALPHA, SendDlgItemMessage(hwndDlg,IDC_ATRANSPARENCYVALUE,TBM_GETPOS,0,0));
- DBWriteContactSettingDword(NULL, SRMMMOD, SRMSGSET_INACTIVEALPHA, SendDlgItemMessage(hwndDlg,IDC_ITRANSPARENCYVALUE,TBM_GETPOS,0,0));
+ db_set_dw(NULL, SRMMMOD, SRMSGSET_ACTIVEALPHA, SendDlgItemMessage(hwndDlg,IDC_ATRANSPARENCYVALUE,TBM_GETPOS,0,0));
+ db_set_dw(NULL, SRMMMOD, SRMSGSET_INACTIVEALPHA, SendDlgItemMessage(hwndDlg,IDC_ITRANSPARENCYVALUE,TBM_GETPOS,0,0));
db_set_b(NULL, SRMMMOD, SRMSGSET_STATUSICON, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_STATUSWIN));
db_set_b(NULL, SRMMMOD, SRMSGSET_SHOWPROGRESS, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWPROGRESS));
@@ -590,7 +590,7 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar db_set_b(NULL, SRMMMOD, SRMSGSET_AVATARENABLE, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AVATARSUPPORT));
lines = GetDlgItemInt(hwndDlg, IDC_INPUTLINES, NULL, FALSE);
- DBWriteContactSettingDword(NULL, SRMMMOD, SRMSGSET_AUTORESIZELINES, lines ? lines : SRMSGDEFSET_AUTORESIZELINES);
+ db_set_dw(NULL, SRMMMOD, SRMSGSET_AUTORESIZELINES, lines ? lines : SRMSGDEFSET_AUTORESIZELINES);
LoadInfobarFonts();
ApplyChanges(16);
@@ -613,14 +613,14 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_POPLIST), GWL_STYLE, (GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_POPLIST), GWL_STYLE) & ~WS_BORDER) | TVS_NOHSCROLL | TVS_CHECKBOXES);
FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_POPLIST), statusValues, sizeof(statusValues) / sizeof(statusValues[0]),
- DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_POPFLAGS, SRMSGDEFSET_POPFLAGS));
+ db_get_dw(NULL, SRMMMOD, SRMSGSET_POPFLAGS, SRMSGDEFSET_POPFLAGS));
CheckDlgButton(hwndDlg, IDC_AUTOPOPUP, db_get_b(NULL, SRMMMOD, SRMSGSET_AUTOPOPUP, SRMSGDEFSET_AUTOPOPUP));
CheckDlgButton(hwndDlg, IDC_STAYMINIMIZED, db_get_b(NULL, SRMMMOD, SRMSGSET_STAYMINIMIZED, SRMSGDEFSET_STAYMINIMIZED));
CheckDlgButton(hwndDlg, IDC_AUTOMIN, db_get_b(NULL, SRMMMOD, SRMSGSET_AUTOMIN, SRMSGDEFSET_AUTOMIN));
CheckDlgButton(hwndDlg, IDC_SAVEDRAFTS, db_get_b(NULL, SRMMMOD, SRMSGSET_SAVEDRAFTS, SRMSGDEFSET_SAVEDRAFTS));
CheckDlgButton(hwndDlg, IDC_DELTEMP, db_get_b(NULL, SRMMMOD, SRMSGSET_DELTEMP, SRMSGDEFSET_DELTEMP));
- msgTimeout = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_MSGTIMEOUT, SRMSGDEFSET_MSGTIMEOUT);
+ msgTimeout = db_get_dw(NULL, SRMMMOD, SRMSGSET_MSGTIMEOUT, SRMSGDEFSET_MSGTIMEOUT);
SetDlgItemInt(hwndDlg, IDC_SECONDS, msgTimeout >= SRMSGSET_MSGTIMEOUT_MIN ? msgTimeout / 1000 : SRMSGDEFSET_MSGTIMEOUT / 1000, FALSE);
CheckDlgButton(hwndDlg, IDC_SAVEPERCONTACT, db_get_b(NULL, SRMMMOD, SRMSGSET_SAVEPERCONTACT, SRMSGDEFSET_SAVEPERCONTACT));
@@ -692,7 +692,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP case PSN_APPLY:
{
DWORD msgTimeout;
- DBWriteContactSettingDword(NULL, SRMMMOD, SRMSGSET_POPFLAGS, MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_POPLIST)));
+ db_set_dw(NULL, SRMMMOD, SRMSGSET_POPFLAGS, MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_POPLIST)));
db_set_b(NULL, SRMMMOD, SRMSGSET_AUTOPOPUP, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOPOPUP));
db_set_b(NULL, SRMMMOD, SRMSGSET_STAYMINIMIZED, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_STAYMINIMIZED));
db_set_b(NULL, SRMMMOD, SRMSGSET_AUTOMIN, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOMIN));
@@ -700,7 +700,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP db_set_b(NULL, SRMMMOD, SRMSGSET_DELTEMP, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_DELTEMP));
msgTimeout = GetDlgItemInt(hwndDlg, IDC_SECONDS, NULL, TRUE) >= SRMSGSET_MSGTIMEOUT_MIN / 1000 ? GetDlgItemInt(hwndDlg, IDC_SECONDS, NULL, TRUE) * 1000 : SRMSGDEFSET_MSGTIMEOUT;
- DBWriteContactSettingDword(NULL, SRMMMOD, SRMSGSET_MSGTIMEOUT, msgTimeout);
+ db_set_dw(NULL, SRMMMOD, SRMSGSET_MSGTIMEOUT, msgTimeout);
db_set_b(NULL, SRMMMOD, SRMSGSET_SENDONENTER, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SENDONENTER));
db_set_b(NULL, SRMMMOD, SRMSGSET_SENDONDBLENTER, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SENDONDBLENTER));
@@ -807,7 +807,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, CheckDlgButton(hwndDlg, IDC_SHOWSTATUSCHANGES, db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWSTATUSCH, SRMSGDEFSET_SHOWSTATUSCH));
- SendDlgItemMessage(hwndDlg, IDC_LINECOLOUR, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_LINECOLOUR, SRMSGDEFSET_LINECOLOUR));
+ SendDlgItemMessage(hwndDlg, IDC_LINECOLOUR, CPM_SETCOLOUR, 0, db_get_dw(NULL, SRMMMOD, SRMSGSET_LINECOLOUR, SRMSGDEFSET_LINECOLOUR));
{
PARAFORMAT2 pf2;
ZeroMemory((void *)&pf2, sizeof(pf2));
@@ -912,7 +912,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, db_set_b(NULL, SRMMMOD, SRMSGSET_MARKFOLLOWUPS, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_MARKFOLLOWUPS));
db_set_b(NULL, SRMMMOD, SRMSGSET_MESSAGEONNEWLINE, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_MESSAGEONNEWLINE));
db_set_b(NULL, SRMMMOD, SRMSGSET_DRAWLINES, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_DRAWLINES));
- DBWriteContactSettingDword(NULL, SRMMMOD, SRMSGSET_LINECOLOUR, SendDlgItemMessage(hwndDlg, IDC_LINECOLOUR, CPM_GETCOLOUR, 0, 0));
+ db_set_dw(NULL, SRMMMOD, SRMSGSET_LINECOLOUR, SendDlgItemMessage(hwndDlg, IDC_LINECOLOUR, CPM_GETCOLOUR, 0, 0));
db_set_b(NULL, SRMMMOD, SRMSGSET_USEIEVIEW, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_USEIEVIEW));
db_set_b(NULL, SRMMMOD, SRMSGSET_INDENTTEXT, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_INDENTTEXT));
db_set_w(NULL, SRMMMOD, SRMSGSET_INDENTSIZE, (WORD) SendDlgItemMessage(hwndDlg, IDC_INDENTSPIN, UDM_GETPOS, 0, 0));
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp index 186a832f3a..f8108668b6 100644 --- a/plugins/Scriver/src/msgwindow.cpp +++ b/plugins/Scriver/src/msgwindow.cpp @@ -868,14 +868,14 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR char *szNamePrefix = (!savePerContact && dat->isChat) ? "chat" : "";
if (!dat->windowWasCascaded) {
wsprintfA(szSettingName,"%sx",szNamePrefix);
- DBWriteContactSettingDword(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.left);
+ db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.left);
wsprintfA(szSettingName,"%sy",szNamePrefix);
- DBWriteContactSettingDword(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.top);
+ db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.top);
}
wsprintfA(szSettingName,"%swidth",szNamePrefix);
- DBWriteContactSettingDword(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.right - wp.rcNormalPosition.left);
+ db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.right - wp.rcNormalPosition.left);
wsprintfA(szSettingName,"%sheight",szNamePrefix);
- DBWriteContactSettingDword(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
+ db_set_dw(hContact, SRMMMOD, szSettingName, wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
db_set_b(hContact, SRMMMOD, SRMSGSET_TOPMOST, (BYTE)dat->bTopmost);
if (g_dat.lastParent == dat)
g_dat.lastParent = dat->prev;
@@ -1550,9 +1550,9 @@ int ScriverRestoreWindowPosition(HWND hwnd,HANDLE hContact,const char *szModule, wp.length=sizeof(wp);
GetWindowPlacement(hwnd,&wp);
wsprintfA(szSettingName,"%sx",szNamePrefix);
- x=DBGetContactSettingDword(hContact,szModule,szSettingName,-1);
+ x=db_get_dw(hContact,szModule,szSettingName,-1);
wsprintfA(szSettingName,"%sy",szNamePrefix);
- y=(int)DBGetContactSettingDword(hContact,szModule,szSettingName,-1);
+ y=(int)db_get_dw(hContact,szModule,szSettingName,-1);
if (x==-1) return 1;
if (flags&RWPF_NOSIZE) {
OffsetRect(&wp.rcNormalPosition,x-wp.rcNormalPosition.left,y-wp.rcNormalPosition.top);
@@ -1560,9 +1560,9 @@ int ScriverRestoreWindowPosition(HWND hwnd,HANDLE hContact,const char *szModule, wp.rcNormalPosition.left=x;
wp.rcNormalPosition.top=y;
wsprintfA(szSettingName,"%swidth",szNamePrefix);
- wp.rcNormalPosition.right=wp.rcNormalPosition.left+DBGetContactSettingDword(hContact,szModule,szSettingName,-1);
+ wp.rcNormalPosition.right=wp.rcNormalPosition.left+db_get_dw(hContact,szModule,szSettingName,-1);
wsprintfA(szSettingName,"%sheight",szNamePrefix);
- wp.rcNormalPosition.bottom=wp.rcNormalPosition.top+DBGetContactSettingDword(hContact,szModule,szSettingName,-1);
+ wp.rcNormalPosition.bottom=wp.rcNormalPosition.top+db_get_dw(hContact,szModule,szSettingName,-1);
}
wp.flags=0;
wp.showCmd = showCmd;
diff --git a/plugins/Scriver/src/sendqueue.cpp b/plugins/Scriver/src/sendqueue.cpp index 6367999a44..fda0384591 100644 --- a/plugins/Scriver/src/sendqueue.cpp +++ b/plugins/Scriver/src/sendqueue.cpp @@ -131,7 +131,7 @@ BOOL RemoveSendQueueItem(MessageSendQueueItem* item) { void ReportSendQueueTimeouts(HWND hwndSender) {
MessageSendQueueItem *item, *item2;
- int timeout = DBGetContactSettingDword(NULL, SRMMMOD, SRMSGSET_MSGTIMEOUT, SRMSGDEFSET_MSGTIMEOUT);
+ int timeout = db_get_dw(NULL, SRMMMOD, SRMSGSET_MSGTIMEOUT, SRMSGDEFSET_MSGTIMEOUT);
EnterCriticalSection(&queueMutex);
for (item = global_sendQueue; item != NULL; item = item2) {
item2 = item->next;
diff --git a/plugins/SecureIM/src/commonheaders.cpp b/plugins/SecureIM/src/commonheaders.cpp index f23ef86633..4f92e5a34c 100644 --- a/plugins/SecureIM/src/commonheaders.cpp +++ b/plugins/SecureIM/src/commonheaders.cpp @@ -6,7 +6,8 @@ LPCSTR szVersionStr = MODULENAME" DLL ("__VERSION_STRING")"; char TEMP[MAX_PATH];
int TEMP_SIZE = 0;
-HANDLE g_hEvent[2], g_hMenu[15], g_hCLIcon=0, g_hFolders=0;
+HANDLE g_hEvent[2], g_hCLIcon=0, g_hFolders=0;
+HGENMENU g_hMenu[15];
int iService=0;
int iHook=0;
diff --git a/plugins/SecureIM/src/commonheaders.h b/plugins/SecureIM/src/commonheaders.h index 9a5091183b..5b0b0173d7 100644 --- a/plugins/SecureIM/src/commonheaders.h +++ b/plugins/SecureIM/src/commonheaders.h @@ -83,7 +83,8 @@ extern PLUGININFOEX pluginInfoEx; #define PREF_METANODB 0x2000 //!< Flag to indicate message should not be added to db by filter when sending
#define PREF_SIMNOMETA 0x4000 //!< Flag to indicate message should not be inspected by filter on metacontact
-extern HANDLE g_hEvent[2], g_hMenu[15], g_hCLIcon, g_hFolders;
+extern HANDLE g_hEvent[2], g_hCLIcon, g_hFolders;
+extern HGENMENU g_hMenu[15];
extern int iService, iHook;
extern HICON g_hICO[ICO_CNT], g_hIEC[1+IEC_CNT*MODE_CNT], g_hPOP[POP_CNT];
extern HANDLE g_IEC[1+IEC_CNT*MODE_CNT];
diff --git a/plugins/SecureIM/src/crypt_dll.cpp b/plugins/SecureIM/src/crypt_dll.cpp index 023de0ba68..c98d6e8489 100644 --- a/plugins/SecureIM/src/crypt_dll.cpp +++ b/plugins/SecureIM/src/crypt_dll.cpp @@ -204,7 +204,7 @@ BOOL LoadKeyPGP(pUinKey ptr) int mode = db_get_b(ptr->hContact,MODULENAME,"pgp_mode",255);
if (mode == 0) {
DBVARIANT dbv;
- DBGetContactSetting(ptr->hContact,MODULENAME,"pgp",&dbv);
+ db_get(ptr->hContact,MODULENAME,"pgp",&dbv);
BOOL r=(dbv.type == DBVT_BLOB);
if (r) pgp_set_keyid(ptr->cntx,(PVOID)dbv.pbVal);
db_free(&dbv);
diff --git a/plugins/SecureIM/src/crypt_lists.cpp b/plugins/SecureIM/src/crypt_lists.cpp index 5c89f4d2e9..784cb2378d 100644 --- a/plugins/SecureIM/src/crypt_lists.cpp +++ b/plugins/SecureIM/src/crypt_lists.cpp @@ -221,7 +221,7 @@ void getContactUinA(HANDLE hContact, LPSTR szUIN) DBVARIANT dbv_uniqueid;
LPSTR uID = (LPSTR) CallProtoService(ptr->name, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
if (uID == (LPSTR)CALLSERVICE_NOTFOUND ) uID = 0; // Billy_Bons
- if (uID && DBGetContactSetting(hContact, ptr->name, uID, &dbv_uniqueid) == 0) {
+ if (uID && db_get(hContact, ptr->name, uID, &dbv_uniqueid) == 0) {
if (dbv_uniqueid.type == DBVT_WORD)
sprintf(szUIN, "%u [%s]", dbv_uniqueid.wVal, ptr->name);
else if (dbv_uniqueid.type == DBVT_DWORD)
diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index 504e2e1e5e..531ea39a96 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -17,7 +17,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda return &pluginInfoEx;
}
-HANDLE AddMenuItem(LPCSTR name,int pos,HICON hicon,LPCSTR service,int flags=0,WPARAM wParam=0)
+HGENMENU AddMenuItem(LPCSTR name,int pos,HICON hicon,LPCSTR service,int flags=0,WPARAM wParam=0)
{
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = flags | CMIF_HIDDEN;
@@ -29,13 +29,12 @@ HANDLE AddMenuItem(LPCSTR name,int pos,HICON hicon,LPCSTR service,int flags=0,WP return Menu_AddContactMenuItem(&mi);
}
-HANDLE AddSubItem(HANDLE rootid,LPCSTR name,int pos,int poppos,LPCSTR service,WPARAM wParam=0)
+HGENMENU AddSubItem(HANDLE rootid,LPCSTR name,int pos,int poppos,LPCSTR service,WPARAM wParam=0)
{
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_CHILDPOPUP | CMIF_HIDDEN;
mi.position = pos;
mi.popupPosition = poppos;
- mi.hIcon = NULL;
mi.pszName = (char*)name;
mi.pszPopupName = (char*)rootid;
mi.pszService = (char*)service;
@@ -150,12 +149,12 @@ int onModulesLoaded(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
dbv.type = DBVT_BLOB;
- if (DBGetContactSetting(0,MODULENAME,"rsa_priv",&dbv) == 0) {
+ if (db_get(0,MODULENAME,"rsa_priv",&dbv) == 0) {
exp->rsa_set_keypair(CPP_MODE_RSA_4096,dbv.pbVal,dbv.cpbVal);
db_free(&dbv);
rsa_4096=1;
}
- else if (DBGetContactSetting(0,MODULENAME,"rsa_priv_4096",&dbv) == 0) {
+ else if (db_get(0,MODULENAME,"rsa_priv_4096",&dbv) == 0) {
exp->rsa_set_keypair(CPP_MODE_RSA_4096|CPP_MODE_RSA_BER,dbv.pbVal,dbv.cpbVal);
db_free(&dbv);
diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 3cbbe13449..386fc023bf 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -15,7 +15,7 @@ BOOL hasKey(pUinKey ptr) else if (ptr->mode == MODE_RSAAES) {
DBVARIANT dbv;
dbv.type = DBVT_BLOB;
- if (DBGetContactSetting(ptr->hContact,MODULENAME,"rsa_pub",&dbv) == 0) {
+ if (db_get(ptr->hContact,MODULENAME,"rsa_pub",&dbv) == 0) {
ret = 1;
db_free(&dbv);
}
@@ -1233,7 +1233,7 @@ void ApplyGeneralSettings(HWND hDlg) // Key Exchange Timeout
GetDlgItemText(hDlg,IDC_KET,timeout,5);
tmp = atoi(timeout); if (tmp > 65535) tmp = 65535;
- DBWriteContactSettingWord(0,MODULENAME,"ket",tmp);
+ db_set_w(0,MODULENAME,"ket",tmp);
exp->rsa_set_timeout( db_get_w(0,MODULENAME,"ket",10));
mir_itoa(tmp,timeout,10);
SetDlgItemText(hDlg,IDC_KET,timeout);
@@ -1241,7 +1241,7 @@ void ApplyGeneralSettings(HWND hDlg) // Offline Key Timeout
GetDlgItemText(hDlg,IDC_OKT,timeout,5);
tmp = atoi(timeout); if (tmp > 65535) tmp = 65535;
- DBWriteContactSettingWord(0,MODULENAME,"okt",tmp);
+ db_set_w(0,MODULENAME,"okt",tmp);
mir_itoa(tmp,timeout,10);
SetDlgItemText(hDlg,IDC_OKT,timeout);
@@ -1461,7 +1461,7 @@ void setListViewPUB(HWND hLV, UINT iItem, UINT iStatus) DBVARIANT dbv;
dbv.type = DBVT_BLOB;
pUinKey ptr = (pUinKey) getListViewParam(hLV, iItem);
- if (DBGetContactSetting(ptr->hContact,MODULENAME,"rsa_pub",&dbv) == 0) {
+ if (db_get(ptr->hContact,MODULENAME,"rsa_pub",&dbv) == 0) {
int len;
exp->rsa_get_hash((PBYTE)dbv.pbVal,dbv.cpbVal,(PBYTE)str,&len);
sha = mir_strdup(to_hex((PBYTE)str,len));
diff --git a/plugins/SecureIM/src/popupOptions.cpp b/plugins/SecureIM/src/popupOptions.cpp index 7098db2b0e..e25403582c 100644 --- a/plugins/SecureIM/src/popupOptions.cpp +++ b/plugins/SecureIM/src/popupOptions.cpp @@ -20,19 +20,19 @@ INT_PTR CALLBACK PopOptionsDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l char *timeout;
//set timeout value for Key
- if (DBGetContactSetting(0, MODULENAME, "timeoutKey", &dbv) == 0) timeout=dbv.pszVal;
+ if (db_get(0, MODULENAME, "timeoutKey", &dbv) == 0) timeout=dbv.pszVal;
else timeout="0";
SetDlgItemText(hDlg, IDC_TIMEKEY, timeout);
db_free(&dbv);
//set timeout value for SEC
- if (DBGetContactSetting(0, MODULENAME, "timeoutSec", &dbv) == 0) timeout=dbv.pszVal;
+ if (db_get(0, MODULENAME, "timeoutSec", &dbv) == 0) timeout=dbv.pszVal;
else timeout="0";
SetDlgItemText(hDlg, IDC_TIMESEC, timeout);
db_free(&dbv);
//set timeout value for SR
- if (DBGetContactSetting(0, MODULENAME, "timeoutSR", &dbv) == 0) timeout=dbv.pszVal;
+ if (db_get(0, MODULENAME, "timeoutSR", &dbv) == 0) timeout=dbv.pszVal;
else timeout="0";
SetDlgItemText(hDlg, IDC_TIMESR, timeout);
db_free(&dbv);
@@ -57,22 +57,22 @@ INT_PTR CALLBACK PopOptionsDlgProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM l switch(LOWORD(wParam)) {
case IDC_BACKKEY:
- DBWriteContactSettingDword(0, MODULENAME, "colorKeyb", color);
+ db_set_dw(0, MODULENAME, "colorKeyb", color);
break;
case IDC_TEXTKEY:
- DBWriteContactSettingDword(0, MODULENAME, "colorKeyt", color);
+ db_set_dw(0, MODULENAME, "colorKeyt", color);
break;
case IDC_BACKSEC:
- DBWriteContactSettingDword(0, MODULENAME, "colorSecb", color);
+ db_set_dw(0, MODULENAME, "colorSecb", color);
break;
case IDC_TEXTSEC:
- DBWriteContactSettingDword(0, MODULENAME, "colorSect", color);
+ db_set_dw(0, MODULENAME, "colorSect", color);
break;
case IDC_BACKSR:
- DBWriteContactSettingDword(0, MODULENAME, "colorSRb", color);
+ db_set_dw(0, MODULENAME, "colorSRb", color);
break;
case IDC_TEXTSR:
- DBWriteContactSettingDword(0, MODULENAME, "colorSRt", color);
+ db_set_dw(0, MODULENAME, "colorSRt", color);
break;
}
return TRUE;
diff --git a/plugins/SecureIM/src/splitmsg.cpp b/plugins/SecureIM/src/splitmsg.cpp index a21cb8ef44..c9098e1999 100644 --- a/plugins/SecureIM/src/splitmsg.cpp +++ b/plugins/SecureIM/src/splitmsg.cpp @@ -11,7 +11,7 @@ LPSTR splitMsg(LPSTR szMsg, int iLen) LPSTR buf = out;
WORD msg_id = db_get_w(0, MODULENAME, "msgid", 0) + 1;
- DBWriteContactSettingWord(0, MODULENAME, "msgid", msg_id);
+ db_set_w(0, MODULENAME, "msgid", msg_id);
int part_all = (len+iLen-1)/iLen;
for (int part_num=0; part_num<part_all; part_num++) {
diff --git a/plugins/SecureIM/src/svcs_clist.cpp b/plugins/SecureIM/src/svcs_clist.cpp index 2b02df1092..3524f78775 100644 --- a/plugins/SecureIM/src/svcs_clist.cpp +++ b/plugins/SecureIM/src/svcs_clist.cpp @@ -71,25 +71,18 @@ int __cdecl onRebuildContactMenu(WPARAM wParam,LPARAM lParam) if (bMC ) hContact = getMostOnline(hContact); // âîçüìåì òîò, ÷åðåç êîòîðûé ïîéäåò ñîîáùåíèå
pUinKey ptr = getUinKey(hContact);
int i;
+ CLISTMENUITEM mi = { sizeof(mi) };
ShowStatusIconNotify(hContact);
// check offline/online
- CLISTMENUITEM mi = { sizeof(mi) };
if (!ptr) {
// hide menu bars
- mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_HIDDEN;
- for (i=0;i<SIZEOF(g_hMenu);i++) {
- if (g_hMenu[i] )
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[i],(LPARAM)&mi);
- }
+ for (i=0; i < SIZEOF(g_hMenu); i++)
+ Menu_ShowItem(g_hMenu[i], false);
return 0;
}
-// char *szProto = GetContactProto(hContact,0);
-// if (szProto == NULL) // || db_get_dw(hContact, szProto, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
-// return 0;
-
bool isSecureProto = isSecureProtocol(hContact);
bool isPGP = isContactPGP(hContact);
bool isGPG = isContactGPG(hContact);
@@ -98,11 +91,8 @@ int __cdecl onRebuildContactMenu(WPARAM wParam,LPARAM lParam) bool isMiranda = isClientMiranda(hContact);
// hide all menu bars
- mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_HIDDEN;
- for (i=0;i<SIZEOF(g_hMenu);i++) {
- if (g_hMenu[i] )
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[i],(LPARAM)&mi);
- }
+ for (i=0; i < SIZEOF(g_hMenu); i++)
+ Menu_ShowItem(g_hMenu[i], false);
if (isSecureProto && !isChat && isMiranda &&
(ptr->mode == MODE_NATIVE || ptr->mode == MODE_RSAAES)) {
@@ -111,61 +101,52 @@ int __cdecl onRebuildContactMenu(WPARAM wParam,LPARAM lParam) if (!isSecured) {
// create secureim connection
mi.hIcon = mode2icon(ptr->mode|SECURED,2);
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[0],(LPARAM)&mi);
+ Menu_ModifyItem(g_hMenu[0], &mi);
}
else {
// disable secureim connection
mi.hIcon = mode2icon(ptr->mode,2);
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[1],(LPARAM)&mi);
+ Menu_ModifyItem(g_hMenu[1], &mi);
}
// set status menu
- if (bSCM && !bMC &&
- ( !isSecured || ptr->mode == MODE_PGP || ptr->mode == MODE_GPG )) {
+ if (bSCM && !bMC && (!isSecured || ptr->mode == MODE_PGP || ptr->mode == MODE_GPG)) {
mi.flags = CMIM_FLAGS | CMIM_NAME | CMIM_ICON;
mi.hIcon = g_hICO[ICO_ST_DIS+ptr->status];
mi.pszName = (LPSTR)sim312[ptr->status];
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[2],(LPARAM)&mi);
+ Menu_ModifyItem(g_hMenu[2], &mi);
mi.flags = CMIM_FLAGS | CMIM_ICON;
for (i=0;i<=(ptr->mode == MODE_RSAAES?1:2);i++) {
mi.hIcon = (i == ptr->status) ? g_hICO[ICO_ST_DIS+ptr->status] : NULL;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[3+i],(LPARAM)&mi);
+ Menu_ModifyItem(g_hMenu[3+i], &mi);
}
}
}
- else
- if (isSecureProto && !isChat && (ptr->mode == MODE_PGP || ptr->mode == MODE_GPG)) {
+ else if (isSecureProto && !isChat && (ptr->mode == MODE_PGP || ptr->mode == MODE_GPG)) {
// PGP, GPG
- if (ptr->mode == MODE_PGP && bPGPloaded) {
- if ((bPGPkeyrings || bPGPprivkey) && !isGPG) {
- mi.flags = CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[isPGP+6],(LPARAM)&mi);
- }
- }
- if (ptr->mode == MODE_GPG && bGPGloaded) {
- if (bGPGkeyrings && !isPGP) {
- mi.flags = CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[isGPG+8],(LPARAM)&mi);
- }
- }
+ if (ptr->mode == MODE_PGP && bPGPloaded)
+ if ((bPGPkeyrings || bPGPprivkey) && !isGPG)
+ Menu_ShowItem(g_hMenu[isPGP+6], true);
+
+ if (ptr->mode == MODE_GPG && bGPGloaded)
+ if (bGPGkeyrings && !isPGP)
+ Menu_ShowItem(g_hMenu[isGPG+8], true);
}
if (isSecureProto && !isChat && isMiranda) {
// set mode menu
- if (bMCM && !bMC &&
- ( !isSecured || ptr->mode == MODE_PGP || ptr->mode == MODE_GPG )) {
-
+ if (bMCM && !bMC && (!isSecured || ptr->mode == MODE_PGP || ptr->mode == MODE_GPG)) {
mi.flags = CMIM_FLAGS | CMIM_NAME | CMIM_ICON;
mi.hIcon = g_hICO[ICO_OV_NAT+ptr->mode];
mi.pszName = (LPSTR)sim311[ptr->mode];
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[10],(LPARAM)&mi);
+ Menu_ModifyItem(g_hMenu[10], &mi);
mi.flags = CMIM_FLAGS | CMIM_ICON;
for (i=0;i<MODE_CNT;i++) {
if (i == MODE_PGP && ptr->mode != MODE_PGP && !bPGP ) continue;
if (i == MODE_GPG && ptr->mode != MODE_GPG && !bGPG ) continue;
mi.hIcon = (i == ptr->mode) ? g_hICO[ICO_ST_ENA] : NULL;
- CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_hMenu[11+i],(LPARAM)&mi);
+ Menu_ModifyItem(g_hMenu[11+i], &mi);
}
}
}
diff --git a/plugins/SecureIM/src/svcs_proto.cpp b/plugins/SecureIM/src/svcs_proto.cpp index 3e4f708792..9031b88231 100644 --- a/plugins/SecureIM/src/svcs_proto.cpp +++ b/plugins/SecureIM/src/svcs_proto.cpp @@ -283,7 +283,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) // decrypting message with last offline key
DBVARIANT dbv;
dbv.type = DBVT_BLOB;
- if (DBGetContactSetting(ptr->hContact, MODULENAME, "offlineKey", &dbv))
+ if (db_get(ptr->hContact, MODULENAME, "offlineKey", &dbv))
return CallService(MS_PROTO_CHAINRECV, wParam, lParam); // exit and show messsage
// if valid key is succefully retrieved
@@ -683,7 +683,7 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) // set key for offline user
DBVARIANT dbv; dbv.type = DBVT_BLOB;
if (db_get_dw(ptr->hContact, MODULENAME, "offlineKeyTimeout", 0) > gettime() &&
- DBGetContactSetting(ptr->hContact, MODULENAME, "offlineKey", &dbv) == 0) {
+ db_get(ptr->hContact, MODULENAME, "offlineKey", &dbv) == 0) {
// if valid key is succefully retrieved
ptr->offlineKey = true;
InitKeyX(ptr,dbv.pbVal);
diff --git a/plugins/SecureIM/src/svcs_rsa.cpp b/plugins/SecureIM/src/svcs_rsa.cpp index 38adfa7cd8..d065d0b397 100644 --- a/plugins/SecureIM/src/svcs_rsa.cpp +++ b/plugins/SecureIM/src/svcs_rsa.cpp @@ -42,7 +42,7 @@ int __cdecl rsa_check_pub(HANDLE context, PBYTE pub, int pubLen, PBYTE sig, int DBVARIANT dbv;
dbv.type = DBVT_BLOB;
- if (DBGetContactSetting(ptr->hContact,MODULENAME,"rsa_pub",&dbv) == 0) {
+ if (db_get(ptr->hContact,MODULENAME,"rsa_pub",&dbv) == 0) {
k = 1;
PBYTE buf = (PBYTE) alloca(sigLen); int len;
exp->rsa_get_hash((PBYTE)dbv.pbVal,dbv.cpbVal,(PBYTE)buf,&len);
@@ -181,7 +181,7 @@ BYTE loadRSAkey(pUinKey ptr) if (!ptr->keyLoaded) {
DBVARIANT dbv;
dbv.type = DBVT_BLOB;
- if ( DBGetContactSetting(ptr->hContact,MODULENAME,"rsa_pub",&dbv) == 0) {
+ if ( db_get(ptr->hContact,MODULENAME,"rsa_pub",&dbv) == 0) {
ptr->keyLoaded = exp->rsa_set_pubkey(ptr->cntx,dbv.pbVal,dbv.cpbVal);
Sent_NetLog("loadRSAkey %d", ptr->keyLoaded);
db_free(&dbv);
diff --git a/plugins/SeenPlugin/src/file.cpp b/plugins/SeenPlugin/src/file.cpp index 0c9fbf5372..2e78e8f5c6 100644 --- a/plugins/SeenPlugin/src/file.cpp +++ b/plugins/SeenPlugin/src/file.cpp @@ -31,7 +31,7 @@ int InitFileOutput(void) GetModuleFileName(NULL, szmpath, MAX_PATH);
DBVARIANT dbv;
- _tcscpy(szfpath, !DBGetContactSettingTString(NULL, S_MOD, "FileName", &dbv) ? dbv.ptszVal : _T(DEFAULT_FILENAME));
+ _tcscpy(szfpath, !db_get_ts(NULL, S_MOD, "FileName", &dbv) ? dbv.ptszVal : _T(DEFAULT_FILENAME));
db_free(&dbv);
if (szfpath[0] == '\\')
@@ -60,7 +60,7 @@ void FileWrite(HANDLE hcontact) TCHAR szout[1024];
DBVARIANT dbv;
- DBGetContactSettingTString(NULL, S_MOD, "PathToFile", &dbv);
+ db_get_ts(NULL, S_MOD, "PathToFile", &dbv);
_tcscpy(szout, ParseString(dbv.ptszVal, hcontact, 1));
HANDLE fhout = CreateFile(szout, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, 0, NULL);
@@ -78,7 +78,7 @@ void FileWrite(HANDLE hcontact) db_free(&dbv);
SetFilePointer(fhout,0,0,FILE_END);
- if ( !DBGetContactSettingTString(NULL, S_MOD,"FileStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD,"FileStamp", &dbv)) {
_tcscpy(szout, ParseString(dbv.ptszVal, hcontact, 1));
db_free(&dbv);
}
diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index 60d08bc89e..13d5b88277 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -51,7 +51,7 @@ void HistoryWrite(HANDLE hContact) TCHAR *ptszString;
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, S_MOD, "HistoryStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "HistoryStamp", &dbv)) {
ptszString = ParseString(dbv.ptszVal, hContact, 0);
db_free(&dbv);
}
@@ -87,7 +87,7 @@ void LoadHistoryList(HANDLE hContact, HWND hwnd, int nList) i = (i-1+historyMax) % historyMax;
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(hContact, S_MOD, BuildSetting(i), &dbv)) {
+ if ( !db_get_ts(hContact, S_MOD, BuildSetting(i), &dbv)) {
SendDlgItemMessage(hwnd, nList, LB_ADDSTRING, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/SeenPlugin/src/main.cpp b/plugins/SeenPlugin/src/main.cpp index 9dd4e7ea1c..98391ee155 100644 --- a/plugins/SeenPlugin/src/main.cpp +++ b/plugins/SeenPlugin/src/main.cpp @@ -115,7 +115,6 @@ extern "C" __declspec(dllexport) int Unload(void) arContacts.destroy();
CloseHandle(g_hShutdownEvent);
- UninitMenuitem();
return 0;
}
diff --git a/plugins/SeenPlugin/src/menu.cpp b/plugins/SeenPlugin/src/menu.cpp index 00afddde37..7c0e2222db 100644 --- a/plugins/SeenPlugin/src/menu.cpp +++ b/plugins/SeenPlugin/src/menu.cpp @@ -20,7 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "seen.h"
-HANDLE hmenuitem=NULL, hLSUserDet = NULL, hBuildMenu = NULL;
+HANDLE hLSUserDet = NULL;
+HGENMENU hmenuitem = NULL;
void InitHistoryDialog(void);
@@ -47,7 +48,7 @@ int BuildContactMenu(WPARAM wparam,LPARAM lparam) cmi.hIcon = NULL;
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(NULL, S_MOD, "MenuStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "MenuStamp", &dbv)) {
cmi.ptszName = ParseString(dbv.ptszVal, (HANDLE)wparam, 0);
db_free(&dbv);
}
@@ -65,13 +66,13 @@ int BuildContactMenu(WPARAM wparam,LPARAM lparam) }
}
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hmenuitem, (LPARAM)&cmi);
+ Menu_ModifyItem(hmenuitem, &cmi);
return 0;
}
void InitMenuitem()
{
- hLSUserDet = CreateServiceFunction("LastSeenUserDetails", MenuitemClicked);
+ CreateServiceFunction("LastSeenUserDetails", MenuitemClicked);
CLISTMENUITEM cmi = { sizeof(cmi) };
cmi.position = -0x7FFFFFFF;
@@ -80,13 +81,7 @@ void InitMenuitem() cmi.pszService = "LastSeenUserDetails";
hmenuitem = Menu_AddContactMenuItem(&cmi);
- hBuildMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU,BuildContactMenu);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU,BuildContactMenu);
InitHistoryDialog();
}
-
-void UninitMenuitem()
-{
- DestroyServiceFunction(hLSUserDet);
- UnhookEvent(hBuildMenu);
-}
diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index 18d5bd478f..6fa34e2a1b 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -65,13 +65,13 @@ INT_PTR CALLBACK OptsPopUpsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpara EnableWindow( GetDlgItem(hdlg, i+20), hasPopups);
}
- if ( !DBGetContactSettingTString(NULL, S_MOD, "PopupStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "PopupStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_POPUPSTAMP, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_POPUPSTAMP, DEFAULT_POPUPSTAMP);
- if ( !DBGetContactSettingTString(NULL, S_MOD, "PopupStampText", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "PopupStampText", &dbv)) {
SetDlgItemText(hdlg, IDC_POPUPSTAMPTEXT, dbv.ptszVal);
db_free(&dbv);
}
@@ -199,31 +199,31 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpa EnableWindow(GetDlgItem(hdlg, IDC_HISTORYSTAMP),IsDlgButtonChecked(hdlg, IDC_HISTORY));
EnableWindow(GetDlgItem(hdlg, IDC_COUNT),IsDlgButtonChecked(hdlg, IDC_MISSEDONES));
- if ( !DBGetContactSettingTString(NULL, S_MOD, "MenuStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "MenuStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_MENUSTAMP, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_MENUSTAMP, _T(DEFAULT_MENUSTAMP));
- if ( !DBGetContactSettingTString(NULL, S_MOD, "UserStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "UserStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_USERSTAMP, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_USERSTAMP, DEFAULT_USERSTAMP);
- if ( !DBGetContactSettingTString(NULL, S_MOD, "FileStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "FileStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_FILESTAMP, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_FILESTAMP, _T(DEFAULT_FILESTAMP));
- if ( !DBGetContactSettingTString(NULL, S_MOD, "FileName", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "FileName", &dbv)) {
SetDlgItemText(hdlg, IDC_FILENAME, dbv.ptszVal);
db_free(&dbv);
}
else SetDlgItemText(hdlg, IDC_FILENAME, _T(DEFAULT_FILENAME));
- if ( !DBGetContactSettingTString(NULL, S_MOD, "HistoryStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "HistoryStamp", &dbv)) {
SetDlgItemText(hdlg, IDC_HISTORYSTAMP, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/SeenPlugin/src/seen.h b/plugins/SeenPlugin/src/seen.h index 1a07999868..0fb4921070 100644 --- a/plugins/SeenPlugin/src/seen.h +++ b/plugins/SeenPlugin/src/seen.h @@ -106,7 +106,6 @@ int ModeChange(WPARAM,LPARAM); void SetOffline(void);
int ModeChange_mo(WPARAM,LPARAM);
int CheckIfOnline(void);
-void UninitMenuitem();
void ShowHistory(HANDLE hContact, BYTE isAlert);
struct logthread_info
@@ -120,7 +119,8 @@ extern HINSTANCE hInstance; extern DWORD StatusColors15bits[];
extern BOOL includeIdle;
extern HANDLE ehmissed;
-extern HANDLE ehuserinfo, hmenuitem, ehmissed_proto;
+extern HANDLE ehuserinfo, ehmissed_proto;
+extern HGENMENU hmenuitem;
extern DWORD dwmirver;
extern LIST<logthread_info> arContacts;
\ No newline at end of file diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp index 1bc7f1c805..6205dcaa1e 100644 --- a/plugins/SeenPlugin/src/userinfo.cpp +++ b/plugins/SeenPlugin/src/userinfo.cpp @@ -39,7 +39,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) mir_subclassWindow( GetDlgItem(hdlg, IDC_INFOTEXT), EditProc);
{
TCHAR *szout;
- if ( !DBGetContactSettingTString(NULL, S_MOD, "UserStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "UserStamp", &dbv)) {
szout = ParseString(dbv.ptszVal, (HANDLE)lparam, 0);
db_free(&dbv);
}
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index e22fff1911..a7948c6baa 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -41,7 +41,7 @@ int IsWatchedProtocol(const char* szProto) int iProtoLen = (int)strlen(szProto);
char *szWatched;
DBVARIANT dbv;
- if ( DBGetContactSettingString(NULL, S_MOD, "WatchedProtocols", &dbv))
+ if ( db_get_s(NULL, S_MOD, "WatchedProtocols", &dbv))
szWatched = DEFAULT_WATCHEDPROTOCOLS;
else {
szWatched = NEWSTR_ALLOCA(dbv.pszVal);
@@ -261,7 +261,7 @@ LBL_charPtr: goto LBL_noData;
case 'G':
- if ( !DBGetContactSettingTString(hcontact, "CList", "Group", &dbv)) {
+ if ( !db_get_ts(hcontact, "CList", "Group", &dbv)) {
_tcscpy(szdbsetting, dbv.ptszVal);
db_free(&dbv);
charPtr = szdbsetting;
@@ -289,18 +289,18 @@ LBL_charPtr: }
else if (ci.szProto != NULL) {
if ( isYahoo(ci.szProto)) { // YAHOO support
- DBGetContactSettingTString(hcontact, ci.szProto, "id", &dbv);
+ db_get_ts(hcontact, ci.szProto, "id", &dbv);
_tcscpy(szdbsetting, dbv.ptszVal);
db_free(&dbv);
}
else if ( isJabber(ci.szProto)) { // JABBER support
- if ( DBGetContactSettingTString(hcontact, ci.szProto, "LoginName", &dbv))
+ if ( db_get_ts(hcontact, ci.szProto, "LoginName", &dbv))
goto LBL_noData;
_tcscpy(szdbsetting, dbv.ptszVal);
db_free(&dbv);
- DBGetContactSettingTString(hcontact, ci.szProto, "LoginServer", &dbv);
+ db_get_ts(hcontact, ci.szProto, "LoginServer", &dbv);
_tcscat(szdbsetting, _T("@"));
_tcscat(szdbsetting, dbv.ptszVal);
db_free(&dbv);
@@ -324,7 +324,7 @@ LBL_charPtr: goto LBL_noData;
case 'T':
- if ( DBGetContactSettingTString(hcontact, "CList", "StatusMsg", &dbv))
+ if ( db_get_ts(hcontact, "CList", "StatusMsg", &dbv))
goto LBL_noData;
d += mir_sntprintf(d, MAXSIZE-(d-sztemp), _T("%s"), dbv.ptszVal);
@@ -346,7 +346,7 @@ LBL_charPtr: case 'i':
case 'r':
if ( isJabber(ci.szProto)) {
- if ( DBGetContactSettingTString(hcontact, ci.szProto, *p == 'i' ? "Resource" : "System", &dbv))
+ if ( db_get_ts(hcontact, ci.szProto, *p == 'i' ? "Resource" : "System", &dbv))
goto LBL_noData;
_tcscpy(szdbsetting, dbv.ptszVal);
@@ -374,7 +374,7 @@ LBL_charPtr: goto LBL_charPtr;
case 'C': // Get Client Info
- if ( !DBGetContactSettingTString(hcontact, ci.szProto, "MirVer", &dbv)) {
+ if ( !db_get_ts(hcontact, ci.szProto, "MirVer", &dbv)) {
_tcscpy(szdbsetting, dbv.ptszVal);
db_free(&dbv);
}
@@ -497,13 +497,13 @@ void ShowPopup(HANDLE hcontact, const char * lpzProto, int newStatus) ppd.lchContact = hcontact;
ppd.lchIcon = LoadSkinnedProtoIcon(lpzProto, newStatus);
- if ( !DBGetContactSettingTString(NULL, S_MOD, "PopupStamp", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "PopupStamp", &dbv)) {
_tcsncpy(ppd.lptzContactName, ParseString(dbv.ptszVal, hcontact, 0), MAX_CONTACTNAME);
db_free(&dbv);
}
else _tcsncpy(ppd.lptzContactName, ParseString(DEFAULT_POPUPSTAMP, hcontact, 0), MAX_CONTACTNAME);
- if ( !DBGetContactSettingTString(NULL, S_MOD, "PopupStampText", &dbv)) {
+ if ( !db_get_ts(NULL, S_MOD, "PopupStampText", &dbv)) {
_tcsncpy(ppd.lptzText, ParseString(dbv.ptszVal, hcontact, 0), MAX_SECONDLINE);
db_free(&dbv);
}
@@ -735,7 +735,7 @@ int ModeChange(WPARAM wparam,LPARAM lparam) short int isDbZero(HANDLE hContact, const char *module_name, const char *setting_name)
{
DBVARIANT dbv;
- if ( !DBGetContactSetting(hContact, module_name, setting_name, &dbv)) {
+ if ( !db_get(hContact, module_name, setting_name, &dbv)) {
short int res = 0;
switch (dbv.type) {
case DBVT_BYTE: res=dbv.bVal==0; break;
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index d7498d21b6..097b9ff18f 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -60,7 +60,7 @@ CSend::~CSend(){ void CSend::SetContact(HANDLE hContact) {
m_hContact = hContact;
m_pszProto = GetContactProto(hContact);
- m_ChatRoom = DBGetContactSettingByte(hContact, m_pszProto, "ChatRoom", 0);
+ m_ChatRoom = db_get_b(hContact, m_pszProto, "ChatRoom", 0);
m_PFflag = hasCap(PF1_URLSEND);
m_PFflag = hasCap(PF1_CHAT);
m_PFflag = hasCap(PF1_IMSEND);
diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp index 229f19ac37..95311e984d 100644 --- a/plugins/SendScreenshotPlus/src/UMainForm.cpp +++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp @@ -716,51 +716,51 @@ TfrmMain::~TfrmMain() { //---------------------------------------------------------------------------
// Load / Saving options from miranda's database
void TfrmMain::LoadOptions(void) {
- DWORD rgb = DBGetContactSettingDword(NULL, SZ_SENDSS, "AlphaColor", 16777215);
+ DWORD rgb = db_get_dw(NULL, SZ_SENDSS, "AlphaColor", 16777215);
m_AlphaColor.rgbRed = GetRValue(rgb);
m_AlphaColor.rgbGreen = GetGValue(rgb);
m_AlphaColor.rgbBlue = GetBValue(rgb);
m_AlphaColor.rgbReserved = 0;
-// m_opt_chkEmulateClick = DBGetContactSettingByte(NULL, SZ_SENDSS, "AutoSend", 1);
- m_opt_edtQuality = DBGetContactSettingByte(NULL, SZ_SENDSS, "JpegQuality", 75);
+// m_opt_chkEmulateClick = db_get_b(NULL, SZ_SENDSS, "AutoSend", 1);
+ m_opt_edtQuality = db_get_b(NULL, SZ_SENDSS, "JpegQuality", 75);
- m_opt_tabCapture = DBGetContactSettingByte(NULL, SZ_SENDSS, "Capture", 0);
- m_opt_chkClientArea = DBGetContactSettingByte(NULL, SZ_SENDSS, "ClientArea", 0);
- m_opt_cboxDesktop = DBGetContactSettingByte(NULL, SZ_SENDSS, "Desktop", 0);
+ m_opt_tabCapture = db_get_b(NULL, SZ_SENDSS, "Capture", 0);
+ m_opt_chkClientArea = db_get_b(NULL, SZ_SENDSS, "ClientArea", 0);
+ m_opt_cboxDesktop = db_get_b(NULL, SZ_SENDSS, "Desktop", 0);
- m_opt_chkTimed = DBGetContactSettingByte(NULL, SZ_SENDSS, "TimedCap", 0);
- m_opt_edtTimed = DBGetContactSettingByte(NULL, SZ_SENDSS, "CapTime", 3);
- m_opt_cboxFormat = DBGetContactSettingByte(NULL, SZ_SENDSS, "OutputFormat", 3);
- m_opt_cboxSendBy = DBGetContactSettingByte(NULL, SZ_SENDSS, "SendBy", 0);
+ m_opt_chkTimed = db_get_b(NULL, SZ_SENDSS, "TimedCap", 0);
+ m_opt_edtTimed = db_get_b(NULL, SZ_SENDSS, "CapTime", 3);
+ m_opt_cboxFormat = db_get_b(NULL, SZ_SENDSS, "OutputFormat", 3);
+ m_opt_cboxSendBy = db_get_b(NULL, SZ_SENDSS, "SendBy", 0);
- m_opt_chkEditor = DBGetContactSettingByte(NULL, SZ_SENDSS, "Preview", 0);
- m_opt_btnDesc = DBGetContactSettingByte(NULL, SZ_SENDSS, "AutoDescription", 1);
- m_opt_btnDeleteAfterSend = DBGetContactSettingByte(NULL, SZ_SENDSS, "DelAfterSend", 1);
- m_opt_chkOpenAgain = DBGetContactSettingByte(NULL, SZ_SENDSS, "OpenAgain", 0);
+ m_opt_chkEditor = db_get_b(NULL, SZ_SENDSS, "Preview", 0);
+ m_opt_btnDesc = db_get_b(NULL, SZ_SENDSS, "AutoDescription", 1);
+ m_opt_btnDeleteAfterSend = db_get_b(NULL, SZ_SENDSS, "DelAfterSend", 1);
+ m_opt_chkOpenAgain = db_get_b(NULL, SZ_SENDSS, "OpenAgain", 0);
}
void TfrmMain::SaveOptions(void) {
if(m_bOnExitSave) {
- DBWriteContactSettingDword(NULL, SZ_SENDSS, "AlphaColor",
+ db_set_dw(NULL, SZ_SENDSS, "AlphaColor",
(DWORD)RGB(m_AlphaColor.rgbRed, m_AlphaColor.rgbGreen, m_AlphaColor.rgbBlue));
-// DBWriteContactSettingByte(NULL, SZ_SENDSS, "AutoSend", m_opt_chkEmulateClick);
- DBWriteContactSettingByte(NULL, SZ_SENDSS, "JpegQuality", m_opt_edtQuality);
+// db_set_b(NULL, SZ_SENDSS, "AutoSend", m_opt_chkEmulateClick);
+ db_set_b(NULL, SZ_SENDSS, "JpegQuality", m_opt_edtQuality);
- DBWriteContactSettingByte(NULL, SZ_SENDSS, "Capture", m_opt_tabCapture);
- DBWriteContactSettingByte(NULL, SZ_SENDSS, "ClientArea", m_opt_chkClientArea);
- DBWriteContactSettingByte(NULL, SZ_SENDSS, "Desktop", m_opt_cboxDesktop);
+ db_set_b(NULL, SZ_SENDSS, "Capture", m_opt_tabCapture);
+ db_set_b(NULL, SZ_SENDSS, "ClientArea", m_opt_chkClientArea);
+ db_set_b(NULL, SZ_SENDSS, "Desktop", m_opt_cboxDesktop);
- DBWriteContactSettingByte(NULL, SZ_SENDSS, "TimedCap", m_opt_chkTimed);
- DBWriteContactSettingByte(NULL, SZ_SENDSS, "CapTime", m_opt_edtTimed);
- DBWriteContactSettingByte(NULL, SZ_SENDSS, "OutputFormat", m_opt_cboxFormat);
- DBWriteContactSettingByte(NULL, SZ_SENDSS, "SendBy", m_opt_cboxSendBy);
+ db_set_b(NULL, SZ_SENDSS, "TimedCap", m_opt_chkTimed);
+ db_set_b(NULL, SZ_SENDSS, "CapTime", m_opt_edtTimed);
+ db_set_b(NULL, SZ_SENDSS, "OutputFormat", m_opt_cboxFormat);
+ db_set_b(NULL, SZ_SENDSS, "SendBy", m_opt_cboxSendBy);
- DBWriteContactSettingByte(NULL, SZ_SENDSS, "AutoDescription", m_opt_btnDesc);
- DBWriteContactSettingByte(NULL, SZ_SENDSS, "DelAfterSend", m_opt_btnDeleteAfterSend);
- DBWriteContactSettingByte(NULL, SZ_SENDSS, "OpenAgain", m_opt_chkOpenAgain);
- DBWriteContactSettingByte(NULL, SZ_SENDSS, "Preview", m_opt_chkEditor);
+ db_set_b(NULL, SZ_SENDSS, "AutoDescription", m_opt_btnDesc);
+ db_set_b(NULL, SZ_SENDSS, "DelAfterSend", m_opt_btnDeleteAfterSend);
+ db_set_b(NULL, SZ_SENDSS, "OpenAgain", m_opt_chkOpenAgain);
+ db_set_b(NULL, SZ_SENDSS, "Preview", m_opt_chkEditor);
}
}
@@ -957,7 +957,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) { mir_tcsadd(path, m_FDestFolder);
if (path[_tcslen(path)-1] != _T('\\')) mir_tcsadd(path, _T("\\"));
mir_tcsadd(path, _T("shot%.5ld"));
- int FileNumber=DBGetContactSettingDword(NULL, SZ_SENDSS, "FileNumber", 0) + 1;
+ int FileNumber=db_get_dw(NULL, SZ_SENDSS, "FileNumber", 0) + 1;
// '00000'-'%.5ld'=0 (add more or less len if differ from 5
size_t len = (_tcslen(path)+0+1);
pszFilename = (LPTSTR)mir_alloc(sizeof(TCHAR)*(len));
@@ -1103,7 +1103,7 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) { mir_freeAndNil(pszFilename);
if (ret) {
- DBWriteContactSettingDword(NULL, SZ_SENDSS, "FileNumber", (DWORD)FileNumber);
+ db_set_dw(NULL, SZ_SENDSS, "FileNumber", (DWORD)FileNumber);
mir_freeAndNil(m_pszFile);
mir_freeAndNil(m_pszFileDesc);
m_pszFile = ret;
diff --git a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp index 9d49a9b63f..7f618368c8 100644 --- a/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp +++ b/plugins/SendScreenshotPlus/src/dlg_msgbox.cpp @@ -729,8 +729,8 @@ INT_PTR MsgBoxService(WPARAM wParam, LPARAM lParam) if (!(pMsgBox->uType & (MB_INFOBAR|MB_NOPOPUP)) && // message box can be a popup?
ServiceExists(MS_POPUP_ADDPOPUPT) && // popups exist?
myGlobals.PopUpActionsExist == 1 && // popup support ext stuct?
- (DBGetContactSettingDword(NULL, "PopUp","Actions", 0) & 1) && // popup++ actions on?
- DBGetContactSettingByte(NULL, MODNAME, SET_POPUPMSGBOX, DEFVAL_POPUPMSGBOX) // user likes popups?
+ (db_get_dw(NULL, "PopUp","Actions", 0) & 1) && // popup++ actions on?
+ db_get_b(NULL, MODNAME, SET_POPUPMSGBOX, DEFVAL_POPUPMSGBOX) // user likes popups?
)
{
rc = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_MSGBOXDUMMI), pMsgBox->hParent, (DLGPROC)MsgBoxPop, lParam);
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 89ef6e1266..b5c7fd658a 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -100,14 +100,14 @@ INT_PTR CALLBACK ExitDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) SavePosition(hdlg, "ExitDlg");
SaveSessionDate();
SaveSessionHandles(0,0);
- DBWriteContactSettingByte(NULL, MODNAME, "lastempty", 0);
+ db_set_b(NULL, MODNAME, "lastempty", 0);
DestroyWindow(hdlg);
}break;
case IDCANCEL:
{
SavePosition(hdlg, "ExitDlg");
- DBWriteContactSettingByte(NULL, MODNAME, "lastempty", 1);
+ db_set_b(NULL, MODNAME, "lastempty", 1);
DestroyWindow(hdlg);
}break;
}
@@ -287,7 +287,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar {
case WM_INITDIALOG:
{
- int iDelay=DBGetContactSettingWord(NULL, MODNAME, "StartupModeDelay", 1500);
+ int iDelay=db_get_w(NULL, MODNAME, "StartupModeDelay", 1500);
if(g_hghostw==TRUE)
SetTimer(hdlg, TIMERID_LOAD, iDelay, NULL);
else
@@ -359,7 +359,7 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar int i=0;
while(session_list_recovered[i])
{
- DBWriteContactSettingByte((HANDLE)session_list_recovered[i], MODNAME, "wasInLastSession", 0);
+ db_set_b((HANDLE)session_list_recovered[i], MODNAME, "wasInLastSession", 0);
i++;
}
ZeroMemory(session_list_recovered,SIZEOF(session_list_recovered));
@@ -494,7 +494,7 @@ int SaveSessionHandles(WPARAM wparam,LPARAM lparam) if(lparam==1)
{
g_ses_count++;
- DBWriteContactSettingByte(0, MODNAME, "UserSessionsCount", (BYTE)g_ses_count);
+ db_set_b(0, MODNAME, "UserSessionsCount", (BYTE)g_ses_count);
}
return 0;
}
@@ -552,11 +552,11 @@ int SaveSessionDate() char szSessionDate[256];
DBVARIANT dbv = {0};
mir_snprintf(szSessionDate, SIZEOF(szSessionDate), "%s_%d", "SessionDate", 0);
- DBGetContactSettingTString(NULL, MODNAME, szSessionDate, &dbv);
+ db_get_ts(NULL, MODNAME, szSessionDate, &dbv);
TCHAR *szSessionDateBuf_1 = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
- DBWriteContactSettingTString(NULL, MODNAME, szSessionDate, szSessionTime);
+ db_set_ts(NULL, MODNAME, szSessionDate, szSessionTime);
mir_free(szSessionTime);
ResaveSettings("SessionDate", 1, ses_limit, szSessionDateBuf_1);
@@ -566,7 +566,7 @@ int SaveSessionDate() mir_free(szDateBuf);
}
if(g_bCrashRecovery)
- DBWriteContactSettingByte(NULL, MODNAME, "lastSaveCompleted", 1);
+ db_set_b(NULL, MODNAME, "lastSaveCompleted", 1);
return 0;
}
@@ -583,14 +583,14 @@ int SaveUserSessionName(TCHAR *szUSessionName) {
szUserSessionName = mir_tstrdup(szUSessionName);
mir_snprintf(szUserSessionNameBuf, SIZEOF(szUserSessionNameBuf), "%s_%u", "UserSessionDsc", 0);
- if (!DBGetContactSettingTString(NULL, MODNAME, szUserSessionNameBuf, &dbv))
+ if (!db_get_ts(NULL, MODNAME, szUserSessionNameBuf, &dbv))
{
szUserSessionNameBuf_1 = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
ResaveSettings("UserSessionDsc",1,255,szUserSessionNameBuf_1);
}
- DBWriteContactSettingTString(NULL, MODNAME, szUserSessionNameBuf, szUserSessionName);
+ db_set_ts(NULL, MODNAME, szUserSessionNameBuf, szUserSessionName);
//free(szUserSessionNameBuf_1);
mir_free(szUserSessionName);
@@ -704,10 +704,10 @@ int DelUserDefSession(int ses_count) }
mir_snprintf(szSessionName, SIZEOF(szSessionName), "%s_%u", "UserSessionDsc", ses_count);
- DBDeleteContactSetting(NULL, MODNAME, szSessionName);
+ db_unset(NULL, MODNAME, szSessionName);
mir_snprintf(szSessionName, SIZEOF(szSessionName), "%s_%u", "FavUserSession", ses_count);
- DBDeleteContactSetting(NULL, MODNAME, szSessionName);
+ db_unset(NULL, MODNAME, szSessionName);
for (i=(ses_count+1);;i++)
{
@@ -717,20 +717,20 @@ int DelUserDefSession(int ses_count) {
MarkUserDefSession(i-1,IsMarkedUserDefSession(i));
mir_snprintf(szSessionName, SIZEOF(szSessionName), "%s_%u", "UserSessionDsc", i-1);
- DBWriteContactSettingTString(NULL, MODNAME, szSessionName, szSessionNameBuf);
+ db_set_ts(NULL, MODNAME, szSessionName, szSessionNameBuf);
}
else
{
mir_snprintf(szSessionName, SIZEOF(szSessionName), "%s_%u", "UserSessionDsc", i-1);
- DBDeleteContactSetting(NULL, MODNAME, szSessionName);
+ db_unset(NULL, MODNAME, szSessionName);
mir_snprintf(szSessionName, SIZEOF(szSessionName), "%s_%u", "FavUserSession", i-1);
- DBDeleteContactSetting(NULL, MODNAME, szSessionName);
+ db_unset(NULL, MODNAME, szSessionName);
break;
}
}
g_ses_count--;
- DBWriteContactSettingByte(0, MODNAME, "UserSessionsCount", (BYTE)g_ses_count);
+ db_set_b(0, MODNAME, "UserSessionsCount", (BYTE)g_ses_count);
mir_free(szSessionNameBuf);
return 0;
}
@@ -751,7 +751,7 @@ int DeleteAutoSession(int ses_count) }
mir_snprintf(szSessionName, SIZEOF(szSessionName), "%s_%u", "SessionDate", ses_count);
- DBDeleteContactSetting(NULL, MODNAME, szSessionName);
+ db_unset(NULL, MODNAME, szSessionName);
for (i=(ses_count+1);;i++)
{
@@ -760,13 +760,13 @@ int DeleteAutoSession(int ses_count) if ((szSessionNameBuf=DBGetStringT(NULL, MODNAME, szSessionName))/*&&(szSessionHandlesBuf=DBGetStringT(NULL,PLGNAME,szSessionHandles))*/)
{
mir_snprintf(szSessionName, SIZEOF(szSessionName), "%s_%u", "SessionDate", i-1);
- DBWriteContactSettingTString(NULL, MODNAME, szSessionName, szSessionNameBuf);
+ db_set_ts(NULL, MODNAME, szSessionName, szSessionNameBuf);
}
else
{
mir_snprintf(szSessionName, SIZEOF(szSessionName), "%s_%u", "SessionDate", i-1);
- DBDeleteContactSetting(NULL, MODNAME, szSessionName);
+ db_unset(NULL, MODNAME, szSessionName);
break;
}
}
@@ -789,30 +789,30 @@ int SessionPreShutdown(WPARAM wparam,LPARAM lparam) if(g_bIncompletedSave) {
int i=0;
while(session_list_recovered[i]) {
- DBWriteContactSettingByte((HANDLE)session_list_recovered[i], MODNAME, "wasInLastSession", 0);
+ db_set_b((HANDLE)session_list_recovered[i], MODNAME, "wasInLastSession", 0);
i++;
}
}
- DBWriteContactSettingByte(NULL, MODNAME, "lastSaveCompleted", 1);
+ db_set_b(NULL, MODNAME, "lastSaveCompleted", 1);
return 0;
}
int OkToExit(WPARAM wparam,LPARAM lparam)
{
- int exitmode=DBGetContactSettingByte(NULL, MODNAME, "ShutdownMode", 2);
+ int exitmode=db_get_b(NULL, MODNAME, "ShutdownMode", 2);
DONT=1;
if(exitmode==2&&session_list[0]!=0)
{
SaveSessionDate();
SaveSessionHandles(0,0);
- DBWriteContactSettingByte(NULL, MODNAME, "lastempty", 0);
+ db_set_b(NULL, MODNAME, "lastempty", 0);
}
else if(exitmode==1&&session_list[0]!=0)
{
DialogBox(hinstance,MAKEINTRESOURCE(IDD_EXDIALOG), 0, ExitDlgProc);
}
- else DBWriteContactSettingByte(NULL, MODNAME, "lastempty", 1);
+ else db_set_b(NULL, MODNAME, "lastempty", 1);
return 0;
}
@@ -824,12 +824,12 @@ static int GetContactHandle(WPARAM wparam,LPARAM lParam) {
if (strstr(MWeventdata->szModule,"tabSRMsg")) g_mode=1;
AddToCurSession((DWORD)MWeventdata->hContact,0);
- if(g_bCrashRecovery) DBWriteContactSettingByte(MWeventdata->hContact, MODNAME, "wasInLastSession", 1);
+ if(g_bCrashRecovery) db_set_b(MWeventdata->hContact, MODNAME, "wasInLastSession", 1);
}
else if(MWeventdata->uType == MSG_WINDOW_EVT_CLOSE)
{
if (!DONT) DelFromCurSession((DWORD)MWeventdata->hContact,0);
- if(g_bCrashRecovery) DBWriteContactSettingByte(MWeventdata->hContact, MODNAME, "wasInLastSession", 0);
+ if(g_bCrashRecovery) db_set_b(MWeventdata->hContact, MODNAME, "wasInLastSession", 0);
}
return 0;
@@ -890,17 +890,17 @@ static int PluginInit(WPARAM wparam,LPARAM lparam) hServiceSaveUserSession = CreateServiceFunction(MS_SESSIONS_SAVEUSERSESSION, SaveUserSessionHandles);
hServiceCloseCurrentSession = CreateServiceFunction(MS_SESSIONS_CLOSESESSION, CloseCurrentSession);
- g_ses_count = DBGetContactSettingByte(0, MODNAME, "UserSessionsCount", 0);
+ g_ses_count = db_get_b(0, MODNAME, "UserSessionsCount", 0);
if (!g_ses_count)
- g_ses_count = DBGetContactSettingByte(0, "Sessions (Unicode)", "UserSessionsCount", 0);
- ses_limit = DBGetContactSettingByte(0, MODNAME, "TrackCount", 10);
- g_bExclHidden = DBGetContactSettingByte(NULL, MODNAME, "ExclHidden", 0);
- g_bWarnOnHidden = DBGetContactSettingByte(NULL, MODNAME, "WarnOnHidden", 0);
- g_bOtherWarnings = DBGetContactSettingByte(NULL, MODNAME, "OtherWarnings", 1);
- g_bCrashRecovery = DBGetContactSettingByte(NULL, MODNAME, "CrashRecovery", 0);
+ g_ses_count = db_get_b(0, "Sessions (Unicode)", "UserSessionsCount", 0);
+ ses_limit = db_get_b(0, MODNAME, "TrackCount", 10);
+ g_bExclHidden = db_get_b(NULL, MODNAME, "ExclHidden", 0);
+ g_bWarnOnHidden = db_get_b(NULL, MODNAME, "WarnOnHidden", 0);
+ g_bOtherWarnings = db_get_b(NULL, MODNAME, "OtherWarnings", 1);
+ g_bCrashRecovery = db_get_b(NULL, MODNAME, "CrashRecovery", 0);
if(g_bCrashRecovery)
- g_bIncompletedSave=!DBGetContactSettingByte(NULL, MODNAME, "lastSaveCompleted", 0);
+ g_bIncompletedSave=!db_get_b(NULL, MODNAME, "lastSaveCompleted", 0);
if(g_bIncompletedSave)
{
@@ -911,16 +911,16 @@ static int PluginInit(WPARAM wparam,LPARAM lparam) for (hContact = db_find_first(); hContact;
hContact = db_find_next(hContact))
{
- if(DBGetContactSettingByte(hContact, MODNAME, "wasInLastSession", 0))
+ if(db_get_b(hContact, MODNAME, "wasInLastSession", 0))
session_list_recovered[i++]=(DWORD)hContact;
}
}
if (!session_list_recovered[0]) g_bIncompletedSave=FALSE;
- DBWriteContactSettingByte(NULL, MODNAME, "lastSaveCompleted", 0);
+ db_set_b(NULL, MODNAME, "lastSaveCompleted", 0);
- if (!DBGetContactSettingByte(NULL, MODNAME, "lastempty", 1)||g_bIncompletedSave) isLastTRUE=TRUE;
+ if (!db_get_b(NULL, MODNAME, "lastempty", 1)||g_bIncompletedSave) isLastTRUE=TRUE;
- startup=DBGetContactSettingByte(NULL, MODNAME, "StartupMode", 3);
+ startup=db_get_b(NULL, MODNAME, "StartupMode", 3);
if (startup==1||(startup==3&&isLastTRUE==TRUE))
{
diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index 24834c7047..b22d14b6f7 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -178,19 +178,19 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) hIcon=(bChecked=IsMarkedUserDefSession(opses_count))?hMarked:hNotMarked;
- SetDlgItemInt(hdlg, IDC_TRACK,ses_limit=DBGetContactSettingByte(0, MODNAME, "TrackCount", 10), FALSE);
+ SetDlgItemInt(hdlg, IDC_TRACK,ses_limit=db_get_b(0, MODNAME, "TrackCount", 10), FALSE);
SendDlgItemMessage(hdlg, IDC_SPIN1, UDM_SETRANGE, 0, MAKELONG(10, 1));
SendDlgItemMessage(hdlg, IDC_SPIN1, UDM_SETPOS, 0, GetDlgItemInt(hdlg, IDC_TRACK, NULL, FALSE));
SendDlgItemMessage(hdlg, IDC_OPCLIST, LB_RESETCONTENT, 0, 0);
- SetDlgItemInt(hdlg, IDC_STARTDELAY, DBGetContactSettingWord(NULL, MODNAME, "StartupModeDelay", 1500), FALSE);
- startupmode = DBGetContactSettingByte(NULL, MODNAME, "StartupMode", 3);
- exitmode = DBGetContactSettingByte(NULL, MODNAME, "ShutdownMode", 2);
+ SetDlgItemInt(hdlg, IDC_STARTDELAY, db_get_w(NULL, MODNAME, "StartupModeDelay", 1500), FALSE);
+ startupmode = db_get_b(NULL, MODNAME, "StartupMode", 3);
+ exitmode = db_get_b(NULL, MODNAME, "ShutdownMode", 2);
- g_bExclHidden = DBGetContactSettingByte(NULL, MODNAME, "ExclHidden", 0);
- g_bWarnOnHidden = DBGetContactSettingByte(NULL, MODNAME, "WarnOnHidden", 0);
- g_bOtherWarnings = DBGetContactSettingByte(NULL, MODNAME, "OtherWarnings", 1);
- g_bCrashRecovery = DBGetContactSettingByte(NULL, MODNAME, "CrashRecovery", 0);
+ g_bExclHidden = db_get_b(NULL, MODNAME, "ExclHidden", 0);
+ g_bWarnOnHidden = db_get_b(NULL, MODNAME, "WarnOnHidden", 0);
+ g_bOtherWarnings = db_get_b(NULL, MODNAME, "OtherWarnings", 1);
+ g_bCrashRecovery = db_get_b(NULL, MODNAME, "CrashRecovery", 0);
CheckDlgButton(hdlg,IDC_EXCLHIDDEN,g_bExclHidden?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hdlg,IDC_LASTHIDDENWARN,g_bWarnOnHidden?BST_CHECKED:BST_UNCHECKED);
@@ -262,26 +262,26 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) case PSN_APPLY:
{
int iDelay=GetDlgItemInt(hdlg, IDC_STARTDELAY,NULL, FALSE);
- DBWriteContactSettingWord(0, MODNAME, "StartupModeDelay", (WORD)iDelay);
+ db_set_w(0, MODNAME, "StartupModeDelay", (WORD)iDelay);
- DBWriteContactSettingByte(0, MODNAME, "TrackCount", (BYTE)(ses_limit=GetDlgItemInt(hdlg, IDC_TRACK,NULL, FALSE)));
- if(IsDlgButtonChecked(hdlg, IDC_REXSAVE)) DBWriteContactSettingByte(NULL, MODNAME, "ShutdownMode", 2);
- else if(IsDlgButtonChecked(hdlg, IDC_REXDSAVE)) DBWriteContactSettingByte(NULL, MODNAME, "ShutdownMode", 0);
- else if(IsDlgButtonChecked(hdlg, IDC_REXASK)) DBWriteContactSettingByte(NULL, MODNAME, "ShutdownMode", 1);
+ db_set_b(0, MODNAME, "TrackCount", (BYTE)(ses_limit=GetDlgItemInt(hdlg, IDC_TRACK,NULL, FALSE)));
+ if(IsDlgButtonChecked(hdlg, IDC_REXSAVE)) db_set_b(NULL, MODNAME, "ShutdownMode", 2);
+ else if(IsDlgButtonChecked(hdlg, IDC_REXDSAVE)) db_set_b(NULL, MODNAME, "ShutdownMode", 0);
+ else if(IsDlgButtonChecked(hdlg, IDC_REXASK)) db_set_b(NULL, MODNAME, "ShutdownMode", 1);
if(IsDlgButtonChecked(hdlg, IDC_STARTDIALOG))
{
if (!IsDlgButtonChecked(hdlg, IDC_CHECKLAST))
- DBWriteContactSettingByte(NULL, MODNAME, "StartupMode", 1);
- else DBWriteContactSettingByte(NULL, MODNAME, "StartupMode", 3);
+ db_set_b(NULL, MODNAME, "StartupMode", 1);
+ else db_set_b(NULL, MODNAME, "StartupMode", 3);
}
- else if(IsDlgButtonChecked(hdlg, IDC_RLOADLAST)) DBWriteContactSettingByte(NULL, MODNAME, "StartupMode", 2);
- else if(IsDlgButtonChecked(hdlg, IDC_RNOTHING)) DBWriteContactSettingByte(NULL, MODNAME, "StartupMode", 0);
+ else if(IsDlgButtonChecked(hdlg, IDC_RLOADLAST)) db_set_b(NULL, MODNAME, "StartupMode", 2);
+ else if(IsDlgButtonChecked(hdlg, IDC_RNOTHING)) db_set_b(NULL, MODNAME, "StartupMode", 0);
- DBWriteContactSettingByte(NULL, MODNAME, "ExclHidden", (BYTE)(IsDlgButtonChecked(hdlg, IDC_EXCLHIDDEN) ? (g_bExclHidden = 1) : (g_bExclHidden = 0)));
- DBWriteContactSettingByte(NULL, MODNAME, "WarnOnHidden", (BYTE)(IsDlgButtonChecked(hdlg, IDC_LASTHIDDENWARN) ? (g_bWarnOnHidden = 1) : (g_bWarnOnHidden = 0)));
- DBWriteContactSettingByte(NULL, MODNAME, "OtherWarnings", (BYTE)(IsDlgButtonChecked(hdlg, IDC_WARNINGS) ? (g_bOtherWarnings = 1) : (g_bOtherWarnings = 0)));
- DBWriteContactSettingByte(NULL, MODNAME, "CrashRecovery", (BYTE)(IsDlgButtonChecked(hdlg, IDC_CRASHRECOVERY) ? (g_bCrashRecovery = 1) : (g_bCrashRecovery = 0)));
+ db_set_b(NULL, MODNAME, "ExclHidden", (BYTE)(IsDlgButtonChecked(hdlg, IDC_EXCLHIDDEN) ? (g_bExclHidden = 1) : (g_bExclHidden = 0)));
+ db_set_b(NULL, MODNAME, "WarnOnHidden", (BYTE)(IsDlgButtonChecked(hdlg, IDC_LASTHIDDENWARN) ? (g_bWarnOnHidden = 1) : (g_bWarnOnHidden = 0)));
+ db_set_b(NULL, MODNAME, "OtherWarnings", (BYTE)(IsDlgButtonChecked(hdlg, IDC_WARNINGS) ? (g_bOtherWarnings = 1) : (g_bOtherWarnings = 0)));
+ db_set_b(NULL, MODNAME, "CrashRecovery", (BYTE)(IsDlgButtonChecked(hdlg, IDC_CRASHRECOVERY) ? (g_bCrashRecovery = 1) : (g_bCrashRecovery = 0)));
return 1;
}
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp index fcd2898b77..bab43d06d3 100644 --- a/plugins/Sessions/Src/Utils.cpp +++ b/plugins/Sessions/Src/Utils.cpp @@ -29,7 +29,7 @@ void AddSessionMark(HANDLE hContact,int mode,char bit) if(mode==0)
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(hContact, MODNAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
+ if (!db_get_s(hContact, MODNAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
{
temp_1[0]=dbv.pszVal[0];
for (i=0;i<ses_limit;i++)
@@ -41,16 +41,16 @@ void AddSessionMark(HANDLE hContact,int mode,char bit) for (i=ses_limit;i<10;i++)
dbv.pszVal[i]='0';
dbv.pszVal[0]=bit;
- DBWriteContactSettingString(hContact, MODNAME, "LastSessionsMarks", dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_set_s(hContact, MODNAME, "LastSessionsMarks", dbv.pszVal);
+ db_free(&dbv);
}
- else if(bit=='1') DBWriteContactSettingString(hContact, MODNAME, "LastSessionsMarks", "10000000000");
+ else if(bit=='1') db_set_s(hContact, MODNAME, "LastSessionsMarks", "10000000000");
}
if (mode==1)
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(hContact, MODNAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
+ if (!db_get_s(hContact, MODNAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
{
if(strlen(dbv.pszVal)<g_ses_count)
{
@@ -61,7 +61,7 @@ void AddSessionMark(HANDLE hContact,int mode,char bit) else
pszBuffer = mir_strdup(dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
temp_1[0]=pszBuffer[0];
for (i=0;i<g_ses_count;i++)
@@ -71,12 +71,12 @@ void AddSessionMark(HANDLE hContact,int mode,char bit) temp_1[0]=temp_2[0];
}
pszBuffer[0]=bit;
- DBWriteContactSettingString(hContact, MODNAME, "UserSessionsMarks", pszBuffer);
+ db_set_s(hContact, MODNAME, "UserSessionsMarks", pszBuffer);
mir_free(pszBuffer);
}
- else if(bit=='1')DBWriteContactSettingString(hContact, MODNAME, "UserSessionsMarks", "10000000000");
- else DBWriteContactSettingString(hContact, MODNAME, "UserSessionsMarks", "00000000000");
+ else if(bit=='1')db_set_s(hContact, MODNAME, "UserSessionsMarks", "10000000000");
+ else db_set_s(hContact, MODNAME, "UserSessionsMarks", "00000000000");
}
}
@@ -88,7 +88,7 @@ void RemoveSessionMark(HANDLE hContact,int mode,int marknum) if(mode==0)
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(hContact, MODNAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
+ if (!db_get_s(hContact, MODNAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
{
for (i=marknum;i<ses_limit;i++)
dbv.pszVal[i]=dbv.pszVal[i+1];
@@ -96,20 +96,20 @@ void RemoveSessionMark(HANDLE hContact,int mode,int marknum) for (i=ses_limit;i<10;i++)
dbv.pszVal[i]='0';
- DBWriteContactSettingString(hContact, MODNAME, "LastSessionsMarks", dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_set_s(hContact, MODNAME, "LastSessionsMarks", dbv.pszVal);
+ db_free(&dbv);
}
}
if (mode==1)
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(hContact, MODNAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
+ if (!db_get_s(hContact, MODNAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
{
for (i=marknum;i<ses_limit;i++)
dbv.pszVal[i]=dbv.pszVal[i+1];
- DBWriteContactSettingString(hContact, MODNAME, "UserSessionsMarks", dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_set_s(hContact, MODNAME, "UserSessionsMarks", dbv.pszVal);
+ db_free(&dbv);
}
}
}
@@ -121,25 +121,25 @@ void SetSessionMark(HANDLE hContact,int mode,char bit,unsigned int marknum) if(mode==0)
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(hContact, MODNAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
+ if (!db_get_s(hContact, MODNAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
{
dbv.pszVal[marknum]=bit;
- DBWriteContactSettingString(hContact, MODNAME, "LastSessionsMarks", dbv.pszVal);
+ db_set_s(hContact, MODNAME, "LastSessionsMarks", dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
if (mode==1)
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(hContact, MODNAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
+ if (!db_get_s(hContact, MODNAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
{
pszBuffer = mir_strdup(dbv.pszVal);
pszBuffer[marknum]=bit;
- DBWriteContactSettingString(hContact, MODNAME, "UserSessionsMarks", pszBuffer);
+ db_set_s(hContact, MODNAME, "UserSessionsMarks", pszBuffer);
mir_free(pszBuffer);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -148,21 +148,21 @@ BOOL LoadContactsFromMask(HANDLE hContact,int mode,int count) {
if (mode == 0) {
DBVARIANT dbv;
- if ( DBGetContactSettingString(hContact, MODNAME, "LastSessionsMarks", &dbv))
+ if ( db_get_s(hContact, MODNAME, "LastSessionsMarks", &dbv))
return 0;
BOOL res = dbv.pszVal[count] == '1';
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return res;
}
if (mode == 1) {
DBVARIANT dbv;
- if ( DBGetContactSettingString(hContact, MODNAME, "UserSessionsMarks", &dbv))
+ if ( db_get_s(hContact, MODNAME, "UserSessionsMarks", &dbv))
return 0;
BOOL res = dbv.pszVal[count] == '1';
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return res;
}
return 0;
@@ -184,7 +184,7 @@ void AddInSessionOrder(HANDLE hContact,int mode,int ordernum,int writemode) if(mode==0)
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(hContact, MODNAME, "LastSessionsOrder", &dbv))
+ if (!db_get_s(hContact, MODNAME, "LastSessionsOrder", &dbv))
{
char* temp=NULL;
char* temp2=NULL;
@@ -208,10 +208,10 @@ void AddInSessionOrder(HANDLE hContact,int mode,int ordernum,int writemode) for (i=(ses_limit*2);i<20;i++)
temp[i]='0';
- DBWriteContactSettingString(hContact, MODNAME, "LastSessionsOrder", temp);
+ db_set_s(hContact, MODNAME, "LastSessionsOrder", temp);
mir_free(temp);
mir_free(temp2);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else if(writemode==1)
{
@@ -221,7 +221,7 @@ void AddInSessionOrder(HANDLE hContact,int mode,int ordernum,int writemode) else
mir_snprintf(szFormNumBuf, SIZEOF(szFormNumBuf), "%u%s", ordernum, "000000000000000000");
- DBWriteContactSettingString(hContact, MODNAME, "LastSessionsOrder", szFormNumBuf);
+ db_set_s(hContact, MODNAME, "LastSessionsOrder", szFormNumBuf);
}
}
@@ -229,7 +229,7 @@ void AddInSessionOrder(HANDLE hContact,int mode,int ordernum,int writemode) {
DBVARIANT dbv;
int advlen=0;
- if (!DBGetContactSettingString(hContact, MODNAME, "UserSessionsOrder", &dbv) && dbv.pszVal)
+ if (!db_get_s(hContact, MODNAME, "UserSessionsOrder", &dbv) && dbv.pszVal)
{
char* temp=NULL;
char* temp2=NULL;
@@ -257,16 +257,16 @@ void AddInSessionOrder(HANDLE hContact,int mode,int ordernum,int writemode) else
mir_snprintf(temp, advlen+1, "%u%s", ordernum, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
- DBWriteContactSettingString(hContact, MODNAME, "UserSessionsOrder", temp);
+ db_set_s(hContact, MODNAME, "UserSessionsOrder", temp);
mir_free(temp);
mir_free(pszBuffer);
}
else if(writemode==1)
- DBWriteContactSettingString(hContact, MODNAME, "UserSessionsOrder", szFormNumBuf);
+ db_set_s(hContact, MODNAME, "UserSessionsOrder", szFormNumBuf);
else
- DBWriteContactSettingString(hContact, MODNAME, "UserSessionsOrder", "00");
+ db_set_s(hContact, MODNAME, "UserSessionsOrder", "00");
}
}
@@ -277,23 +277,23 @@ int GetInSessionOrder(HANDLE hContact,int mode,int count) if(mode==0)
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(hContact, MODNAME, "LastSessionsOrder", &dbv) && dbv.pszVal)
+ if (!db_get_s(hContact, MODNAME, "LastSessionsOrder", &dbv) && dbv.pszVal)
{
szTemp[0]=dbv.pszVal[count*2];
szTemp[1]=dbv.pszVal[count*2+1];
iOrder=atoi(szTemp);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
if (mode==1)
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(hContact, MODNAME, "UserSessionsOrder", &dbv) && dbv.pszVal)
+ if (!db_get_s(hContact, MODNAME, "UserSessionsOrder", &dbv) && dbv.pszVal)
{
szTemp[0]=dbv.pszVal[count*2];
szTemp[1]=dbv.pszVal[count*2+1];
iOrder=atoi(szTemp);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
return iOrder;
@@ -312,24 +312,24 @@ void SetInSessionOrder(HANDLE hContact,int mode,int count,unsigned int ordernum) if(mode==0)
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(hContact, MODNAME, "LastSessionsOrder", &dbv) && dbv.pszVal)
+ if (!db_get_s(hContact, MODNAME, "LastSessionsOrder", &dbv) && dbv.pszVal)
{
dbv.pszVal[count*2]=szTemp[0];
dbv.pszVal[count*2+1]=szTemp[1];
- DBWriteContactSettingString(hContact, MODNAME, "LastSessionsOrder", dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_set_s(hContact, MODNAME, "LastSessionsOrder", dbv.pszVal);
+ db_free(&dbv);
}
}
if (mode==1)
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(hContact, MODNAME, "UserSessionsOrder", &dbv) && dbv.pszVal)
+ if (!db_get_s(hContact, MODNAME, "UserSessionsOrder", &dbv) && dbv.pszVal)
{
dbv.pszVal[count*2]=szTemp[0];
dbv.pszVal[count*2+1]=szTemp[1];
- DBWriteContactSettingString(hContact, MODNAME, "UserSessionsOrder", dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_set_s(hContact, MODNAME, "UserSessionsOrder", dbv.pszVal);
+ db_free(&dbv);
}
}
}
@@ -347,8 +347,8 @@ BOOL ResaveSettings(char* szName,int iFirst,int iLimit,TCHAR* szBuffer) mir_snprintf(szNameBuf, SIZEOF(szNameBuf), "%s_%u", szName, i);
DBVARIANT dbv_temp;
- int res = DBGetContactSettingTString(NULL, MODNAME, szNameBuf, &dbv_temp);
- DBWriteContactSettingTString(NULL, MODNAME, szNameBuf, szBuffer);
+ int res = db_get_ts(NULL, MODNAME, szNameBuf, &dbv_temp);
+ db_set_ts(NULL, MODNAME, szNameBuf, szBuffer);
mir_free(szBuffer);
marked = IsMarkedUserDefSession(i);
@@ -359,7 +359,7 @@ BOOL ResaveSettings(char* szName,int iFirst,int iLimit,TCHAR* szBuffer) return 0;
szBuffer = mir_tstrdup(dbv_temp.ptszVal);
- DBFreeVariant(&dbv_temp);
+ db_free(&dbv_temp);
}
mir_free(szBuffer);
@@ -499,7 +499,7 @@ void OffsetWindow(HWND parent, HWND hwnd, int dx, int dy) int CheckContactVisibility(HANDLE hContact)
{
- if (DBGetContactSettingByte(hContact, "CList", "Hidden", 0))
+ if (db_get_b(hContact, "CList", "Hidden", 0))
return 0;
return 1;
}
@@ -508,14 +508,14 @@ void RenameUserDefSession(int ses_count,TCHAR* ptszNewName) {
char szSession[256]={0};
mir_snprintf(szSession, SIZEOF(szSession), "%s_%u", "UserSessionDsc", ses_count);
- DBWriteContactSettingTString(NULL, MODNAME, szSession, ptszNewName);
+ db_set_ts(NULL, MODNAME, szSession, ptszNewName);
}
int MarkUserDefSession(int ses_count,BYTE bCheck)
{
char szSessionName[256]={0};
mir_snprintf(szSessionName, SIZEOF(szSessionName), "%s_%u", "FavUserSession", ses_count);
- DBWriteContactSettingByte(NULL, MODNAME, szSessionName, bCheck);
+ db_set_b(NULL, MODNAME, szSessionName, bCheck);
return 0;
}
@@ -523,7 +523,7 @@ BYTE IsMarkedUserDefSession(int ses_count) {
char szSessionName[256]={0};
mir_snprintf(szSessionName, SIZEOF(szSessionName), "%s_%u","FavUserSession", ses_count);
- return DBGetContactSettingByte(NULL, MODNAME, szSessionName, 0);
+ return db_get_b(NULL, MODNAME, szSessionName, 0);
}
void SavePosition(HWND hwnd, char *wndName)
@@ -532,9 +532,9 @@ void SavePosition(HWND hwnd, char *wndName) char buffer[512];
GetWindowRect(hwnd, &rc);
mir_snprintf(buffer, SIZEOF(buffer), "%sPosX", wndName);
- DBWriteContactSettingDword(0, MODNAME, buffer, rc.left);
+ db_set_dw(0, MODNAME, buffer, rc.left);
mir_snprintf(buffer, SIZEOF(buffer), "%sPosY", wndName);
- DBWriteContactSettingDword(0, MODNAME, buffer, rc.top);
+ db_set_dw(0, MODNAME, buffer, rc.top);
}
void LoadPosition(HWND hWnd, char *wndName)
@@ -542,8 +542,8 @@ void LoadPosition(HWND hWnd, char *wndName) char buffer[512];
int x,y ;
mir_snprintf(buffer, SIZEOF(buffer), "%sPosX", wndName);
- x = DBGetContactSettingDword(0, MODNAME, buffer, ((GetSystemMetrics(SM_CXSCREEN)) / 2)-130);
+ x = db_get_dw(0, MODNAME, buffer, ((GetSystemMetrics(SM_CXSCREEN)) / 2)-130);
mir_snprintf(buffer, SIZEOF(buffer), "%sPosY", wndName);
- y = DBGetContactSettingDword(0, MODNAME, buffer, ((GetSystemMetrics(SM_CYSCREEN))/ 2)-80);
+ y = db_get_dw(0, MODNAME, buffer, ((GetSystemMetrics(SM_CYSCREEN))/ 2)-80);
SetWindowPos(hWnd, NULL, x, y, 0, 0, SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOSIZE);
}
\ No newline at end of file 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<ID_STATUS_IDLE; c++)
{
@@ -128,7 +128,7 @@ INT CheckDefaults(WPARAM, LPARAM) continue;
else
{
- if (DBGetContactSettingTString(NULL,protocolname,szStatus,&dbv))
+ if (db_get_ts(NULL,protocolname,szStatus,&dbv))
{
if (c < 40077)
// This mode does not have a preset message
@@ -136,10 +136,10 @@ INT CheckDefaults(WPARAM, LPARAM) else if(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;
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index 60d26d3b56..e286a13dbd 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -26,9 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "commonheaders.h"
-static HANDLE hAwayMsgMenuItem;
-static HANDLE hCopyMsgMenuItem;
-static HANDLE hGoToURLMenuItem;
+static HGENMENU hAwayMsgMenuItem, hCopyMsgMenuItem, hGoToURLMenuItem;
static HANDLE hWindowList;
static HANDLE hWindowList2;
@@ -106,7 +104,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP TCHAR str[256], format[128];
TCHAR *contactName = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)dat->hContact, GCDNF_TCHAR);
char *szProto = GetContactProto(dat->hContact);
- WORD dwStatus = DBGetContactSettingWord(dat->hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ WORD dwStatus = db_get_w(dat->hContact, szProto, "Status", ID_STATUS_OFFLINE);
TCHAR *status = (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, dwStatus, GSMDF_TCHAR);
GetWindowText(hwndDlg, format, SIZEOF(format));
@@ -335,20 +333,20 @@ static INT_PTR GoToURLMsgCommand(WPARAM wParam, LPARAM lParam) char *szMsg;
- int unicode = !DBGetContactSetting((HANDLE)wParam, "CList", "StatusMsg", &dbv) && (dbv.type == DBVT_UTF8 || dbv.type == DBVT_WCHAR);
- DBFreeVariant(&dbv);
+ int unicode = !db_get((HANDLE)wParam, "CList", "StatusMsg", &dbv) && (dbv.type == DBVT_UTF8 || dbv.type == DBVT_WCHAR);
+ db_free(&dbv);
if (unicode)
{
- DBGetContactSettingWString((HANDLE)wParam, "CList", "StatusMsg", &dbv);
+ db_get_ws((HANDLE)wParam, "CList", "StatusMsg", &dbv);
szMsg = mir_u2a(dbv.pwszVal);
}
else
{
- DBGetContactSettingString((HANDLE)wParam, "CList", "StatusMsg", &dbv);
+ db_get_s((HANDLE)wParam, "CList", "StatusMsg", &dbv);
szMsg = mir_strdup(dbv.pszVal);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
char *szURL = StrFindURL(szMsg);
if (szURL != NULL)
@@ -374,7 +372,7 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM lParam) {
TCHAR str[128];
char *szProto = GetContactProto((HANDLE)wParam);
- int iHidden = szProto ? DBGetContactSettingByte((HANDLE)wParam, szProto, "ChatRoom", 0) : 0;
+ int iHidden = szProto ? db_get_b((HANDLE)wParam, szProto, "ChatRoom", 0) : 0;
char *szMsg;
int iStatus;
@@ -382,14 +380,11 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM lParam) clmi.cbSize = sizeof(clmi);
clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
- if (!iHidden)
- {
+ if (!iHidden) {
iHidden = 1;
- iStatus = DBGetContactSettingWord((HANDLE)wParam, szProto, "Status", ID_STATUS_OFFLINE);
- if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1,0) & PF1_MODEMSGRECV)
- {
- if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3,0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus))
- {
+ iStatus = db_get_w((HANDLE)wParam, szProto, "Status", ID_STATUS_OFFLINE);
+ if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1,0) & PF1_MODEMSGRECV) {
+ if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3,0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus)) {
iHidden = 0;
clmi.flags = CMIM_FLAGS | CMIM_NAME | CMIM_ICON | CMIF_TCHAR;
clmi.hIcon = LoadSkinnedProtoIcon(szProto, iStatus);
@@ -398,51 +393,43 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM lParam) }
}
}
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hAwayMsgMenuItem, (LPARAM)&clmi);
+ Menu_ModifyItem(hAwayMsgMenuItem, &clmi);
Skin_ReleaseIcon(clmi.hIcon);
- clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
- if (!iHidden)
- {
+ clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
+ if (!iHidden) {
DBVARIANT dbv;
- int unicode = !DBGetContactSetting((HANDLE)wParam, "CList", "StatusMsg", &dbv) && (dbv.type == DBVT_UTF8 || dbv.type == DBVT_WCHAR);
- DBFreeVariant(&dbv);
- if (unicode)
- {
- DBGetContactSettingWString((HANDLE)wParam, "CList", "StatusMsg", &dbv);
+ int unicode = !db_get((HANDLE)wParam, "CList", "StatusMsg", &dbv) && (dbv.type == DBVT_UTF8 || dbv.type == DBVT_WCHAR);
+ db_free(&dbv);
+ if (unicode) {
+ db_get_ws((HANDLE)wParam, "CList", "StatusMsg", &dbv);
szMsg = mir_u2a(dbv.pwszVal);
}
- else
-
- {
- DBGetContactSettingString((HANDLE)wParam, "CList", "StatusMsg", &dbv);
+ else {
+ db_get_s((HANDLE)wParam, "CList", "StatusMsg", &dbv);
szMsg = mir_strdup(dbv.pszVal);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ShowCopy", 1) && szMsg && *szMsg != '\0')
- {
+ if (db_get_b(NULL, "SimpleStatusMsg", "ShowCopy", 1) && szMsg && *szMsg != '\0') {
clmi.flags = CMIM_FLAGS | CMIM_NAME | CMIF_TCHAR;
mir_sntprintf(str, SIZEOF(str), TranslateT("Copy %s Message"), (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, iStatus, GSMDF_TCHAR));
clmi.ptszName = str;
}
}
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hCopyMsgMenuItem, (LPARAM)&clmi);
- clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
+ Menu_ModifyItem(hCopyMsgMenuItem, &clmi);
- if (!iHidden)
- {
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ShowGoToURL", 1) && StrFindURL(szMsg) != NULL)
- {
+ clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
+ if (!iHidden) {
+ if (db_get_b(NULL, "SimpleStatusMsg", "ShowGoToURL", 1) && StrFindURL(szMsg) != NULL) {
clmi.flags = CMIM_FLAGS | CMIM_NAME | CMIF_TCHAR;
mir_sntprintf(str, SIZEOF(str), TranslateT("&Go to URL in %s Message"), (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, iStatus, GSMDF_TCHAR));
clmi.ptszName = str;
}
mir_free(szMsg);
}
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hGoToURLMenuItem, (LPARAM)&clmi);
-
+ Menu_ModifyItem(hGoToURLMenuItem, &clmi);
return 0;
}
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index b534c8d0b3..92676a3b32 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -152,7 +152,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) for (i = 0; msg[i]; i++)
{
- if (msg[i] == 0x0D && DBGetContactSettingByte(NULL, "SimpleStatusMsg", "RemoveCR", 0))
+ if (msg[i] == 0x0D && db_get_b(NULL, "SimpleStatusMsg", "RemoveCR", 0))
{
TCHAR *p = msg + i;
if (i + 1 <= 1024 && msg[i + 1])
@@ -186,7 +186,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) g_ptszWinampSong = mir_tstrdup(ptszWinampTitle);
}
else if (g_ptszWinampSong && lstrcmp(g_ptszWinampSong, _T("SimpleStatusMsg"))
- && DBGetContactSettingByte(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))
+ && db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))
{
ptszWinampTitle = mir_tstrdup(g_ptszWinampSong);
}
@@ -353,7 +353,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) BOOL rmark[25];
for (k = 0; k < SIZEOF(rmark); k++) rmark[k] = FALSE;
- maxk = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "MaxHist", 10);
+ maxk = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
if (maxk == 0) rmark[0] = TRUE;
while (!rmark[0])
@@ -365,15 +365,15 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) if (k2 == maxk || k2 > maxk) rmark[0] = TRUE;
mir_snprintf(buff, SIZEOF(buff), "SMsg%d", k);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", buff, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (dbv.ptszVal == NULL)
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
continue;
}
lstrcpy(substituteStr, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else continue;
@@ -401,7 +401,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) BOOL rmark[25];
for (k = 0; k < SIZEOF(rmark); k++) rmark[k] = FALSE;
- maxk = DBGetContactSettingWord(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
+ maxk = db_get_w(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
if (maxk == 0) rmark[0] = TRUE;
while (!rmark[0])
@@ -413,15 +413,15 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) if (k2 == maxk || k2 > maxk) rmark[0] = TRUE;
mir_snprintf(buff, SIZEOF(buff), "DefMsg%d", k);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", buff, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (dbv.ptszVal == NULL)
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
continue;
}
lstrcpy(substituteStr, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else continue;
@@ -449,7 +449,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) {
char szSetting[80];
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sMaxLen", szProto);
- len = DBGetContactSettingWord(NULL, "SimpleStatusMsg", szSetting, 1024);
+ len = db_get_w(NULL, "SimpleStatusMsg", szSetting, 1024);
if (len < lstrlen(msg))
{
msg = (TCHAR *)mir_realloc(msg, len * sizeof(TCHAR));
@@ -462,7 +462,7 @@ TCHAR *InsertBuiltinVarsIntoMsg(TCHAR *in, const char *szProto, int status) TCHAR *InsertVarsIntoMsg(TCHAR *tszMsg, const char *szProto, int iStatus, HANDLE hContact)
{
- if (ServiceExists(MS_VARS_FORMATSTRING) && DBGetContactSettingByte(NULL, "SimpleStatusMsg", "EnableVariables", 1))
+ if (ServiceExists(MS_VARS_FORMATSTRING) && db_get_b(NULL, "SimpleStatusMsg", "EnableVariables", 1))
{
FORMATINFO fInfo = {0};
fInfo.cbSize = sizeof(fInfo);
@@ -489,7 +489,7 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) TCHAR *format;
mir_snprintf(szSetting, SIZEOF(szSetting), "%sFlags", szProto ? szProto : "");
- flags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, szSetting), STATUS_DEFAULT);
+ flags = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, szSetting), STATUS_DEFAULT);
if (flags & STATUS_EMPTY_MSG)
return mir_tstrdup(_T(""));
@@ -501,11 +501,11 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) else
mir_snprintf(szSetting, SIZEOF(szSetting), "Msg");
- if (DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), &dbv))
+ if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), &dbv))
return NULL; //mir_tstrdup(_T(""));
format = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else if (flags & STATUS_LAST_MSG)
{
@@ -514,18 +514,18 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) else
mir_snprintf(szSetting, SIZEOF(szSetting), "LastMsg");
- if (DBGetContactSetting(NULL, "SimpleStatusMsg", szSetting, &dbv2))
+ if (db_get(NULL, "SimpleStatusMsg", szSetting, &dbv2))
return NULL; //mir_tstrdup(_T(""));
- if (DBGetContactSettingTString(NULL, "SimpleStatusMsg", dbv2.pszVal, &dbv))
+ if (db_get_ts(NULL, "SimpleStatusMsg", dbv2.pszVal, &dbv))
{
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
return NULL; //mir_tstrdup(_T(""));
}
format = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
- DBFreeVariant(&dbv2);
+ db_free(&dbv);
+ db_free(&dbv2);
}
else if (flags & STATUS_THIS_MSG)
{
@@ -534,11 +534,11 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) else
mir_snprintf(szSetting, SIZEOF(szSetting), "Default");
- if (DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), &dbv))
+ if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), &dbv))
return mir_tstrdup(_T(""));
format = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
format = mir_tstrdup(GetDefaultMessage(iStatus));
@@ -549,9 +549,9 @@ static TCHAR *GetAwayMessageFormat(int iStatus, const char *szProto) void DBWriteMessage(char *szSetting, TCHAR *tszMsg)
{
if (tszMsg && lstrlen(tszMsg))
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", szSetting, tszMsg);
+ db_set_ts(NULL, "SimpleStatusMsg", szSetting, tszMsg);
else
- DBDeleteContactSetting(NULL, "SimpleStatusMsg", szSetting);
+ db_unset(NULL, "SimpleStatusMsg", szSetting);
}
void SaveMessageToDB(const char *szProto, TCHAR *tszMsg, BOOL bIsFormat)
@@ -601,7 +601,7 @@ void SaveStatusAsCurrent(const char *szProto, int iStatus) {
char szSetting[80];
mir_snprintf(szSetting, SIZEOF(szSetting), "Cur%sStatus", szProto);
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", szSetting, (WORD)iStatus);
+ db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)iStatus);
}
static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, HANDLE hContact)
@@ -613,10 +613,10 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, {
DBVARIANT dbv;
mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", szProto);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
format = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
//else
// format = mir_tstrdup(_T(""));
@@ -632,7 +632,7 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, return NULL;
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", szProto ? szProto : "");
- flags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
+ flags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
//if (flags & PROTO_NO_MSG)
//{
@@ -643,10 +643,10 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, {
DBVARIANT dbv;
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sDefault", szProto);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
format = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
format = mir_tstrdup(_T(""));
@@ -655,10 +655,10 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, {
DBVARIANT dbv;
mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", szProto);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
format = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
//else
// format = mir_tstrdup(_T(""));
@@ -682,10 +682,10 @@ static TCHAR *GetAwayMessage(int iStatus, const char *szProto, BOOL bInsertVars, int CheckProtoSettings(const char *szProto, int iInitialStatus)
{
- int iSetting = DBGetContactSettingWord(NULL, szProto, "LeaveStatus", -1); //GG settings
+ int iSetting = db_get_w(NULL, szProto, "LeaveStatus", -1); //GG settings
if (iSetting != -1)
return iSetting ? iSetting : iInitialStatus;
- iSetting = DBGetContactSettingWord(NULL, szProto, "OfflineMessageOption", -1); //TLEN settings
+ iSetting = db_get_w(NULL, szProto, "OfflineMessageOption", -1); //TLEN settings
if (iSetting != -1)
{
switch (iSetting)
@@ -752,7 +752,7 @@ int HasProtoStaticStatusMsg(const char *szProto, int iInitialStatus, int iStatus int flags;
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", szProto);
- flags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
+ flags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
if (flags & PROTO_NO_MSG)
{
@@ -767,11 +767,11 @@ int HasProtoStaticStatusMsg(const char *szProto, int iInitialStatus, int iStatus TCHAR *msg;
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sDefault", szProto);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
SaveMessageToDB(szProto, dbv.ptszVal, TRUE);
msg = InsertVarsIntoMsg(dbv.ptszVal, szProto, iStatus, NULL);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
Proto_SetStatus(szProto, iInitialStatus, iStatus, msg);
SaveMessageToDB(szProto, msg, FALSE);
mir_free(msg);
@@ -802,7 +802,7 @@ INT_PTR SetStatusModeFromExtern(WPARAM wParam, LPARAM lParam) if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) &~ CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
- if (DBGetContactSettingByte(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
+ if (db_get_b(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
continue;
if (wParam == ID_STATUS_CURRENT || wParam == 0)
@@ -896,7 +896,7 @@ void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, TCHA if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
- if (!bOnStartup && DBGetContactSettingByte(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
+ if (!bOnStartup && db_get_b(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
continue;
if (iProfileStatus)
@@ -904,11 +904,11 @@ void SetStatusMessage(const char *szProto, int iInitialStatus, int iStatus, TCHA int iProfileNumber = iStatus - 40083;
char szSetting[128];
mir_snprintf(szSetting, SIZEOF(szSetting), "%d_%s", iProfileNumber, accounts->pa[i]->szModuleName);
- iStatus = DBGetContactSettingWord(NULL, "StartupStatus", szSetting, ID_STATUS_OFFLINE);
+ iStatus = db_get_w(NULL, "StartupStatus", szSetting, ID_STATUS_OFFLINE);
if (iStatus == ID_STATUS_IDLE) // the same as ID_STATUS_LAST in StartupStatus
{
mir_snprintf(szSetting, SIZEOF(szSetting), "last_%s", accounts->pa[i]->szModuleName);
- iStatus = DBGetContactSettingWord(NULL, "StartupStatus", szSetting, ID_STATUS_OFFLINE);
+ iStatus = db_get_w(NULL, "StartupStatus", szSetting, ID_STATUS_OFFLINE);
}
else if (iStatus == ID_STATUS_CURRENT)
iStatus = GetCurrentStatus(accounts->pa[i]->szModuleName);
@@ -1124,7 +1124,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) }
mir_snprintf(szSetting, SIZEOF(szSetting), "%sFlags", szProto ? szProto : "");
- iDlgFlags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, szSetting), STATUS_DEFAULT);
+ iDlgFlags = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, szSetting), STATUS_DEFAULT);
bShowDlg = iDlgFlags & STATUS_SHOW_DLG || bOnStartup;
SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, &bScreenSaverRunning, 0);
@@ -1151,7 +1151,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) }
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", szProto);
- iProtoFlags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
+ iProtoFlags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
if (iProtoFlags & PROTO_NO_MSG || iProtoFlags & PROTO_THIS_MSG)
{
if (HasProtoStaticStatusMsg(szProto, iStatus, iStatus))
@@ -1163,10 +1163,10 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) TCHAR *msg = NULL;
mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", szProto);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
msg = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
//else
// msg = mir_tstrdup(_T(""));
@@ -1218,7 +1218,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) if (iStatus == ID_STATUS_OFFLINE || (!(accounts->statusMsgFlags & Proto_Status2Flag(iStatus)) && iStatus != ID_STATUS_CURRENT))
return 0;
- iProtoFlags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ProtoFlags", PROTO_DEFAULT);
+ iProtoFlags = db_get_b(NULL, "SimpleStatusMsg", "ProtoFlags", PROTO_DEFAULT);
if (!bShowDlg || bScreenSaverRunning || (iProtoFlags & PROTO_NOCHANGE && !bOnStartup))
{
TCHAR *msg = NULL;
@@ -1230,7 +1230,7 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
- if (DBGetContactSettingByte(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
+ if (db_get_b(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
continue;
if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iStatus)) ||
@@ -1241,10 +1241,10 @@ static int ChangeStatusMessage(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv;
mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", accounts->pa[i]->szModuleName);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
msg = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
//else
// msg = mir_tstrdup(_T(""));
@@ -1397,7 +1397,7 @@ int SetStartupStatus(int i) }
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", accounts->pa[i]->szModuleName);
- flags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
+ flags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
if (flags & PROTO_NO_MSG || flags & PROTO_THIS_MSG)
{
if (HasProtoStaticStatusMsg(accounts->pa[i]->szModuleName, ID_STATUS_OFFLINE, iStatus))
@@ -1407,10 +1407,10 @@ int SetStartupStatus(int i) {
DBVARIANT dbv;
mir_snprintf(szSetting, SIZEOF(szSetting), "FCur%sMsg", accounts->pa[i]->szModuleName);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
fmsg = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
//else
// fmsg = mir_tstrdup(_T(""));
@@ -1468,7 +1468,7 @@ VOID CALLBACK SetStartupStatusGlobal(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWO }
// popup status msg dialog at startup?
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "StartupPopupDlg", 1) && accounts->statusMsgFlags)
+ if (db_get_b(NULL, "SimpleStatusMsg", "StartupPopupDlg", 1) && accounts->statusMsgFlags)
{
if (globalstatus)
{
@@ -1477,7 +1477,7 @@ VOID CALLBACK SetStartupStatusGlobal(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWO else
{
// pseudo-currentDesiredStatusMode ;-)
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "StartupStatus", (WORD)temp_status_mode);
+ db_set_w(NULL, "SimpleStatusMsg", "StartupStatus", (WORD)temp_status_mode);
ChangeStatusMessage((WPARAM)ID_STATUS_CURRENT, (LPARAM)"SimpleStatusMsgGlobalStartupStatus");
}
return;
@@ -1491,7 +1491,7 @@ VOID CALLBACK SetStartupStatusGlobal(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWO if (!(CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
-// if (DBGetContactSettingByte(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
+// if (db_get_b(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
// continue;
SetStartupStatus(i);
@@ -1533,7 +1533,7 @@ VOID CALLBACK UpdateMsgTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD d MIRANDA_IDLE_INFO mii = {0};
mii.cbSize = sizeof(mii);
CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii);
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "NoUpdateOnIdle", 1) && mii.idleType)
+ if (db_get_b(NULL, "SimpleStatusMsg", "NoUpdateOnIdle", 1) && mii.idleType)
return;
if (!hwndSAMsgDialog)
@@ -1559,22 +1559,22 @@ VOID CALLBACK UpdateMsgTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD d continue;
mir_snprintf(szBuffer, SIZEOF(szBuffer), "FCur%sMsg", accounts->pa[i]->szModuleName);
- if (DBGetContactSettingTString(NULL, "SimpleStatusMsg", szBuffer, &dbv))
+ if (db_get_ts(NULL, "SimpleStatusMsg", szBuffer, &dbv))
continue;
tszMsg = InsertVarsIntoMsg(dbv.ptszVal, accounts->pa[i]->szModuleName, iCurrentStatus, NULL);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szBuffer, SIZEOF(szBuffer), "Cur%sMsg", accounts->pa[i]->szModuleName);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szBuffer, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szBuffer, &dbv))
{
if (tszMsg && dbv.ptszVal && !lstrcmp(tszMsg, dbv.ptszVal) || !tszMsg && !dbv.ptszVal)
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_free(tszMsg);
continue;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (tszMsg && lstrlen(tszMsg))
@@ -1647,7 +1647,7 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
- if (!DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", 1))
+ if (!db_get_b(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", 1))
mi.flags |= CMIF_HIDDEN;
mi.icolibItem = GetIconHandle(IDI_CSMSG);
mi.pszService = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
@@ -1676,7 +1676,7 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) continue;
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", pa[i]->szModuleName);
- iProtoFlags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
+ iProtoFlags = db_get_b(NULL, "SimpleStatusMsg", szSetting, PROTO_DEFAULT);
if (iProtoFlags & PROTO_NO_MSG || iProtoFlags & PROTO_THIS_MSG)
continue;
@@ -1717,7 +1717,7 @@ static int OnIdleChanged(WPARAM, LPARAM lParam) if (!IsAccountEnabled(accounts->pa[i]))
continue;
- if (DBGetContactSettingByte(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
+ if (db_get_b(NULL, accounts->pa[i]->szModuleName, "LockMainStatus", 0))
continue;
int iStatusBits = CallProtoService(accounts->pa[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0);
@@ -1734,7 +1734,7 @@ static int OnIdleChanged(WPARAM, LPARAM lParam) if (iCurrentStatus < ID_STATUS_ONLINE || iCurrentStatus == ID_STATUS_INVISIBLE)
continue;
- if ((lParam & IDF_ISIDLE && (DBGetContactSettingByte(NULL, "AutoAway", accounts->pa[i]->szModuleName, 0) ||
+ if ((lParam & IDF_ISIDLE && (db_get_b(NULL, "AutoAway", accounts->pa[i]->szModuleName, 0) ||
iCurrentStatus == ID_STATUS_ONLINE || iCurrentStatus == ID_STATUS_FREECHAT)) ||
(!(lParam & IDF_ISIDLE) && !mii.aaLock))
{
@@ -1791,11 +1791,11 @@ static int CSStatusChange(WPARAM wParam, LPARAM lParam) #ifdef _DEBUG
log2file("CSStatusChange(): Set \"%s\" status message for %s.", ps[i]->szMsg, ps[i]->szName);
#endif
- max_hist_msgs = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "MaxHist", 10);
+ max_hist_msgs = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
for (j = 1; j <= max_hist_msgs; j++)
{
mir_snprintf(buff, SIZEOF(buff), "SMsg%d", j);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", buff, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (!lstrcmp(dbv.ptszVal, szMsgW))
@@ -1803,8 +1803,8 @@ static int CSStatusChange(WPARAM wParam, LPARAM lParam) {
found = TRUE;
mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", ps[i]->szName);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", szSetting, buff);
- DBFreeVariant(&dbv);
+ db_set_s(NULL, "SimpleStatusMsg", szSetting, buff);
+ db_free(&dbv);
break;
}
}
@@ -1814,12 +1814,12 @@ static int CSStatusChange(WPARAM wParam, LPARAM lParam) {
mir_snprintf(buff, SIZEOF(buff), "FCur%sMsg", ps[i]->szName);
mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", ps[i]->szName);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", szSetting, buff);
+ db_set_s(NULL, "SimpleStatusMsg", szSetting, buff);
}
mir_snprintf(szSetting, SIZEOF(szSetting), "%sMsg", ps[i]->szName);
- DBWriteContactSettingWString(NULL, "SRAway", StatusModeToDbSetting(status_mode, szSetting), szMsgW);
+ db_set_ws(NULL, "SRAway", StatusModeToDbSetting(status_mode, szSetting), szMsgW);
msg = InsertVarsIntoMsg(szMsgW, ps[i]->szName, status_mode, NULL);
SaveMessageToDB(ps[i]->szName, szMsgW, TRUE);
mir_free(szMsgW);
@@ -1847,7 +1847,7 @@ static TCHAR *ParseWinampSong(ARGUMENTSINFO *ai) mir_free(g_ptszWinampSong);
g_ptszWinampSong = mir_tstrdup(ptszWinampTitle);
}
- else if (g_ptszWinampSong && lstrcmp(g_ptszWinampSong, _T("SimpleStatusMsg")) && DBGetContactSettingByte(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))
+ else if (g_ptszWinampSong && lstrcmp(g_ptszWinampSong, _T("SimpleStatusMsg")) && db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))
ptszWinampTitle = mir_tstrdup(g_ptszWinampSong);
return ptszWinampTitle;
@@ -1886,7 +1886,7 @@ static int OnICQStatusMsgRequest(WPARAM wParam, LPARAM lParam, LPARAM lMirParam) log2file("OnICQStatusMsgRequest(): UIN: %d on %s", (int)lParam, (char *)lMirParam);
#endif
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "NoUpdateOnICQReq", 1))
+ if (db_get_b(NULL, "SimpleStatusMsg", "NoUpdateOnICQReq", 1))
return 0;
HANDLE hContact;
@@ -1897,7 +1897,7 @@ static int OnICQStatusMsgRequest(WPARAM wParam, LPARAM lParam, LPARAM lMirParam) while (hContact)
{
szProto = GetContactProto(hContact);
- if (szProto != NULL && !strcmp(szProto, (char *)lMirParam) && DBGetContactSettingDword(hContact, szProto, "UIN", 0) == (DWORD)lParam)
+ if (szProto != NULL && !strcmp(szProto, (char *)lMirParam) && db_get_dw(hContact, szProto, "UIN", 0) == (DWORD)lParam)
{
bContactFound = TRUE;
break;
@@ -1991,7 +1991,7 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) tr.szHelpText = LPGEN("External Applications\tretrieves song name of the song currently playing in Winamp (Simple Status Message compatible)");
CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM)&tr);
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ExclDateToken", 0) != 0)
+ if (db_get_b(NULL, "SimpleStatusMsg", "ExclDateToken", 0) != 0)
{
tr.tszTokenString = _T("date");
tr.parseFunctionT = ParseDate;
@@ -2000,13 +2000,13 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) }
}
-/* if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))*/ {
+/* if (db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1))*/ {
DBVARIANT dbv;
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", "AmpLastTitle", &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", "AmpLastTitle", &dbv))
{
g_ptszWinampSong = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
g_ptszWinampSong = mir_tstrdup(_T("SimpleStatusMsg"));
@@ -2014,8 +2014,8 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) /* else
g_ptszWinampSong = mir_tstrdup(_T("SimpleStatusMsg"));*/
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "UpdateMsgOn", 1))
- g_uUpdateMsgTimer = SetTimer(NULL, 0, DBGetContactSettingWord(NULL, "SimpleStatusMsg", "UpdateMsgInt", 10) * 1000, (TIMERPROC)UpdateMsgTimerProc);
+ if (db_get_b(NULL, "SimpleStatusMsg", "UpdateMsgOn", 1))
+ g_uUpdateMsgTimer = SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", "UpdateMsgInt", 10) * 1000, (TIMERPROC)UpdateMsgTimerProc);
if (ServiceExists(MS_CS_SETSTATUSEX))
HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChange);
@@ -2025,9 +2025,9 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) if (!ServiceExists(MS_SS_GETPROFILECOUNT))
{
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "GlobalStatusDelay", 1))
+ if (db_get_b(NULL, "SimpleStatusMsg", "GlobalStatusDelay", 1))
{
- SetTimer(NULL, 0, DBGetContactSettingWord(NULL, "SimpleStatusMsg", "SetStatusDelay", 300), (TIMERPROC)SetStartupStatusGlobal);
+ SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", "SetStatusDelay", 300), (TIMERPROC)SetStartupStatusGlobal);
}
else
{
@@ -2043,7 +2043,7 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) continue;
mir_snprintf(szSetting, SIZEOF(szSetting), "Set%sStatusDelay", accounts->pa[i]->szModuleName);
- g_uSetStatusTimer[i] = SetTimer(NULL, 0, DBGetContactSettingWord(NULL, "SimpleStatusMsg", szSetting, 300), (TIMERPROC)SetStartupStatusProc);
+ g_uSetStatusTimer[i] = SetTimer(NULL, 0, db_get_w(NULL, "SimpleStatusMsg", szSetting, 300), (TIMERPROC)SetStartupStatusProc);
}
}
}
@@ -2066,10 +2066,10 @@ static int OnOkToExit(WPARAM wParam, LPARAM lParam) continue;
mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sStatus", accounts->pa[i]->szModuleName);
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", szSetting, (WORD)CallProtoService(accounts->pa[i]->szModuleName, PS_GETSTATUS, 0, 0));
+ db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)CallProtoService(accounts->pa[i]->szModuleName, PS_GETSTATUS, 0, 0));
}
- if (g_ptszWinampSong && lstrcmp(g_ptszWinampSong, _T("SimpleStatusMsg")) /*&& DBGetContactSettingByte(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1)*/)
+ if (g_ptszWinampSong && lstrcmp(g_ptszWinampSong, _T("SimpleStatusMsg")) /*&& db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1)*/)
DBWriteMessage("AmpLastTitle", g_ptszWinampSong);
}
@@ -2119,7 +2119,7 @@ extern "C" int __declspec(dllexport) Load(void) hwndSAMsgDialog = NULL;
accounts = (PROTOACCOUNTS *)mir_alloc(sizeof(PROTOACCOUNTS));
- DBWriteContactSettingWord(NULL, "CList", "Status", (WORD)ID_STATUS_OFFLINE);
+ db_set_w(NULL, "CList", "Status", (WORD)ID_STATUS_OFFLINE);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccListChanged);
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index e7b4a7c436..b98b9d5c40 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -242,7 +242,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) else
cbei.mask = CBEIF_LPARAM | CBEIF_TEXT | CBEIF_IMAGE | CBEIF_SELECTEDIMAGE;
- j = DBGetContactSettingWord(NULL, "SimpleStatusMsg", "LMMsg", 1);
+ j = db_get_w(NULL, "SimpleStatusMsg", "LMMsg", 1);
for (i = 1; i <= data->max_hist_msgs; ++i)
{
@@ -250,7 +250,7 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) if (j < 1) j = data->max_hist_msgs;
mir_snprintf(buff, SIZEOF(buff), "SMsg%d", j);
j--;
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", buff, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (dbv.ptszVal != NULL && dbv.ptszVal != '\0')
{
@@ -269,11 +269,11 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) if (SendMessage(handle, CBEM_INSERTITEM, 0, (LPARAM)&cbei) == -1)
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
break;
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -361,13 +361,13 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) {
// predefined messages
mir_snprintf(buff, SIZEOF(buff), "DefMsg%d", i);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", buff, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (dbv.ptszVal)
{
if (!lstrlen(dbv.ptszVal))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
continue;
}
@@ -386,11 +386,11 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) if (SendMessage(handle,CBEM_INSERTITEM,0,(LPARAM)&cbei) == -1)
break;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "PutDefInList", 0))
+ if (db_get_b(NULL, "SimpleStatusMsg", "PutDefInList", 0))
{
cbei.iItem = -1;
cbei.pszText = (LPTSTR)GetDefaultMessage(data->m_iStatus);
@@ -704,9 +704,9 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel) for (i = 1; i <= data->max_hist_msgs; i++)
{
mir_snprintf(text, SIZEOF(text), "SMsg%d", i);
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", text, _T(""));
+ db_set_ts(NULL, "SimpleStatusMsg", text, _T(""));
}
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", "LastMsg", "");
+ db_set_s(NULL, "SimpleStatusMsg", "LastMsg", "");
for (i = 0; i < accounts->count; i++)
{
if (!IsAccountEnabled(accounts->pa[i]))
@@ -719,9 +719,9 @@ void ClearHistory(struct MsgBoxData *data, int cur_sel) continue;
mir_snprintf(buff2, SIZEOF(buff2), "Last%sMsg", accounts->pa[i]->szModuleName);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", buff2, "");
+ db_set_s(NULL, "SimpleStatusMsg", buff2, "");
}
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "LMMsg", (WORD)data->max_hist_msgs);
+ db_set_w(NULL, "SimpleStatusMsg", "LMMsg", (WORD)data->max_hist_msgs);
SendMessage(data->recent_cbex, CB_SETCURSEL, -1, 0);
num_items = SendMessage(data->recent_cbex, CB_GETCOUNT, 0, 0);
if (num_items == CB_ERR)
@@ -750,7 +750,7 @@ void DisplayCharsCount(struct MsgBoxData *dlg_data, HWND hwndDlg) return;
len = GetDlgItemText(hwndDlg, IDC_EDIT1, msg, SIZEOF(msg));
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "RemoveCR", 0))
+ if (db_get_b(NULL, "SimpleStatusMsg", "RemoveCR", 0))
{
int index, num_lines = SendMessage(GetDlgItem(hwndDlg, IDC_EDIT1), EM_GETLINECOUNT, 0, 0);
for (int i = 1; i < num_lines; ++i)
@@ -773,7 +773,7 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) num_start -= data->num_def_msgs + 1;
mir_snprintf(setting, SIZEOF(setting), "%sFlags", data->m_szProto ? data->m_szProto : "");
- flags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, setting), STATUS_DEFAULT);
+ flags = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(iStatus, setting), STATUS_DEFAULT);
if (flags & STATUS_LAST_MSG)
{
@@ -782,11 +782,11 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) else
mir_snprintf(setting, SIZEOF(setting), "LastMsg");
- if (!DBGetContactSetting(NULL, "SimpleStatusMsg", setting, &dbv))
+ if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
{
if (dbv.pszVal)
{
- if (strlen(dbv.pszVal) && !DBGetContactSettingTString(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2))
+ if (strlen(dbv.pszVal) && !db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2))
{
if (dbv2.ptszVal && lstrlen(dbv2.ptszVal))
{
@@ -795,17 +795,17 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) if (fcursel != CB_ERR)
SendMessage(data->recent_cbex, CB_SETCURSEL, (WPARAM)fcursel, 0);
}
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else if (flags & STATUS_DEFAULT_MSG)
{
SetDlgItemText(hwndDlg, IDC_EDIT1, GetDefaultMessage(iStatus));
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "PutDefInList", 0))
+ if (db_get_b(NULL, "SimpleStatusMsg", "PutDefInList", 0))
{
fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)GetDefaultMessage(iStatus));
if (fcursel != CB_ERR)
@@ -819,13 +819,13 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) else
mir_snprintf(setting, SIZEOF(setting), "Default");
- if (!DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting), &dbv))
+ if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting), &dbv))
{
SetDlgItemText(hwndDlg, IDC_EDIT1, dbv.ptszVal);
fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)dbv.ptszVal);
if (fcursel != CB_ERR)
SendMessage(data->recent_cbex, CB_SETCURSEL, (WPARAM)fcursel, 0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else if (flags & STATUS_LAST_STATUS_MSG)
@@ -835,13 +835,13 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus) else
mir_snprintf(setting, SIZEOF(setting), "Msg");
- if (!DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting), &dbv))
+ if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, setting), &dbv))
{
SetDlgItemText(hwndDlg, IDC_EDIT1, dbv.ptszVal);
fcursel = SendMessage(data->recent_cbex, CB_FINDSTRINGEXACT, num_start, (LPARAM)dbv.ptszVal);
if (fcursel != CB_ERR)
SendMessage(data->recent_cbex, CB_SETCURSEL, (WPARAM)fcursel, 0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -1021,9 +1021,9 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA HookEventMessage(ME_SYSTEM_PRESHUTDOWN, hwndDlg, DM_SIMPAWAY_SHUTDOWN);
HookEventMessage(ME_SKIN2_ICONSCHANGED, hwndDlg, DM_SIMPAWAY_CHANGEICONS);
- copy_init_data->num_def_msgs = DBGetContactSettingWord(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
- copy_init_data->max_hist_msgs = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "MaxHist", 10);
- copy_init_data->m_iDlgFlags = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "DlgFlags", DLG_SHOW_DEFAULT);
+ copy_init_data->num_def_msgs = db_get_w(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
+ copy_init_data->max_hist_msgs = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
+ copy_init_data->m_iDlgFlags = db_get_b(NULL, "SimpleStatusMsg", "DlgFlags", DLG_SHOW_DEFAULT);
copy_init_data->m_szProto = init_data->m_szProto;
copy_init_data->m_iStatus = init_data->m_iStatus;
copy_init_data->m_iStatusModes = init_data->m_iStatusModes;
@@ -1144,9 +1144,9 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA }
}
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "AutoClose", 1) && init_data->m_bOnEvent)
+ if (db_get_b(NULL, "SimpleStatusMsg", "AutoClose", 1) && init_data->m_bOnEvent)
{
- copy_init_data->m_iCountdown = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "DlgTime", 5);
+ copy_init_data->m_iCountdown = db_get_b(NULL, "SimpleStatusMsg", "DlgTime", 5);
SendMessage(hwndDlg, WM_TIMER, 0, 0);
SetTimer(hwndDlg, 1, 1000, 0);
}
@@ -1170,7 +1170,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA else
SetFocus(GetDlgItem(hwndDlg, IDC_OK));
- if (!DBGetContactSettingByte(NULL, "SimpleStatusMsg", "WinCentered", 1))
+ if (!db_get_b(NULL, "SimpleStatusMsg", "WinCentered", 1))
{
WINDOWPLACEMENT wp;
int x, y;
@@ -1178,8 +1178,8 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA wp.length = sizeof(wp);
GetWindowPlacement(hwndDlg, &wp);
- x = (int)DBGetContactSettingDword(NULL, "SimpleStatusMsg", "Winx", -1);
- y = (int)DBGetContactSettingDword(NULL, "SimpleStatusMsg", "Winy", -1);
+ x = (int)db_get_dw(NULL, "SimpleStatusMsg", "Winx", -1);
+ y = (int)db_get_dw(NULL, "SimpleStatusMsg", "Winy", -1);
if (x !=- 1)
{
@@ -1238,14 +1238,14 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (msgbox_data->m_szProto)
{
mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", msgbox_data->m_szProto);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", szSetting, "");
+ db_set_s(NULL, "SimpleStatusMsg", szSetting, "");
mir_snprintf(szSetting, SIZEOF(szSetting), "%sMsg", msgbox_data->m_szProto);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, szSetting), _T(""));
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, szSetting), _T(""));
}
else
{
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", "LastMsg", "");
+ db_set_s(NULL, "SimpleStatusMsg", "LastMsg", "");
for (int j = 0; j < accounts->count; j++)
{
if (!IsAccountEnabled(accounts->pa[j]))
@@ -1254,21 +1254,21 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (!CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
continue;
- if (DBGetContactSettingByte(NULL, accounts->pa[j]->szModuleName, "LockMainStatus", 0))
+ if (db_get_b(NULL, accounts->pa[j]->szModuleName, "LockMainStatus", 0))
continue;
if (!(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sMsg", accounts->pa[j]->szModuleName);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", szSetting, "");
+ db_set_s(NULL, "SimpleStatusMsg", szSetting, "");
mir_snprintf(szSetting, SIZEOF(szSetting), "%sMsg", accounts->pa[j]->szModuleName);
iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), _T(""));
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, szSetting), _T(""));
}
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, "Msg"), _T("")); // for compatibility with some plugins
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, "Msg"), _T("")); // for compatibility with some plugins
}
if (bCurrentStatus)
@@ -1287,7 +1287,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA for (int i = 1; i <= msgbox_data->max_hist_msgs; i++)
{
mir_snprintf(buff, SIZEOF(buff), "SMsg%d", i);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", buff, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", buff, &dbv))
{
if (!lstrcmp(dbv.ptszVal, tszMsg))
{
@@ -1295,14 +1295,14 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (msgbox_data->m_szProto)
{
mir_snprintf(buff2, SIZEOF(buff2), "Last%sMsg", msgbox_data->m_szProto);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", buff2, buff);
+ db_set_s(NULL, "SimpleStatusMsg", buff2, buff);
mir_snprintf(buff2, SIZEOF(buff2), "%sMsg", msgbox_data->m_szProto);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg);
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg);
}
else
{
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", "LastMsg", buff);
+ db_set_s(NULL, "SimpleStatusMsg", "LastMsg", buff);
for (int j = 0; j < accounts->count; j++)
{
if (!IsAccountEnabled(accounts->pa[j]))
@@ -1311,21 +1311,21 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (!CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
continue;
- if (DBGetContactSettingByte(NULL, accounts->pa[j]->szModuleName, "LockMainStatus", 0))
+ if (db_get_b(NULL, accounts->pa[j]->szModuleName, "LockMainStatus", 0))
continue;
if (!(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
mir_snprintf(buff2, SIZEOF(buff2), "Last%sMsg", accounts->pa[j]->szModuleName);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", buff2, buff);
+ db_set_s(NULL, "SimpleStatusMsg", buff2, buff);
mir_snprintf(buff2, SIZEOF(buff2), "%sMsg", accounts->pa[j]->szModuleName);
iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg);
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
break;
}
}
@@ -1333,7 +1333,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (!found)
{
- int last_modified_msg = DBGetContactSettingWord(NULL, "SimpleStatusMsg", "LMMsg", msgbox_data->max_hist_msgs);
+ int last_modified_msg = db_get_w(NULL, "SimpleStatusMsg", "LMMsg", msgbox_data->max_hist_msgs);
if (last_modified_msg == msgbox_data->max_hist_msgs)
last_modified_msg = 1;
@@ -1341,19 +1341,19 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA last_modified_msg++;
mir_snprintf(buff, SIZEOF(buff), "SMsg%d", last_modified_msg);
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", buff, tszMsg);
+ db_set_ts(NULL, "SimpleStatusMsg", buff, tszMsg);
if (msgbox_data->m_szProto)
{
mir_snprintf(buff2, SIZEOF(buff2), "Last%sMsg", msgbox_data->m_szProto);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", buff2, buff);
+ db_set_s(NULL, "SimpleStatusMsg", buff2, buff);
mir_snprintf(buff2, SIZEOF(buff2), "%sMsg", msgbox_data->m_szProto);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg);
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, buff2), tszMsg);
}
else
{
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", "LastMsg", buff);
+ db_set_s(NULL, "SimpleStatusMsg", "LastMsg", buff);
for (int j = 0; j < accounts->count; j++)
{
if (!IsAccountEnabled(accounts->pa[j]))
@@ -1362,25 +1362,25 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (!CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0))
continue;
- if (DBGetContactSettingByte(NULL, accounts->pa[j]->szModuleName, "LockMainStatus", 0))
+ if (db_get_b(NULL, accounts->pa[j]->szModuleName, "LockMainStatus", 0))
continue;
if (!(CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
mir_snprintf(buff2, SIZEOF(buff2), "Last%sMsg", accounts->pa[j]->szModuleName);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", buff2, buff);
+ db_set_s(NULL, "SimpleStatusMsg", buff2, buff);
mir_snprintf(buff2, SIZEOF(buff2), "%sMsg", accounts->pa[j]->szModuleName);
iStatus = msgbox_data->m_bOnStartup ? GetStartupStatus(accounts->pa[j]->szModuleName) : GetCurrentStatus(accounts->pa[j]->szModuleName);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg);
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(iStatus, buff2), tszMsg);
}
}
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "LMMsg", (WORD)last_modified_msg);
+ db_set_w(NULL, "SimpleStatusMsg", "LMMsg", (WORD)last_modified_msg);
}
if (!msgbox_data->m_szProto)
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, "Msg"), tszMsg); // for compatibility with some plugins
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(msgbox_data->m_iStatus, "Msg"), tszMsg); // for compatibility with some plugins
if (bCurrentStatus)
SetStatusMessage(msgbox_data->m_szProto, msgbox_data->m_iInitialStatus, ID_STATUS_CURRENT, tszMsg, msgbox_data->m_bOnStartup);
@@ -1526,7 +1526,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA {
char szSetting[16];
mir_snprintf(szSetting, SIZEOF(szSetting), "SMsg%d", (int)HIWORD(histitem.lParam));
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", szSetting, _T(""));
+ db_set_ts(NULL, "SimpleStatusMsg", szSetting, _T(""));
SendMessage(msgbox_data->recent_cbex, CBEM_DELETEITEM, (WPARAM)msgbox_data->curr_sel_msg, 0);
}
if (LOWORD(histitem.lParam) == PREDEFINED_MSG)
@@ -1660,7 +1660,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (LOWORD(histitem.lParam) == HISTORY_MSG)
{
mir_snprintf(buff, SIZEOF(buff), "SMsg%d", (int)HIWORD(histitem.lParam));
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", buff, _T(""));
+ db_set_ts(NULL, "SimpleStatusMsg", buff, _T(""));
}
else if (LOWORD(histitem.lParam) == PREDEFINED_MSG)
{
@@ -1737,8 +1737,8 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA WINDOWPLACEMENT wp;
wp.length = sizeof(wp);
GetWindowPlacement(hwndDlg, &wp);
- DBWriteContactSettingDword(NULL, "SimpleStatusMsg", "Winx", wp.rcNormalPosition.left);
- DBWriteContactSettingDword(NULL, "SimpleStatusMsg", "Winy", wp.rcNormalPosition.top);
+ db_set_dw(NULL, "SimpleStatusMsg", "Winx", wp.rcNormalPosition.left);
+ db_set_dw(NULL, "SimpleStatusMsg", "Winy", wp.rcNormalPosition.top);
if (msgbox_data->m_bPredefChanged)
{
@@ -1761,13 +1761,13 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (LOWORD(cbitem.lParam) == PREDEFINED_MSG)
{
new_num_def_msgs++;
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", buff, text);
+ db_set_ts(NULL, "SimpleStatusMsg", buff, text);
}
else
- DBDeleteContactSetting(NULL, "SimpleStatusMsg", buff);
+ db_unset(NULL, "SimpleStatusMsg", buff);
num_items--;
}
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "DefMsgCount", (WORD)new_num_def_msgs);
+ db_set_w(NULL, "SimpleStatusMsg", "DefMsgCount", (WORD)new_num_def_msgs);
}
ImageList_Destroy(msgbox_data->status_icons);
diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index 4aef49ef2d..e803be5784 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -138,13 +138,13 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTSTATUS), CB_SETITEMDATA, (WPARAM)index, (LPARAM)i - ID_STATUS_ONLINE);
- val = DBGetContactSettingByte(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, "Flags"), STATUS_DEFAULT);
+ val = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, "Flags"), STATUS_DEFAULT);
data->status_msg[0].flags[i - ID_STATUS_ONLINE] = val;
- if (DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(i, "Default"), &dbv))
+ if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(i, "Default"), &dbv))
dbv.ptszVal = mir_tstrdup(GetDefaultMessage(i));
lstrcpy(data->status_msg[0].msg[i - ID_STATUS_ONLINE], dbv.ptszVal);
mir_free(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
for (j = 0; j < accounts->count; j++)
{
@@ -152,14 +152,14 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L continue;
mir_snprintf(setting, SIZEOF(setting), "%sFlags", accounts->pa[j]->szModuleName);
- val = DBGetContactSettingByte(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, setting), STATUS_DEFAULT);
+ val = db_get_b(NULL, "SimpleStatusMsg", (char *)StatusModeToDbSetting(i, setting), STATUS_DEFAULT);
data->status_msg[j+1].flags[i-ID_STATUS_ONLINE] = val;
mir_snprintf(setting, SIZEOF(setting), "%sDefault", accounts->pa[j]->szModuleName);
- if (DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(i, setting), &dbv))
+ if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(i, setting), &dbv))
dbv.ptszVal = mir_tstrdup(GetDefaultMessage(i));
lstrcpy(data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE], dbv.ptszVal);
mir_free(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -190,7 +190,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L {
data->proto_msg[0].msg = NULL;
- val = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ProtoFlags", PROTO_DEFAULT);
+ val = db_get_b(NULL, "SimpleStatusMsg", "ProtoFlags", PROTO_DEFAULT);
data->proto_msg[0].flags = val;
data->proto_msg[0].max_length = 0;
SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_SETITEMDATA, (WPARAM)index, 0);
@@ -211,19 +211,19 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L if (index != CB_ERR && index != CB_ERRSPACE)
{
mir_snprintf(setting, SIZEOF(setting), "Proto%sDefault", accounts->pa[i]->szModuleName);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", setting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", setting, &dbv))
{
data->proto_msg[i+1].msg = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
data->proto_msg[i+1].msg = NULL;
mir_snprintf(setting, SIZEOF(setting), "Proto%sFlags", accounts->pa[i]->szModuleName);
- val = DBGetContactSettingByte(NULL, "SimpleStatusMsg", setting, PROTO_DEFAULT);
+ val = db_get_b(NULL, "SimpleStatusMsg", setting, PROTO_DEFAULT);
data->proto_msg[i+1].flags = val;
mir_snprintf(setting, SIZEOF(setting), "Proto%sMaxLen", accounts->pa[i]->szModuleName);
- val = DBGetContactSettingWord(NULL, "SimpleStatusMsg", setting, 1024);
+ val = db_get_w(NULL, "SimpleStatusMsg", setting, 1024);
data->proto_msg[i+1].max_length = val;
SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), CB_SETITEMDATA, (WPARAM)index, (LPARAM)i + 1);
}
@@ -242,7 +242,7 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_CBOPTPROTO, CBN_SELCHANGE), (LPARAM)GetDlgItem(hwndDlg, IDC_CBOPTPROTO));
}
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "PutDefInList", 0))
+ if (db_get_b(NULL, "SimpleStatusMsg", "PutDefInList", 0))
CheckDlgButton(hwndDlg, IDC_COPTMSG2, BST_CHECKED);
if (ServiceExists(MS_VARS_FORMATSTRING))
@@ -464,19 +464,19 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L mir_snprintf(setting, SIZEOF(setting), "LastMsg");
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
- if (!DBGetContactSetting(NULL, "SimpleStatusMsg", setting, &dbv))
+ if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
{
if (dbv.pszVal)
{
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
{
if ((dbv2.ptszVal) && (lstrlen(dbv2.ptszVal)))
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv2.ptszVal);
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
EnableWindow(GetDlgItem(hwndDlg, IDC_OPTEDIT1), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_VARSHELP), FALSE);
@@ -507,10 +507,10 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L else
mir_snprintf(setting, SIZEOF(setting), "Msg");
- if (!DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting), &dbv))
+ if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting), &dbv))
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
@@ -619,18 +619,18 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L mir_snprintf(setting, SIZEOF(setting), "LastMsg");
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
- if (!DBGetContactSetting(NULL, "SimpleStatusMsg", setting, &dbv))
+ if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
{
if (dbv.pszVal)
{
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
{
if (dbv2.ptszVal && lstrlen(dbv2.ptszVal))
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv2.ptszVal);
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
EnableWindow(GetDlgItem(hwndDlg, IDC_OPTEDIT1), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_VARSHELP), FALSE);
@@ -661,10 +661,10 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L else
mir_snprintf(setting, SIZEOF(setting), "Msg");
- if (!DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting), &dbv))
+ if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(j + ID_STATUS_ONLINE, setting), &dbv))
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
@@ -719,18 +719,18 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L mir_snprintf(setting, SIZEOF(setting), "LastMsg");
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
- if (!DBGetContactSetting(NULL, "SimpleStatusMsg", setting, &dbv))
+ if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
{
if (dbv.pszVal)
{
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
{
if (dbv2.ptszVal && lstrlen(dbv2.ptszVal))
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv2.ptszVal);
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
EnableWindow(GetDlgItem(hwndDlg, IDC_OPTEDIT1), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_VARSHELP), FALSE);
@@ -753,10 +753,10 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L else
mir_snprintf(setting, SIZEOF(setting), "Msg");
- if (!DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(i + ID_STATUS_ONLINE, setting), &dbv))
+ if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(i + ID_STATUS_ONLINE, setting), &dbv))
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
@@ -833,18 +833,18 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L mir_snprintf(setting, SIZEOF(setting), "LastMsg");
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
- if (!DBGetContactSetting(NULL, "SimpleStatusMsg", setting, &dbv))
+ if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
{
if (dbv.pszVal)
{
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2) && strlen(dbv.pszVal))
{
if (dbv2.ptszVal && lstrlen(dbv2.ptszVal))
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv2.ptszVal);
- DBFreeVariant(&dbv2);
+ db_free(&dbv2);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
EnableWindow(GetDlgItem(hwndDlg, IDC_OPTEDIT1), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_VARSHELP), FALSE);
@@ -867,10 +867,10 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L else
mir_snprintf(setting, SIZEOF(setting), "Msg");
- if (!DBGetContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(i+ID_STATUS_ONLINE, setting), &dbv))
+ if (!db_get_ts(NULL, "SRAway", StatusModeToDbSetting(i+ID_STATUS_ONLINE, setting), &dbv))
{
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
SetDlgItemText(hwndDlg, IDC_OPTEDIT1, _T(""));
@@ -1032,8 +1032,8 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L {
if (accounts->statusMsgFlags & Proto_Status2Flag(i))
{
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(i, "Default"), data->status_msg[0].msg[i - ID_STATUS_ONLINE]);
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", StatusModeToDbSetting(i, "Flags"), (BYTE)data->status_msg[0].flags[i - ID_STATUS_ONLINE]);
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(i, "Default"), data->status_msg[0].msg[i - ID_STATUS_ONLINE]);
+ db_set_b(NULL, "SimpleStatusMsg", StatusModeToDbSetting(i, "Flags"), (BYTE)data->status_msg[0].flags[i - ID_STATUS_ONLINE]);
for (int j = 0; j < accounts->count; j++)
{
@@ -1046,20 +1046,20 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L if (CallProtoService(accounts->pa[j]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(i))
{
mir_snprintf(szSetting, SIZEOF(szSetting), "%sDefault", accounts->pa[j]->szModuleName);
- DBWriteContactSettingTString(NULL, "SRAway", StatusModeToDbSetting(i, szSetting), data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE]);
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(i, szSetting), data->status_msg[j + 1].msg[i - ID_STATUS_ONLINE]);
mir_snprintf(szSetting, SIZEOF(szSetting), "%sFlags", accounts->pa[j]->szModuleName);
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", StatusModeToDbSetting(i, szSetting), (BYTE)data->status_msg[j + 1].flags[i - ID_STATUS_ONLINE]);
+ db_set_b(NULL, "SimpleStatusMsg", StatusModeToDbSetting(i, szSetting), (BYTE)data->status_msg[j + 1].flags[i - ID_STATUS_ONLINE]);
}
}
}
}
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "PutDefInList", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_COPTMSG2) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "PutDefInList", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_COPTMSG2) == BST_CHECKED));
if (data->proto_ok)
{
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "ProtoFlags", (BYTE)data->proto_msg[0].flags);
+ db_set_b(NULL, "SimpleStatusMsg", "ProtoFlags", (BYTE)data->proto_msg[0].flags);
for (i = 0; i < accounts->count; i++)
{
@@ -1074,15 +1074,15 @@ static INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sDefault", accounts->pa[i]->szModuleName);
if (data->proto_msg[i+1].msg && (data->proto_msg[i+1].flags & PROTO_THIS_MSG))
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", szSetting, data->proto_msg[i+1].msg);
+ db_set_ts(NULL, "SimpleStatusMsg", szSetting, data->proto_msg[i+1].msg);
// else
- // DBDeleteContactSetting(NULL, "SimpleStatusMsg", szSetting);
+ // db_unset(NULL, "SimpleStatusMsg", szSetting);
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sMaxLen", accounts->pa[i]->szModuleName);
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", szSetting, (WORD)data->proto_msg[i+1].max_length);
+ db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)data->proto_msg[i+1].max_length);
mir_snprintf(szSetting, SIZEOF(szSetting), "Proto%sFlags", accounts->pa[i]->szModuleName);
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", szSetting, (BYTE)data->proto_msg[i+1].flags);
+ db_set_b(NULL, "SimpleStatusMsg", szSetting, (BYTE)data->proto_msg[i+1].flags);
}
}
RebuildStatusMenu();
@@ -1116,17 +1116,17 @@ static INT_PTR CALLBACK DlgVariablesOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM SendDlgItemMessage(hwndDlg, IDC_SSECUPDTMSG, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_ESECUPDTMSG), 0);
SendDlgItemMessage(hwndDlg, IDC_SSECUPDTMSG, UDM_SETRANGE32, 1, 999);
- SendDlgItemMessage(hwndDlg, IDC_SSECUPDTMSG, UDM_SETPOS, 0, MAKELONG((short)DBGetContactSettingWord(NULL, "SimpleStatusMsg", "UpdateMsgInt", 10), 0));
+ SendDlgItemMessage(hwndDlg, IDC_SSECUPDTMSG, UDM_SETPOS, 0, MAKELONG((short)db_get_w(NULL, "SimpleStatusMsg", "UpdateMsgInt", 10), 0));
SendDlgItemMessage(hwndDlg, IDC_ESECUPDTMSG, EM_LIMITTEXT, 3, 0);
- CheckDlgButton(hwndDlg, IDC_CUPDATEMSG, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "UpdateMsgOn", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CNOIDLE, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "NoUpdateOnIdle", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CNOICQREQ, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "NoUpdateOnICQReq", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLEAVEWINAMP, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CUPDATEMSG, db_get_b(NULL, "SimpleStatusMsg", "UpdateMsgOn", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CNOIDLE, db_get_b(NULL, "SimpleStatusMsg", "NoUpdateOnIdle", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CNOICQREQ, db_get_b(NULL, "SimpleStatusMsg", "NoUpdateOnICQReq", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLEAVEWINAMP, db_get_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", 1) ? BST_CHECKED : BST_UNCHECKED);
if (ServiceExists(MS_VARS_FORMATSTRING))
{
- CheckDlgButton(hwndDlg, IDC_CVARIABLES, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "EnableVariables", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CDATEPARSING, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ExclDateToken", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CVARIABLES, db_get_b(NULL, "SimpleStatusMsg", "EnableVariables", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CDATEPARSING, db_get_b(NULL, "SimpleStatusMsg", "ExclDateToken", 0) ? BST_CHECKED : BST_UNCHECKED);
}
else
{
@@ -1179,25 +1179,25 @@ static INT_PTR CALLBACK DlgVariablesOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM KillTimer(NULL, g_uUpdateMsgTimer);
int val = SendDlgItemMessage(hwndDlg, IDC_SSECUPDTMSG, UDM_GETPOS, 0, 0);
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "UpdateMsgInt", (WORD)val);
+ db_set_w(NULL, "SimpleStatusMsg", "UpdateMsgInt", (WORD)val);
if (IsDlgButtonChecked(hwndDlg, IDC_CUPDATEMSG) == BST_CHECKED && val)
{
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "UpdateMsgOn", (BYTE)1);
+ db_set_b(NULL, "SimpleStatusMsg", "UpdateMsgOn", (BYTE)1);
g_uUpdateMsgTimer = SetTimer(NULL, 0, val * 1000, (TIMERPROC)UpdateMsgTimerProc);
}
else
{
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "UpdateMsgOn", (BYTE)0);
+ db_set_b(NULL, "SimpleStatusMsg", "UpdateMsgOn", (BYTE)0);
}
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "NoUpdateOnIdle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CNOIDLE) == BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "NoUpdateOnICQReq", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CNOICQREQ) == BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "AmpLeaveTitle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CLEAVEWINAMP) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "NoUpdateOnIdle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CNOIDLE) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "NoUpdateOnICQReq", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CNOICQREQ) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "AmpLeaveTitle", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CLEAVEWINAMP) == BST_CHECKED));
if (ServiceExists(MS_VARS_FORMATSTRING))
{
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "EnableVariables", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CVARIABLES) == BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "ExclDateToken", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CDATEPARSING) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "EnableVariables", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CVARIABLES) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "ExclDateToken", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CDATEPARSING) == BST_CHECKED));
}
return TRUE;
}
@@ -1210,19 +1210,19 @@ static BOOL IsHistoryMsgsFound(HWND hwndDlg, int histMax) {
char szSetting[16];
DBVARIANT dbv;
- int j = DBGetContactSettingWord(NULL, "SimpleStatusMsg", "LMMsg", 1);
+ int j = db_get_w(NULL, "SimpleStatusMsg", "LMMsg", 1);
for (int i = 1; i <= histMax; ++i, --j)
{
if (j < 1) j = histMax;
mir_snprintf(szSetting, SIZEOF(szSetting), "SMsg%d", j);
- if (!DBGetContactSettingTString(NULL, "SimpleStatusMsg", szSetting, &dbv))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", szSetting, &dbv))
{
if (dbv.ptszVal != NULL && *dbv.ptszVal != '\0')
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return TRUE;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
return FALSE;
@@ -1248,7 +1248,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_SETITEMDATA, (WPARAM)i_btndownflat, DLG_SHOW_BUTTONS_FLAT);
SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_SETITEMDATA, (WPARAM)i_btnlist, DLG_SHOW_BUTTONS_INLIST);
- settingValue = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "DlgFlags", DLG_SHOW_DEFAULT);
+ settingValue = db_get_b(NULL, "SimpleStatusMsg", "DlgFlags", DLG_SHOW_DEFAULT);
CheckDlgButton(hwndDlg, IDC_CSTATUSLIST, settingValue & DLG_SHOW_STATUS ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CPROFILES, settingValue & DLG_SHOW_STATUS_PROFILES ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CICONS1, settingValue & DLG_SHOW_STATUS_ICONS ? BST_CHECKED : BST_UNCHECKED);
@@ -1279,7 +1279,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w }
// Misc.
- settingValue = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "MaxHist", 10);
+ settingValue = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
SendDlgItemMessage(hwndDlg, IDC_SMAXHIST, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_EMAXHIST), 0);
SendDlgItemMessage(hwndDlg, IDC_SMAXHIST, UDM_SETRANGE32, 0, 25);
@@ -1290,19 +1290,19 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w EnableWindow(GetDlgItem(hwndDlg, IDC_CICONS2), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BOPTHIST), IsHistoryMsgsFound(hwndDlg, settingValue));
- EnableWindow(GetDlgItem(hwndDlg, IDC_BOPTDEF), DBGetContactSettingWord(NULL, "SimpleStatusMsg", "DefMsgCount", 0) != 0);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BOPTDEF), db_get_w(NULL, "SimpleStatusMsg", "DefMsgCount", 0) != 0);
SendDlgItemMessage(hwndDlg, IDC_STIMEOUT, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_ETIMEOUT), 0);
SendDlgItemMessage(hwndDlg, IDC_STIMEOUT, UDM_SETRANGE32, 1, 60);
- SendDlgItemMessage(hwndDlg, IDC_STIMEOUT, UDM_SETPOS, 0, MAKELONG((short)DBGetContactSettingByte(NULL, "SimpleStatusMsg", "DlgTime", 5), 0));
+ SendDlgItemMessage(hwndDlg, IDC_STIMEOUT, UDM_SETPOS, 0, MAKELONG((short)db_get_b(NULL, "SimpleStatusMsg", "DlgTime", 5), 0));
SendDlgItemMessage(hwndDlg, IDC_ETIMEOUT, EM_LIMITTEXT, 2, 0);
- CheckDlgButton(hwndDlg, IDC_CCLOSEWND, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "AutoClose", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CRPOSWND, !DBGetContactSettingByte(NULL, "SimpleStatusMsg", "WinCentered", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CREMOVECR, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "RemoveCR", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CSHOWCOPY, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ShowCopy", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CSHOWGURL, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ShowGoToURL", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CSHOWSMSG, DBGetContactSettingByte(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CCLOSEWND, db_get_b(NULL, "SimpleStatusMsg", "AutoClose", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CRPOSWND, !db_get_b(NULL, "SimpleStatusMsg", "WinCentered", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CREMOVECR, db_get_b(NULL, "SimpleStatusMsg", "RemoveCR", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CSHOWCOPY, db_get_b(NULL, "SimpleStatusMsg", "ShowCopy", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CSHOWGURL, db_get_b(NULL, "SimpleStatusMsg", "ShowGoToURL", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CSHOWSMSG, db_get_b(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", 1) ? BST_CHECKED : BST_UNCHECKED);
SendMessage(hwndDlg, WM_USER + 2, 0, 0);
return TRUE;
@@ -1364,13 +1364,13 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w if (hwndSAMsgDialog) DestroyWindow(hwndSAMsgDialog);
- max_hist_msgs = DBGetContactSettingByte(NULL, "SimpleStatusMsg", "MaxHist", 10);
+ max_hist_msgs = db_get_b(NULL, "SimpleStatusMsg", "MaxHist", 10);
for (i = 1; i <= max_hist_msgs; i++)
{
mir_snprintf(text, SIZEOF(text), "SMsg%d", i);
- DBWriteContactSettingTString(NULL, "SimpleStatusMsg", text, _T(""));
+ db_set_ts(NULL, "SimpleStatusMsg", text, _T(""));
}
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", "LastMsg", "");
+ db_set_s(NULL, "SimpleStatusMsg", "LastMsg", "");
for (i = 0; i < accounts->count; i++)
{
if (!IsAccountEnabled(accounts->pa[i]))
@@ -1383,9 +1383,9 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w continue;
mir_snprintf(setting, SIZEOF(setting), "Last%sMsg", accounts->pa[i]->szModuleName);
- DBWriteContactSettingString(NULL, "SimpleStatusMsg", setting, "");
+ db_set_s(NULL, "SimpleStatusMsg", setting, "");
}
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "LMMsg", (WORD)max_hist_msgs);
+ db_set_w(NULL, "SimpleStatusMsg", "LMMsg", (WORD)max_hist_msgs);
EnableWindow(GetDlgItem(hwndDlg, IDC_BOPTHIST), FALSE);
}
return 0;
@@ -1398,13 +1398,13 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w if (hwndSAMsgDialog) DestroyWindow(hwndSAMsgDialog);
- nDefMSgCount = DBGetContactSettingWord(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
+ nDefMSgCount = db_get_w(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
for (int i = 1; i <= nDefMSgCount; i++)
{
mir_snprintf(szSetting, SIZEOF(szSetting), "DefMsg%d", i);
- DBDeleteContactSetting(NULL, "SimpleStatusMsg", szSetting);
+ db_unset(NULL, "SimpleStatusMsg", szSetting);
}
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
+ db_set_w(NULL, "SimpleStatusMsg", "DefMsgCount", 0);
EnableWindow(GetDlgItem(hwndDlg, IDC_BOPTDEF), FALSE);
}
return 0;
@@ -1427,17 +1427,17 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w if (curSel != CB_ERR)
flags |= SendMessage(GetDlgItem(hwndDlg, IDC_CBOPTBUTTONS), CB_GETITEMDATA, (WPARAM)curSel, 0);
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "DlgFlags", (BYTE)flags);
+ db_set_b(NULL, "SimpleStatusMsg", "DlgFlags", (BYTE)flags);
// Misc.
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "MaxHist", (BYTE)GetDlgItemInt(hwndDlg, IDC_EMAXHIST, NULL, FALSE));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "AutoClose", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CCLOSEWND) == BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "DlgTime", (BYTE)GetDlgItemInt(hwndDlg, IDC_ETIMEOUT, NULL, FALSE));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "WinCentered", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CRPOSWND) != BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "RemoveCR", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CREMOVECR) == BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "ShowCopy", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CSHOWCOPY) == BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "ShowGoToURL", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CSHOWGURL) == BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CSHOWSMSG) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "MaxHist", (BYTE)GetDlgItemInt(hwndDlg, IDC_EMAXHIST, NULL, FALSE));
+ db_set_b(NULL, "SimpleStatusMsg", "AutoClose", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CCLOSEWND) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "DlgTime", (BYTE)GetDlgItemInt(hwndDlg, IDC_ETIMEOUT, NULL, FALSE));
+ db_set_b(NULL, "SimpleStatusMsg", "WinCentered", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CRPOSWND) != BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "RemoveCR", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CREMOVECR) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "ShowCopy", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CSHOWCOPY) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "ShowGoToURL", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CSHOWGURL) == BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "ShowStatusMenuItem", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CSHOWSMSG) == BST_CHECKED));
RebuildStatusMenu();
return TRUE;
@@ -1480,22 +1480,22 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa {
char setting[80];
mir_snprintf(setting, SIZEOF(setting), "Startup%sStatus", accounts->pa[i]->szModuleName);
- data->status[i] = DBGetContactSettingWord(NULL, "SimpleStatusMsg", setting, ID_STATUS_OFFLINE);
+ data->status[i] = db_get_w(NULL, "SimpleStatusMsg", setting, ID_STATUS_OFFLINE);
mir_snprintf(setting, SIZEOF(setting), "Set%sStatusDelay", accounts->pa[i]->szModuleName);
- data->setdelay[i] = DBGetContactSettingWord(NULL, "SimpleStatusMsg", setting, 300);
+ data->setdelay[i] = db_get_w(NULL, "SimpleStatusMsg", setting, 300);
SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_SETITEMDATA, (WPARAM)index, (LPARAM)i);
}
}
SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_SETCURSEL, 0, 0);
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_LISTPROTO, LBN_SELCHANGE), (LPARAM)GetDlgItem(hwndDlg, IDC_LISTPROTO));
- data->setglobaldelay = DBGetContactSettingWord(NULL, "SimpleStatusMsg", "SetStatusDelay", 300);
+ data->setglobaldelay = db_get_w(NULL, "SimpleStatusMsg", "SetStatusDelay", 300);
SendMessage(GetDlgItem(hwndDlg, IDC_SSETSTATUS), UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_ESETSTATUS), 0);
SendMessage(GetDlgItem(hwndDlg, IDC_SSETSTATUS), UDM_SETRANGE32, 0, 9000);
SendMessage(GetDlgItem(hwndDlg, IDC_ESETSTATUS), EM_LIMITTEXT, 4, 0);
- if (!DBGetContactSettingByte(NULL, "SimpleStatusMsg", "GlobalStatusDelay", 1))
+ if (!db_get_b(NULL, "SimpleStatusMsg", "GlobalStatusDelay", 1))
{
CheckDlgButton(hwndDlg, IDC_SPECSET, BST_CHECKED);
i = SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_GETITEMDATA, (WPARAM)SendMessage(GetDlgItem(hwndDlg, IDC_LISTPROTO), LB_GETCURSEL, 0, 0), 0);
@@ -1507,7 +1507,7 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa SetDlgItemInt(hwndDlg, IDC_ESETSTATUS, data->setglobaldelay, FALSE);
}
- if (DBGetContactSettingByte(NULL, "SimpleStatusMsg", "StartupPopupDlg", 1))
+ if (db_get_b(NULL, "SimpleStatusMsg", "StartupPopupDlg", 1))
{
CheckDlgButton(hwndDlg, IDC_POPUPDLG, BST_CHECKED);
if (IsDlgButtonChecked(hwndDlg, IDC_SPECSET) == BST_CHECKED)
@@ -1662,14 +1662,14 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa continue;
mir_snprintf(szSetting, SIZEOF(szSetting), "Startup%sStatus", accounts->pa[i]->szModuleName);
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", szSetting, (WORD)data->status[i]);
+ db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)data->status[i]);
mir_snprintf(szSetting, SIZEOF(szSetting), "Set%sStatusDelay", accounts->pa[i]->szModuleName);
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", szSetting, (WORD)data->setdelay[i]);
+ db_set_w(NULL, "SimpleStatusMsg", szSetting, (WORD)data->setdelay[i]);
}
- DBWriteContactSettingWord(NULL, "SimpleStatusMsg", "SetStatusDelay", (WORD)data->setglobaldelay);
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "GlobalStatusDelay", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SPECSET) != BST_CHECKED));
- DBWriteContactSettingByte(NULL, "SimpleStatusMsg", "StartupPopupDlg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_POPUPDLG) == BST_CHECKED));
+ db_set_w(NULL, "SimpleStatusMsg", "SetStatusDelay", (WORD)data->setglobaldelay);
+ db_set_b(NULL, "SimpleStatusMsg", "GlobalStatusDelay", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SPECSET) != BST_CHECKED));
+ db_set_b(NULL, "SimpleStatusMsg", "StartupPopupDlg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_POPUPDLG) == BST_CHECKED));
return TRUE;
}
break;
diff --git a/plugins/SimpleStatusMsg/src/utils.cpp b/plugins/SimpleStatusMsg/src/utils.cpp index d730f03caa..eef790fc8a 100644 --- a/plugins/SimpleStatusMsg/src/utils.cpp +++ b/plugins/SimpleStatusMsg/src/utils.cpp @@ -137,7 +137,7 @@ int GetCurrentStatus(const char *szProto) {
char szSetting[80];
mir_snprintf(szSetting, SIZEOF(szSetting), "Cur%sStatus", szProto);
- return (int)DBGetContactSettingWord(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE);
+ return (int)db_get_w(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE);
}
return CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
@@ -151,14 +151,14 @@ int GetStartupStatus(const char *szProto) char szSetting[80];
mir_snprintf(szSetting, SIZEOF(szSetting), "Startup%sStatus", szProto);
- status_mode = DBGetContactSettingWord(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE);
+ status_mode = db_get_w(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE);
if (status_mode == ID_STATUS_CURRENT)
{
// load status used for this proto last time
mir_snprintf(szSetting, SIZEOF(szSetting), "Last%sStatus", szProto);
- status_mode = DBGetContactSettingWord(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE);
+ status_mode = db_get_w(NULL, "SimpleStatusMsg", szSetting, ID_STATUS_OFFLINE);
}
return status_mode;
}
- return (int)DBGetContactSettingWord(NULL, "SimpleStatusMsg", "StartupStatus", ID_STATUS_OFFLINE);
+ return (int)db_get_w(NULL, "SimpleStatusMsg", "StartupStatus", ID_STATUS_OFFLINE);
}
diff --git a/plugins/SmileyAdd/src/general.h b/plugins/SmileyAdd/src/general.h index 182d2007c3..cb268cdfc7 100644 --- a/plugins/SmileyAdd/src/general.h +++ b/plugins/SmileyAdd/src/general.h @@ -90,7 +90,8 @@ typedef WCMatcher _TMatcher; extern HINSTANCE g_hInst;
extern char* metaProtoName;
extern HANDLE hNetlibUser;
-extern HANDLE hEvent1, hContactMenuItem;
+extern HANDLE hEvent1;
+extern HGENMENU hContactMenuItem;
extern SmileyCategoryListType g_SmileyCategories;
extern SmileyPackListType g_SmileyPacks;
extern LIST<void> menuHandleArray;
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp index b578227c0d..795760164f 100644 --- a/plugins/SmileyAdd/src/main.cpp +++ b/plugins/SmileyAdd/src/main.cpp @@ -21,7 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. //globals
HINSTANCE g_hInst;
-HANDLE hEvent1, hContactMenuItem;
+HANDLE hEvent1;
+HGENMENU hContactMenuItem;
char* metaProtoName;
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index e6915189e6..191bb92c58 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -644,7 +644,7 @@ void OptionsType::ReadPackFileName(bkstring& filename, const bkstring& name, con void OptionsType::WritePackFileName(const bkstring& filename, const bkstring& name)
{
bkstring settingKey = name + _T("-filename");
- DBWriteContactSettingTString(NULL, "SmileyAdd", T2A_SM(settingKey.c_str()),
+ db_set_ts(NULL, "SmileyAdd", T2A_SM(settingKey.c_str()),
filename.c_str());
}
@@ -665,9 +665,9 @@ void OptionsType::ReadCustomCategories(bkstring& cats) void OptionsType::WriteCustomCategories(const bkstring& cats)
{
if (cats.empty())
- DBDeleteContactSetting(NULL, "SmileyAdd", "CustomCategories");
+ db_unset(NULL, "SmileyAdd", "CustomCategories");
else
- DBWriteContactSettingTString(NULL, "SmileyAdd", "CustomCategories", cats.c_str());
+ db_set_ts(NULL, "SmileyAdd", "CustomCategories", cats.c_str());
}
@@ -687,7 +687,7 @@ void OptionsType::ReadContactCategory(HANDLE hContact, bkstring& cats) void OptionsType::WriteContactCategory(HANDLE hContact, const bkstring& cats)
{
if (cats.empty())
- DBDeleteContactSetting(hContact, "SmileyAdd", "CustomCategory");
+ db_unset(hContact, "SmileyAdd", "CustomCategory");
else
- DBWriteContactSettingTString(hContact, "SmileyAdd", "CustomCategory", cats.c_str());
+ db_set_ts(hContact, "SmileyAdd", "CustomCategory", cats.c_str());
}
diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index 64b8c71d06..30717b81c1 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -392,9 +392,6 @@ INT_PTR CustomCatMenu(WPARAM wParam, LPARAM lParam) int RebuildContactMenu(WPARAM wParam, LPARAM)
{
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS | CMIF_ROOTPOPUP | CMIF_ICONFROMICOLIB;
-
SmileyCategoryListType::SmileyCategoryVectorType& smc = *g_SmileyCategories.GetSmileyCategoryList();
char* protnam = GetContactProto((HANDLE)wParam);
@@ -406,9 +403,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) haveMenu = cnt != 0;
}
- if (!haveMenu) mi.flags |= CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenuItem, (LPARAM)&mi);
+ Menu_ShowItem(hContactMenuItem, haveMenu);
for (int i=0; i < menuHandleArray.getCount(); i++)
CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)menuHandleArray[i], 0);
@@ -418,9 +413,10 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) bkstring cat;
opt.ReadContactCategory((HANDLE)wParam, cat);
- mi.pszPopupName = (char*)hContactMenuItem;
- mi.flags = CMIF_CHILDPOPUP | CMIM_FLAGS | CMIF_TCHAR;
- mi.pszService = MS_SMILEYADD_CUSTOMCATMENU;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.hParentMenu = hContactMenuItem;
+ mi.flags = CMIF_CHILDPOPUP | CMIM_FLAGS | CMIF_TCHAR;
+ mi.pszService = MS_SMILEYADD_CUSTOMCATMENU;
bool nonecheck = true;
HGENMENU hMenu;
diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp index aeb03b4b86..374892b060 100644 --- a/plugins/SpellChecker/src/dictionary.cpp +++ b/plugins/SpellChecker/src/dictionary.cpp @@ -804,7 +804,7 @@ void GetDictsInfo(LIST<Dictionary> &dicts) {
lstrcpyn(dict->localized_name, dbv.ptszVal, SIZEOF(dict->localized_name));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (dict->localized_name[0] == _T('\0'))
diff --git a/plugins/SpellChecker/src/options.cpp b/plugins/SpellChecker/src/options.cpp index 844ec42390..dd574537da 100644 --- a/plugins/SpellChecker/src/options.cpp +++ b/plugins/SpellChecker/src/options.cpp @@ -98,7 +98,7 @@ void LoadOptions() DBVARIANT dbv;
if (!db_get_ts(NULL, MODULE_NAME, "DefaultLanguage", &dbv)) {
lstrcpyn(opts.default_language, dbv.ptszVal, SIZEOF(opts.default_language));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
int i;
@@ -215,7 +215,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP int sel = SendDlgItemMessage(hwndDlg, IDC_DEF_LANG, CB_GETCURSEL, 0, 0);
if (sel >= languages.getCount())
sel = 0;
- DBWriteContactSettingTString(NULL, MODULE_NAME, "DefaultLanguage",
+ db_set_ts(NULL, MODULE_NAME, "DefaultLanguage",
(TCHAR *) languages[sel]->language);
lstrcpy(opts.default_language, languages[sel]->language);
}
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index 55abea5848..06a82da925 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -529,7 +529,7 @@ LRESULT CALLBACK OwnerProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) void ToggleEnabled(Dialog *dlg) { dlg->enabled = !dlg->enabled; - DBWriteContactSettingByte(dlg->hContact, MODULE_NAME, dlg->name, dlg->enabled); + db_set_b(dlg->hContact, MODULE_NAME, dlg->name, dlg->enabled); if (!dlg->enabled) SetNoUnderline(dlg); @@ -750,7 +750,7 @@ void GetUserProtoLanguageSetting(Dialog *dlg, HANDLE hContact, char *group, char } if (!rc) - DBFreeVariant(&dbv); + db_free(&dbv); } void GetUserLanguageSetting(Dialog *dlg, char *setting) @@ -796,18 +796,18 @@ void GetContactLanguage(Dialog *dlg) if (dlg->hContact == NULL) { if ( !db_get_ts(NULL, MODULE_NAME, dlg->name, &dbv)) { lstrcpyn(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name)); - DBFreeVariant(&dbv); + db_free(&dbv); } } else { if (!db_get_ts(dlg->hContact, MODULE_NAME, "TalkLanguage", &dbv)) { lstrcpyn(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name)); - DBFreeVariant(&dbv); + db_free(&dbv); } if (dlg->lang_name[0] == _T('\0') && !db_get_ts(dlg->hContact, "eSpeak", "TalkLanguage", &dbv)) { lstrcpyn(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name)); - DBFreeVariant(&dbv); + db_free(&dbv); } // Try from metacontact @@ -818,12 +818,12 @@ void GetContactLanguage(Dialog *dlg) if (hMetaContact != NULL) { if (!db_get_ts(hMetaContact, MODULE_NAME, "TalkLanguage", &dbv)) { lstrcpyn(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name)); - DBFreeVariant(&dbv); + db_free(&dbv); } if (dlg->lang_name[0] == _T('\0') && !db_get_ts(hMetaContact, "eSpeak", "TalkLanguage", &dbv)) { lstrcpyn(dlg->lang_name, dbv.ptszVal, SIZEOF(dlg->lang_name)); - DBFreeVariant(&dbv); + db_free(&dbv); } } } @@ -924,7 +924,7 @@ int AddContactTextBox(HANDLE hContact, HWND hwnd, char *name, BOOL srmm, HWND hw dlg->hContact = hContact; dlg->hwnd = hwnd; strncpy(dlg->name, name, sizeof(dlg->name)); - dlg->enabled = DBGetContactSettingByte(dlg->hContact, MODULE_NAME, dlg->name, 1); + dlg->enabled = db_get_b(dlg->hContact, MODULE_NAME, dlg->name, 1); dlg->srmm = srmm; GetContactLanguage(dlg); @@ -1250,10 +1250,10 @@ BOOL HandleMenuSelection(Dialog *dlg, POINT pt, unsigned selection) SetNoUnderline(dlg); if (dlg->hContact == NULL) - DBWriteContactSettingTString(NULL, MODULE_NAME, dlg->name, + db_set_ts(NULL, MODULE_NAME, dlg->name, languages[selection - LANGUAGE_MENU_ID_BASE]->language); else - DBWriteContactSettingTString(dlg->hContact, MODULE_NAME, "TalkLanguage", + db_set_ts(dlg->hContact, MODULE_NAME, "TalkLanguage", languages[selection - LANGUAGE_MENU_ID_BASE]->language); GetContactLanguage(dlg); diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index 96054f39f6..4ae218f6b4 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -94,8 +94,8 @@ void SplashMain() {
if (options.runonce)
{
- DBWriteContactSettingByte(NULL, MODNAME, "Active", 0);
- DBWriteContactSettingByte(NULL, MODNAME, "DisableAfterStartup", 0);
+ db_set_b(NULL, MODNAME, "Active", 0);
+ db_set_b(NULL, MODNAME, "DisableAfterStartup", 0);
}
if (hUserDll == NULL)
@@ -133,21 +133,21 @@ void SplashMain() //for 9x "alfa" testing
DBVARIANT dbv = {0};
- DBGetContactSettingTString(NULL, MODNAME, "VersionPrefix", &dbv);
+ db_get_ts(NULL, MODNAME, "VersionPrefix", &dbv);
if (lstrcmp(dbv.ptszVal, NULL) == 0)
{
_tcscpy_s(szPrefix, _T(""));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
_tcscpy_s(szPrefix, dbv.ptszVal);
dbv.ptszVal = NULL;
- DBGetContactSettingTString(NULL, MODNAME, "Path", &dbv);
+ db_get_ts(NULL, MODNAME, "Path", &dbv);
if (lstrcmp(dbv.ptszVal, NULL) == 0)
{
_tcscpy_s(inBuf, _T("splash\\splash.png"));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
_tcscpy_s(inBuf, dbv.ptszVal);
@@ -164,11 +164,11 @@ void SplashMain() else
_tcscpy_s(szSplashFile, inBuf);
- DBGetContactSettingTString(NULL, MODNAME, "Sound", &dbv);
+ db_get_ts(NULL, MODNAME, "Sound", &dbv);
if (lstrcmp(dbv.ptszVal, NULL) == 0)
{
_tcscpy_s(inBuf, _T("sounds\\startup.wav"));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
_tcscpy_s(inBuf, dbv.ptszVal);
@@ -282,7 +282,7 @@ int PlugDisableHook(WPARAM wParam, LPARAM lParam) {
if (!lstrcmp(tszModule, _T("Skin")) & !lstrcmp(tszSetting, _T("UseSound")))
{
- DBWriteContactSettingByte(NULL, MODNAME, "PlaySound", cws->value.bVal);
+ db_set_b(NULL, MODNAME, "PlaySound", cws->value.bVal);
#ifdef _DEBUG
cws->value.bVal ? _DebugPopup(NULL, _T("Sounds enabled."), _T("")) : _DebugPopup(NULL, _T("Sounds disabled."), _T(""));
logMessage(_T("Module"), tszModule);
@@ -292,7 +292,7 @@ int PlugDisableHook(WPARAM wParam, LPARAM lParam) }
if (!lstrcmp(tszModule, _T("PluginDisable")) & (!lstrcmp(tszSetting, szDllName)))
{
- DBWriteContactSettingByte(NULL, MODNAME, "Active", cws->value.bVal);
+ db_set_b(NULL, MODNAME, "Active", cws->value.bVal);
#ifdef _DEBUG
cws->value.bVal ? _DebugPopup(NULL, _T("Disabled."), "") : _DebugPopup(NULL, _T("Enabled."), _T(""));
logMessage(_T("PlugDisableHook"), _T("Triggered"));
diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp index 8c0248985b..128b0d4856 100644 --- a/plugins/SplashScreen/src/options.cpp +++ b/plugins/SplashScreen/src/options.cpp @@ -24,17 +24,17 @@ TCHAR szPath2Spash [MAX_PATH], szSoundFilePath[MAX_PATH]; // Reads values from db
void ReadIniConfig()
{
- options.active = DBGetContactSettingByte(NULL, MODNAME, "Active", 1);
- options.playsnd = DBGetContactSettingByte(NULL, MODNAME, "PlaySound", 0);
- options.fadein = DBGetContactSettingByte(NULL, MODNAME, "FadeIn", 1);
- options.fadeout = DBGetContactSettingByte(NULL, MODNAME, "FadeOut", 1);
- options.showtime = DBGetContactSettingDword(NULL, MODNAME, "TimeToShow", 2000);
- options.fisteps = DBGetContactSettingDword(NULL, MODNAME, "FadeinSpeed", 5);
- options.fosteps = DBGetContactSettingDword(NULL, MODNAME, "FadeoutSpeed", 5);
- options.inheritGS = DBGetContactSettingByte(NULL, MODNAME, "InheritGlobalSound", 1);
- options.showversion = DBGetContactSettingByte(NULL, MODNAME, "ShowVersion", 0);
- options.random = DBGetContactSettingByte(NULL, MODNAME, "Random", 0);
- options.runonce = DBGetContactSettingByte(NULL, MODNAME, "DisableAfterStartup", 0);
+ options.active = db_get_b(NULL, MODNAME, "Active", 1);
+ options.playsnd = db_get_b(NULL, MODNAME, "PlaySound", 0);
+ options.fadein = db_get_b(NULL, MODNAME, "FadeIn", 1);
+ options.fadeout = db_get_b(NULL, MODNAME, "FadeOut", 1);
+ options.showtime = db_get_dw(NULL, MODNAME, "TimeToShow", 2000);
+ options.fisteps = db_get_dw(NULL, MODNAME, "FadeinSpeed", 5);
+ options.fosteps = db_get_dw(NULL, MODNAME, "FadeoutSpeed", 5);
+ options.inheritGS = db_get_b(NULL, MODNAME, "InheritGlobalSound", 1);
+ options.showversion = db_get_b(NULL, MODNAME, "ShowVersion", 0);
+ options.random = db_get_b(NULL, MODNAME, "Random", 0);
+ options.runonce = db_get_b(NULL, MODNAME, "DisableAfterStartup", 0);
}
BOOL Exists(LPCTSTR strName)
@@ -60,31 +60,31 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ReadIniConfig();
TCHAR inBuf[80];
DBVARIANT dbv = {0};
- DBGetContactSettingTString(NULL, MODNAME, "Path", &dbv);
+ db_get_ts(NULL, MODNAME, "Path", &dbv);
if (lstrcmp(dbv.ptszVal, NULL) == 0)
{
_tcscpy_s(inBuf, _T("splash\\splash.png"));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
_tcscpy_s(inBuf, dbv.ptszVal);
dbv.ptszVal = NULL;
SetWindowText(GetDlgItem(hwndDlg, IDC_SPLASHPATH),inBuf);
- DBGetContactSettingTString(NULL, MODNAME, "Sound", &dbv);
+ db_get_ts(NULL, MODNAME, "Sound", &dbv);
if (lstrcmp(dbv.ptszVal, NULL) == 0)
{
_tcscpy_s(inBuf, _T("sounds\\startup.wav"));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
_tcscpy_s(inBuf, dbv.ptszVal);
dbv.ptszVal = NULL;
SetWindowText(GetDlgItem(hwndDlg, IDC_SNDPATH),inBuf);
- DBGetContactSettingTString(NULL, MODNAME, "VersionPrefix", &dbv);
+ db_get_ts(NULL, MODNAME, "VersionPrefix", &dbv);
if (lstrcmp(dbv.ptszVal, NULL) == 0)
{
_tcscpy_s(inBuf, _T(""));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
_tcscpy_s(inBuf, dbv.ptszVal);
@@ -301,58 +301,58 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TCHAR tmp[MAX_PATH];
GetWindowText(GetDlgItem(hwndDlg, IDC_SPLASHPATH), tmp, MAX_PATH);
- DBWriteContactSettingTString(NULL, MODNAME, "Path", tmp);
+ db_set_ts(NULL, MODNAME, "Path", tmp);
GetWindowText(GetDlgItem(hwndDlg, IDC_SNDPATH), tmp, MAX_PATH);
- DBWriteContactSettingTString(NULL, MODNAME, "Sound", tmp);
+ db_set_ts(NULL, MODNAME, "Sound", tmp);
GetWindowText(GetDlgItem(hwndDlg, IDC_VERSIONPREFIX), tmp, MAX_PATH);
- DBWriteContactSettingTString(NULL, MODNAME, "VersionPrefix", tmp);
+ db_set_ts(NULL, MODNAME, "VersionPrefix", tmp);
_tcscpy_s(szPrefix, tmp);
GetWindowText(GetDlgItem(hwndDlg, IDC_SHOWTIME), tmp, MAX_PATH);
- DBWriteContactSettingDword(NULL, MODNAME, "TimeToShow", _ttoi(tmp));
+ db_set_dw(NULL, MODNAME, "TimeToShow", _ttoi(tmp));
options.showtime = _ttoi(tmp);
GetWindowText(GetDlgItem(hwndDlg, IDC_FISTEP), tmp, MAX_PATH);
- DBWriteContactSettingDword(NULL, MODNAME, "FadeinSpeed", _ttoi(tmp));
+ db_set_dw(NULL, MODNAME, "FadeinSpeed", _ttoi(tmp));
options.fisteps = _ttoi(tmp);
GetWindowText(GetDlgItem(hwndDlg, IDC_FOSTEP), tmp, MAX_PATH);
- DBWriteContactSettingDword(NULL, MODNAME, "FadeoutSpeed", _ttoi(tmp));
+ db_set_dw(NULL, MODNAME, "FadeoutSpeed", _ttoi(tmp));
options.fosteps = _ttoi(tmp);
if (IsDlgButtonChecked(hwndDlg, IDC_ACTIVE))
{
- DBWriteContactSettingByte(NULL, MODNAME, "Active", 1);
+ db_set_b(NULL, MODNAME, "Active", 1);
options.active = 1;
}
else
{
- DBWriteContactSettingByte(NULL, MODNAME, "Active", 0);
+ db_set_b(NULL, MODNAME, "Active", 0);
options.active = 0;
}
if (IsDlgButtonChecked(hwndDlg, IDC_PLAYSND))
{
- DBWriteContactSettingByte(NULL, MODNAME, "PlaySound", 1);
+ db_set_b(NULL, MODNAME, "PlaySound", 1);
options.playsnd = 1;
- DBWriteContactSettingByte(NULL, MODNAME, "InheritGlobalSound", 1);
+ db_set_b(NULL, MODNAME, "InheritGlobalSound", 1);
options.inheritGS = 1;
}
else
{
- DBWriteContactSettingByte(NULL, MODNAME, "PlaySound", 0);
+ db_set_b(NULL, MODNAME, "PlaySound", 0);
options.playsnd = 0;
- DBWriteContactSettingByte(NULL, MODNAME, "InheritGlobalSound", 0);
+ db_set_b(NULL, MODNAME, "InheritGlobalSound", 0);
options.inheritGS = 0;
}
if (IsDlgButtonChecked(hwndDlg, IDC_PLAYSND) == BST_INDETERMINATE)
{
- DBWriteContactSettingByte(NULL, MODNAME, "PlaySound", 1);
+ db_set_b(NULL, MODNAME, "PlaySound", 1);
options.playsnd = 1;
- DBWriteContactSettingByte(NULL, MODNAME, "InheritGlobalSound", 0);
+ db_set_b(NULL, MODNAME, "InheritGlobalSound", 0);
options.inheritGS = 0;
}
@@ -371,42 +371,42 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (IsDlgButtonChecked(hwndDlg, IDC_FADEIN))
{
- DBWriteContactSettingByte(NULL, MODNAME, "FadeIn", 1);
+ db_set_b(NULL, MODNAME, "FadeIn", 1);
options.fadein = 1;
}
else
{
- DBWriteContactSettingByte(NULL, MODNAME, "FadeIn", 0);
+ db_set_b(NULL, MODNAME, "FadeIn", 0);
options.fadein = 0;
}
if (IsDlgButtonChecked(hwndDlg, IDC_FADEOUT))
{
- DBWriteContactSettingByte(NULL, MODNAME, "FadeOut", 1);
+ db_set_b(NULL, MODNAME, "FadeOut", 1);
options.fadeout = 1;
}
else
{
- DBWriteContactSettingByte(NULL, MODNAME, "FadeOut", 0);
+ db_set_b(NULL, MODNAME, "FadeOut", 0);
options.fadeout = 0;
}
if (IsDlgButtonChecked(hwndDlg, IDC_RANDOM))
{
- DBWriteContactSettingByte(NULL, MODNAME, "Random", 1);
+ db_set_b(NULL, MODNAME, "Random", 1);
options.random = 1;
}
else
{
- DBWriteContactSettingByte(NULL, MODNAME, "Random", 0);
+ db_set_b(NULL, MODNAME, "Random", 0);
options.random = 0;
}
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWVERSION))
{
- DBWriteContactSettingByte(NULL, MODNAME, "ShowVersion", 1);
+ db_set_b(NULL, MODNAME, "ShowVersion", 1);
options.showversion = 1;
}
else
{
- DBWriteContactSettingByte(NULL, MODNAME, "ShowVersion", 0);
+ db_set_b(NULL, MODNAME, "ShowVersion", 0);
options.showversion = 0;
}
return TRUE;
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp index b40e45960f..6e53e477f3 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp @@ -129,16 +129,16 @@ void LoadOptions( OBJLIST<TAAAProtoSetting>& loadSettings, BOOL override) if (hAutoAwayTimer != 0)
KillTimer(NULL, hAutoAwayTimer);
- ignoreLockKeys = DBGetContactSettingByte(NULL, MODULENAME, SETTING_IGNLOCK, FALSE);
- ignoreSysKeys = DBGetContactSettingByte(NULL, MODULENAME, SETTING_IGNSYSKEYS, FALSE);
- ignoreAltCombo = DBGetContactSettingByte(NULL, MODULENAME, SETTING_IGNALTCOMBO, FALSE);
- monitorMouse = DBGetContactSettingByte(NULL, MODULENAME, SETTING_MONITORMOUSE, TRUE);
- monitorKeyboard = DBGetContactSettingByte(NULL, MODULENAME, SETTING_MONITORKEYBOARD, TRUE);
+ ignoreLockKeys = db_get_b(NULL, MODULENAME, SETTING_IGNLOCK, FALSE);
+ ignoreSysKeys = db_get_b(NULL, MODULENAME, SETTING_IGNSYSKEYS, FALSE);
+ ignoreAltCombo = db_get_b(NULL, MODULENAME, SETTING_IGNALTCOMBO, FALSE);
+ monitorMouse = db_get_b(NULL, MODULENAME, SETTING_MONITORMOUSE, TRUE);
+ monitorKeyboard = db_get_b(NULL, MODULENAME, SETTING_MONITORKEYBOARD, TRUE);
lastInput = lastMirandaInput = GetTickCount();
for ( int i=0; i < loadSettings.getCount(); i++ ) {
char* protoName;
- if ((DBGetContactSettingByte(NULL, MODULENAME, SETTING_SAMESETTINGS, 0)) && !override)
+ if ((db_get_b(NULL, MODULENAME, SETTING_SAMESETTINGS, 0)) && !override)
protoName = SETTING_ALL;
else
protoName = loadSettings[i].szName;
@@ -150,34 +150,34 @@ void LoadOptions( OBJLIST<TAAAProtoSetting>& loadSettings, BOOL override) monitorAll = TRUE;
} }
- if (DBGetContactSettingByte(NULL, "Idle", "AAEnable", 0))
+ if (db_get_b(NULL, "Idle", "AAEnable", 0))
return;
HookWindowsHooks(monitorMiranda, monitorAll);
- hAutoAwayTimer = SetTimer(NULL,0, DBGetContactSettingWord(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, 5)*1000,AutoAwayTimer);
+ hAutoAwayTimer = SetTimer(NULL,0, db_get_w(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, 5)*1000,AutoAwayTimer);
}
int LoadAutoAwaySetting(TAAAProtoSetting& autoAwaySetting, char* protoName)
{
char setting[128];
_snprintf(setting, sizeof(setting), "%s_OptionFlags", protoName);
- autoAwaySetting.optionFlags = DBGetContactSettingByte(NULL,MODULENAME,setting,FLAG_LV2ONINACTIVE|FLAG_RESET);
+ autoAwaySetting.optionFlags = db_get_b(NULL,MODULENAME,setting,FLAG_LV2ONINACTIVE|FLAG_RESET);
_snprintf(setting, sizeof(setting), "%s_AwayTime", protoName);
- autoAwaySetting.awayTime = DBGetContactSettingWord(NULL,MODULENAME,setting,SETTING_AWAYTIME_DEFAULT);
+ autoAwaySetting.awayTime = db_get_w(NULL,MODULENAME,setting,SETTING_AWAYTIME_DEFAULT);
_snprintf(setting, sizeof(setting), "%s_NATime", protoName);
- autoAwaySetting.naTime = DBGetContactSettingWord(NULL,MODULENAME,setting,SETTING_NATIME_DEFAULT);
+ autoAwaySetting.naTime = db_get_w(NULL,MODULENAME,setting,SETTING_NATIME_DEFAULT);
_snprintf(setting, sizeof(setting), "%s_StatusFlags", protoName);
- autoAwaySetting.statusFlags = DBGetContactSettingWord(NULL,MODULENAME,setting, StatusModeToProtoFlag(ID_STATUS_ONLINE)|StatusModeToProtoFlag(ID_STATUS_FREECHAT));
+ autoAwaySetting.statusFlags = db_get_w(NULL,MODULENAME,setting, StatusModeToProtoFlag(ID_STATUS_ONLINE)|StatusModeToProtoFlag(ID_STATUS_FREECHAT));
int flags;
- if (DBGetContactSettingByte(NULL, MODULENAME, SETTING_SAMESETTINGS, 0))
+ if (db_get_b(NULL, MODULENAME, SETTING_SAMESETTINGS, 0))
flags = 0xFFFFFF;
else
flags = CallProtoService(protoName, PS_GETCAPS,PFLAGNUM_2,0)&~CallProtoService(protoName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0);
_snprintf(setting, sizeof(setting), "%s_Lv1Status", protoName);
- autoAwaySetting.lv1Status = DBGetContactSettingWord(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_AWAY))?ID_STATUS_AWAY:ID_STATUS_OFFLINE);
+ autoAwaySetting.lv1Status = db_get_w(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_AWAY))?ID_STATUS_AWAY:ID_STATUS_OFFLINE);
_snprintf(setting, sizeof(setting), "%s_Lv2Status", protoName);
- autoAwaySetting.lv2Status = DBGetContactSettingWord(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_NA))?ID_STATUS_NA:ID_STATUS_OFFLINE);
+ autoAwaySetting.lv2Status = db_get_w(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_NA))?ID_STATUS_NA:ID_STATUS_OFFLINE);
return 0;
}
@@ -273,11 +273,11 @@ static int changeState(TAAAProtoSetting& setting, STATES newState) setting.szMsg = NULL;
}
- if (DBGetContactSettingByte(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_MSGCUSTOM), FALSE)) {
+ if (db_get_b(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_MSGCUSTOM), FALSE)) {
DBVARIANT dbv;
- if (!DBGetContactSettingTString(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_STATUSMSG), &dbv)) {
+ if (!db_get_ts(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_STATUSMSG), &dbv)) {
setting.szMsg = _tcsdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} }
}
else if (setting.szMsg != NULL) {
@@ -416,7 +416,7 @@ static VOID CALLBACK AutoAwayTimer(HWND hwnd,UINT message,UINT_PTR idEvent,DWORD }
if (confirm)
- confirmDialog = (HWND)CallService(MS_CS_SHOWCONFIRMDLGEX, (WPARAM)&ps, DBGetContactSettingWord(NULL, MODULENAME, SETTING_CONFIRMDELAY, 5));
+ confirmDialog = (HWND)CallService(MS_CS_SHOWCONFIRMDLGEX, (WPARAM)&ps, db_get_w(NULL, MODULENAME, SETTING_CONFIRMDELAY, 5));
else if (statusChanged)
CallService(MS_CS_SETSTATUSEX, (WPARAM)&ps, 0);
} }
@@ -602,7 +602,7 @@ int CSModuleLoaded(WPARAM wParam, LPARAM lParam) openInputDesktop = ( pfnOpenInputDesktop )GetProcAddress (hUser32, "OpenInputDesktop");
closeDesktop = ( pfnCloseDesktop )GetProcAddress (hUser32, "CloseDesktop");
- if ( IsWinVer2000Plus() && !DBGetContactSettingByte(NULL, MODULENAME, SETTING_IGNLOCK, FALSE))
+ if ( IsWinVer2000Plus() && !db_get_b(NULL, MODULENAME, SETTING_IGNLOCK, FALSE))
MyGetLastInputInfo = (BOOL (WINAPI *)(PLASTINPUTINFO))GetProcAddress(GetModuleHandleA("user32"),"GetLastInputInfo");
else
MyGetLastInputInfo = NULL;
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp index 4075dde869..1e154d7bca 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp @@ -60,14 +60,14 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L settings[count]->status = statusModeList[i];
DBVARIANT dbv;
- if ( !DBGetContactSetting(NULL, MODULENAME, StatusModeToDbSetting(statusModeList[i],SETTING_STATUSMSG), &dbv)) {
+ if ( !db_get(NULL, MODULENAME, StatusModeToDbSetting(statusModeList[i],SETTING_STATUSMSG), &dbv)) {
settings[count]->msg = ( char* )malloc(strlen(dbv.pszVal) + 1);
strcpy(settings[count]->msg, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else settings[count]->msg = NULL;
- settings[count]->useCustom = DBGetContactSettingByte(NULL, MODULENAME, StatusModeToDbSetting(statusModeList[i], SETTING_MSGCUSTOM), FALSE);
+ settings[count]->useCustom = db_get_b(NULL, MODULENAME, StatusModeToDbSetting(statusModeList[i], SETTING_MSGCUSTOM), FALSE);
count += 1;
}
SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_SETCURSEL,0,0);
@@ -142,9 +142,9 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case PSN_APPLY:
SendMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDC_STATUS,CBN_SELCHANGE),0);
for ( i=0; i < count; i++ ) {
- DBWriteContactSettingByte(NULL, MODULENAME, StatusModeToDbSetting(settings[i]->status,SETTING_MSGCUSTOM), (BYTE)settings[i]->useCustom);
+ db_set_b(NULL, MODULENAME, StatusModeToDbSetting(settings[i]->status,SETTING_MSGCUSTOM), (BYTE)settings[i]->useCustom);
if ( (settings[i]->useCustom) && (settings[i]->msg != NULL) && (strlen(settings[i]->msg) > 0))
- DBWriteContactSettingString(NULL, MODULENAME, StatusModeToDbSetting(settings[i]->status,SETTING_STATUSMSG), settings[i]->msg);
+ db_set_s(NULL, MODULENAME, StatusModeToDbSetting(settings[i]->status,SETTING_STATUSMSG), settings[i]->msg);
}
break;
}
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp index edfeb0aaa8..f1286139ec 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp @@ -44,17 +44,17 @@ static int WriteAutoAwaySetting(TAAAProtoSetting& autoAwaySetting, char* protoNa {
char setting[128];
mir_snprintf(setting, sizeof(setting), "%s_OptionFlags", protoName);
- DBWriteContactSettingByte(NULL,MODULENAME,setting,(BYTE)autoAwaySetting.optionFlags);
+ db_set_b(NULL,MODULENAME,setting,(BYTE)autoAwaySetting.optionFlags);
mir_snprintf(setting, sizeof(setting), "%s_AwayTime", protoName);
- DBWriteContactSettingWord(NULL,MODULENAME,setting,(WORD)autoAwaySetting.awayTime);
+ db_set_w(NULL,MODULENAME,setting,(WORD)autoAwaySetting.awayTime);
mir_snprintf(setting, sizeof(setting), "%s_NATime", protoName);
- DBWriteContactSettingWord(NULL,MODULENAME,setting,(WORD)autoAwaySetting.naTime);
+ db_set_w(NULL,MODULENAME,setting,(WORD)autoAwaySetting.naTime);
mir_snprintf(setting, sizeof(setting), "%s_StatusFlags", protoName);
- DBWriteContactSettingWord(NULL,MODULENAME,setting,(WORD)autoAwaySetting.statusFlags);
+ db_set_w(NULL,MODULENAME,setting,(WORD)autoAwaySetting.statusFlags);
mir_snprintf(setting, sizeof(setting), "%s_Lv1Status", protoName);
- DBWriteContactSettingWord(NULL,MODULENAME,setting,(WORD)autoAwaySetting.lv1Status);
+ db_set_w(NULL,MODULENAME,setting,(WORD)autoAwaySetting.lv1Status);
mir_snprintf(setting, sizeof(setting), "%s_Lv2Status", protoName);
- DBWriteContactSettingWord(NULL,MODULENAME,setting,(WORD)autoAwaySetting.lv2Status);
+ db_set_w(NULL,MODULENAME,setting,(WORD)autoAwaySetting.lv2Status);
return 0;
}
@@ -84,7 +84,7 @@ static void SetDialogItems(HWND hwndDlg, TAAAProtoSetting* setting) EnableWindow(GetDlgItem(hwndDlg,IDC_SETNASTR),IsDlgButtonChecked(hwndDlg,IDC_SETNA)&&IsDlgButtonChecked(hwndDlg,IDC_TIMED));
EnableWindow(GetDlgItem(hwndDlg,IDC_SETNASTR),IsDlgButtonChecked(hwndDlg,IDC_SETNA)&&IsDlgButtonChecked(hwndDlg,IDC_TIMED));
EnableWindow(GetDlgItem(hwndDlg,IDC_LV2STATUS),IsDlgButtonChecked(hwndDlg,IDC_SETNA)&&IsDlgButtonChecked(hwndDlg,IDC_TIMED));
- EnableWindow(GetDlgItem(hwndDlg,IDC_PROTOCOL), !bSettingSame);//DBGetContactSettingByte(NULL, MODULENAME, SETTING_SAMESETTINGS, FALSE));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_PROTOCOL), !bSettingSame);//db_get_b(NULL, MODULENAME, SETTING_SAMESETTINGS, FALSE));
}
static TAAAProtoSetting* GetSetting(HWND hwndDlg, TAAAProtoSetting* sameSetting)
@@ -375,19 +375,19 @@ static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARA switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_IGNLOCK, DBGetContactSettingByte(NULL, MODULENAME, SETTING_IGNLOCK, FALSE)?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_IGNSYSKEYS, DBGetContactSettingByte(NULL, MODULENAME, SETTING_IGNSYSKEYS, FALSE)?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_IGNALTCOMBO, DBGetContactSettingByte(NULL, MODULENAME, SETTING_IGNALTCOMBO, FALSE)?BST_CHECKED:BST_UNCHECKED);
- SetDlgItemInt(hwndDlg, IDC_AWAYCHECKTIMEINSECS, DBGetContactSettingWord(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, 5), FALSE);
- SetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, DBGetContactSettingWord(NULL, MODULENAME, SETTING_CONFIRMDELAY, 5), FALSE);
+ CheckDlgButton(hwndDlg, IDC_IGNLOCK, db_get_b(NULL, MODULENAME, SETTING_IGNLOCK, FALSE)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_IGNSYSKEYS, db_get_b(NULL, MODULENAME, SETTING_IGNSYSKEYS, FALSE)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_IGNALTCOMBO, db_get_b(NULL, MODULENAME, SETTING_IGNALTCOMBO, FALSE)?BST_CHECKED:BST_UNCHECKED);
+ SetDlgItemInt(hwndDlg, IDC_AWAYCHECKTIMEINSECS, db_get_w(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, 5), FALSE);
+ SetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, db_get_w(NULL, MODULENAME, SETTING_CONFIRMDELAY, 5), FALSE);
CheckDlgButton(hwndDlg, bSettingSame?IDC_SAMESETTINGS:IDC_PERPROTOCOLSETTINGS, BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_MONITORMOUSE, DBGetContactSettingByte(NULL, MODULENAME, SETTING_MONITORMOUSE, TRUE)?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_MONITORKEYBOARD, DBGetContactSettingByte(NULL, MODULENAME, SETTING_MONITORKEYBOARD, TRUE)?BST_CHECKED:BST_UNCHECKED);
- ShowWindow(GetDlgItem(hwndDlg, IDC_IDLEWARNING), (DBGetContactSettingByte(NULL, "Idle", "AAEnable", 0)));
+ CheckDlgButton(hwndDlg, IDC_MONITORMOUSE, db_get_b(NULL, MODULENAME, SETTING_MONITORMOUSE, TRUE)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MONITORKEYBOARD, db_get_b(NULL, MODULENAME, SETTING_MONITORKEYBOARD, TRUE)?BST_CHECKED:BST_UNCHECKED);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_IDLEWARNING), (db_get_b(NULL, "Idle", "AAEnable", 0)));
break;
case WM_SHOWWINDOW:
- ShowWindow(GetDlgItem(hwndDlg, IDC_IDLEWARNING), (DBGetContactSettingByte(NULL, "Idle", "AAEnable", 0)));
+ ShowWindow(GetDlgItem(hwndDlg, IDC_IDLEWARNING), (db_get_b(NULL, "Idle", "AAEnable", 0)));
break;
case WM_COMMAND:
@@ -412,14 +412,14 @@ static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARA case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY ) {
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_IGNLOCK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNLOCK));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_IGNSYSKEYS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNSYSKEYS));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_IGNALTCOMBO, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNALTCOMBO));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_SAMESETTINGS, (BYTE)bSettingSame);
- DBWriteContactSettingWord(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, (WORD)GetDlgItemInt(hwndDlg, IDC_AWAYCHECKTIMEINSECS, NULL, FALSE));
- DBWriteContactSettingWord(NULL, MODULENAME, SETTING_CONFIRMDELAY, (WORD)GetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, NULL, FALSE));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_MONITORMOUSE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_MONITORKEYBOARD, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD));
+ db_set_b(NULL, MODULENAME, SETTING_IGNLOCK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNLOCK));
+ db_set_b(NULL, MODULENAME, SETTING_IGNSYSKEYS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNSYSKEYS));
+ db_set_b(NULL, MODULENAME, SETTING_IGNALTCOMBO, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNALTCOMBO));
+ db_set_b(NULL, MODULENAME, SETTING_SAMESETTINGS, (BYTE)bSettingSame);
+ db_set_w(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, (WORD)GetDlgItemInt(hwndDlg, IDC_AWAYCHECKTIMEINSECS, NULL, FALSE));
+ db_set_w(NULL, MODULENAME, SETTING_CONFIRMDELAY, (WORD)GetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, NULL, FALSE));
+ db_set_b(NULL, MODULENAME, SETTING_MONITORMOUSE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE));
+ db_set_b(NULL, MODULENAME, SETTING_MONITORKEYBOARD, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD));
LoadOptions(*autoAwaySettings, FALSE);
}
break;
@@ -441,7 +441,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayTabs(HWND hwndDlg, UINT msg, WPARAM wPara RECT rcTabs, rcOptions, rcPage;
TranslateDialogDefault(hwndDlg);
- bSettingSame = DBGetContactSettingByte(NULL, MODULENAME, SETTING_SAMESETTINGS, FALSE);
+ bSettingSame = db_get_b(NULL, MODULENAME, SETTING_SAMESETTINGS, FALSE);
// set tabs
tabCount = 0;
hTab = GetDlgItem(hwndDlg, IDC_TABS);
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/trigger_aaa.cpp b/plugins/StatusPlugins/AdvancedAutoAway/trigger_aaa.cpp index edecc8f947..47740ac56a 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/trigger_aaa.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/trigger_aaa.cpp @@ -52,14 +52,14 @@ static int AAAStateChanged(WPARAM wParam, LPARAM lParam) { char setting[128];
char *szProto;
- szProto = DBGetContactSettingByte(NULL, MODULENAME, SETTING_SAMESETTINGS, 0)?SETTING_ALL:aas->protocolSetting->szName;
+ szProto = db_get_b(NULL, MODULENAME, SETTING_SAMESETTINGS, 0)?SETTING_ALL:aas->protocolSetting->szName;
_snprintf(setting, sizeof(setting), "%s_Lv1Status", szProto);
- if ( (aas->protocolSetting->lastStatus == DBGetContactSettingWord(NULL, MODULENAME, setting, ID_STATUS_AWAY)) && DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_LEAVEFIRST, 0)) {
+ if ( (aas->protocolSetting->lastStatus == db_get_w(NULL, MODULENAME, setting, ID_STATUS_AWAY)) && DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_LEAVEFIRST, 0)) {
bReport = TRUE;
}
_snprintf(setting, sizeof(setting), "%s_Lv2Status", szProto);
- if ( (aas->protocolSetting->lastStatus == DBGetContactSettingWord(NULL, MODULENAME, setting, ID_STATUS_NA)) && DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_LEAVESECOND, 0)) {
+ if ( (aas->protocolSetting->lastStatus == db_get_w(NULL, MODULENAME, setting, ID_STATUS_NA)) && DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_LEAVESECOND, 0)) {
bReport = TRUE;
}
}
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 40a9400030..c8ad88b213 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -155,8 +155,8 @@ int LoadMainOptions() StartTimer(IDT_CHECKCONTIN, 0, FALSE);
}
increaseExponential = db_get_b(NULL, MODULENAME, SETTING_INCREASEEXPONENTIAL, FALSE);
- currentDelay = initDelay = 1000*DBGetContactSettingDword(NULL, MODULENAME, SETTING_INITDELAY, DEFAULT_INITDELAY);
- maxDelay = 1000*DBGetContactSettingDword(NULL, MODULENAME, SETTING_MAXDELAY, DEFAULT_MAXDELAY);
+ currentDelay = initDelay = 1000*db_get_dw(NULL, MODULENAME, SETTING_INITDELAY, DEFAULT_INITDELAY);
+ maxDelay = 1000*db_get_dw(NULL, MODULENAME, SETTING_MAXDELAY, DEFAULT_MAXDELAY);
maxRetries = db_get_b(NULL, MODULENAME, SETTING_MAXRETRIES,0);
if (maxRetries == 0)
maxRetries = -1;
@@ -416,7 +416,7 @@ static int StartTimerFunction(int timer, int timeout, BOOL restart) if (restart)
KillTimer(NULL, checkContinTimerId);
if (timeout == 0) {
- checkContinTimerId = SetTimer(NULL, 0, 1000*DBGetContactSettingDword(NULL, MODULENAME, SETTING_CNTDELAY, CHECKCONTIN_DELAY), CheckContinueslyTimer);
+ checkContinTimerId = SetTimer(NULL, 0, 1000*db_get_dw(NULL, MODULENAME, SETTING_CNTDELAY, CHECKCONTIN_DELAY), CheckContinueslyTimer);
}
else
checkContinTimerId = SetTimer(NULL, 0, timeout, CheckContinueslyTimer);
@@ -592,7 +592,7 @@ static int ProcessProtoAck(WPARAM wParam,LPARAM lParam) case LOGINERR_SETDELAY:
{
- int newDelay = newDelay = 1000*DBGetContactSettingDword(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY);
+ int newDelay = newDelay = 1000*db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY);
log_infoA("KeepStatus: set delay to %d on login error (%s)", newDelay/1000, ack->szModule);
StartTimer(IDT_CHECKCONN, newDelay, TRUE);
}
@@ -620,7 +620,7 @@ static VOID CALLBACK CheckConnectingTimer(HWND hwnd,UINT message,UINT_PTR idEven int curStatus = GetStatus(cs);
int newStatus = CallProtoService(cs.szName,PS_GETSTATUS, 0, 0);
if (curStatus < MAX_CONNECT_RETRIES) { // connecting
- maxConnectingTime = DBGetContactSettingDword(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, 0);
+ maxConnectingTime = db_get_dw(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, 0);
if (maxConnectingTime > 0) {
if ( (unsigned int)maxConnectingTime <= ((GetTickCount() - cs.lastStatusAckTime)/1000)) {
// set offline
@@ -645,7 +645,7 @@ static VOID CALLBACK CheckAckStatusTimer(HWND hwnd,UINT message,UINT_PTR idEvent continue;
if (newStatus < MAX_CONNECT_RETRIES) { // connecting
- maxConnectingTime = DBGetContactSettingDword(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, 0);
+ maxConnectingTime = db_get_dw(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, 0);
if (maxConnectingTime > 0)
StartTimer(IDT_CHECKCONNECTING, (maxConnectingTime*1000 - (GetTickCount() - cs.lastStatusAckTime)), FALSE);
}
@@ -799,7 +799,7 @@ static void CheckContinueslyFunction(void *arg) BOOL ping = db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE);
if (ping) {
DBVARIANT dbv;
- if (DBGetContactSetting(NULL, MODULENAME, SETTING_PINGHOST, &dbv))
+ if (db_get(NULL, MODULENAME, SETTING_PINGHOST, &dbv))
ping = FALSE;
else {
char *start, *end;
@@ -854,7 +854,7 @@ static void CheckContinueslyFunction(void *arg) }
lpfnIcmpCloseHandle(hICMPFile);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (StartTimer(IDT_CHECKCONN, -1, FALSE)) {
@@ -862,7 +862,7 @@ static void CheckContinueslyFunction(void *arg) return; // already connecting, leave
}
- if ( ((!ping) && (!InternetGetConnectedState(NULL, 0))) || ( (ping) && (!bLastPingResult) && (pingFailures >= DBGetContactSettingWord(NULL, MODULENAME, SETTING_PINGCOUNT, DEFAULT_PINGCOUNT)))) {
+ if ( ((!ping) && (!InternetGetConnectedState(NULL, 0))) || ( (ping) && (!bLastPingResult) && (pingFailures >= db_get_w(NULL, MODULENAME, SETTING_PINGCOUNT, DEFAULT_PINGCOUNT)))) {
pingFailures = 0;
int count;
@@ -945,7 +945,7 @@ static int ProcessPopup(int reason, LPARAM lParam) _snprintf(text, sizeof(text), Translate("%s Login error, cancel reconnecting"), protoName);
else if ( db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_SETDELAY)
- _snprintf(text, sizeof(text), Translate("%s Login error (next retry (%d) in %ds)"), protoName, retryCount+1, DBGetContactSettingDword(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY));
+ _snprintf(text, sizeof(text), Translate("%s Login error (next retry (%d) in %ds)"), protoName, retryCount+1, db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY));
else
return -1;
@@ -1056,14 +1056,14 @@ static INT_PTR ShowPopup(char* msg, HICON hIcon) }
else if ( !db_get_b(NULL, MODULENAME, SETTING_POPUP_USEDEFCOLORS, 0))
{
- ppd.colorBack = DBGetContactSettingDword(NULL, MODULENAME, SETTING_POPUP_BACKCOLOR, 0xAAAAAA);
- ppd.colorText = DBGetContactSettingDword(NULL, MODULENAME, SETTING_POPUP_TEXTCOLOR, 0x0000CC);
+ ppd.colorBack = db_get_dw(NULL, MODULENAME, SETTING_POPUP_BACKCOLOR, 0xAAAAAA);
+ ppd.colorText = db_get_dw(NULL, MODULENAME, SETTING_POPUP_TEXTCOLOR, 0x0000CC);
}
ppd.PluginWindowProc = PopupDlgProc;
switch ( db_get_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU)) {
case POPUP_DELAYCUSTOM:
- ppd.iSeconds = (int)DBGetContactSettingDword(NULL, MODULENAME, SETTING_POPUP_TIMEOUT, 0);
+ ppd.iSeconds = (int)db_get_dw(NULL, MODULENAME, SETTING_POPUP_TIMEOUT, 0);
if (ppd.iSeconds == 0) {
ppd.iSeconds = currentDelay/1000-1;
}
diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp index 15b1996748..11bec59372 100644 --- a/plugins/StatusPlugins/KeepStatus/options.cpp +++ b/plugins/StatusPlugins/KeepStatus/options.cpp @@ -46,13 +46,13 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg,UINT msg,WPARAM wParam,L DBVARIANT dbv;
SetDlgItemInt(hwndDlg, IDC_MAXRETRIES, db_get_b(NULL,MODULENAME,SETTING_MAXRETRIES,DEFAULT_MAXRETRIES),FALSE);
- SetDlgItemInt(hwndDlg, IDC_INITDELAY, DBGetContactSettingDword(NULL,MODULENAME,SETTING_INITDELAY,DEFAULT_INITDELAY),FALSE);
+ SetDlgItemInt(hwndDlg, IDC_INITDELAY, db_get_dw(NULL,MODULENAME,SETTING_INITDELAY,DEFAULT_INITDELAY),FALSE);
CheckDlgButton(hwndDlg, IDC_CHECKCONNECTION, db_get_b(NULL, MODULENAME, SETTING_CHECKCONNECTION,FALSE)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWCONNECTIONPOPUPS, ( db_get_b(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS,FALSE)&&ServiceExists(MS_POPUP_SHOWMESSAGE))?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CHKINET, db_get_b(NULL, MODULENAME, SETTING_CHKINET, FALSE)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CONTCHECK, db_get_b(NULL, MODULENAME, SETTING_CONTCHECK, FALSE)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_BYPING, db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE)?BST_CHECKED:BST_UNCHECKED);
- if (!DBGetContactSetting(NULL, MODULENAME, SETTING_PINGHOST, &dbv))
+ if (!db_get(NULL, MODULENAME, SETTING_PINGHOST, &dbv))
SetDlgItemTextA(hwndDlg, IDC_PINGHOST, dbv.pszVal);
// proto list
HWND hList = GetDlgItem(hwndDlg,IDC_PROTOCOLLIST);
@@ -132,13 +132,13 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg,UINT msg,WPARAM wParam,L int i;
LVITEM lvItem;
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_MAXRETRIES, (BYTE)GetDlgItemInt(hwndDlg,IDC_MAXRETRIES, NULL, FALSE));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_CHECKCONNECTION, (BYTE)SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWCONNECTIONPOPUPS));
- DBWriteContactSettingDword(NULL, MODULENAME, SETTING_INITDELAY, (DWORD)GetDlgItemInt(hwndDlg,IDC_INITDELAY, NULL, FALSE));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_CHKINET, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CHKINET));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_CONTCHECK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_BYPING, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BYPING));
+ db_set_b(NULL, MODULENAME, SETTING_MAXRETRIES, (BYTE)GetDlgItemInt(hwndDlg,IDC_MAXRETRIES, NULL, FALSE));
+ db_set_b(NULL, MODULENAME, SETTING_CHECKCONNECTION, (BYTE)SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0));
+ db_set_b(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWCONNECTIONPOPUPS));
+ db_set_dw(NULL, MODULENAME, SETTING_INITDELAY, (DWORD)GetDlgItemInt(hwndDlg,IDC_INITDELAY, NULL, FALSE));
+ db_set_b(NULL, MODULENAME, SETTING_CHKINET, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CHKINET));
+ db_set_b(NULL, MODULENAME, SETTING_CONTCHECK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK));
+ db_set_b(NULL, MODULENAME, SETTING_BYPING, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BYPING));
if (IsDlgButtonChecked(hwndDlg, IDC_BYPING)) {
char *host;
@@ -148,7 +148,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg,UINT msg,WPARAM wParam,L if (host != NULL) {
memset(host, '\0', len+1);
GetDlgItemTextA(hwndDlg, IDC_PINGHOST, host, len+1);
- DBWriteContactSettingString(NULL, MODULENAME, SETTING_PINGHOST, host);
+ db_set_s(NULL, MODULENAME, SETTING_PINGHOST, host);
}
}
}
@@ -162,7 +162,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg,UINT msg,WPARAM wParam,L char dbSetting[128];
mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", (char *)lvItem.lParam);
- DBWriteContactSettingByte(NULL, MODULENAME, dbSetting, (BYTE)ListView_GetCheckState(hList, lvItem.iItem));
+ db_set_b(NULL, MODULENAME, dbSetting, (BYTE)ListView_GetCheckState(hList, lvItem.iItem));
}
}
break;
@@ -176,17 +176,17 @@ static INT_PTR CALLBACK DlgProcKSAdvOpts(HWND hwndDlg,UINT msg,WPARAM wParam,LPA switch(msg) {
case WM_INITDIALOG: {
TranslateDialogDefault(hwndDlg);
- SetDlgItemInt(hwndDlg, IDC_MAXDELAY, DBGetContactSettingDword(NULL,MODULENAME,SETTING_MAXDELAY,DEFAULT_MAXDELAY),FALSE);
- SetDlgItemInt(hwndDlg, IDC_MAXCONNECTINGTIME, DBGetContactSettingDword(NULL,MODULENAME,SETTING_MAXCONNECTINGTIME,0),FALSE);
+ SetDlgItemInt(hwndDlg, IDC_MAXDELAY, db_get_dw(NULL,MODULENAME,SETTING_MAXDELAY,DEFAULT_MAXDELAY),FALSE);
+ SetDlgItemInt(hwndDlg, IDC_MAXCONNECTINGTIME, db_get_dw(NULL,MODULENAME,SETTING_MAXCONNECTINGTIME,0),FALSE);
CheckDlgButton(hwndDlg, IDC_INCREASEEXPONENTIAL, db_get_b(NULL, MODULENAME, SETTING_INCREASEEXPONENTIAL,FALSE)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CNCOTHERLOC, ( db_get_b(NULL, MODULENAME, SETTING_CNCOTHERLOC, FALSE)&&(CallService(MS_SYSTEM_GETVERSION,0,0) >= 0x00040000))?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_LOGINERR, db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING)==LOGINERR_NOTHING?FALSE:TRUE);
CheckDlgButton(hwndDlg, IDC_CHECKAPMRESUME, ( db_get_b(NULL, MODULENAME, SETTING_CHECKAPMRESUME, FALSE)&&(CallService(MS_SYSTEM_GETVERSION,0,0) >= 0x00040000))?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_FIRSTOFFLINE, ( db_get_b(NULL, MODULENAME, SETTING_FIRSTOFFLINE, FALSE)));
CheckDlgButton(hwndDlg, IDC_NOLOCKED, ( db_get_b(NULL, MODULENAME, SETTING_NOLOCKED, FALSE)));
- SetDlgItemInt(hwndDlg, IDC_LOGINERR_DELAY, DBGetContactSettingDword(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY), FALSE);
- SetDlgItemInt(hwndDlg, IDC_PINGCOUNT, DBGetContactSettingWord(NULL, MODULENAME, SETTING_PINGCOUNT, DEFAULT_PINGCOUNT), FALSE);
- SetDlgItemInt(hwndDlg, IDC_CNTDELAY, DBGetContactSettingDword(NULL, MODULENAME, SETTING_CNTDELAY, CHECKCONTIN_DELAY), FALSE);
+ SetDlgItemInt(hwndDlg, IDC_LOGINERR_DELAY, db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY), FALSE);
+ SetDlgItemInt(hwndDlg, IDC_PINGCOUNT, db_get_w(NULL, MODULENAME, SETTING_PINGCOUNT, DEFAULT_PINGCOUNT), FALSE);
+ SetDlgItemInt(hwndDlg, IDC_CNTDELAY, db_get_dw(NULL, MODULENAME, SETTING_CNTDELAY, CHECKCONTIN_DELAY), FALSE);
switch ( db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_CANCEL)) {
case LOGINERR_SETDELAY:
CheckRadioButton(hwndDlg, IDC_LOGINERR_CANCEL, IDC_LOGINERR_SETDELAY, IDC_LOGINERR_SETDELAY);
@@ -219,25 +219,25 @@ static INT_PTR CALLBACK DlgProcKSAdvOpts(HWND hwndDlg,UINT msg,WPARAM wParam,LPA case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_INCREASEEXPONENTIAL, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_INCREASEEXPONENTIAL));
- DBWriteContactSettingDword(NULL, MODULENAME, SETTING_MAXDELAY, (DWORD)GetDlgItemInt(hwndDlg,IDC_MAXDELAY, NULL, FALSE));
- DBWriteContactSettingDword(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, (DWORD)GetDlgItemInt(hwndDlg,IDC_MAXCONNECTINGTIME, NULL, FALSE));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_FIRSTOFFLINE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FIRSTOFFLINE));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_NOLOCKED, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOLOCKED));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_CNCOTHERLOC, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CNCOTHERLOC));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_LOGINERR, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_LOGINERR));
+ db_set_b(NULL, MODULENAME, SETTING_INCREASEEXPONENTIAL, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_INCREASEEXPONENTIAL));
+ db_set_dw(NULL, MODULENAME, SETTING_MAXDELAY, (DWORD)GetDlgItemInt(hwndDlg,IDC_MAXDELAY, NULL, FALSE));
+ db_set_dw(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, (DWORD)GetDlgItemInt(hwndDlg,IDC_MAXCONNECTINGTIME, NULL, FALSE));
+ db_set_b(NULL, MODULENAME, SETTING_FIRSTOFFLINE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FIRSTOFFLINE));
+ db_set_b(NULL, MODULENAME, SETTING_NOLOCKED, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOLOCKED));
+ db_set_b(NULL, MODULENAME, SETTING_CNCOTHERLOC, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CNCOTHERLOC));
+ db_set_b(NULL, MODULENAME, SETTING_LOGINERR, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_LOGINERR));
if (IsDlgButtonChecked(hwndDlg, IDC_LOGINERR)) {
if (IsDlgButtonChecked(hwndDlg, IDC_LOGINERR_SETDELAY)) {
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_SETDELAY);
- DBWriteContactSettingDword(NULL, MODULENAME, SETTING_LOGINERR_DELAY, GetDlgItemInt(hwndDlg, IDC_LOGINERR_DELAY, NULL, FALSE));
+ db_set_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_SETDELAY);
+ db_set_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, GetDlgItemInt(hwndDlg, IDC_LOGINERR_DELAY, NULL, FALSE));
}
- else DBWriteContactSettingByte(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_CANCEL);
+ else db_set_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_CANCEL);
}
- else DBWriteContactSettingByte(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING);
+ else db_set_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING);
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_CHECKAPMRESUME, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CHECKAPMRESUME));
- DBWriteContactSettingWord(NULL, MODULENAME, SETTING_PINGCOUNT, (WORD)GetDlgItemInt(hwndDlg,IDC_PINGCOUNT, NULL, FALSE));
- DBWriteContactSettingDword(NULL, MODULENAME, SETTING_CNTDELAY, (DWORD)GetDlgItemInt(hwndDlg,IDC_CNTDELAY, NULL, FALSE)==0?CHECKCONTIN_DELAY:GetDlgItemInt(hwndDlg,IDC_CNTDELAY, NULL, FALSE));
+ db_set_b(NULL, MODULENAME, SETTING_CHECKAPMRESUME, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CHECKAPMRESUME));
+ db_set_w(NULL, MODULENAME, SETTING_PINGCOUNT, (WORD)GetDlgItemInt(hwndDlg,IDC_PINGCOUNT, NULL, FALSE));
+ db_set_dw(NULL, MODULENAME, SETTING_CNTDELAY, (DWORD)GetDlgItemInt(hwndDlg,IDC_CNTDELAY, NULL, FALSE)==0?CHECKCONTIN_DELAY:GetDlgItemInt(hwndDlg,IDC_CNTDELAY, NULL, FALSE));
}
break;
@@ -423,11 +423,11 @@ INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar break;
}
// delay
- SetDlgItemInt(hwndDlg,IDC_DELAY, DBGetContactSettingDword(NULL, MODULENAME, SETTING_POPUP_TIMEOUT, 0), FALSE);
+ SetDlgItemInt(hwndDlg,IDC_DELAY, db_get_dw(NULL, MODULENAME, SETTING_POPUP_TIMEOUT, 0), FALSE);
// back color
- SendDlgItemMessage(hwndDlg,IDC_BGCOLOR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL, MODULENAME, SETTING_POPUP_BACKCOLOR, 0xAAAAAA));
+ SendDlgItemMessage(hwndDlg,IDC_BGCOLOR,CPM_SETCOLOUR,0,db_get_dw(NULL, MODULENAME, SETTING_POPUP_BACKCOLOR, 0xAAAAAA));
// text
- SendDlgItemMessage(hwndDlg,IDC_TEXTCOLOR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL, MODULENAME, SETTING_POPUP_TEXTCOLOR, 0x0000CC));
+ SendDlgItemMessage(hwndDlg,IDC_TEXTCOLOR,CPM_SETCOLOUR,0,db_get_dw(NULL, MODULENAME, SETTING_POPUP_TEXTCOLOR, 0x0000CC));
// wincolors
CheckDlgButton(hwndDlg, IDC_WINCOLORS, db_get_b(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, 0));
// defaultcolors
@@ -532,41 +532,41 @@ INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar if (((LPNMHDR)lParam)->code == PSN_APPLY) {
// left action
if (IsDlgButtonChecked(hwndDlg, IDC_LNOTHING))
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_NOTHING);
+ db_set_b(NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_NOTHING);
else if (IsDlgButtonChecked(hwndDlg, IDC_LCLOSE))
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_CLOSEPOPUP);
+ db_set_b(NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_CLOSEPOPUP);
else if (IsDlgButtonChecked(hwndDlg, IDC_LCANCEL))
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_CANCEL);
+ db_set_b(NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_CANCEL);
// right action
if (IsDlgButtonChecked(hwndDlg, IDC_RNOTHING))
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_NOTHING);
+ db_set_b(NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_NOTHING);
else if (IsDlgButtonChecked(hwndDlg, IDC_RCLOSE))
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_CLOSEPOPUP);
+ db_set_b(NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_CLOSEPOPUP);
else if (IsDlgButtonChecked(hwndDlg, IDC_RCANCEL))
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_CANCEL);
+ db_set_b(NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_CANCEL);
// delay
if (IsDlgButtonChecked(hwndDlg, IDC_DELAYFROMPU))
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU);
+ db_set_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU);
else if (IsDlgButtonChecked(hwndDlg, IDC_DELAYCUSTOM))
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYCUSTOM);
+ db_set_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYCUSTOM);
else if (IsDlgButtonChecked(hwndDlg, IDC_DELAYPERMANENT))
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYPERMANENT);
+ db_set_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYPERMANENT);
// delay
- DBWriteContactSettingDword(NULL, MODULENAME, SETTING_POPUP_TIMEOUT, GetDlgItemInt(hwndDlg,IDC_DELAY, NULL, FALSE));
+ db_set_dw(NULL, MODULENAME, SETTING_POPUP_TIMEOUT, GetDlgItemInt(hwndDlg,IDC_DELAY, NULL, FALSE));
// back color
- DBWriteContactSettingDword(NULL, MODULENAME, SETTING_POPUP_BACKCOLOR, SendDlgItemMessage(hwndDlg,IDC_BGCOLOR,CPM_GETCOLOUR,0,0));
+ db_set_dw(NULL, MODULENAME, SETTING_POPUP_BACKCOLOR, SendDlgItemMessage(hwndDlg,IDC_BGCOLOR,CPM_GETCOLOUR,0,0));
// text color
- DBWriteContactSettingDword(NULL, MODULENAME, SETTING_POPUP_TEXTCOLOR, SendDlgItemMessage(hwndDlg,IDC_TEXTCOLOR,CPM_GETCOLOUR,0,0));
+ db_set_dw(NULL, MODULENAME, SETTING_POPUP_TEXTCOLOR, SendDlgItemMessage(hwndDlg,IDC_TEXTCOLOR,CPM_GETCOLOUR,0,0));
// use win
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS));
+ db_set_b(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS));
// use def
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_POPUP_USEDEFCOLORS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS));
+ db_set_b(NULL, MODULENAME, SETTING_POPUP_USEDEFCOLORS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS));
// store types
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_PUCONNLOST, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUCONNLOST));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_PUOTHER, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUOTHER));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_PUCONNRETRY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUCONNRETRY));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_PURESULT, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PURESULT));
- DBWriteContactSettingByte(NULL, MODULENAME, SETTING_PUSHOWEXTRA, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUSHOWEXTRA));
+ db_set_b(NULL, MODULENAME, SETTING_PUCONNLOST, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUCONNLOST));
+ db_set_b(NULL, MODULENAME, SETTING_PUOTHER, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUOTHER));
+ db_set_b(NULL, MODULENAME, SETTING_PUCONNRETRY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUCONNRETRY));
+ db_set_b(NULL, MODULENAME, SETTING_PURESULT, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PURESULT));
+ db_set_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUSHOWEXTRA));
}
break;
}
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index 70527d62bb..3e78a0230c 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -966,12 +966,12 @@ static int ClearDatabase(char* filter) CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces);
for (i=0; i < settingCount; i++) {
if ((filter == NULL) || (!strncmp(filter, settings[i], strlen(filter))))
- DBDeleteContactSetting(NULL, MODULENAME, settings[i]);
+ db_unset(NULL, MODULENAME, settings[i]);
free(settings[i]);
}
free(settings);
// < v0.0.0.9
- if (filter == NULL) DBDeleteContactSetting(NULL, "AutoAway", "Confirm");
+ if (filter == NULL) db_unset(NULL, "AutoAway", "Confirm");
return 0;
}
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp index 9fc08cea82..bdd7e78114 100644 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp @@ -162,7 +162,7 @@ INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
char setting[80];
_snprintf(setting, sizeof(setting), "%d_%s", profile, SETTING_PROFILENAME);
- if ( DBGetContactSettingTString(NULL, MODULENAME, setting, &dbv))
+ if ( db_get_ts(NULL, MODULENAME, setting, &dbv))
return -1;
_tcsncpy(buf, dbv.ptszVal, 128-1); buf[127] = 0;
@@ -191,7 +191,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto) for ( int i=0; i < pceCount; i++ ) {
if ( (pce[i].profile == profile) && (!strcmp(pce[i].szProto, szProto))) {
_snprintf(dbSetting, sizeof(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG);
- if (!DBGetContactSettingTString(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db
+ if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db
pce[i].msg = ( TCHAR* )realloc(pce[i].msg, sizeof(TCHAR)*(_tcslen(dbv.ptszVal)+1));
if (pce[i].msg != NULL) {
_tcscpy(pce[i].msg, dbv.ptszVal);
@@ -215,7 +215,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto) pce[pceCount].szProto = _strdup(szProto);
pce[pceCount].msg = NULL;
_snprintf(dbSetting, sizeof(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG);
- if (!DBGetContactSettingTString(NULL, MODULENAME, dbSetting, &dbv)) {
+ if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) {
pce[pceCount].msg = _tcsdup(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp index 5df0dff3b4..f95ec4ce8e 100644 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp +++ b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp @@ -176,7 +176,7 @@ static void SetLastStatusMessages(TSettingsList& ps) _snprintf(dbSetting, sizeof(dbSetting), "%s%s", PREFIX_LASTMSG, ps[i].szName);
DBVARIANT dbv;
- if ( ps[i].szMsg == NULL && !DBGetContactSettingTString(NULL, MODULENAME, dbSetting, &dbv)) {
+ if ( ps[i].szMsg == NULL && !db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) {
ps[i].szMsg = _tcsdup(dbv.ptszVal); // remember this won't be freed
db_free(&dbv);
} } }
@@ -303,7 +303,7 @@ static int Exit(WPARAM wParam, LPARAM lParam) if (CallService(MS_PROTO_ISPROTOCOLLOADED, 0, (LPARAM)protos[i]->szModuleName)) {
db_set_w(NULL, MODULENAME, lastName, (WORD)CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0));
mir_snprintf(lastMsg, sizeof(lastMsg), "%s%s", PREFIX_LASTMSG, protos[i]->szModuleName);
- DBDeleteContactSetting(NULL, MODULENAME, lastMsg);
+ db_unset(NULL, MODULENAME, lastMsg);
int status = CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0);
if ( !CallService(MS_PROTO_ISPROTOCOLLOADED, 0, (LPARAM)protos[i]->szModuleName))
diff --git a/plugins/StatusPlugins/StartupStatus/toolbars.cpp b/plugins/StatusPlugins/StartupStatus/toolbars.cpp index 1109eb24f3..a2e53fc395 100644 --- a/plugins/StatusPlugins/StartupStatus/toolbars.cpp +++ b/plugins/StatusPlugins/StartupStatus/toolbars.cpp @@ -61,7 +61,7 @@ int CreateTopToolbarButtons(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
_snprintf(setting, sizeof(setting), "%d_%s", i, SETTING_PROFILENAME);
- if (DBGetContactSetting(NULL, MODULENAME, setting, &dbv))
+ if (db_get(NULL, MODULENAME, setting, &dbv))
continue;
ttb.hIconHandleDn = iconList[0].hIcolib;
diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp index 7de3bc5c96..cd8fd9b75e 100755 --- a/plugins/StopSpamMod/src/stopspam.cpp +++ b/plugins/StopSpamMod/src/stopspam.cpp @@ -155,7 +155,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) if(boost::algorithm::all(message, boost::is_digit())) { int msg = _ttoi(message.c_str()); - int math_answer = DBGetContactSettingDword(hContact, pluginName, "MathAnswer", 0); + int math_answer = db_get_dw(hContact, pluginName, "MathAnswer", 0); if(msg && math_answer) answered = (msg == math_answer); } diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp index 0ce304e59f..efef2f9e02 100755 --- a/plugins/StopSpamMod/src/utilities.cpp +++ b/plugins/StopSpamMod/src/utilities.cpp @@ -21,24 +21,24 @@ tstring DBGetContactSettingStringPAN(HANDLE hContact, char const * szModule, char const * szSetting, tstring errorValue) { DBVARIANT dbv; - //if(DBGetContactSetting(hContact, szModule, szSetting, &dbv)) + //if(db_get(hContact, szModule, szSetting, &dbv)) if(db_get_ts(hContact, szModule, szSetting, &dbv)) return errorValue; // if(DBVT_TCHAR == dbv.type ) errorValue = dbv.ptszVal; - DBFreeVariant(&dbv); + db_free(&dbv); return errorValue; } std::string DBGetContactSettingStringPAN_A(HANDLE hContact, char const * szModule, char const * szSetting, std::string errorValue) { DBVARIANT dbv; - //if(DBGetContactSetting(hContact, szModule, szSetting, &dbv)) + //if(db_get(hContact, szModule, szSetting, &dbv)) if(db_get_s(hContact, szModule, szSetting, &dbv)) return errorValue; // if(DBVT_ASCIIZ == dbv.type ) errorValue = dbv.pszVal; - DBFreeVariant(&dbv); + db_free(&dbv); return errorValue; } @@ -119,7 +119,7 @@ void RemoveExcludedUsers() if(hContact) { do{ - if(DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) && DBGetContactSettingByte(hContact, pluginName, "Excluded", 0)) + if(db_get_b(hContact, "CList", "NotOnList", 0) && db_get_b(hContact, pluginName, "Excluded", 0)) { plist->hContact = hContact; plist->next = new hContact_entry; @@ -136,7 +136,7 @@ void RemoveExcludedUsers() if(status>= ID_STATUS_CONNECTING && status <= ID_STATUS_OFFLINE){ LogSpamToFile(plist->hContact, _T("Mark for delete")); - DBWriteContactSettingByte(plist->hContact,"CList","Delete", 1); + db_set_b(plist->hContact,"CList","Delete", 1); }else{ LogSpamToFile(plist->hContact, _T("Deleted")); CallService(MS_DB_CONTACT_DELETE, (WPARAM)plist->hContact, 0); @@ -160,7 +160,7 @@ void RemoveTemporaryUsers() if(hContact) { do{ - if(DBGetContactSettingByte(hContact, "CList", "NotOnList", 0)|| + if(db_get_b(hContact, "CList", "NotOnList", 0)|| (_T("Not In List")== DBGetContactSettingStringPAN(hContact,"CList","Group",_T(""))) ) { @@ -179,7 +179,7 @@ void RemoveTemporaryUsers() if(status>= ID_STATUS_CONNECTING && status <= ID_STATUS_OFFLINE){ LogSpamToFile(plist->hContact, _T("Mark for delete")); - DBWriteContactSettingByte(plist->hContact,"CList","Delete", 1); + db_set_b(plist->hContact,"CList","Delete", 1); }else{ LogSpamToFile(plist->hContact, _T("Deleted")); CallService(MS_DB_CONTACT_DELETE, (WPARAM)plist->hContact, 0); diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp index 48aa3269e4..75694b5090 100644 --- a/plugins/StopSpamPlus/src/events.cpp +++ b/plugins/StopSpamPlus/src/events.cpp @@ -27,8 +27,8 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) // if request is from unknown or not marked Answered contact
//and if I don't sent message to this contact
- if(DBGetContactSettingByte(hcntct, "CList", "NotOnList", 0) &&
- !DBGetContactSettingByte(hcntct, pluginName, answeredSetting, 0) &&
+ if(db_get_b(hcntct, "CList", "NotOnList", 0) &&
+ !db_get_b(hcntct, pluginName, answeredSetting, 0) &&
!IsExistMyMessage(hcntct))
{
if (!plSets->HandleAuthReq.Get())
@@ -50,8 +50,8 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) mir_free(AuthRepl);
- DBWriteContactSettingByte(hcntct, "CList", "NotOnList", 1);
- DBWriteContactSettingByte(hcntct, "CList", "Hidden", 1);
+ db_set_b(hcntct, "CList", "NotOnList", 1);
+ db_set_b(hcntct, "CList", "Hidden", 1);
if (!plSets->HistLog.Get())
db_event_delete(0, hDbEvent);
delete [] dbei.pBlob;
@@ -81,13 +81,13 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) return 0;
// if message is from known or marked Answered contact
- if(DBGetContactSettingByte(hContact, pluginName, answeredSetting, 0))
+ if(db_get_b(hContact, pluginName, answeredSetting, 0))
// ...let the event go its way
return 0;
// checking if message from self-added contact
//Contact in Not in list icq group
- if (!DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) && DBGetContactSettingWord(hContact, dbei->szModule, "SrvGroupId", -1) != 1)
+ if (!db_get_b(hContact, "CList", "NotOnList", 0) && db_get_w(hContact, dbei->szModule, "SrvGroupId", -1) != 1)
return 0;
//if I sent message to this contact
@@ -135,14 +135,14 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) )
{
// unhide contact
- DBDeleteContactSetting(hContact, "CList", "Hidden");
+ db_unset(hContact, "CList", "Hidden");
// mark contact as Answered
- DBWriteContactSettingByte(hContact, pluginName, answeredSetting, 1);
+ db_set_b(hContact, pluginName, answeredSetting, 1);
//add contact permanently
if(plSets->AddPermanent.Get())
- DBDeleteContactSetting(hContact, "CList", "NotOnList");
+ db_unset(hContact, "CList", "NotOnList");
// send congratulation
@@ -160,7 +160,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) // if message message does not contain infintite talk protection prefix
// and question count for this contact is less then maximum
if ( (!plSets->InfTalkProtection.Get() || tstring::npos==message.find(infTalkProtPrefix))
- && (!plSets->MaxQuestCount.Get() || DBGetContactSettingDword(hContact, pluginName, questCountSetting, 0) < plSets->MaxQuestCount.Get()))
+ && (!plSets->MaxQuestCount.Get() || db_get_dw(hContact, pluginName, questCountSetting, 0) < plSets->MaxQuestCount.Get()))
{
// send question
tstring q = infTalkProtPrefix + variables_parse((tstring)(plSets->Question), hContact);
@@ -172,13 +172,13 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) // increment question count
- DWORD questCount = DBGetContactSettingDword(hContact, pluginName, questCountSetting, 0);
- DBWriteContactSettingDword(hContact, pluginName, questCountSetting, questCount + 1);
+ DWORD questCount = db_get_dw(hContact, pluginName, questCountSetting, 0);
+ db_set_dw(hContact, pluginName, questCountSetting, questCount + 1);
// hide contact from contact list
}
- DBWriteContactSettingByte(hContact, "CList", "NotOnList", 1);
- DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
+ db_set_b(hContact, "CList", "NotOnList", 1);
+ db_set_b(hContact, "CList", "Hidden", 1);
// save message from contact
dbei->flags |= DBEF_READ;
@@ -227,8 +227,8 @@ MIRANDA_HOOK_EVENT(ME_DB_CONTACT_SETTINGCHANGED, w, l) return 0;
if (!cws->value.type)
{
- DBDeleteContactSetting(hContact, pluginName, answeredSetting);
- DBDeleteContactSetting(hContact, pluginName, questCountSetting);
+ db_unset(hContact, pluginName, answeredSetting);
+ db_unset(hContact, pluginName, questCountSetting);
}
return 0;
diff --git a/plugins/StopSpamPlus/src/services.cpp b/plugins/StopSpamPlus/src/services.cpp index 905a87ee89..21b77e14f4 100644 --- a/plugins/StopSpamPlus/src/services.cpp +++ b/plugins/StopSpamPlus/src/services.cpp @@ -8,10 +8,10 @@ INT_PTR IsContactPassed(WPARAM wParam, LPARAM /*lParam*/) if ( !plSets->ProtoDisabled( proto.c_str()))
return CS_PASSED;
- if ( DBGetContactSettingByte(hContact, pluginName, answeredSetting, 0))
+ if ( db_get_b(hContact, pluginName, answeredSetting, 0))
return CS_PASSED;
- if ( !DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) && DBGetContactSettingWord( hContact, proto.c_str(), "SrvGroupId", -1 ) != 1)
+ if ( !db_get_b(hContact, "CList", "NotOnList", 0) && db_get_w( hContact, proto.c_str(), "SrvGroupId", -1 ) != 1)
return CS_PASSED;
if ( IsExistMyMessage(hContact))
@@ -27,10 +27,10 @@ INT_PTR RemoveTempContacts(WPARAM wParam,LPARAM lParam) HANDLE hNext = db_find_next(hContact);
DBVARIANT dbv = { 0 };
- if ( DBGetContactSettingTString( hContact, "CList", "Group", &dbv ))
+ if ( db_get_ts( hContact, "CList", "Group", &dbv ))
dbv.ptszVal = NULL;
- if ( DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) || DBGetContactSettingByte(hContact, "CList", "Hidden", 0 ) || (dbv.ptszVal != NULL && (_tcsstr(dbv.ptszVal, _T("Not In List")) || _tcsstr(dbv.ptszVal, TranslateT("Not In List"))))) {
+ if ( db_get_b(hContact, "CList", "NotOnList", 0) || db_get_b(hContact, "CList", "Hidden", 0 ) || (dbv.ptszVal != NULL && (_tcsstr(dbv.ptszVal, _T("Not In List")) || _tcsstr(dbv.ptszVal, TranslateT("Not In List"))))) {
char *szProto = GetContactProto(hContact);
if ( szProto != NULL ) {
// Check if protocol uses server side lists
@@ -40,14 +40,14 @@ INT_PTR RemoveTempContacts(WPARAM wParam,LPARAM lParam) status = CallProtoService(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( hContact, "CList", "Delete", 1 );
+ db_set_b( hContact, "CList", "Delete", 1 );
else
CallService( MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0 );
}
}
}
- DBFreeVariant( &dbv );
+ db_free( &dbv );
hContact = hNext;
}
@@ -56,13 +56,13 @@ INT_PTR RemoveTempContacts(WPARAM wParam,LPARAM lParam) do {
group_name = (char *)CallService(MS_CLIST_GROUPGETNAME, (WPARAM)hGroup, 0);
if (group_name != NULL && strstr(group_name, "Not In List")) {
- BYTE ConfirmDelete = DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT);
+ BYTE ConfirmDelete = db_get_b(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT);
if ( ConfirmDelete )
- DBWriteContactSettingByte( NULL, "CList", "ConfirmDelete", 0 );
+ db_set_b( NULL, "CList", "ConfirmDelete", 0 );
CallService( MS_CLIST_GROUPDELETE, (WPARAM)hGroup, 0 );
if ( ConfirmDelete )
- DBWriteContactSettingByte( NULL, "CList", "ConfirmDelete", ConfirmDelete );
+ db_set_b( NULL, "CList", "ConfirmDelete", ConfirmDelete );
break;
}
hGroup++;
diff --git a/plugins/StopSpamPlus/src/settings.cpp b/plugins/StopSpamPlus/src/settings.cpp index 05a9007d0c..52dcc274a2 100644 --- a/plugins/StopSpamPlus/src/settings.cpp +++ b/plugins/StopSpamPlus/src/settings.cpp @@ -4,10 +4,10 @@ tstring db_usage::DBGetPluginSetting(std::string const &name, tstring const &defValue)
{
DBVARIANT dbv;
- if(DBGetContactSettingTString(NULL, pluginName, name.c_str(), &dbv))
+ if(db_get_ts(NULL, pluginName, name.c_str(), &dbv))
return defValue;
tstring value = dbv.ptszVal;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return value;
}
@@ -15,45 +15,45 @@ tstring db_usage::DBGetPluginSetting(std::string const &name, tstring const &def std::string db_usage::DBGetPluginSetting(std::string const &name, std::string const &defValue)
{
DBVARIANT dbv;
- if(DBGetContactSettingString(NULL, pluginName, name.c_str(), &dbv))
+ if(db_get_s(NULL, pluginName, name.c_str(), &dbv))
return defValue;
std::string value = dbv.pszVal;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return value;
}
bool db_usage::DBGetPluginSetting(std::string const &name, bool const &defValue)
{
- return(0 != DBGetContactSettingByte(NULL, pluginName, name.c_str(), defValue?1:0));
+ return(0 != db_get_b(NULL, pluginName, name.c_str(), defValue?1:0));
}
DWORD db_usage::DBGetPluginSetting(std::string const &name, DWORD const &defValue)
{
- return DBGetContactSettingDword(NULL, pluginName, name.c_str(), defValue);
+ return db_get_dw(NULL, pluginName, name.c_str(), defValue);
}
//writting to database--------------
void db_usage::DBSetPluginSetting(std::string const &name, tstring const &value)
{
- DBWriteContactSettingTString(NULL, pluginName, name.c_str(), value.c_str());
+ db_set_ts(NULL, pluginName, name.c_str(), value.c_str());
}
void db_usage::DBSetPluginSetting(std::string const &name, std::string const &value)
{
- DBWriteContactSettingString(NULL, pluginName, name.c_str(), value.c_str());
+ db_set_s(NULL, pluginName, name.c_str(), value.c_str());
}
void db_usage::DBSetPluginSetting(std::string const &name, bool const &value)
{
- DBWriteContactSettingByte(NULL, pluginName, name.c_str(), value?1:0);
+ db_set_b(NULL, pluginName, name.c_str(), value?1:0);
}
void db_usage::DBSetPluginSetting(std::string const &name, DWORD const &value)
{
- DBWriteContactSettingDword(NULL, pluginName, name.c_str(),value);
+ db_set_dw(NULL, pluginName, name.c_str(),value);
}
Settings *plSets;
diff --git a/plugins/StopSpamPlus/src/utils.cpp b/plugins/StopSpamPlus/src/utils.cpp index b1329ccd0c..ca4c46c292 100644 --- a/plugins/StopSpamPlus/src/utils.cpp +++ b/plugins/StopSpamPlus/src/utils.cpp @@ -22,7 +22,7 @@ bool IsExistMyMessage(HANDLE hContact) if(dbei.flags & DBEF_SENT){
// mark contact as Answered
- DBWriteContactSettingByte(hContact, pluginName, answeredSetting, 1);
+ db_set_b(hContact, pluginName, answeredSetting, 1);
// ...let the event go its way
return true;
}
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 8205a902dc..a7fcff7b36 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -141,7 +141,7 @@ void CB_InitCustomButtons() InitializeCriticalSection(&ToolBarCS);
dwSepCount = M->GetDword("TabSRMM_Toolbar", "SeparatorsCount", 0);
- //dwSepCount = DBGetContactSettingDword(NULL, "TabSRMM_Toolbar", "SeparatorsCount", 0);
+ //dwSepCount = db_get_dw(NULL, "TabSRMM_Toolbar", "SeparatorsCount", 0);
hButtonsBarAddButton = CreateServiceFunction(MS_BB_ADDBUTTON, CB_AddButton);
hButtonsBarRemoveButton = CreateServiceFunction(MS_BB_REMOVEBUTTON, CB_RemoveButton);
@@ -865,7 +865,7 @@ void CB_GetButtonSettings(HANDLE hContact, CustomButtonData *cbd) mir_snprintf(SettingName, sizeof(SettingName), "%s_%d", cbd->pszModuleName, cbd->dwButtonOrigID);
- if (!DBGetContactSettingString(hContact, "TabSRMM_Toolbar", SettingName, &dbv)) {
+ if (!db_get_s(hContact, "TabSRMM_Toolbar", SettingName, &dbv)) {
token = strtok(dbv.pszVal, "_");
cbd->dwPosition = (DWORD)atoi(token);
token = strtok(NULL, "_");
@@ -879,7 +879,7 @@ void CB_GetButtonSettings(HANDLE hContact, CustomButtonData *cbd) token = strtok(NULL, "_");
cbd->bCanBeHidden = (BOOL)atoi(token);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -893,7 +893,7 @@ void CB_WriteButtonSettings(HANDLE hContact, CustomButtonData *cbd) mir_snprintf(SettingName, sizeof(SettingName), "%s_%d", cbd->pszModuleName, cbd->dwButtonOrigID);
mir_snprintf(SettingParameter, sizeof(SettingParameter), "%d_%u_%u_%u_%u_%u", cbd->dwPosition, cbd->bIMButton, cbd->bChatButton, cbd->bLSided, cbd->bRSided, cbd->bCanBeHidden);
if (!(cbd->opFlags&BBSF_NTBDESTRUCT))
- DBWriteContactSettingString(hContact, "TabSRMM_Toolbar", SettingName, SettingParameter);
+ db_set_s(hContact, "TabSRMM_Toolbar", SettingName, SettingParameter);
else
db_unset(hContact, "TabSRMM_Toolbar", SettingName);
}
diff --git a/plugins/TabSRMM/src/chat/clist.cpp b/plugins/TabSRMM/src/chat/clist.cpp index 18172a2e01..fd0f232573 100644 --- a/plugins/TabSRMM/src/chat/clist.cpp +++ b/plugins/TabSRMM/src/chat/clist.cpp @@ -50,7 +50,7 @@ static HANDLE Clist_GroupExists(TCHAR *tszGroup) result = M->GetTString(0, "CListGroups", str, &dbv);
if (!result) {
match = (!_tcscmp(tszGroup, &dbv.ptszVal[1]) && (lstrlen(tszGroup) == lstrlen(&dbv.ptszVal[1])));
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (match)
return((HANDLE)(i + 1));
}
@@ -70,7 +70,7 @@ HANDLE CList_AddRoom(const char* pszModule, const TCHAR* pszRoom, const TCHAR* p if (!M->GetTString(NULL, "Chat", "AddToGroup", &dbv)) {
if (lstrlen(dbv.ptszVal) > 0)
lstrcpyn(pszGroup, dbv.ptszVal, 50);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else
lstrcpyn(pszGroup, _T("Chat rooms"), 50);
@@ -94,7 +94,7 @@ HANDLE CList_AddRoom(const char* pszModule, const TCHAR* pszRoom, const TCHAR* p M->WriteTString(hContact, pszModule, "Nick", pszDisplayName);
M->WriteTString(hContact, pszModule, "ChatRoomID", pszRoom);
M->WriteByte(hContact, pszModule, "ChatRoom", (BYTE)iType);
- DBWriteContactSettingWord(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
+ db_set_w(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
return hContact;
}
@@ -106,8 +106,8 @@ BOOL CList_SetOffline(HANDLE hContact, BOOL bHide) return FALSE;
int i = M->GetByte(hContact, szProto, "ChatRoom", 0);
- DBWriteContactSettingWord(hContact, szProto, "ApparentMode", (LPARAM)0);
- DBWriteContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ db_set_w(hContact, szProto, "ApparentMode", (LPARAM)0);
+ db_set_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
return TRUE;
}
return FALSE;
@@ -125,8 +125,8 @@ BOOL CList_SetAllOffline(BOOL bHide, const char *pszModule) if (!pszModule || (pszModule && !strcmp(pszModule, szProto))) {
int i = M->GetByte(hContact, szProto, "ChatRoom", 0);
if (i != 0) {
- DBWriteContactSettingWord(hContact, szProto, "ApparentMode", (LPARAM)(WORD) 0);
- DBWriteContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ db_set_w(hContact, szProto, "ApparentMode", (LPARAM)(WORD) 0);
+ db_set_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
}
}
}
@@ -162,7 +162,7 @@ int CList_RoomDoubleclicked(WPARAM wParam, LPARAM lParam) && IsWindowVisible(si->hWnd)
&& !IsIconic(si->pContainer->hwnd)) {
PostMessage(si->hWnd, GC_CLOSEWINDOW, 0, 0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 1;
}
else
@@ -175,7 +175,7 @@ int CList_RoomDoubleclicked(WPARAM wParam, LPARAM lParam) SetForegroundWindow(si->dat->pContainer->hwnd);
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 1;
}
}
@@ -305,10 +305,10 @@ HANDLE CList_FindRoom(const char* pszModule, const TCHAR* pszRoom) DBVARIANT dbv;
if (!M->GetTString(hContact, szProto, "ChatRoomID", &dbv)) {
if (!lstrcmpi(dbv.ptszVal, pszRoom)) {
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return hContact;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp index 1e8919e8c0..c3ffc5e0e9 100644 --- a/plugins/TabSRMM/src/chat/main.cpp +++ b/plugins/TabSRMM/src/chat/main.cpp @@ -76,8 +76,8 @@ int Chat_Unload(void) if (!PluginConfig.m_chat_enabled)
return 0;
- DBWriteContactSettingWord(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
- DBWriteContactSettingWord(NULL, "Chat", "splitY", (WORD)g_Settings.iSplitterY);
+ db_set_w(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
+ db_set_w(NULL, "Chat", "splitY", (WORD)g_Settings.iSplitterY);
CList_SetAllOffline(TRUE, NULL);
diff --git a/plugins/TabSRMM/src/chat/manager.cpp b/plugins/TabSRMM/src/chat/manager.cpp index 2649cb2a24..4b706059d9 100644 --- a/plugins/TabSRMM/src/chat/manager.cpp +++ b/plugins/TabSRMM/src/chat/manager.cpp @@ -121,10 +121,10 @@ int SM_RemoveSession(const TCHAR* pszID, const char* pszModule, bool removeConta if (pTemp->hContact) {
CList_SetOffline(pTemp->hContact, pTemp->iType == GCW_CHATROOM ? TRUE : FALSE);
//if (pTemp->iType != GCW_SERVER)
- //DBWriteContactSettingByte(pTemp->hContact, "CList", "Hidden", 1);
+ //db_set_b(pTemp->hContact, "CList", "Hidden", 1);
}
- DBWriteContactSettingString(pTemp->hContact, pTemp->pszModule , "Topic", "");
- DBWriteContactSettingString(pTemp->hContact, pTemp->pszModule, "StatusBar", "");
+ db_set_s(pTemp->hContact, pTemp->pszModule , "Topic", "");
+ db_set_s(pTemp->hContact, pTemp->pszModule, "StatusBar", "");
db_unset(pTemp->hContact, "CList", "StatusMsg");
if (removeContact)
@@ -610,7 +610,7 @@ BOOL SM_SetStatus(const TCHAR* pszID, const char* pszModule, int wStatus) if (pTemp->iType != GCW_SERVER && wStatus != ID_STATUS_OFFLINE)
db_unset(pTemp->hContact, "CList", "Hidden");
- DBWriteContactSettingWord(pTemp->hContact, pTemp->pszModule, "Status", (WORD)wStatus);
+ db_set_w(pTemp->hContact, pTemp->pszModule, "Status", (WORD)wStatus);
}
if (pszID)
@@ -702,9 +702,9 @@ BOOL SM_RemoveAll(void) DoEventHook(m_WndList->ptszID, m_WndList->pszModule, GC_SESSION_TERMINATE, NULL, NULL, (DWORD)m_WndList->dwItemData);
if (m_WndList->hContact)
CList_SetOffline(m_WndList->hContact, m_WndList->iType == GCW_CHATROOM ? TRUE : FALSE);
- DBWriteContactSettingString(m_WndList->hContact, m_WndList->pszModule , "Topic", "");
+ db_set_s(m_WndList->hContact, m_WndList->pszModule , "Topic", "");
db_unset(m_WndList->hContact, "CList", "StatusMsg");
- DBWriteContactSettingString(m_WndList->hContact, m_WndList->pszModule, "StatusBar", "");
+ db_set_s(m_WndList->hContact, m_WndList->pszModule, "StatusBar", "");
UM_RemoveAll(&m_WndList->pUsers);
TM_RemoveAll(&m_WndList->pStatuses);
diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp index 935d2e38d4..79752fa472 100644 --- a/plugins/TabSRMM/src/chat/muchighlight.cpp +++ b/plugins/TabSRMM/src/chat/muchighlight.cpp @@ -269,12 +269,12 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L DBVARIANT dbv = {0};
if ( !M->GetTString(0, "Chat", "HighlightWords", &dbv)) {
::SetDlgItemText(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, dbv.ptszVal);
- ::DBFreeVariant(&dbv);
+ ::db_free(&dbv);
}
if ( !M->GetTString(0, "Chat", "HighlightNames", &dbv)) {
::SetDlgItemText(hwndDlg, IDC_HIGHLIGHTNICKPATTERN, dbv.ptszVal);
- ::DBFreeVariant(&dbv);
+ ::db_free(&dbv);
}
DWORD dwFlags = M->GetByte("Chat", "HighlightEnabled", MATCH_TEXT);
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 0590070abf..6011d8a194 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -1050,7 +1050,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM SM_InvalidateLogDirectories();
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN4, UDM_GETPOS, 0, 0);
- DBWriteContactSettingWord(NULL, "Chat", "LoggingLimit", (WORD)iLen);
+ db_set_w(NULL, "Chat", "LoggingLimit", (WORD)iLen);
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_GETPOS, 0, 0);
if (iLen > 0)
@@ -1062,32 +1062,32 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM if (iLen > 0) {
pszText = (char *)realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_LOGTIMESTAMP, pszText, iLen + 1);
- DBWriteContactSettingString(NULL, "Chat", "LogTimestamp", pszText);
+ db_set_s(NULL, "Chat", "LogTimestamp", pszText);
} else db_unset(NULL, "Chat", "LogTimestamp");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_TIMESTAMP));
if (iLen > 0) {
pszText = (char *)realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_TIMESTAMP, pszText, iLen + 1);
- DBWriteContactSettingString(NULL, "Chat", "HeaderTime", pszText);
+ db_set_s(NULL, "Chat", "HeaderTime", pszText);
} else db_unset(NULL, "Chat", "HeaderTime");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_INSTAMP));
if (iLen > 0) {
pszText = (char *)realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_INSTAMP, pszText, iLen + 1);
- DBWriteContactSettingString(NULL, "Chat", "HeaderIncoming", pszText);
+ db_set_s(NULL, "Chat", "HeaderIncoming", pszText);
} else db_unset(NULL, "Chat", "HeaderIncoming");
iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_OUTSTAMP));
if (iLen > 0) {
pszText = (char *)realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_OUTSTAMP, pszText, iLen + 1);
- DBWriteContactSettingString(NULL, "Chat", "HeaderOutgoing", pszText);
+ db_set_s(NULL, "Chat", "HeaderOutgoing", pszText);
} else db_unset(NULL, "Chat", "HeaderOutgoing");
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_GETPOS, 0, 0);
- DBWriteContactSettingWord(NULL, "Chat", "LogLimit", (WORD)iLen);
+ db_set_w(NULL, "Chat", "LogLimit", (WORD)iLen);
}
if (pszText != NULL)
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index bcd2cc9452..59d4cd646f 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -246,12 +246,12 @@ INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam) else
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s"), si->ptszName);
si->hContact = CList_AddRoom(gcw->pszModule, ptszID, szTemp, si->iType);
- DBWriteContactSettingString(si->hContact, si->pszModule , "Topic", "");
+ db_set_s(si->hContact, si->pszModule , "Topic", "");
db_unset(si->hContact, "CList", "StatusMsg");
if (si->ptszStatusbarText)
M->WriteTString(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
- DBWriteContactSettingString(si->hContact, si->pszModule, "StatusBar", "");
+ db_set_s(si->hContact, si->pszModule, "StatusBar", "");
if (si->hContact)
Chat_SetFilters(si);
}
@@ -371,7 +371,7 @@ static int DoControl(GCEVENT * gce, WPARAM wp) if (si->ptszStatusbarText)
M->WriteTString(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
- DBWriteContactSettingString(si->hContact, si->pszModule, "StatusBar", "");
+ db_set_s(si->hContact, si->pszModule, "StatusBar", "");
if (si->hWnd)
SendMessage(si->hWnd, GC_UPDATESTATUSBAR, 0, 0);
}
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index 5e0b679f07..85167448e8 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -607,7 +607,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO* si, GCEVENT * gce, BOOL bHighligh params->sound = "ChatMessage";
if (params->bInactive && !(si->wState&STATE_TALK)) {
si->wState |= STATE_TALK;
- DBWriteContactSettingWord(si->hContact, si->pszModule, "ApparentMode", (LPARAM)(WORD) 40071);
+ db_set_w(si->hContact, si->pszModule, "ApparentMode", (LPARAM)(WORD) 40071);
}
break;
case GC_EVENT_ACTION:
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index d424e03f78..46e761e8cf 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -288,7 +288,7 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg) if (dat->iTabID >= 0) {
if (db_get_w(si->hContact, si->pszModule , "ApparentMode", 0) != 0)
- DBWriteContactSettingWord(si->hContact, si->pszModule , "ApparentMode", (LPARAM)0);
+ db_set_w(si->hContact, si->pszModule , "ApparentMode", (LPARAM)0);
if (CallService(MS_CLIST_GETEVENT, (WPARAM)si->hContact, 0))
CallService(MS_CLIST_REMOVEEVENT, (WPARAM)si->hContact, (LPARAM)szChatIconString);
@@ -2484,7 +2484,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar si->wState &= ~STATE_TALK;
dat->bWasDeleted = 1;
- DBWriteContactSettingWord(si->hContact, si->pszModule , "ApparentMode", (LPARAM)0);
+ db_set_w(si->hContact, si->pszModule , "ApparentMode", (LPARAM)0);
SendMessage(hwndDlg, GC_CLOSEWINDOW, 0, lParam == 2 ? lParam : 1);
return TRUE;
@@ -3453,7 +3453,7 @@ LABEL_SHOWWINDOW: if (iSelection - IDM_CONTAINERMENU >= 0) {
if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -3735,10 +3735,10 @@ LABEL_SHOWWINDOW: TABSRMM_FireEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_CLOSING, 0);
if (!dat->fIsAutosizingInput)
- DBWriteContactSettingWord(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
+ db_set_w(NULL, "Chat", "SplitterX", (WORD)g_Settings.iSplitterX);
if (dat->pContainer->settings->fPrivate && !IsAutoSplitEnabled(dat))
- DBWriteContactSettingWord(NULL, "Chat", "splitY", (WORD)g_Settings.iSplitterY);
+ db_set_w(NULL, "Chat", "splitY", (WORD)g_Settings.iSplitterY);
DM_FreeTheme(dat);
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 74238bb783..d93afc5fbd 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -483,7 +483,7 @@ void CContactCache::updateStatusMsg(const char *szKey) res = M->GetTString(m_hContact, "CList", "StatusMsg", &dbv);
if (res == 0) {
m_szStatusMsg = (lstrlen(dbv.ptszVal) > 0 ? getNormalizedStatusMsg(dbv.ptszVal) : 0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
if (szKey == 0 || (szKey && !strcmp("ListeningTo", szKey))) {
@@ -493,7 +493,7 @@ void CContactCache::updateStatusMsg(const char *szKey) res = M->GetTString(m_hContact, m_szProto, "ListeningTo", &dbv);
if (res == 0) {
m_ListeningInfo = (lstrlen(dbv.ptszVal) > 0 ? mir_tstrdup(dbv.ptszVal) : 0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
if (szKey == 0 || (szKey && !strcmp("XStatusMsg", szKey))) {
@@ -503,7 +503,7 @@ void CContactCache::updateStatusMsg(const char *szKey) res = M->GetTString(m_hContact, m_szProto, "XStatusMsg", &dbv);
if (res == 0) {
m_xStatusMsg = (lstrlen(dbv.ptszVal) > 0 ? mir_tstrdup(dbv.ptszVal) : 0);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
m_xStatus = M->GetByte(m_hContact, m_szProto, "XStatusId", 0);
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 5e96b41fa4..e5e98c9a44 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -178,7 +178,7 @@ struct TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, HANDL else if (!_tcsncmp(dbv.ptszVal, _T("**free**"), CONTAINER_NAMELEN))
iFirstFree = i;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
while (++i && iFound == FALSE);
@@ -995,7 +995,7 @@ panel_found: if (iSelection - IDM_CONTAINERMENU >= 0) {
if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
SendMessage((HWND)item.lParam, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
return 1;
@@ -1602,7 +1602,7 @@ panel_found: if (szThemeName != NULL) {
M->pathToAbsolute(szThemeName, pContainer->szAbsThemeFile);
mir_sntprintf(pContainer->szRelThemeFile, MAX_PATH, _T("%s"), szThemeName);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
pContainer->szAbsThemeFile[0] = pContainer->szRelThemeFile[0] = 0;
@@ -2364,7 +2364,7 @@ int TSAPI GetContainerNameForContact(HANDLE hContact, TCHAR *szName, int iNameLe dbv.ptszVal[CONTAINER_NAMELEN] = '\0';
_tcsncpy(szName, dbv.ptszVal, iNameLen);
szName[iNameLen] = '\0';
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return dbv.cchVal;
}
}
@@ -2375,10 +2375,10 @@ int TSAPI GetContainerNameForContact(HANDLE hContact, TCHAR *szName, int iNameLe if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) {
_tcsncpy(szName, dbv.ptszVal, iNameLen);
szName[iNameLen] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return dbv.cpbVal;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 0;
}
@@ -2405,7 +2405,7 @@ void TSAPI DeleteContainer(int iIndex) TCHAR *wszString = dbv_c.ptszVal;
if (_tcscmp(wszString, wszContainerName) && lstrlen(wszString) == lstrlen(wszContainerName))
db_unset(hhContact, SRMSGMOD_T, "containerW");
- DBFreeVariant(&dbv_c);
+ db_free(&dbv_c);
}
hhContact = db_find_next(hhContact);
}
@@ -2422,7 +2422,7 @@ void TSAPI DeleteContainer(int iIndex) _snprintf(szSetting, CONTAINER_NAMELEN + 15, "%s%dy", szSettingP, iIndex);
db_unset(NULL, SRMSGMOD_T, szSetting);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -2451,11 +2451,11 @@ void TSAPI RenameContainer(int iIndex, const TCHAR *szNew) M->WriteTString(hhContact, SRMSGMOD_T, szSubKey, szNew);
}
}
- DBFreeVariant(&dbv_c);
+ db_free(&dbv_c);
}
hhContact = db_find_next(hhContact);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -2490,7 +2490,7 @@ HMENU TSAPI BuildContainerMenu() AppendMenu(hMenu, MF_STRING, IDM_CONTAINERMENU + i, !_tcscmp(dbv.ptszVal, _T("default")) ?
TranslateT("Default container") : dbv.ptszVal);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
i++;
}
while (TRUE);
@@ -2535,7 +2535,7 @@ HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg) for (i=0; i < iNumProtos; i++) {
mir_snprintf(szTemp, sizeof(szTemp), "Protocol%d", i);
- if (DBGetContactSettingString(dat->hContact, PluginConfig.szMetaName, szTemp, &dbv))
+ if (db_get_s(dat->hContact, PluginConfig.szMetaName, szTemp, &dbv))
continue;
tzProtoName = dbv.pszVal;
@@ -2557,7 +2557,7 @@ HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg) AppendMenu(hMCSubForce, MF_STRING | iChecked, 100 + i, szMenuLine);
AppendMenu(hMCSubDefault, MF_STRING | (i == iDefaultProtoByNum ? MF_CHECKED : MF_UNCHECKED), 1000 + i, szMenuLine);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
AppendMenu(hMCSubForce, MF_SEPARATOR, 900, _T(""));
AppendMenu(hMCSubForce, MF_STRING | ((isForced == -1) ? MF_CHECKED : MF_UNCHECKED), 999, TranslateT("Autoselect"));
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp index d4be6530a2..eff180cab9 100644 --- a/plugins/TabSRMM/src/controls.cpp +++ b/plugins/TabSRMM/src/controls.cpp @@ -1138,7 +1138,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR tooltip_active = TRUE;
CallService(szTTService, (WPARAM)dbv.ptszVal, (LPARAM)&ti);
if (dbv.pszVal)
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index ee0bd16407..7173c598a9 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -393,7 +393,7 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa }
M->WriteByte("Chat", "PopupStyle", (BYTE)g_Settings.iPopupStyle);
- DBWriteContactSettingWord(NULL, "Chat", "PopupTimeout", g_Settings.iPopupTimeout);
+ db_set_w(NULL, "Chat", "PopupTimeout", g_Settings.iPopupTimeout);
g_Settings.crPUBkgColour = SendDlgItemMessage(hWnd, IDC_COLBACK_MUC, CPM_GETCOLOUR, 0, 0);
M->WriteDword("Chat", "PopupColorBG", (DWORD)g_Settings.crPUBkgColour);
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 5cad2d5e0b..402301a9ff 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -434,11 +434,11 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, switch(iSelection) {
case ID_FAVORITES_ADDCONTACTTOFAVORITES:
- DBWriteContactSettingByte(dat->hContact, SRMSGMOD_T, "isFavorite", 1);
+ db_set_b(dat->hContact, SRMSGMOD_T, "isFavorite", 1);
AddContactToFavorites(dat->hContact, dat->cache->getNick(), dat->cache->getActiveProto(), dat->szStatus, dat->wStatus, LoadSkinnedProtoIcon(dat->cache->getActiveProto(), dat->cache->getActiveStatus()), 1, PluginConfig.g_hMenuFavorites);
break;
case ID_FAVORITES_REMOVECONTACTFROMFAVORITES:
- DBWriteContactSettingByte(dat->hContact, SRMSGMOD_T, "isFavorite", 0);
+ db_set_b(dat->hContact, SRMSGMOD_T, "isFavorite", 0);
DeleteMenu(PluginConfig.g_hMenuFavorites, (UINT_PTR)dat->hContact, MF_BYCOMMAND);
break;
}
@@ -1021,9 +1021,9 @@ void TSAPI DM_SetDBButtonStates(HWND hwndChild, struct TWindowData *dat) if (buttonItem->type == DBVT_ASCIIZ) {
DBVARIANT dbv = {0};
- if (!DBGetContactSettingString(hFinalContact, szModule, szSetting, &dbv)) {
+ if (!db_get_s(hFinalContact, szModule, szSetting, &dbv)) {
result = !strcmp((char *)buttonItem->bValuePush, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
} else {
switch (buttonItem->type) {
@@ -1098,7 +1098,7 @@ static void LoadKLThread(LPVOID vParam) if (res == 0) {
HKL hkl = LoadKeyboardLayout(dbv.ptszVal, 0);
PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_SETLOCALE, (WPARAM)hContact, (LPARAM)hkl);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -1111,8 +1111,8 @@ void TSAPI DM_LoadLocale(TWindowData *dat) return;
DBVARIANT dbv;
- if ( !DBGetContactSettingTString(dat->hContact, SRMSGMOD_T, "locale", &dbv))
- DBFreeVariant(&dbv);
+ if ( !db_get_ts(dat->hContact, SRMSGMOD_T, "locale", &dbv))
+ db_free(&dbv);
else {
TCHAR szKLName[KL_NAMELENGTH+1];
if (!PluginConfig.m_dontUseDefaultKbd) {
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 2c13a771a2..7a3a1b0bde 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -471,7 +471,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP DBVARIANT dbv;
if (0 == M->GetTString(hContact, SRMSGMOD_T, "locale", &dbv)) {
GetLocaleID(dat, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
UpdateReadChars(dat);
}
}
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 771a8a3e53..5ec1268110 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -511,12 +511,12 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) }
else _tcscpy_s (szBuf, 256, tszUin);
- if(M->GetByte("ShowClientDescription",1)) {
+ if (M->GetByte("ShowClientDescription",1)) {
TCHAR temp[256];
DBVARIANT dbv = {0};
if ( !M->GetTString(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer", &dbv)) {
mir_sntprintf(temp, SIZEOF(temp), TranslateT(" Client: %s"), dbv.ptszVal);
- ::DBFreeVariant(&dbv);
+ ::db_free(&dbv);
}
else mir_sntprintf(temp, SIZEOF(temp), TranslateT(" Client not cached yet"));
_tcscat_s(szBuf, 256, temp);
@@ -957,7 +957,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam) if (0 == M->GetTString(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer", &dbv)) {
mir_sntprintf(temp, 1024, TranslateT("\\par\\par\\ul\\b Client:\\ul0\\b0 %s"), dbv.ptszVal);
- ::DBFreeVariant(&dbv);
+ ::db_free(&dbv);
str->append(temp);
}
str->append(_T("}"));
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index cc067fd278..cc3ee55392 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -82,7 +82,7 @@ void CMimAPI::timerMsg(const char *szMsg) DWORD CMimAPI::GetDword(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD uDefault = 0) const
{
- return((DWORD)DBGetContactSettingDword(hContact, szModule, szSetting, uDefault));
+ return((DWORD)db_get_dw(hContact, szModule, szSetting, uDefault));
}
/*
@@ -91,7 +91,7 @@ DWORD CMimAPI::GetDword(const HANDLE hContact = 0, const char *szModule = 0, con DWORD CMimAPI::GetDword(const char *szSetting = 0, DWORD uDefault = 0) const
{
- return((DWORD)DBGetContactSettingDword(0, SRMSGMOD_T, szSetting, uDefault));
+ return((DWORD)db_get_dw(0, SRMSGMOD_T, szSetting, uDefault));
}
/*
@@ -100,7 +100,7 @@ DWORD CMimAPI::GetDword(const char *szSetting = 0, DWORD uDefault = 0) const DWORD CMimAPI::GetDword(const HANDLE hContact = 0, const char *szSetting = 0, DWORD uDefault = 0) const
{
- return((DWORD)DBGetContactSettingDword(hContact, SRMSGMOD_T, szSetting, uDefault));
+ return((DWORD)db_get_dw(hContact, SRMSGMOD_T, szSetting, uDefault));
}
/*
@@ -109,7 +109,7 @@ DWORD CMimAPI::GetDword(const HANDLE hContact = 0, const char *szSetting = 0, DW DWORD CMimAPI::GetDword(const char *szModule, const char *szSetting, DWORD uDefault) const
{
- return((DWORD)DBGetContactSettingDword(0, szModule, szSetting, uDefault));
+ return((DWORD)db_get_dw(0, szModule, szSetting, uDefault));
}
/*
@@ -117,32 +117,32 @@ DWORD CMimAPI::GetDword(const char *szModule, const char *szSetting, DWORD uDefa */
int CMimAPI::GetByte(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, int uDefault = 0) const
{
- return(DBGetContactSettingByte(hContact, szModule, szSetting, uDefault));
+ return(db_get_b(hContact, szModule, szSetting, uDefault));
}
int CMimAPI::GetByte(const char *szSetting = 0, int uDefault = 0) const
{
- return(DBGetContactSettingByte(0, SRMSGMOD_T, szSetting, uDefault));
+ return(db_get_b(0, SRMSGMOD_T, szSetting, uDefault));
}
int CMimAPI::GetByte(const HANDLE hContact = 0, const char *szSetting = 0, int uDefault = 0) const
{
- return(DBGetContactSettingByte(hContact, SRMSGMOD_T, szSetting, uDefault));
+ return(db_get_b(hContact, SRMSGMOD_T, szSetting, uDefault));
}
int CMimAPI::GetByte(const char *szModule, const char *szSetting, int uDefault) const
{
- return(DBGetContactSettingByte(0, szModule, szSetting, uDefault));
+ return(db_get_b(0, szModule, szSetting, uDefault));
}
INT_PTR CMimAPI::GetTString(const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) const
{
- return(DBGetContactSettingTString(hContact, szModule, szSetting, dbv));
+ return(db_get_ts(hContact, szModule, szSetting, dbv));
}
INT_PTR CMimAPI::GetString(const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) const
{
- return(DBGetContactSettingString(hContact, szModule, szSetting, dbv));
+ return(db_get_s(hContact, szModule, szSetting, dbv));
}
/*
@@ -151,7 +151,7 @@ INT_PTR CMimAPI::GetString(const HANDLE hContact, const char *szModule, const ch INT_PTR CMimAPI::WriteDword(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD value = 0) const
{
- return(DBWriteContactSettingDword(hContact, szModule, szSetting, value));
+ return(db_set_dw(hContact, szModule, szSetting, value));
}
/*
@@ -160,22 +160,22 @@ INT_PTR CMimAPI::WriteDword(const HANDLE hContact = 0, const char *szModule = 0, INT_PTR CMimAPI::WriteDword(const char *szModule = 0, const char *szSetting = 0, DWORD value = 0) const
{
- return(DBWriteContactSettingDword(0, szModule, szSetting, value));
+ return(db_set_dw(0, szModule, szSetting, value));
}
INT_PTR CMimAPI::WriteByte(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, BYTE value = 0) const
{
- return(DBWriteContactSettingByte(hContact, szModule, szSetting, value));
+ return(db_set_b(hContact, szModule, szSetting, value));
}
INT_PTR CMimAPI::WriteByte(const char *szModule = 0, const char *szSetting = 0, BYTE value = 0) const
{
- return(DBWriteContactSettingByte(0, szModule, szSetting, value));
+ return(db_set_b(0, szModule, szSetting, value));
}
INT_PTR CMimAPI::WriteTString(const HANDLE hContact, const char *szModule = 0, const char *szSetting = 0, const TCHAR *str = 0) const
{
- return(DBWriteContactSettingTString(hContact, szModule, szSetting, str));
+ return(db_set_ts(hContact, szModule, szSetting, str));
}
/**
diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp index f3430b4f28..aade81051f 100644 --- a/plugins/TabSRMM/src/modplus.cpp +++ b/plugins/TabSRMM/src/modplus.cpp @@ -59,9 +59,9 @@ static char* getMirVer(HANDLE hContact) if ( !szProto )
return (NULL);
- if ( !DBGetContactSettingString(hContact, szProto, "MirVer", &dbv)) {
+ if ( !db_get_s(hContact, szProto, "MirVer", &dbv)) {
msg=mir_strdup(dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return (msg);
}
@@ -74,7 +74,7 @@ static TCHAR* getMenuEntry(int i) { mir_snprintf(MEntry, 255, "MenuEntry_%u", i);
if ( !M->GetTString(NULL, "tabmodplus",MEntry, &dbv)) {
msg = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return (msg);
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 10c5b6fbbb..eafbe66f2c 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -1504,12 +1504,12 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP */
if (dat->hContact) {
DBVARIANT dbv;
- if (!DBGetContactSettingString(dat->hContact, SRMSGMOD, "SavedMsg", &dbv)) {
+ if (!db_get_s(dat->hContact, SRMSGMOD, "SavedMsg", &dbv)) {
SETTEXTEX stx = {ST_DEFAULT, CP_UTF8};
if (dbv.type == DBVT_ASCIIZ && lstrlenA(dbv.pszVal) > 0)
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
SendQueue::UpdateSaveAndSendButton(dat);
if (m_pContainer->hwndActive == hwndDlg)
UpdateReadChars(dat);
@@ -2891,7 +2891,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (iSelection - IDM_CONTAINERMENU >= 0) {
if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -3655,10 +3655,10 @@ quote_from_last: if (!dat->fEditNotesActive) {
char *msg = Message_GetFromStream(GetDlgItem(hwndDlg, IDC_MESSAGE), dat, (CP_UTF8 << 16) | (SF_TEXT | SF_USECODEPAGE));
if (msg) {
- DBWriteContactSettingString(dat->hContact, SRMSGMOD, "SavedMsg", msg);
+ db_set_s(dat->hContact, SRMSGMOD, "SavedMsg", msg);
free(msg);
} else
- DBWriteContactSettingString(dat->hContact, SRMSGMOD, "SavedMsg", "");
+ db_set_s(dat->hContact, SRMSGMOD, "SavedMsg", "");
}
else
SendMessage(hwndDlg, WM_COMMAND, IDC_PIC, 0);
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index c6ba4665cf..3193b37a21 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -864,7 +864,7 @@ void TSAPI ShowPicture(TWindowData *dat, BOOL showNewPic) AdjustBottomAvatarDisplay(dat);
} else {
dat->showPic = dat->showPic ? 0 : 1;
- DBWriteContactSettingByte(dat->hContact, SRMSGMOD_T, "MOD_ShowPic", (BYTE)dat->showPic);
+ db_set_b(dat->hContact, SRMSGMOD_T, "MOD_ShowPic", (BYTE)dat->showPic);
}
GetWindowRect(GetDlgItem(hwndDlg, IDC_CONTACTPIC), &rc);
if (dat->minEditBoxSize.cy + DPISCALEY_S(3)> dat->splitterY)
@@ -2191,9 +2191,9 @@ void TSAPI GetClientIcon(TWindowData *dat) dat->hClientIcon = 0;
if (ServiceExists(MS_FP_GETCLIENTICON)) {
- if (!DBGetContactSettingString(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "MirVer", &dbv)) {
+ if (!db_get_s(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "MirVer", &dbv)) {
dat->hClientIcon = (HICON)CallService(MS_FP_GETCLIENTICON, (WPARAM)dbv.pszVal, 1);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index 4392e11dc6..419863cb75 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -200,7 +200,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox) }
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -421,7 +421,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP TVINSERTSTRUCT tvi = {0};
int i;
- DWORD dwFlags = DBGetContactSettingDword(NULL, SRMSGMOD_T, "mwflags", MWF_LOG_DEFAULT);
+ DWORD dwFlags = db_get_dw(NULL, SRMSGMOD_T, "mwflags", MWF_LOG_DEFAULT);
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
@@ -779,8 +779,8 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_TIME);
else
M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_UNREAD);
- DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_GETPOS, 0, 0));
- DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADTIME, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, SRMSGMOD, SRMSGSET_LOADTIME, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_GETPOS, 0, 0));
M->WriteDword(SRMSGMOD_T, "IndentAmount", (DWORD) GetDlgItemInt(hwndDlg, IDC_INDENTAMOUNT, &translated, FALSE));
M->WriteDword(SRMSGMOD_T, "RightIndent", (DWORD) GetDlgItemInt(hwndDlg, IDC_RIGHTINDENT, &translated, FALSE));
@@ -885,7 +885,7 @@ static void SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown) do {
hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) {
- DBWriteContactSettingByte(hContact, SRMSGMOD, SRMSGSET_TYPING, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0) ? 1 : 0));
+ db_set_b(hContact, SRMSGMOD, SRMSGSET_TYPING, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0) ? 1 : 0));
}
} while (hContact = db_find_next(hContact));
}
@@ -1120,7 +1120,7 @@ static INT_PTR CALLBACK DlgProcTabbedOptions(HWND hwndDlg, UINT msg, WPARAM wPar case PSN_APPLY: {
TVITEM item = {0};
M->WriteByte(SRMSGMOD_T, "cuttitle", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_CUT_TABTITLE));
- DBWriteContactSettingWord(NULL, SRMSGMOD_T, "cut_at", (WORD)SendDlgItemMessage(hwndDlg, IDC_CUT_TITLEMAXSPIN, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, SRMSGMOD_T, "cut_at", (WORD)SendDlgItemMessage(hwndDlg, IDC_CUT_TITLEMAXSPIN, UDM_GETPOS, 0, 0));
/*
* scan the tree view and obtain the options...
@@ -1441,7 +1441,7 @@ void OptCheckBox_Save(HWND hwnd, struct OptCheckBox *cb) M->WriteByte(cb->dbModule, cb->dbSetting, (BYTE)value);
break;
case DBVT_WORD:
- DBWriteContactSettingWord(NULL, cb->dbModule, cb->dbSetting, (WORD)value);
+ db_set_w(NULL, cb->dbModule, cb->dbSetting, (WORD)value);
break;
case DBVT_DWORD:
M->WriteDword(cb->dbModule, cb->dbSetting, (DWORD)value);
@@ -1590,8 +1590,8 @@ static INT_PTR CALLBACK DlgProcTabSrmmModernOptions(HWND hwndDlg, UINT msg, WPAR M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_TIME);
else
M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_UNREAD);
- DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_GETPOS, 0, 0));
- DBWriteContactSettingWord(NULL, SRMSGMOD, SRMSGSET_LOADTIME, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, SRMSGMOD, SRMSGSET_LOADTIME, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_GETPOS, 0, 0));
if (IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM))
M->WriteDword(SRMSGMOD_T, "maxhist", (DWORD)SendDlgItemMessage(hwndDlg, IDC_TRIMSPIN, UDM_GETPOS, 0, 0));
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp index eb6c66f1ad..6936dc4d1b 100644 --- a/plugins/TabSRMM/src/selectcontainer.cpp +++ b/plugins/TabSRMM/src/selectcontainer.cpp @@ -198,7 +198,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (iItemNew != LB_ERR)
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_SETITEMDATA, (WPARAM)iItemNew, (LPARAM)iCounter);
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
} while (++iCounter);
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 5b740bb503..596ce729d3 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -328,7 +328,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam) }
if (szSetting[0] == 'S') {
- if (0 == DBGetContactSettingString(hContact, "SendLater", szSetting, &dbv))
+ if (0 == db_get_s(hContact, "SendLater", szSetting, &dbv))
szOrig_Utf = dbv.pszVal;
else
return 0;
@@ -378,7 +378,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam) wcsncpy((wchar_t *)&job->pBuf[iLen + 1], szWchar, lstrlenW(szWchar));
if (szSetting[0] == 'S')
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_free(szWchar);
job->readFlags();
@@ -711,7 +711,7 @@ void CSendLater::qMgrSetupColumns() if (0 == M->GetString(0, SRMSGMOD_T, "qmgrListColumns", &dbv)) {
sscanf(dbv.pszVal, szColFormat, &nWidths[0], &nWidths[1], &nWidths[2], &nWidths[3], &nWidths[4]);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
sscanf(szColDefault, szColFormat, &nWidths[0], &nWidths[1], &nWidths[2], &nWidths[3], &nWidths[4]);
@@ -755,7 +755,7 @@ void CSendLater::qMgrSaveColumns() nWidths[i] = max(col.cx, 10);
}
mir_snprintf(szColFormatNew, 100, "%d;%d;%d;%d;%d", nWidths[0], nWidths[1], nWidths[2], nWidths[3], nWidths[4]);
- ::DBWriteContactSettingString(0, SRMSGMOD_T, "qmgrListColumns", szColFormatNew);
+ ::db_set_s(0, SRMSGMOD_T, "qmgrListColumns", szColFormatNew);
}
INT_PTR CALLBACK CSendLater::DlgProcStub(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index 530a53dc0b..fdfda626b7 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -174,7 +174,7 @@ static int SendChunkW(WCHAR *chunk, HANDLE hContact, char *szSvc, DWORD dwFlags) BYTE *pBuf = NULL;
int wLen = lstrlenW(chunk), id;
DWORD memRequired = (wLen + 1) * sizeof(WCHAR);
- DWORD codePage = DBGetContactSettingDword(hContact, SRMSGMOD_T, "ANSIcodepage", CP_ACP);
+ DWORD codePage = db_get_dw(hContact, SRMSGMOD_T, "ANSIcodepage", CP_ACP);
int mbcsSize = WideCharToMultiByte(codePage, 0, chunk, -1, (char *)pBuf, 0, 0, 0);
memRequired += mbcsSize;
@@ -942,7 +942,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HANDLE hContact, boo if (fIsSendLater) {
mir_snprintf(tszMsg, required, "%s%s", job->sendBuffer, utf_header);
- DBWriteContactSettingString(hContact ? hContact : job->hOwner, "SendLater", szKeyName, tszMsg);
+ db_set_s(hContact ? hContact : job->hOwner, "SendLater", szKeyName, tszMsg);
}
else {
mir_snprintf(tszMsg, required, "%s%s", utf_header, job->sendBuffer);
@@ -964,7 +964,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HANDLE hContact, boo mir_sntprintf(tszMsg, required, _T("%s%s"), tszHeader, wszMsg);
char *utf = mir_utf8encodeT(tszMsg);
if (fIsSendLater)
- DBWriteContactSettingString(hContact ? hContact : job->hOwner, "SendLater", szKeyName, utf);
+ db_set_s(hContact ? hContact : job->hOwner, "SendLater", szKeyName, utf);
else
sendLater->addJob(utf, (LPARAM)hContact);
mir_free(utf);
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 1cb01dccb5..215be250c6 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -91,7 +91,7 @@ static void LoadTemplatesFrom(TTemplateSet *tSet, HANDLE hContact, int rtl) continue;
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR)
mir_sntprintf(tSet->szTemplates[i], TEMPLATE_LENGTH, _T("%s"), dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp index 0a0d32197a..8165b5432d 100644 --- a/plugins/TabSRMM/src/themeio.cpp +++ b/plugins/TabSRMM/src/themeio.cpp @@ -194,9 +194,9 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, struct TWindowData *dat) for (i=0; i < fontBlocks[n].iCount; i++) {
sprintf(szTemp, "Font%d", firstIndex + i);
sprintf(szAppname, fontBlocks[n].szIniTemp, firstIndex + i);
- if (!DBGetContactSettingString(NULL, szModule, szTemp, &dbv)) {
+ if (!db_get_s(NULL, szModule, szTemp, &dbv)) {
WritePrivateProfileStringA(szAppname, "Face", dbv.pszVal, szIniFilename);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
sprintf(szTemp, "Font%dCol", firstIndex + i);
WritePrivateProfileStringA(szAppname, "Color", _itoa(M->GetDword(szModule, szTemp, 0), szBuf, 10), szIniFilename);
@@ -288,7 +288,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in if (GetPrivateProfileStringA(szAppname, "Face", "Verdana", szBuf, sizeof(szBuf), szIniFilename) != 0) {
if (i == MSGFONTID_SYMBOLS_IN || i == MSGFONTID_SYMBOLS_OUT)
lstrcpynA(szBuf, "Arial", sizeof(szBuf));
- DBWriteContactSettingString(NULL, szModule, szTemp, szBuf);
+ db_set_s(NULL, szModule, szTemp, szBuf);
}
sprintf(szTemp, "Font%dCol", firstIndex + i);
@@ -398,7 +398,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in if (strcmp(szTemplateBuffer, "[undef]")) {
if (dat == 0)
- DBWriteContactSettingStringUtf(NULL, TEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer);
+ db_set_utf(NULL, TEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer);
decoded = mir_utf8decodeW(szTemplateBuffer);
if (dat == 0)
mir_sntprintf(LTR_Active.szTemplates[i], TEMPLATE_LENGTH, L"%s", decoded);
@@ -411,7 +411,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in if (strcmp(szTemplateBuffer, "[undef]")) {
if (dat == 0)
- DBWriteContactSettingStringUtf(NULL, RTLTEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer);
+ db_set_utf(NULL, RTLTEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer);
decoded = mir_utf8decodeW(szTemplateBuffer);
if (dat == 0)
mir_sntprintf(RTL_Active.szTemplates[i], TEMPLATE_LENGTH, L"%s", decoded);
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 8d828a3910..09ed80222b 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -1050,7 +1050,7 @@ void CSkin::setFileName() if (0 == M->GetTString(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
M->pathToAbsolute(dbv.ptszVal, m_tszFileName, M->getSkinPath());
m_tszFileName[MAX_PATH - 1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
m_tszFileName[0] = 0;
@@ -1430,7 +1430,7 @@ void CSkin::Load(void) M->WriteDword(SRMSGMOD_T, _tagSettings[i].szSetting, data);
break;
case 2:
- DBWriteContactSettingWord(NULL, SRMSGMOD_T, _tagSettings[i].szSetting, (WORD)data);
+ db_set_w(NULL, SRMSGMOD_T, _tagSettings[i].szSetting, (WORD)data);
break;
case 5:
GetPrivateProfileString(_tagSettings[i].szIniKey, _tagSettings[i].szIniName, _T("000000"),
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 7248588213..d572cafc2a 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -409,7 +409,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat if (!M->GetTString(dat->hContact, (char *)dat->szProto, "XStatusName", &dbv)) {
_tcsncpy(szTemp, dbv.ptszVal, 500);
szTemp[500] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
title.insert(tempmark + 2, szTemp);
curpos = tempmark + lstrlen(szTemp);
}
@@ -431,7 +431,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat if (!M->GetTString(dat->hContact, (char *)dat->szProto, "XStatusName", &dbv)) {
_tcsncpy(szTemp, dbv.ptszVal, 500);
szTemp[500] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
title.insert(tempmark + 2, szTemp);
} else
szFinalStatus = xStatusDescr[xStatus - 1];
@@ -721,16 +721,16 @@ int Utils::ReadContainerSettingsFromDB(const HANDLE hContact, TContainerSettings CopyMemory(cs, &PluginConfig.globalContainerSettings, sizeof(TContainerSettings));
- if (0 == DBGetContactSetting(hContact, SRMSGMOD_T, szKey ? szKey : CNT_KEYNAME, &dbv)) {
+ if (0 == db_get(hContact, SRMSGMOD_T, szKey ? szKey : CNT_KEYNAME, &dbv)) {
if (dbv.type == DBVT_BLOB && dbv.cpbVal > 0 && dbv.cpbVal <= sizeof(TContainerSettings)) {
::CopyMemory((void*)cs, (void*)dbv.pbVal, dbv.cpbVal);
- ::DBFreeVariant(&dbv);
+ ::db_free(&dbv);
if (hContact == 0 && szKey == 0)
cs->fPrivate = false;
return 0;
}
cs->fPrivate = false;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 1;
}
else {
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp index f0a52cdc9a..8029b04782 100644 --- a/plugins/TipperYM/src/message_pump.cpp +++ b/plugins/TipperYM/src/message_pump.cpp @@ -58,7 +58,7 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex) if (opt.bWaitForStatusMsg && !bStatusMsgReady)
{
- DBDeleteContactSetting(clcitex->hItem, MODULE, "TempStatusMsg");
+ db_unset(clcitex->hItem, MODULE, "TempStatusMsg");
if (CanRetrieveStatusMsg(clcitex->hItem, szProto) &&
CallContactService(clcitex->hItem, PSS_GETAWAYMSG, 0, 0))
{
@@ -74,7 +74,7 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex) CallProtoService(szProto, PS_GETAVATARCAPS, AF_ENABLED, 0))
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(clcitex->hItem, "ContactPhoto", "File", &dbv))
+ if (!db_get_s(clcitex->hItem, "ContactPhoto", "File", &dbv))
{
if (!strstr(dbv.pszVal, ".xml"))
{
@@ -93,7 +93,7 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex) else
bAvatarReady = true;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
bAvatarReady = true;
@@ -176,7 +176,7 @@ unsigned int CALLBACK MessagePumpThread(void *param) if (swzMsg)
{
- DBWriteContactSettingTString(clcitex->hItem, MODULE, "TempStatusMsg", swzMsg);
+ db_set_ts(clcitex->hItem, MODULE, "TempStatusMsg", swzMsg);
mir_free(swzMsg);
}
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index ed38a434ca..383770067c 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -36,10 +36,10 @@ extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip) DBVARIANT dbv;
int result = 1;
- if (!DBGetContactSettingTString(NULL, MODULE, szSetting, &dbv))
+ if (!db_get_ts(NULL, MODULE, szSetting, &dbv))
{
result = _tcsstr(dbv.ptszVal, swzProto) ? 1 : 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return result;
@@ -106,43 +106,43 @@ bool LoadDS(DISPLAYSUBST *ds, int index) mir_snprintf(setting, SIZEOF(setting), "Name%d", index);
ds->swzName[0] = 0;
- if (!DBGetContactSettingTString(0, MODULE_ITEMS, setting, &dbv))
+ if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv))
{
_tcsncpy(ds->swzName, dbv.ptszVal, SIZEOF(ds->swzName));
ds->swzName[SIZEOF(ds->swzName) - 1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else
return false;
mir_snprintf(setting, SIZEOF(setting), "Type%d", index);
- ds->type = (DisplaySubstType)DBGetContactSettingByte(0, MODULE_ITEMS, setting, DVT_PROTODB);
+ ds->type = (DisplaySubstType)db_get_b(0, MODULE_ITEMS, setting, DVT_PROTODB);
mir_snprintf(setting, SIZEOF(setting), "Module%d", index);
ds->szModuleName[0] = 0;
- if (!DBGetContactSetting(0, MODULE_ITEMS, setting, &dbv))
+ if (!db_get(0, MODULE_ITEMS, setting, &dbv))
{
strncpy(ds->szModuleName, dbv.pszVal, MODULE_NAME_LEN);
ds->szModuleName[MODULE_NAME_LEN - 1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
mir_snprintf(setting, SIZEOF(setting), "Setting%d", index);
ds->szSettingName[0] = 0;
- if (!DBGetContactSetting(0, MODULE_ITEMS, setting, &dbv))
+ if (!db_get(0, MODULE_ITEMS, setting, &dbv))
{
strncpy(ds->szSettingName, dbv.pszVal, SETTING_NAME_LEN);
ds->szSettingName[SETTING_NAME_LEN - 1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
mir_snprintf(setting, SIZEOF(setting), "TransFuncId%d", index);
- ds->iTranslateFuncId = DBGetContactSettingDword(0, MODULE_ITEMS, setting, (DWORD)-1);
+ ds->iTranslateFuncId = db_get_dw(0, MODULE_ITEMS, setting, (DWORD)-1);
// a little backward compatibility
if ((DWORD)ds->iTranslateFuncId == (DWORD)-1)
{
mir_snprintf(setting, SIZEOF(setting), "TransFunc%d", index);
- ds->iTranslateFuncId = (DWORD)DBGetContactSettingWord(0, MODULE_ITEMS, setting, 0);
+ ds->iTranslateFuncId = (DWORD)db_get_w(0, MODULE_ITEMS, setting, 0);
}
return true;
@@ -154,15 +154,15 @@ void SaveDS(DISPLAYSUBST *ds, int index) char setting[512];
mir_snprintf(setting, SIZEOF(setting), "Name%d", index);
- DBWriteContactSettingTString(0, MODULE_ITEMS, setting, ds->swzName);
+ db_set_ts(0, MODULE_ITEMS, setting, ds->swzName);
mir_snprintf(setting, SIZEOF(setting), "Type%d", index);
- DBWriteContactSettingByte(0, MODULE_ITEMS, setting, (BYTE)ds->type);
+ db_set_b(0, MODULE_ITEMS, setting, (BYTE)ds->type);
mir_snprintf(setting, SIZEOF(setting), "Module%d", index);
- DBWriteContactSettingString(0, MODULE_ITEMS, setting, ds->szModuleName);
+ db_set_s(0, MODULE_ITEMS, setting, ds->szModuleName);
mir_snprintf(setting, SIZEOF(setting), "Setting%d", index);
- DBWriteContactSettingString(0, MODULE_ITEMS, setting, ds->szSettingName);
+ db_set_s(0, MODULE_ITEMS, setting, ds->szSettingName);
mir_snprintf(setting, SIZEOF(setting), "TransFuncId%d", index);
- DBWriteContactSettingDword(0, MODULE_ITEMS, setting, (WORD)ds->iTranslateFuncId);
+ db_set_dw(0, MODULE_ITEMS, setting, (WORD)ds->iTranslateFuncId);
}
@@ -173,31 +173,31 @@ bool LoadDI(DISPLAYITEM *di, int index) mir_snprintf(setting, SIZEOF(setting), "DILabel%d", index);
di->swzLabel[0] = 0;
- if (!DBGetContactSettingTString(0, MODULE_ITEMS, setting, &dbv))
+ if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv))
{
_tcsncpy( di->swzLabel, dbv.ptszVal, SIZEOF(di->swzLabel));
di->swzLabel[SIZEOF(di->swzLabel) - 1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else
return false;
mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index);
di->swzValue[0] = 0;
- if (!DBGetContactSettingTString(0, MODULE_ITEMS, setting, &dbv))
+ if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv))
{
_tcsncpy(di->swzValue, dbv.ptszVal, SIZEOF(di->swzValue));
di->swzValue[SIZEOF(di->swzValue) - 1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
mir_snprintf(setting, SIZEOF(setting), "DILineAbove%d", index);
- di->bLineAbove = (DBGetContactSettingByte(0, MODULE_ITEMS, setting, 0) == 1);
+ di->bLineAbove = (db_get_b(0, MODULE_ITEMS, setting, 0) == 1);
mir_snprintf(setting, SIZEOF(setting), "DIValNewline%d", index);
- di->bValueNewline = (DBGetContactSettingByte(0, MODULE_ITEMS, setting, 0) == 1);
+ di->bValueNewline = (db_get_b(0, MODULE_ITEMS, setting, 0) == 1);
mir_snprintf(setting, SIZEOF(setting), "DIVisible%d", index);
- di->bIsVisible = (DBGetContactSettingByte(0, MODULE_ITEMS, setting, 1) == 1);
+ di->bIsVisible = (db_get_b(0, MODULE_ITEMS, setting, 1) == 1);
mir_snprintf(setting, SIZEOF(setting), "DITipperVarsFirst%d", index);
- di->bParseTipperVarsFirst = (DBGetContactSettingByte(0, MODULE_ITEMS, setting, 0) == 1);
+ di->bParseTipperVarsFirst = (db_get_b(0, MODULE_ITEMS, setting, 0) == 1);
return true;
}
@@ -208,70 +208,70 @@ void SaveDI(DISPLAYITEM *di, int index) char setting[512];
mir_snprintf(setting, SIZEOF(setting), "DILabel%d", index);
- if (DBWriteContactSettingTString(0, MODULE_ITEMS, setting, di->swzLabel))
+ if (db_set_ts(0, MODULE_ITEMS, setting, di->swzLabel))
{
char buff[LABEL_LEN];
t2a(di->swzLabel, buff, LABEL_LEN);
- DBWriteContactSettingString(0, MODULE_ITEMS, setting, buff);
+ db_set_s(0, MODULE_ITEMS, setting, buff);
}
mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index);
- if (DBWriteContactSettingTString(0, MODULE_ITEMS, setting, di->swzValue))
+ if (db_set_ts(0, MODULE_ITEMS, setting, di->swzValue))
{
char buff[VALUE_LEN];
t2a(di->swzValue, buff, VALUE_LEN);
- DBWriteContactSettingString(0, MODULE_ITEMS, setting, buff);
+ db_set_s(0, MODULE_ITEMS, setting, buff);
}
mir_snprintf(setting, SIZEOF(setting), "DILineAbove%d", index);
- DBWriteContactSettingByte(0, MODULE_ITEMS, setting, di->bLineAbove ? 1 : 0);
+ db_set_b(0, MODULE_ITEMS, setting, di->bLineAbove ? 1 : 0);
mir_snprintf(setting, SIZEOF(setting), "DIValNewline%d", index);
- DBWriteContactSettingByte(0, MODULE_ITEMS, setting, di->bValueNewline ? 1 : 0);
+ db_set_b(0, MODULE_ITEMS, setting, di->bValueNewline ? 1 : 0);
mir_snprintf(setting, SIZEOF(setting), "DIVisible%d", index);
- DBWriteContactSettingByte(0, MODULE_ITEMS, setting, di->bIsVisible ? 1 : 0);
+ db_set_b(0, MODULE_ITEMS, setting, di->bIsVisible ? 1 : 0);
mir_snprintf(setting, SIZEOF(setting), "DITipperVarsFirst%d", index);
- DBWriteContactSettingByte(0, MODULE_ITEMS, setting, di->bParseTipperVarsFirst ? 1 : 0);
+ db_set_b(0, MODULE_ITEMS, setting, di->bParseTipperVarsFirst ? 1 : 0);
}
void SaveOptions()
{
- DBWriteContactSettingDword(0, MODULE, "MaxWidth", opt.iWinWidth);
- DBWriteContactSettingDword(0, MODULE, "MaxHeight", opt.iWinMaxHeight);
- DBWriteContactSettingByte(0, MODULE, "AvatarOpacity", (BYTE)opt.iAvatarOpacity);
- DBWriteContactSettingByte(0, MODULE, "AvatarRoundCorners", (opt.bAvatarRound ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "TitleLayout", (BYTE)opt.titleLayout);
+ db_set_dw(0, MODULE, "MaxWidth", opt.iWinWidth);
+ db_set_dw(0, MODULE, "MaxHeight", opt.iWinMaxHeight);
+ db_set_b(0, MODULE, "AvatarOpacity", (BYTE)opt.iAvatarOpacity);
+ db_set_b(0, MODULE, "AvatarRoundCorners", (opt.bAvatarRound ? 1 : 0));
+ db_set_b(0, MODULE, "TitleLayout", (BYTE)opt.titleLayout);
if (ServiceExists(MS_AV_DRAWAVATAR))
- DBWriteContactSettingByte(0, MODULE, "AVLayout", (BYTE)opt.avatarLayout);
+ db_set_b(0, MODULE, "AVLayout", (BYTE)opt.avatarLayout);
opt.bWaitForAvatar = (opt.avatarLayout == PAV_NONE) ? false : true;
- DBWriteContactSettingDword(0, MODULE, "AVSize", opt.iAvatarSize);
- DBWriteContactSettingDword(0, MODULE, "TextIndent", opt.iTextIndent);
- DBWriteContactSettingDword(0, MODULE, "TitleIndent", opt.iTitleIndent);
- DBWriteContactSettingDword(0, MODULE, "ValueIndent", opt.iValueIndent);
- DBWriteContactSettingByte(0, MODULE, "ShowNoFocus", (opt.bShowNoFocus ? 1 : 0));
+ db_set_dw(0, MODULE, "AVSize", opt.iAvatarSize);
+ db_set_dw(0, MODULE, "TextIndent", opt.iTextIndent);
+ db_set_dw(0, MODULE, "TitleIndent", opt.iTitleIndent);
+ db_set_dw(0, MODULE, "ValueIndent", opt.iValueIndent);
+ db_set_b(0, MODULE, "ShowNoFocus", (opt.bShowNoFocus ? 1 : 0));
- DBWriteContactSettingWord(0, MODULE, "TimeIn", opt.iTimeIn);
+ db_set_w(0, MODULE, "TimeIn", opt.iTimeIn);
CallService(MS_CLC_SETINFOTIPHOVERTIME, opt.iTimeIn, 0);
- DBWriteContactSettingWord(0, MODULE, "Padding", opt.iPadding);
- DBWriteContactSettingWord(0, MODULE, "OuterAvatarPadding", opt.iOuterAvatarPadding);
- DBWriteContactSettingWord(0, MODULE, "InnerAvatarPadding", opt.iInnerAvatarPadding);
- DBWriteContactSettingWord(0, MODULE, "TextPadding", opt.iTextPadding);
- DBWriteContactSettingByte(0, MODULE, "Position", (BYTE)opt.pos);
- DBWriteContactSettingDword(0, MODULE, "MinWidth", (DWORD)opt.iMinWidth);
- DBWriteContactSettingDword(0, MODULE, "MinHeight", (DWORD)opt.iMinHeight);
- DBWriteContactSettingDword(0, MODULE, "SidebarWidth", (DWORD)opt.iSidebarWidth);
- DBWriteContactSettingByte(0, MODULE, "MouseTollerance", (BYTE)opt.iMouseTollerance);
- DBWriteContactSettingByte(0, MODULE, "SBarTips", (opt.bStatusBarTips ? 1 : 0));
-
- DBWriteContactSettingWord(0, MODULE, "LabelVAlign", opt.iLabelValign);
- DBWriteContactSettingWord(0, MODULE, "LabelHAlign", opt.iLabelHalign);
- DBWriteContactSettingWord(0, MODULE, "ValueVAlign", opt.iValueValign);
- DBWriteContactSettingWord(0, MODULE, "ValueHAlign", opt.iValueHalign);
-
- DBWriteContactSettingByte(0, MODULE, "OriginalAvSize", (opt.bOriginalAvatarSize ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "AvatarBorder", (opt.bAvatarBorder ? 1 : 0));
+ db_set_w(0, MODULE, "Padding", opt.iPadding);
+ db_set_w(0, MODULE, "OuterAvatarPadding", opt.iOuterAvatarPadding);
+ db_set_w(0, MODULE, "InnerAvatarPadding", opt.iInnerAvatarPadding);
+ db_set_w(0, MODULE, "TextPadding", opt.iTextPadding);
+ db_set_b(0, MODULE, "Position", (BYTE)opt.pos);
+ db_set_dw(0, MODULE, "MinWidth", (DWORD)opt.iMinWidth);
+ db_set_dw(0, MODULE, "MinHeight", (DWORD)opt.iMinHeight);
+ db_set_dw(0, MODULE, "SidebarWidth", (DWORD)opt.iSidebarWidth);
+ db_set_b(0, MODULE, "MouseTollerance", (BYTE)opt.iMouseTollerance);
+ db_set_b(0, MODULE, "SBarTips", (opt.bStatusBarTips ? 1 : 0));
+
+ db_set_w(0, MODULE, "LabelVAlign", opt.iLabelValign);
+ db_set_w(0, MODULE, "LabelHAlign", opt.iLabelHalign);
+ db_set_w(0, MODULE, "ValueVAlign", opt.iValueValign);
+ db_set_w(0, MODULE, "ValueHAlign", opt.iValueHalign);
+
+ db_set_b(0, MODULE, "OriginalAvSize", (opt.bOriginalAvatarSize ? 1 : 0));
+ db_set_b(0, MODULE, "AvatarBorder", (opt.bAvatarBorder ? 1 : 0));
}
void SaveItems()
@@ -285,7 +285,7 @@ void SaveItems() index++;
}
- DBWriteContactSettingWord(0, MODULE_ITEMS, "DSNumValues", index);
+ db_set_w(0, MODULE_ITEMS, "DSNumValues", index);
index = 0;
DIListNode *di_node = opt.diList;
@@ -299,21 +299,21 @@ void SaveItems() index++;
}
- DBWriteContactSettingWord(0, MODULE_ITEMS, "DINumValues", index);
+ db_set_w(0, MODULE_ITEMS, "DINumValues", index);
}
void SaveSkinOptions()
{
- DBWriteContactSettingByte(0, MODULE, "Border", (opt.bBorder ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "DropShadow", (opt.bDropShadow ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "RoundCorners", (opt.bRound ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "AeroGlass", (opt.bAeroGlass ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "Opacity", (BYTE)opt.iOpacity);
- DBWriteContactSettingByte(0, MODULE, "ShowEffect", (BYTE)opt.showEffect);
- DBWriteContactSettingByte(0, MODULE, "ShowEffectSpeed", (BYTE)opt.iAnimateSpeed);
- DBWriteContactSettingByte(0, MODULE, "LoadFonts", (opt.bLoadFonts ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "LoadProportions", (opt.bLoadProportions ? 1 : 0));
- DBWriteContactSettingDword(0, MODULE, "EnableColoring", opt.iEnableColoring);
+ db_set_b(0, MODULE, "Border", (opt.bBorder ? 1 : 0));
+ db_set_b(0, MODULE, "DropShadow", (opt.bDropShadow ? 1 : 0));
+ db_set_b(0, MODULE, "RoundCorners", (opt.bRound ? 1 : 0));
+ db_set_b(0, MODULE, "AeroGlass", (opt.bAeroGlass ? 1 : 0));
+ db_set_b(0, MODULE, "Opacity", (BYTE)opt.iOpacity);
+ db_set_b(0, MODULE, "ShowEffect", (BYTE)opt.showEffect);
+ db_set_b(0, MODULE, "ShowEffectSpeed", (BYTE)opt.iAnimateSpeed);
+ db_set_b(0, MODULE, "LoadFonts", (opt.bLoadFonts ? 1 : 0));
+ db_set_b(0, MODULE, "LoadProportions", (opt.bLoadProportions ? 1 : 0));
+ db_set_dw(0, MODULE, "EnableColoring", opt.iEnableColoring);
}
void LoadObsoleteSkinSetting()
@@ -324,16 +324,16 @@ void LoadObsoleteSkinSetting() for (int i = 0; i < SKIN_ITEMS_COUNT; i++)
{
mir_snprintf(setting, 128, "SPaintMode%d", i);
- opt.transfMode[i] = (TransformationMode)DBGetContactSettingByte(0, MODULE, setting, 0);
+ opt.transfMode[i] = (TransformationMode)db_get_b(0, MODULE, setting, 0);
mir_snprintf(setting, 128, "SImgFile%d", i);
- if (!DBGetContactSettingTString(NULL, MODULE, setting, &dbv))
+ if (!db_get_ts(NULL, MODULE, setting, &dbv))
{
opt.szImgFile[i] = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
mir_snprintf(setting, 128, "SGlyphMargins%d", i);
- DWORD margins = DBGetContactSettingDword(NULL, MODULE, setting, 0);
+ DWORD margins = db_get_dw(NULL, MODULE, setting, 0);
opt.margins[i].top = LOBYTE(LOWORD(margins));
opt.margins[i].right = HIBYTE(LOWORD(margins));
opt.margins[i].bottom = LOBYTE(HIWORD(margins));
@@ -343,30 +343,30 @@ void LoadObsoleteSkinSetting() void LoadOptions()
{
- opt.iWinWidth = DBGetContactSettingDword(0, MODULE, "MaxWidth", 420);
- opt.iWinMaxHeight = DBGetContactSettingDword(0, MODULE, "MaxHeight", 400);
- opt.iAvatarOpacity = DBGetContactSettingByte(0, MODULE, "AvatarOpacity", 100);
+ opt.iWinWidth = db_get_dw(0, MODULE, "MaxWidth", 420);
+ opt.iWinMaxHeight = db_get_dw(0, MODULE, "MaxHeight", 400);
+ opt.iAvatarOpacity = db_get_b(0, MODULE, "AvatarOpacity", 100);
if (opt.iAvatarOpacity > 100) opt.iAvatarOpacity = 100;
- opt.bAvatarRound = (DBGetContactSettingByte(0, MODULE, "AvatarRoundCorners", opt.bRound ? 1 : 0) == 1);
- opt.titleLayout = (PopupTitleLayout)DBGetContactSettingByte(0, MODULE, "TitleLayout", (BYTE)PTL_LEFTICON);
+ opt.bAvatarRound = (db_get_b(0, MODULE, "AvatarRoundCorners", opt.bRound ? 1 : 0) == 1);
+ opt.titleLayout = (PopupTitleLayout)db_get_b(0, MODULE, "TitleLayout", (BYTE)PTL_LEFTICON);
if (ServiceExists(MS_AV_DRAWAVATAR))
- opt.avatarLayout = (PopupAvLayout)DBGetContactSettingByte(0, MODULE, "AVLayout", PAV_RIGHT);
+ opt.avatarLayout = (PopupAvLayout)db_get_b(0, MODULE, "AVLayout", PAV_RIGHT);
else
opt.avatarLayout = PAV_NONE;
opt.bWaitForAvatar = (opt.avatarLayout == PAV_NONE) ? false : true;
- opt.iAvatarSize = DBGetContactSettingDword(0, MODULE, "AVSize", 60); //tweety
- opt.iTextIndent = DBGetContactSettingDword(0, MODULE, "TextIndent", 22);
- opt.iTitleIndent = DBGetContactSettingDword(0, MODULE, "TitleIndent", 22);
- opt.iValueIndent = DBGetContactSettingDword(0, MODULE, "ValueIndent", 10);
- opt.iSidebarWidth = DBGetContactSettingDword(0, MODULE, "SidebarWidth", 22);
- opt.bShowNoFocus = (DBGetContactSettingByte(0, MODULE, "ShowNoFocus", 1) == 1);
+ opt.iAvatarSize = db_get_dw(0, MODULE, "AVSize", 60); //tweety
+ opt.iTextIndent = db_get_dw(0, MODULE, "TextIndent", 22);
+ opt.iTitleIndent = db_get_dw(0, MODULE, "TitleIndent", 22);
+ opt.iValueIndent = db_get_dw(0, MODULE, "ValueIndent", 10);
+ opt.iSidebarWidth = db_get_dw(0, MODULE, "SidebarWidth", 22);
+ opt.bShowNoFocus = (db_get_b(0, MODULE, "ShowNoFocus", 1) == 1);
int i, real_count = 0;
opt.dsList = 0;
DSListNode *ds_node;
- opt.iDsCount = DBGetContactSettingWord(0, MODULE_ITEMS, "DSNumValues", 0);
+ opt.iDsCount = db_get_w(0, MODULE_ITEMS, "DSNumValues", 0);
for (i = opt.iDsCount - 1; i >= 0; i--)
{
ds_node = (DSListNode *)mir_alloc(sizeof(DSListNode));
@@ -388,7 +388,7 @@ void LoadOptions() DIListNode *di_node;
opt.bWaitForStatusMsg = false;
- opt.iDiCount = DBGetContactSettingWord(0, MODULE_ITEMS, "DINumValues", 0);
+ opt.iDiCount = db_get_w(0, MODULE_ITEMS, "DINumValues", 0);
for (i = opt.iDiCount - 1; i >= 0; i--)
{
di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
@@ -407,22 +407,22 @@ void LoadOptions() }
opt.iDiCount = real_count;
- opt.iTimeIn = DBGetContactSettingWord(0, MODULE, "TimeIn", 750);
- opt.iPadding = DBGetContactSettingWord(0, MODULE, "Padding", 4);
- opt.iOuterAvatarPadding = DBGetContactSettingWord(0, MODULE, "OuterAvatarPadding", 6);
- opt.iInnerAvatarPadding = DBGetContactSettingWord(0, MODULE, "InnerAvatarPadding", 10);
- opt.iTextPadding = DBGetContactSettingWord(0, MODULE, "TextPadding", 4);
- opt.pos = (PopupPosition)DBGetContactSettingByte(0, MODULE, "Position", (BYTE)PP_BOTTOMRIGHT);
- opt.iMinWidth = DBGetContactSettingDword(0, MODULE, "MinWidth", 0);
- opt.iMinHeight = DBGetContactSettingDword(0, MODULE, "MinHeight", 0);
+ opt.iTimeIn = db_get_w(0, MODULE, "TimeIn", 750);
+ opt.iPadding = db_get_w(0, MODULE, "Padding", 4);
+ opt.iOuterAvatarPadding = db_get_w(0, MODULE, "OuterAvatarPadding", 6);
+ opt.iInnerAvatarPadding = db_get_w(0, MODULE, "InnerAvatarPadding", 10);
+ opt.iTextPadding = db_get_w(0, MODULE, "TextPadding", 4);
+ opt.pos = (PopupPosition)db_get_b(0, MODULE, "Position", (BYTE)PP_BOTTOMRIGHT);
+ opt.iMinWidth = db_get_dw(0, MODULE, "MinWidth", 0);
+ opt.iMinHeight = db_get_dw(0, MODULE, "MinHeight", 0);
- opt.iMouseTollerance = DBGetContactSettingByte(0, MODULE, "MouseTollerance", (BYTE)GetSystemMetrics(SM_CXSMICON));
- opt.bStatusBarTips = (DBGetContactSettingByte(0, MODULE, "SBarTips", 1) == 1);
+ opt.iMouseTollerance = db_get_b(0, MODULE, "MouseTollerance", (BYTE)GetSystemMetrics(SM_CXSMICON));
+ opt.bStatusBarTips = (db_get_b(0, MODULE, "SBarTips", 1) == 1);
// convert defunct last message and status message options to new 'sys' items, and remove the old settings
- if (DBGetContactSettingByte(0, MODULE, "ShowLastMessage", 0))
+ if (db_get_b(0, MODULE, "ShowLastMessage", 0))
{
- DBDeleteContactSetting(0, MODULE, "ShowLastMessage");
+ db_unset(0, MODULE, "ShowLastMessage");
// find end of list
di_node = opt.diList;
@@ -448,9 +448,9 @@ void LoadOptions() opt.iDiCount++;
}
- if (DBGetContactSettingByte(0, MODULE, "ShowStatusMessage", 0))
+ if (db_get_b(0, MODULE, "ShowStatusMessage", 0))
{
- DBDeleteContactSetting(0, MODULE, "ShowStatusMessage");
+ db_unset(0, MODULE, "ShowStatusMessage");
// find end of list
di_node = opt.diList;
@@ -476,31 +476,31 @@ void LoadOptions() opt.iDiCount++;
}
- opt.iLabelValign = DBGetContactSettingWord(0, MODULE, "LabelVAlign", DT_TOP /*DT_VCENTER*/);
- opt.iLabelHalign = DBGetContactSettingWord(0, MODULE, "LabelHAlign", DT_LEFT);
- opt.iValueValign = DBGetContactSettingWord(0, MODULE, "ValueVAlign", DT_TOP /*DT_VCENTER*/);
- opt.iValueHalign = DBGetContactSettingWord(0, MODULE, "ValueHAlign", DT_LEFT);
+ opt.iLabelValign = db_get_w(0, MODULE, "LabelVAlign", DT_TOP /*DT_VCENTER*/);
+ opt.iLabelHalign = db_get_w(0, MODULE, "LabelHAlign", DT_LEFT);
+ opt.iValueValign = db_get_w(0, MODULE, "ValueVAlign", DT_TOP /*DT_VCENTER*/);
+ opt.iValueHalign = db_get_w(0, MODULE, "ValueHAlign", DT_LEFT);
// tray tooltip
- opt.bTraytip = DBGetContactSettingByte(0, MODULE, "TrayTip", 1) ? true : false;
- opt.bHandleByTipper = DBGetContactSettingByte(0, MODULE, "ExtendedTrayTip", 1) ? true : false;
- opt.bExpandTraytip = DBGetContactSettingByte(0, MODULE, "ExpandTrayTip", 1) ? true : false;
- opt.bHideOffline = DBGetContactSettingByte(0, MODULE, "HideOffline", 0) ? true : false;
- opt.iExpandTime = DBGetContactSettingDword(0, MODULE, "ExpandTime", 1000);
- opt.iFirstItems = DBGetContactSettingDword(0, MODULE, "TrayTipItems", TRAYTIP_NUMCONTACTS | TRAYTIP_LOGON | TRAYTIP_STATUS | TRAYTIP_CLIST_EVENT);
- opt.iSecondItems = DBGetContactSettingDword(0, MODULE, "TrayTipItemsEx", TRAYTIP_NUMCONTACTS | TRAYTIP_LOGON | TRAYTIP_STATUS | TRAYTIP_STATUS_MSG | TRAYTIP_EXTRA_STATUS | TRAYTIP_MIRANDA_UPTIME | TRAYTIP_CLIST_EVENT);
- opt.iFavoriteContFlags = DBGetContactSettingDword(0, MODULE, "FavContFlags", FAVCONT_APPEND_PROTO);
+ opt.bTraytip = db_get_b(0, MODULE, "TrayTip", 1) ? true : false;
+ opt.bHandleByTipper = db_get_b(0, MODULE, "ExtendedTrayTip", 1) ? true : false;
+ opt.bExpandTraytip = db_get_b(0, MODULE, "ExpandTrayTip", 1) ? true : false;
+ opt.bHideOffline = db_get_b(0, MODULE, "HideOffline", 0) ? true : false;
+ opt.iExpandTime = db_get_dw(0, MODULE, "ExpandTime", 1000);
+ opt.iFirstItems = db_get_dw(0, MODULE, "TrayTipItems", TRAYTIP_NUMCONTACTS | TRAYTIP_LOGON | TRAYTIP_STATUS | TRAYTIP_CLIST_EVENT);
+ opt.iSecondItems = db_get_dw(0, MODULE, "TrayTipItemsEx", TRAYTIP_NUMCONTACTS | TRAYTIP_LOGON | TRAYTIP_STATUS | TRAYTIP_STATUS_MSG | TRAYTIP_EXTRA_STATUS | TRAYTIP_MIRANDA_UPTIME | TRAYTIP_CLIST_EVENT);
+ opt.iFavoriteContFlags = db_get_dw(0, MODULE, "FavContFlags", FAVCONT_APPEND_PROTO);
// extra setting
- opt.bWaitForContent= DBGetContactSettingByte(0, MODULE, "WaitForContent", 0) ? true : false;
- opt.bGetNewStatusMsg = DBGetContactSettingByte(0, MODULE, "GetNewStatusMsg", 0) ? true : false;
- opt.bDisableIfInvisible = DBGetContactSettingByte(0, MODULE, "DisableInvisible", 1) ? true : false;
- opt.bRetrieveXstatus = DBGetContactSettingByte(0, MODULE, "RetrieveXStatus", 0) ? true : false;
- opt.bOriginalAvatarSize = DBGetContactSettingByte(0, MODULE, "OriginalAvSize", 0) ? true : false;
- opt.bAvatarBorder = DBGetContactSettingByte(0, MODULE, "AvatarBorder", 0) ? true : false;
- opt.bLimitMsg = DBGetContactSettingByte(0, MODULE, "LimitMsg", 0) ? true : false;
- opt.iLimitCharCount = DBGetContactSettingByte(0, MODULE, "LimitCharCount", 64);
- opt.iSmileyAddFlags = DBGetContactSettingDword(0, MODULE, "SmileyAddFlags", SMILEYADD_ENABLE);
+ opt.bWaitForContent= db_get_b(0, MODULE, "WaitForContent", 0) ? true : false;
+ opt.bGetNewStatusMsg = db_get_b(0, MODULE, "GetNewStatusMsg", 0) ? true : false;
+ opt.bDisableIfInvisible = db_get_b(0, MODULE, "DisableInvisible", 1) ? true : false;
+ opt.bRetrieveXstatus = db_get_b(0, MODULE, "RetrieveXStatus", 0) ? true : false;
+ opt.bOriginalAvatarSize = db_get_b(0, MODULE, "OriginalAvSize", 0) ? true : false;
+ opt.bAvatarBorder = db_get_b(0, MODULE, "AvatarBorder", 0) ? true : false;
+ opt.bLimitMsg = db_get_b(0, MODULE, "LimitMsg", 0) ? true : false;
+ opt.iLimitCharCount = db_get_b(0, MODULE, "LimitCharCount", 64);
+ opt.iSmileyAddFlags = db_get_dw(0, MODULE, "SmileyAddFlags", SMILEYADD_ENABLE);
DBVARIANT dbv;
// Load the icons order
@@ -510,16 +510,16 @@ void LoadOptions() opt.exIconsVis[i]=1;
}
- if (!DBGetContactSetting(NULL, MODULE, "IconOrder", &dbv))
+ if (!db_get(NULL, MODULE, "IconOrder", &dbv))
{
CopyMemory(opt.exIconsOrder,dbv.pbVal,dbv.cpbVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if (!DBGetContactSetting(NULL, MODULE, "icons_vis", &dbv))
+ if (!db_get(NULL, MODULE, "icons_vis", &dbv))
{
CopyMemory(opt.exIconsVis,dbv.pbVal,dbv.cpbVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
for(i = 0; i < EXICONS_COUNT; i++)
@@ -528,24 +528,24 @@ void LoadOptions() exIcons[i].vis = opt.exIconsVis[i];
}
- opt.iOpacity = DBGetContactSettingByte(0, MODULE, "Opacity", 75);
- opt.bBorder = DBGetContactSettingByte(0, MODULE, "Border", 1) ? true : false;
- opt.bDropShadow = DBGetContactSettingByte(0, MODULE, "DropShadow", 1) ? true : false;
- opt.bRound = DBGetContactSettingByte(0, MODULE, "RoundCorners", 1) ? true : false;
- opt.bAeroGlass = DBGetContactSettingByte(0, MODULE, "AeroGlass", 0) ? true : false;
- opt.showEffect = (PopupShowEffect)DBGetContactSettingByte(0, MODULE, "ShowEffect", (BYTE)PSE_FADE);
- opt.iAnimateSpeed = DBGetContactSettingByte(0, MODULE, "ShowEffectSpeed", 12);
+ opt.iOpacity = db_get_b(0, MODULE, "Opacity", 75);
+ opt.bBorder = db_get_b(0, MODULE, "Border", 1) ? true : false;
+ opt.bDropShadow = db_get_b(0, MODULE, "DropShadow", 1) ? true : false;
+ opt.bRound = db_get_b(0, MODULE, "RoundCorners", 1) ? true : false;
+ opt.bAeroGlass = db_get_b(0, MODULE, "AeroGlass", 0) ? true : false;
+ opt.showEffect = (PopupShowEffect)db_get_b(0, MODULE, "ShowEffect", (BYTE)PSE_FADE);
+ opt.iAnimateSpeed = db_get_b(0, MODULE, "ShowEffectSpeed", 12);
if (opt.iAnimateSpeed < 1)
opt.iAnimateSpeed = 1;
else if (opt.iAnimateSpeed > 20)
opt.iAnimateSpeed = 20;
- int iBgImg = DBGetContactSettingByte(0, MODULE, "SBgImage", 0);
- opt.skinMode = (SkinMode)DBGetContactSettingByte(0, MODULE, "SkinEngine", iBgImg ? SM_OBSOLOTE : SM_COLORFILL);
- opt.bLoadFonts = DBGetContactSettingByte(0, MODULE, "LoadFonts", 1) ? true : false;
- opt.bLoadProportions= DBGetContactSettingByte(0, MODULE, "LoadProportions", 1) ? true : false;
- opt.iEnableColoring = DBGetContactSettingDword(0, MODULE, "EnableColoring", 0);
+ int iBgImg = db_get_b(0, MODULE, "SBgImage", 0);
+ opt.skinMode = (SkinMode)db_get_b(0, MODULE, "SkinEngine", iBgImg ? SM_OBSOLOTE : SM_COLORFILL);
+ opt.bLoadFonts = db_get_b(0, MODULE, "LoadFonts", 1) ? true : false;
+ opt.bLoadProportions= db_get_b(0, MODULE, "LoadProportions", 1) ? true : false;
+ opt.iEnableColoring = db_get_dw(0, MODULE, "EnableColoring", 0);
opt.szSkinName[0] = 0;
if (opt.skinMode == SM_OBSOLOTE)
@@ -554,10 +554,10 @@ void LoadOptions() }
else if (opt.skinMode == SM_IMAGE)
{
- if (!DBGetContactSettingTString(NULL, MODULE, "SkinName", &dbv))
+ if (!db_get_ts(NULL, MODULE, "SkinName", &dbv))
{
_tcscpy(opt.szSkinName, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -1710,13 +1710,13 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM opt.bLimitMsg = IsDlgButtonChecked(hwndDlg, IDC_CHK_LIMITMSG) ? true : false;
opt.iLimitCharCount = GetDlgItemInt(hwndDlg, IDC_ED_CHARCOUNT, 0, FALSE);
- DBWriteContactSettingDword(0, MODULE, "SmileyAddFlags", opt.iSmileyAddFlags);
- DBWriteContactSettingByte(0, MODULE, "WaitForContent", opt.bWaitForContent ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "GetNewStatusMsg", opt.bGetNewStatusMsg ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "DisableInvisible", opt.bDisableIfInvisible ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "RetrieveXStatus", opt.bRetrieveXstatus ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "LimitMsg", opt.bLimitMsg ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "LimitCharCount", opt.iLimitCharCount);
+ db_set_dw(0, MODULE, "SmileyAddFlags", opt.iSmileyAddFlags);
+ db_set_b(0, MODULE, "WaitForContent", opt.bWaitForContent ? 1 : 0);
+ db_set_b(0, MODULE, "GetNewStatusMsg", opt.bGetNewStatusMsg ? 1 : 0);
+ db_set_b(0, MODULE, "DisableInvisible", opt.bDisableIfInvisible ? 1 : 0);
+ db_set_b(0, MODULE, "RetrieveXStatus", opt.bRetrieveXstatus ? 1 : 0);
+ db_set_b(0, MODULE, "LimitMsg", opt.bLimitMsg ? 1 : 0);
+ db_set_b(0, MODULE, "LimitCharCount", opt.iLimitCharCount);
return TRUE;
}
@@ -2026,8 +2026,8 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
}
- DBWriteContactSettingByte(0, MODULE, "SkinEngine", opt.skinMode);
- DBWriteContactSettingTString(0, MODULE, "SkinName", opt.szSkinName);
+ db_set_b(0, MODULE, "SkinEngine", opt.skinMode);
+ db_set_ts(0, MODULE, "SkinName", opt.szSkinName);
DestroySkinBitmap();
SetDlgItemInt(hwndDlg, IDC_ED_TRANS, opt.iOpacity, FALSE);
@@ -2084,7 +2084,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, {
TranslateDialogDefault(hwndDlg);
- if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_DISABLEGROUPS && !DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT))
+ if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_DISABLEGROUPS && !db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETUSEGROUPS, (WPARAM) FALSE, 0);
else
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETUSEGROUPS, (WPARAM) TRUE, 0);
@@ -2098,7 +2098,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, while (hContact)
{
hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
- if (hItem && DBGetContactSettingByte(hContact, MODULE, "FavouriteContact", 0))
+ if (hItem && db_get_b(hContact, MODULE, "FavouriteContact", 0))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
hContact = db_find_next(hContact);
@@ -2126,19 +2126,19 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, if (hItem)
{
isChecked = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0);
- DBWriteContactSettingByte(hContact, MODULE, "FavouriteContact", isChecked);
+ db_set_b(hContact, MODULE, "FavouriteContact", isChecked);
if (isChecked) count++;
}
hContact = db_find_next(hContact);
}
- DBWriteContactSettingDword(0, MODULE, "FavouriteContactsCount", count);
+ db_set_dw(0, MODULE, "FavouriteContactsCount", count);
opt.iFavoriteContFlags = 0;
opt.iFavoriteContFlags |= IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDEOFFLINE) ? FAVCONT_HIDE_OFFLINE : 0 |
IsDlgButtonChecked(hwndDlg, IDC_CHK_APPENDPROTO) ? FAVCONT_APPEND_PROTO : 0;
- DBWriteContactSettingDword(0, MODULE, "FavContFlags", opt.iFavoriteContFlags);
+ db_set_dw(0, MODULE, "FavContFlags", opt.iFavoriteContFlags);
} // fall through
case IDC_BTN_CANCEL:
{
@@ -2295,7 +2295,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), item.hItem);
}
- DBWriteContactSettingTString(0, MODULE, "TrayProtocols", swzProtos);
+ db_set_ts(0, MODULE, "TrayProtocols", swzProtos);
swzProtos[0] = 0;
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg,IDC_TREE_SECOND_PROTOS));
@@ -2312,7 +2312,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), item.hItem);
}
- DBWriteContactSettingTString(0, MODULE, "TrayProtocolsEx", swzProtos);
+ db_set_ts(0, MODULE, "TrayProtocolsEx", swzProtos);
int count = 0;
opt.iFirstItems = 0;
@@ -2348,13 +2348,13 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA opt.bHideOffline = IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDEOFFLINE) ? true : false;
opt.iExpandTime = max(min(GetDlgItemInt(hwndDlg, IDC_ED_EXPANDTIME, 0, FALSE), 5000), 10);
- DBWriteContactSettingByte(0, MODULE, "TrayTip", (opt.bTraytip ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "ExtendedTrayTip", (opt.bHandleByTipper ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "ExpandTrayTip", (opt.bExpandTraytip ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "HideOffline", (opt.bHideOffline ? 1 : 0));
- DBWriteContactSettingDword(0, MODULE, "ExpandTime", opt.iExpandTime);
- DBWriteContactSettingDword(0, MODULE, "TrayTipItems", opt.iFirstItems);
- DBWriteContactSettingDword(0, MODULE, "TrayTipItemsEx", opt.iSecondItems);
+ db_set_b(0, MODULE, "TrayTip", (opt.bTraytip ? 1 : 0));
+ db_set_b(0, MODULE, "ExtendedTrayTip", (opt.bHandleByTipper ? 1 : 0));
+ db_set_b(0, MODULE, "ExpandTrayTip", (opt.bExpandTraytip ? 1 : 0));
+ db_set_b(0, MODULE, "HideOffline", (opt.bHideOffline ? 1 : 0));
+ db_set_dw(0, MODULE, "ExpandTime", opt.iExpandTime);
+ db_set_dw(0, MODULE, "TrayTipItems", opt.iFirstItems);
+ db_set_dw(0, MODULE, "TrayTipItemsEx", opt.iSecondItems);
return TRUE;
}
break;
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index c3ed182e2b..155990697d 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -153,7 +153,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa }
}
else {
- if (DBGetContactSettingByte(0, pwd->clcit.szProto, "XStatusId", 0)) {
+ if (db_get_b(0, pwd->clcit.szProto, "XStatusId", 0)) {
// xstatus title
swzAdvTitle = GetProtoExtraStatusTitle(pwd->clcit.szProto);
if (swzAdvTitle) {
@@ -316,7 +316,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa // don't use stored status message
if (!opt.bWaitForContent)
- DBDeleteContactSetting(pwd->hContact, MODULE, "TempStatusMsg");
+ db_unset(pwd->hContact, MODULE, "TempStatusMsg");
TCHAR *swzNick = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)pwd->hContact, GCDNF_TCHAR);
_tcsncpy(pwd->swzTitle, swzNick, TITLE_TEXT_LEN);
@@ -339,14 +339,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa // xstatus icon
if (pwd->bIsIconVisible[1]) {
for (i = 0; opt.exIconsOrder[i] != 1; i++);
- int iXstatus = DBGetContactSettingByte(pwd->hContact, szProto, "XStatusId", 0);
+ int iXstatus = db_get_b(pwd->hContact, szProto, "XStatusId", 0);
if (iXstatus) {
char szIconProto[64];
if (strcmp(szProto, szMetaModuleName) != 0)
strcpy(szIconProto, szProto);
- else if (!DBGetContactSettingString(pwd->hContact, szProto, "XStatusProto", &dbv)) {
+ else if (!db_get_s(pwd->hContact, szProto, "XStatusProto", &dbv)) {
strcpy(szIconProto, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
pwd->extraIcons[i].hIcon = (HICON)CallProtoService(szIconProto, PS_GETCUSTOMSTATUSICON, (WPARAM)iXstatus, LR_SHARED);
@@ -367,9 +367,9 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (ServiceExists(MS_GENDER_GETICON))
pwd->extraIcons[i].hIcon = (HICON)CallService(MS_GENDER_GETICON, (WPARAM)pwd->hContact, 0);
else {
- int iGender = DBGetContactSettingByte(pwd->hContact, "UserInfo", "Gender", 0);
+ int iGender = db_get_b(pwd->hContact, "UserInfo", "Gender", 0);
if (iGender == 0)
- iGender = DBGetContactSettingByte(pwd->hContact, szProto, "Gender", 0);
+ iGender = db_get_b(pwd->hContact, szProto, "Gender", 0);
if (iGender == GEN_FEMALE)
pwd->extraIcons[i].hIcon = Skin_GetIcon("UserInfoEx_common_female");
@@ -399,24 +399,24 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (pwd->bIsIconVisible[5]) {
for (i = 0; opt.exIconsOrder[i] != 5; i++);
if ( ServiceExists(MS_FP_GETCLIENTICONT)) {
- if (!DBGetContactSettingTString(pwd->hContact, szProto, "MirVer", &dbv)) {
+ if (!db_get_ts(pwd->hContact, szProto, "MirVer", &dbv)) {
pwd->extraIcons[i].hIcon = (HICON)CallService(MS_FP_GETCLIENTICONT, (WPARAM)dbv.ptszVal, 0);
pwd->extraIcons[i].bDestroy = true;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else if (ServiceExists(MS_FP_GETCLIENTICON)) {
- if (!DBGetContactSettingString(pwd->hContact, szProto, "MirVer", &dbv)) {
+ if (!db_get_s(pwd->hContact, szProto, "MirVer", &dbv)) {
pwd->extraIcons[i].hIcon = (HICON)CallService(MS_FP_GETCLIENTICON, (WPARAM)dbv.pszVal, 0);
pwd->extraIcons[i].bDestroy = true;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
//request xstatus details
if (opt.bRetrieveXstatus)
- if (!DBGetContactSettingByte(0, szProto, "XStatusAuto", 1) && ProtoServiceExists(szProto, PS_ICQ_REQUESTCUSTOMSTATUS))
+ if (!db_get_b(0, szProto, "XStatusAuto", 1) && ProtoServiceExists(szProto, PS_ICQ_REQUESTCUSTOMSTATUS))
CallProtoService(szProto, PS_ICQ_REQUESTCUSTOMSTATUS, (WPARAM)pwd->hContact, 0);
}
@@ -996,7 +996,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa case PUM_SETSTATUSTEXT:
if (pwd && (HANDLE)wParam == pwd->hContact) {
- DBWriteContactSettingTString(pwd->hContact, MODULE, "TempStatusMsg", (TCHAR *)lParam);
+ db_set_ts(pwd->hContact, MODULE, "TempStatusMsg", (TCHAR *)lParam);
pwd->bIsPainted = false;
pwd->bNeedRefresh = true;
SendMessage(hwnd, PUM_REFRESH_VALUES, TRUE, 0);
@@ -1555,7 +1555,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa while (hContact) {
char *proto = GetContactProto(hContact);
if (proto && !strcmp(proto, pa->szModuleName)) {
- if (DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
+ if (db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
iCountOnline++;
iCount++;
}
@@ -1626,7 +1626,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa }
}
else {
- if (DBGetContactSettingByte(0, pa->szModuleName, "XStatusId", 0)) {
+ if (db_get_b(0, pa->szModuleName, "XStatusId", 0)) {
// xstatus title
swzAdvTitle = GetProtoExtraStatusTitle(pa->szModuleName);
if (swzAdvTitle) {
@@ -1672,7 +1672,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa }
if (dwItems & TRAYTIP_FAVCONTACTS) {
- if (DBGetContactSettingDword(0, MODULE, "FavouriteContactsCount", 0)) {
+ if (db_get_dw(0, MODULE, "FavouriteContactsCount", 0)) {
TCHAR swzName[256];
TCHAR swzStatus[256];
bool bTitlePainted = false;
@@ -1680,10 +1680,10 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa HANDLE hContact = db_find_first();
while (hContact) {
- if (DBGetContactSettingByte(hContact, MODULE, "FavouriteContact", 0)) {
+ if (db_get_b(hContact, MODULE, "FavouriteContact", 0)) {
char *proto = GetContactProto(hContact);
if (proto) {
- WORD wStatus = DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE);
+ WORD wStatus = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE);
WordToStatusDesc(hContact, proto, "Status", swzStatus, 256);
if (wStatus != ID_STATUS_OFFLINE)
diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp index 439b1a2b44..3a00979545 100644 --- a/plugins/TipperYM/src/skin_parser.cpp +++ b/plugins/TipperYM/src/skin_parser.cpp @@ -210,7 +210,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff) if (_tcslen(pch) > 32)
pch[32] = 0;
- DBWriteContactSettingTString(0, MODULE, szSetting, pch);
+ db_set_ts(0, MODULE, szSetting, pch);
}
}
else if (_tcsstr(buff, _T("color")))
@@ -227,7 +227,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff) {
BYTE b = _ttoi(pch);
COLORREF color = RGB(r, g ,b);
- DBWriteContactSettingDword(0, MODULE, szSetting, color);
+ db_set_dw(0, MODULE, szSetting, color);
}
}
}
@@ -238,7 +238,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff) {
HDC hdc = GetDC(0);
int size = -MulDiv(_ttoi(pch), GetDeviceCaps(hdc, LOGPIXELSY), 72);
- DBWriteContactSettingByte(0, MODULE, szSetting, (BYTE)size);
+ db_set_b(0, MODULE, szSetting, (BYTE)size);
ReleaseDC(0, hdc);
}
}
@@ -254,7 +254,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff) if (_tcsstr(pch, _T("font_underline")))
effect |= DBFONTF_UNDERLINE;
- DBWriteContactSettingByte(0, MODULE, szSetting, effect);
+ db_set_b(0, MODULE, szSetting, effect);
}
}
}
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 41fb8eda43..779fe76bf8 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -36,7 +36,7 @@ bool DBGetContactSettingAsString(HANDLE hContact, const char *szModuleName, cons if (!szModuleName || !szSettingName)
return false;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
switch(dbv.type)
{
@@ -65,7 +65,7 @@ bool DBGetContactSettingAsString(HANDLE hContact, const char *szModuleName, cons }
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return buff[0] ? true : false;
@@ -73,7 +73,7 @@ bool DBGetContactSettingAsString(HANDLE hContact, const char *szModuleName, cons void StripBBCodesInPlace(TCHAR *swzText)
{
- if (!DBGetContactSettingByte(0, MODULE, "StripBBCodes", 1))
+ if (!db_get_b(0, MODULE, "StripBBCodes", 1))
return;
if (swzText == 0)
@@ -207,13 +207,13 @@ bool CanRetrieveStatusMsg(HANDLE hContact, char *szProto) if (opt.bGetNewStatusMsg)
{
int iFlags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0);
- WORD wStatus = DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ WORD wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
if ((CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) && (iFlags & Proto_Status2Flag(wStatus)))
{
iFlags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & (PF1_VISLIST | PF1_INVISLIST);
if (opt.bDisableIfInvisible && iFlags)
{
- int iVisMode = DBGetContactSettingWord(hContact, szProto, "ApparentMode", 0);
+ int iVisMode = db_get_w(hContact, szProto, "ApparentMode", 0);
int wProtoStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
if ((iVisMode == ID_STATUS_OFFLINE) || (wProtoStatus == ID_STATUS_INVISIBLE && iVisMode != ID_STATUS_ONLINE))
return false;
@@ -252,11 +252,11 @@ TCHAR *GetStatusMessageText(HANDLE hContact) if (wStatus == ID_STATUS_OFFLINE)
return NULL;
- if (!DBGetContactSettingTString(hContact, MODULE, "TempStatusMsg", &dbv))
+ if (!db_get_ts(hContact, MODULE, "TempStatusMsg", &dbv))
{
if (_tcslen(dbv.ptszVal) != 0)
swzMsg = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -268,11 +268,11 @@ TCHAR *GetStatusMessageText(HANDLE hContact) return NULL;
}
- if (!DBGetContactSettingTString(hContact, "CList", "StatusMsg", &dbv))
+ if (!db_get_ts(hContact, "CList", "StatusMsg", &dbv))
{
if (dbv.ptszVal && _tcslen(dbv.ptszVal) != 0)
swzMsg = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -417,17 +417,17 @@ bool GetSysSubstText(HANDLE hContact, TCHAR *swzRawSpec, TCHAR *buff, int buffle for (int i = 0; i < iNumber; i++) {
if (i > 0)
hTmpContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, i);
- dwRecountTs = DBGetContactSettingDword(hTmpContact, MODULE, "LastCountTS", 0);
+ dwRecountTs = db_get_dw(hTmpContact, MODULE, "LastCountTS", 0);
dwTime = (DWORD)time(0);
dwDiff = (dwTime - dwRecountTs);
if (dwDiff > (60 * 60 * 24 * 3)) {
- DBWriteContactSettingDword(hTmpContact, MODULE, "LastCountTS", dwTime);
+ db_set_dw(hTmpContact, MODULE, "LastCountTS", dwTime);
dwCountOut = dwCountIn = dwLastTs = 0;
}
else {
- dwCountOut = DBGetContactSettingDword(hTmpContact, MODULE, "MsgCountOut", 0);
- dwCountIn = DBGetContactSettingDword(hTmpContact, MODULE, "MsgCountIn", 0);
- dwLastTs = DBGetContactSettingDword(hTmpContact, MODULE, "LastMsgTS", 0);
+ dwCountOut = db_get_dw(hTmpContact, MODULE, "MsgCountOut", 0);
+ dwCountIn = db_get_dw(hTmpContact, MODULE, "MsgCountIn", 0);
+ dwLastTs = db_get_dw(hTmpContact, MODULE, "LastMsgTS", 0);
}
dwNewTs = dwLastTs;
@@ -449,9 +449,9 @@ bool GetSysSubstText(HANDLE hContact, TCHAR *swzRawSpec, TCHAR *buff, int buffle }
if (dwNewTs > dwLastTs) {
- DBWriteContactSettingDword(hTmpContact, MODULE, "MsgCountOut", dwCountOut);
- DBWriteContactSettingDword(hTmpContact, MODULE, "MsgCountIn", dwCountIn);
- DBWriteContactSettingDword(hTmpContact, MODULE, "LastMsgTS", dwNewTs);
+ db_set_dw(hTmpContact, MODULE, "MsgCountOut", dwCountOut);
+ db_set_dw(hTmpContact, MODULE, "MsgCountIn", dwCountIn);
+ db_set_dw(hTmpContact, MODULE, "LastMsgTS", dwNewTs);
}
dwMetaCountOut += dwCountOut;
@@ -851,11 +851,11 @@ TCHAR *GetProtoExtraStatusTitle(char *szProto) if (!szProto)
return NULL;
- if (!DBGetContactSettingTString(0, szProto, "XStatusName", &dbv))
+ if (!db_get_ts(0, szProto, "XStatusName", &dbv))
{
if (_tcslen(dbv.ptszVal) != 0)
swzText = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (!swzText)
@@ -879,11 +879,11 @@ TCHAR *GetProtoExtraStatusMessage(char *szProto) if (!szProto)
return NULL;
- if (!DBGetContactSettingTString(0, szProto, "XStatusMsg", &dbv))
+ if (!db_get_ts(0, szProto, "XStatusMsg", &dbv))
{
if (_tcslen(dbv.ptszVal) != 0)
swzText = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (ServiceExists(MS_VARS_FORMATSTRING))
{
@@ -923,11 +923,11 @@ TCHAR *GetListeningTo(char *szProto) if (!szProto)
return NULL;
- if (!DBGetContactSettingTString(0, szProto, "ListeningTo", &dbv))
+ if (!db_get_ts(0, szProto, "ListeningTo", &dbv))
{
if (_tcslen(dbv.ptszVal) != 0)
swzText = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (opt.bLimitMsg)
@@ -946,11 +946,11 @@ TCHAR *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szV return NULL;
mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", szProto, szSlot, szValue);
- if (!DBGetContactSettingTString(0, "AdvStatus", szSetting, &dbv))
+ if (!db_get_ts(0, "AdvStatus", szSetting, &dbv))
{
if (_tcslen(dbv.ptszVal) != 0)
swzText = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (opt.bLimitMsg)
@@ -969,10 +969,10 @@ HICON GetJabberActivityIcon(HANDLE hContact, char *szProto) return NULL;
mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", szProto, "activity", "icon");
- if (!DBGetContactSettingString(hContact, "AdvStatus", szSetting, &dbv))
+ if (!db_get_s(hContact, "AdvStatus", szSetting, &dbv))
{
hIcon = Skin_GetIcon(dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return hIcon;
diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index 17e9100251..4129c9a58a 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -113,7 +113,7 @@ int EventDeleted(WPARAM wParam, LPARAM lParam) DBEVENTINFO dbei = { sizeof(dbei) };
if ( !db_event_get((HANDLE)lParam, &dbei))
if (dbei.eventType == EVENTTYPE_MESSAGE)
- DBDeleteContactSetting((HANDLE)wParam, MODULE, "LastCountTS");
+ db_unset((HANDLE)wParam, MODULE, "LastCountTS");
return 0;
}
@@ -269,7 +269,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) CallService(MS_CLC_SETINFOTIPHOVERTIME, opt.iTimeIn, 0);
// set Miranda start timestamp
- DBWriteContactSettingDword(0, MODULE, "MirandaStartTS", (DWORD)time(0));
+ db_set_dw(0, MODULE, "MirandaStartTS", (DWORD)time(0));
// get MetaContacts module name
if (ServiceExists(MS_MC_GETPROTOCOLNAME))
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index fcbe097981..39b32434a5 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -43,7 +43,7 @@ void AddTranslation(DBVTranslation *newTrans) }
else
{
- DWORD id = DBGetContactSettingDword(0, MODULE_ITEMS, szSetting, 0);
+ DWORD id = db_get_dw(0, MODULE_ITEMS, szSetting, 0);
if (id != 0)
{
translations[iTransFuncsCount - 1].id = id;
@@ -52,10 +52,10 @@ void AddTranslation(DBVTranslation *newTrans) else
{
translations[iTransFuncsCount - 1].id = dwNextFuncId++;
- DBWriteContactSettingDword(0, MODULE_ITEMS, szSetting, translations[iTransFuncsCount - 1].id);
+ db_set_dw(0, MODULE_ITEMS, szSetting, translations[iTransFuncsCount - 1].id);
}
- DBWriteContactSettingDword(0, MODULE_ITEMS, "NextFuncId", dwNextFuncId);
+ db_set_dw(0, MODULE_ITEMS, "NextFuncId", dwNextFuncId);
}
mir_free(szName);
@@ -70,7 +70,7 @@ TCHAR *NullTranslation(HANDLE hContact, const char *szModuleName, const char *sz TCHAR *TimestampToShortDate(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0) return 0;
DBTIMETOSTRINGT dbt = {0};
@@ -83,7 +83,7 @@ TCHAR *TimestampToShortDate(HANDLE hContact, const char *szModuleName, const cha TCHAR *TimestampToLongDate(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0) return 0;
DBTIMETOSTRINGT dbt = {0};
@@ -96,7 +96,7 @@ TCHAR *TimestampToLongDate(HANDLE hContact, const char *szModuleName, const char TCHAR *TimestampToTime(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0) return 0;
DBTIMETOSTRINGT dbt = {0};
@@ -109,7 +109,7 @@ TCHAR *TimestampToTime(HANDLE hContact, const char *szModuleName, const char *sz TCHAR *TimestampToTimeNoSecs(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0) return 0;
DBTIMETOSTRINGT dbt = {0};
@@ -122,7 +122,7 @@ TCHAR *TimestampToTimeNoSecs(HANDLE hContact, const char *szModuleName, const ch TCHAR *TimestampToTimeDifference(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
DWORD t = (DWORD)time(0);
if (ts == 0) return 0;
@@ -142,7 +142,7 @@ TCHAR *TimestampToTimeDifference(HANDLE hContact, const char *szModuleName, cons TCHAR *SecondsToTimeDifference(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- DWORD diff = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD diff = db_get_dw(hContact, szModuleName, szSettingName, 0);
int d = (diff / 60 / 60 / 24);
int h = (diff - d * 60 * 60 * 24) / 60 / 60;
int m = (diff - d * 60 * 60 * 24 - h * 60 * 60) / 60;
@@ -158,7 +158,7 @@ TCHAR *SecondsToTimeDifference(HANDLE hContact, const char *szModuleName, const TCHAR *WordToStatusDesc(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- WORD wStatus = DBGetContactSettingWord(hContact, szModuleName, szSettingName, ID_STATUS_OFFLINE);
+ WORD wStatus = db_get_w(hContact, szModuleName, szSettingName, ID_STATUS_OFFLINE);
TCHAR *szStatus = (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)wStatus, GSMDF_TCHAR);
_tcsncpy(buff,szStatus, bufflen);
buff[bufflen - 1] = 0;
@@ -168,7 +168,7 @@ TCHAR *WordToStatusDesc(HANDLE hContact, const char *szModuleName, const char *s TCHAR *ByteToYesNo(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DBVARIANT dbv;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (dbv.type == DBVT_BYTE)
{
@@ -177,17 +177,17 @@ TCHAR *ByteToYesNo(HANDLE hContact, const char *szModuleName, const char *szSett else
_tcsncpy(buff, _T("No"), bufflen);
buff[bufflen - 1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return buff;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
TCHAR *ByteToGender(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- BYTE val = (BYTE)DBGetContactSettingByte(hContact, szModuleName, szSettingName, 0);
+ BYTE val = (BYTE)db_get_b(hContact, szModuleName, szSettingName, 0);
if (val == 'F')
_tcsncpy(buff, TranslateT("Female"), bufflen);
else if (val == 'M')
@@ -202,7 +202,7 @@ TCHAR *ByteToGender(HANDLE hContact, const char *szModuleName, const char *szSet TCHAR *WordToCountry(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
char *szCountryName = 0;
- WORD cid = (WORD)DBGetContactSettingWord(hContact, szModuleName, szSettingName, (WORD)-1);
+ WORD cid = (WORD)db_get_w(hContact, szModuleName, szSettingName, (WORD)-1);
if (cid != (WORD)-1 && ServiceExists(MS_UTILS_GETCOUNTRYBYNUMBER) && (szCountryName = (char *)CallService(MS_UTILS_GETCOUNTRYBYNUMBER, cid, 0)) != 0)
{
if (strcmp(szCountryName, "Unknown") == 0)
@@ -216,7 +216,7 @@ TCHAR *WordToCountry(HANDLE hContact, const char *szModuleName, const char *szSe TCHAR *DwordToIp(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- DWORD ip = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD ip = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ip) {
unsigned char *ipc = (unsigned char*)&ip;
mir_sntprintf(buff, bufflen, _T("%u.%u.%u.%u"), ipc[3], ipc[2], ipc[1], ipc[0]);
@@ -249,26 +249,26 @@ TCHAR *DayMonthYearToDate(HANDLE hContact, const char *szModuleName, const char DBVARIANT dbv;
char szSettingName[256];
mir_snprintf(szSettingName, 256, "%sDay", prefix);
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sMonth", prefix);
int month = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sYear", prefix);
int year = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &year))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
SYSTEMTIME st = {0};
st.wDay = day;
@@ -279,15 +279,15 @@ TCHAR *DayMonthYearToDate(HANDLE hContact, const char *szModuleName, const char return buff;
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -297,26 +297,26 @@ TCHAR *DayMonthYearToAge(HANDLE hContact, const char *szModuleName, const char * DBVARIANT dbv;
char szSettingName[256];
mir_snprintf(szSettingName, 256, "%sDay", szPrefix);
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sMonth", szPrefix);
int month = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sYear", szPrefix);
int year = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &year))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
SYSTEMTIME now;
GetLocalTime(&now);
@@ -328,15 +328,15 @@ TCHAR *DayMonthYearToAge(HANDLE hContact, const char *szModuleName, const char * return buff;
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -346,25 +346,25 @@ TCHAR *HoursMinutesSecondsToTime(HANDLE hContact, const char *szModuleName, cons DBVARIANT dbv;
char szSettingName[256];
mir_snprintf(szSettingName, 256, "%sHours", szPrefix);
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sMinutes", szPrefix);
int minutes = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &minutes))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sSeconds", szPrefix);
int seconds = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
GetInt(dbv, &seconds);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
SYSTEMTIME st = {0};
@@ -376,11 +376,11 @@ TCHAR *HoursMinutesSecondsToTime(HANDLE hContact, const char *szModuleName, cons return buff;
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -390,19 +390,19 @@ TCHAR *HoursMinutesToTime(HANDLE hContact, const char *szModuleName, const char DBVARIANT dbv;
char szSettingName[256];
mir_snprintf(szSettingName, 256, "%sHours", szPrefix);
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sMinutes", szPrefix);
int minutes = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &minutes))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
SYSTEMTIME st = {0};
st.wHour = hours;
@@ -412,11 +412,11 @@ TCHAR *HoursMinutesToTime(HANDLE hContact, const char *szModuleName, const char return buff;
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -426,46 +426,46 @@ TCHAR *DmyToTimeDifference(HANDLE hContact, const char *szModuleName, const char DBVARIANT dbv;
char szSettingName[256];
mir_snprintf(szSettingName, 256, "%sDay", szPrefix);
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sMonth", szPrefix);
int month = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sYear", szPrefix);
int year = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &year))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sHours", szPrefix);
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sMinutes", szPrefix);
int minutes = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &minutes))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sSeconds", szPrefix);
int seconds = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
GetInt(dbv, &seconds);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
SYSTEMTIME st = {0}, st_now;
@@ -502,23 +502,23 @@ TCHAR *DmyToTimeDifference(HANDLE hContact, const char *szModuleName, const char return buff;
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -528,19 +528,19 @@ TCHAR *DayMonthToDaysToNextBirthday(HANDLE hContact, const char *szModuleName, c DBVARIANT dbv;
char szSettingName[256];
mir_snprintf(szSettingName, 256, "%sDay", szPrefix);
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sMonth", szPrefix);
int month = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
time_t now = time(NULL);
struct tm *ti = localtime(&now);
int yday_now = ti->tm_yday;
@@ -563,13 +563,13 @@ TCHAR *DayMonthToDaysToNextBirthday(HANDLE hContact, const char *szModuleName, c }
else
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
else
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
return 0;
@@ -585,7 +585,7 @@ TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, cons // translate jabber mood
if (ProtoServiceExists(szModuleName, "/SendXML")) // jabber protocol?
{
- if (!DBGetContactSettingTString(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get_ts(hContact, szModuleName, szSettingName, &dbv))
{
_tcsncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
buff[bufflen - 1] = 0;
@@ -596,7 +596,7 @@ TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, cons if (NullTranslation(hContact, szModuleName, szSettingName, buff, bufflen))
return buff;
- int status = DBGetContactSettingByte(hContact, szModuleName, "XStatusId", 0);
+ int status = db_get_b(hContact, szModuleName, "XStatusId", 0);
if (!status) return 0;
if (ProtoServiceExists(szModuleName, PS_GETCUSTOMSTATUSEX))
@@ -618,7 +618,7 @@ TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, cons TCHAR *TimezoneToTime(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- int timezone = DBGetContactSettingByte(hContact,szModuleName,szSettingName,256);
+ int timezone = db_get_b(hContact,szModuleName,szSettingName,256);
if (timezone==256 || (char)timezone==-100)
return 0;
@@ -643,7 +643,7 @@ TCHAR *TimezoneToTime(HANDLE hContact, const char *szModuleName, const char *szS TCHAR *ByteToDay(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- int iDay = DBGetContactSettingWord(hContact, szModuleName, szSettingName, -1);
+ int iDay = db_get_w(hContact, szModuleName, szSettingName, -1);
if (iDay > -1 && iDay < 7)
{
a2t(Translate(days[iDay]), buff, bufflen);
@@ -656,7 +656,7 @@ TCHAR *ByteToDay(HANDLE hContact, const char *szModuleName, const char *szSettin TCHAR *ByteToMonth(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- int iMonth = DBGetContactSettingWord(hContact, szModuleName, szSettingName, 0);
+ int iMonth = db_get_w(hContact, szModuleName, szSettingName, 0);
if (iMonth > 0 && iMonth < 13)
{
a2t(Translate(months[iMonth - 1]), buff, bufflen);
@@ -669,7 +669,7 @@ TCHAR *ByteToMonth(HANDLE hContact, const char *szModuleName, const char *szSett TCHAR *ByteToLanguage(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- int iLang = DBGetContactSettingByte(hContact, szModuleName, szSettingName, 0);
+ int iLang = db_get_b(hContact, szModuleName, szSettingName, 0);
if (iLang)
{
for (int i = 0; i < SIZEOF(languages); i++)
@@ -725,7 +725,7 @@ static DBVTranslation internalTranslations[] = void InitTranslations()
{
- dwNextFuncId = DBGetContactSettingDword(0, MODULE_ITEMS, "NextFuncId", 1);
+ dwNextFuncId = db_get_dw(0, MODULE_ITEMS, "NextFuncId", 1);
for (int i = 0; i < SIZEOF(internalTranslations); i++)
AddTranslation( &internalTranslations[i] );
diff --git a/plugins/TopToolBar/src/toolbarwnd.cpp b/plugins/TopToolBar/src/toolbarwnd.cpp index 9801ac5faa..b0778edff9 100644 --- a/plugins/TopToolBar/src/toolbarwnd.cpp +++ b/plugins/TopToolBar/src/toolbarwnd.cpp @@ -305,7 +305,7 @@ INT_PTR OnEventFire(WPARAM wParam, LPARAM lParam) int LoadBackgroundOptions()
{
//load options
- bkColour = DBGetContactSettingDword(NULL, TTB_OPTDIR, "BkColour", TTBDEFAULT_BKCOLOUR);
+ bkColour = db_get_dw(NULL, TTB_OPTDIR, "BkColour", TTBDEFAULT_BKCOLOUR);
if (hBmpBackground) {
DeleteObject(hBmpBackground);
hBmpBackground = NULL;
@@ -313,12 +313,12 @@ int LoadBackgroundOptions() if (db_get_b(NULL, TTB_OPTDIR, "UseBitmap", TTBDEFAULT_USEBITMAP)) {
DBVARIANT dbv;
- if (!DBGetContactSetting(NULL, TTB_OPTDIR, "BkBitmap", &dbv)) {
+ if (!db_get(NULL, TTB_OPTDIR, "BkBitmap", &dbv)) {
hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
- backgroundBmpUse = DBGetContactSettingWord(NULL, TTB_OPTDIR, "BkBmpUse", TTBDEFAULT_BKBMPUSE);
+ backgroundBmpUse = db_get_w(NULL, TTB_OPTDIR, "BkBmpUse", TTBDEFAULT_BKBMPUSE);
RECT rc;
GetClientRect(g_ctrl->hWnd, &rc);
diff --git a/plugins/TopToolBar/src/topbutton.cpp b/plugins/TopToolBar/src/topbutton.cpp index 8e2f8a1cfd..d0d423f7e7 100644 --- a/plugins/TopToolBar/src/topbutton.cpp +++ b/plugins/TopToolBar/src/topbutton.cpp @@ -134,8 +134,8 @@ void TopButtonInt::SaveSettings(int *SepCnt, int *LaunchCnt) char buf2[20];
AS(buf2, "Launch", buf1);
- DBWriteContactSettingString(0, TTB_OPTDIR, AS(buf, buf2, "_name"), pszName);
- DBWriteContactSettingTString(0, TTB_OPTDIR, AS(buf, buf2, "_lpath"), ptszProgram);
+ db_set_s(0, TTB_OPTDIR, AS(buf, buf2, "_name"), pszName);
+ db_set_ts(0, TTB_OPTDIR, AS(buf, buf2, "_lpath"), ptszProgram);
db_set_b(0, TTB_OPTDIR, AS(buf, buf2, "_Position"), arrangedpos);
db_set_b(0, TTB_OPTDIR, AS(buf, buf2, "_Visible"), isVisible());
}
diff --git a/plugins/TranslitSwitcher/src/Layoutproc.cpp b/plugins/TranslitSwitcher/src/Layoutproc.cpp index 6cd5342ad5..26ab1ebe52 100644 --- a/plugins/TranslitSwitcher/src/Layoutproc.cpp +++ b/plugins/TranslitSwitcher/src/Layoutproc.cpp @@ -806,10 +806,10 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) CallService(MS_SMILEYADD_BATCHFREE, 0, (LPARAM)smileyPrs);
DBVARIANT dbv = {0};
- DBGetContactSettingTString(NULL, "TranslitSwitcher", "ResendSymbol", &dbv);
+ db_get_ts(NULL, "TranslitSwitcher", "ResendSymbol", &dbv);
if (lstrcmp(dbv.ptszVal, NULL) == 0)
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
SendMessage(hEdit, WM_SETTEXT, 0, (LPARAM)sel);
SendMessage(hEdit, EM_SETSEL, 0, slen);
SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0);
@@ -855,10 +855,10 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) if (slen != 0)
Transliterate(sel);
DBVARIANT dbv = {0};
- DBGetContactSettingTString(NULL, "TranslitSwitcher", "ResendSymbol", &dbv);
+ db_get_ts(NULL, "TranslitSwitcher", "ResendSymbol", &dbv);
if (lstrcmp(dbv.ptszVal, NULL) == 0)
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
SendMessage(hEdit, WM_SETTEXT, 0, (LPARAM)sel);
SendMessage(hEdit, EM_SETSEL, 0, slen);
SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0);
@@ -903,10 +903,10 @@ int OnButtonPressed(WPARAM wParam, LPARAM lParam) if (slen != 0)
Invert(sel);
DBVARIANT dbv = {0};
- DBGetContactSettingTString(NULL, "TranslitSwitcher", "ResendSymbol", &dbv);
+ db_get_ts(NULL, "TranslitSwitcher", "ResendSymbol", &dbv);
if (lstrcmp(dbv.ptszVal, NULL) == 0)
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
SendMessage(hEdit, WM_SETTEXT, 0, (LPARAM)sel);
SendMessage(hEdit, EM_SETSEL, 0, slen);
SendMessage(cbcd->hwndFrom, WM_COMMAND, IDOK, 0);
diff --git a/plugins/UserGuide/src/main.cpp b/plugins/UserGuide/src/main.cpp index 5650084b91..a0cb7e9ffa 100644 --- a/plugins/UserGuide/src/main.cpp +++ b/plugins/UserGuide/src/main.cpp @@ -34,7 +34,7 @@ static INT_PTR ShowGuideFile(WPARAM wParam, LPARAM lParam) pszDirName = (LPTSTR)mir_alloc(250*sizeof(TCHAR));
pszFileName = (LPTSTR)mir_alloc(250*sizeof(TCHAR));
- iRes = DBGetContactSettingTString(NULL, "UserGuide", "PathToHelpFile", &dbv);
+ iRes = db_get_ts(NULL, "UserGuide", "PathToHelpFile", &dbv);
if (iRes!=0)
{
@@ -64,7 +64,7 @@ static INT_PTR ShowGuideFile(WPARAM wParam, LPARAM lParam) pszDirName[pszDivider - dbv.ptszVal] = 0;
}
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (ServiceExists(MS_UTILS_REPLACEVARS))
pszDirNameEx = (TCHAR *) CallService(MS_UTILS_REPLACEVARS, (WPARAM)pszDirName, (LPARAM)&dat);
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index 7f068b1e00..ced26a1b07 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -207,8 +207,8 @@ static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM lParam) else if (countryNumber = (int)DB::Setting::GetWord((HANDLE)wParam,pszProto,"CompanyCountry",0))
return (INT_PTR)countryNumber;
/* fallback ip detect
- else if(countryNumber==0xFFFF && DBGetContactSettingByte(NULL,"Flags","UseIpToCountry",SETTING_USEIPTOCOUNTRY_DEFAULT)) {
- countryNumber=ServiceIpToCountry(DBGetContactSettingDword((HANDLE)wParam,pszProto,"RealIP",0),0);
+ else if(countryNumber==0xFFFF && db_get_b(NULL,"Flags","UseIpToCountry",SETTING_USEIPTOCOUNTRY_DEFAULT)) {
+ countryNumber=ServiceIpToCountry(db_get_dw((HANDLE)wParam,pszProto,"RealIP",0),0);
}*/
return (INT_PTR)0xFFFF;
diff --git a/plugins/UserInfoEx/src/svc_avatar.cpp b/plugins/UserInfoEx/src/svc_avatar.cpp index c82965f96c..cdf94288cc 100644 --- a/plugins/UserInfoEx/src/svc_avatar.cpp +++ b/plugins/UserInfoEx/src/svc_avatar.cpp @@ -186,7 +186,7 @@ namespace NServices }
// the absolute file is valid
- if (bInvalidAvatar && !DBGetContactSetting(hContact, "ContactPhoto", "File", &dbv))
+ if (bInvalidAvatar && !db_get(hContact, "ContactPhoto", "File", &dbv))
{
FILE *f = fopen(dbv.pszVal, "rb");
if (f) {
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp index b0d5b382ec..105d7f2c68 100644 --- a/plugins/UserInfoEx/src/svc_email.cpp +++ b/plugins/UserInfoEx/src/svc_email.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h"
-static HANDLE ghMenuItem = NULL;
+static HGENMENU ghMenuItem = NULL;
static HANDLE ghExtraIconDef = INVALID_HANDLE_VALUE;
static HANDLE ghExtraIconSvc = INVALID_HANDLE_VALUE;
@@ -172,16 +172,9 @@ static int OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw **/
static int OnPreBuildMenu(WPARAM wParam, LPARAM lParam)
{
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS;
-
LPSTR val = Get((HANDLE)wParam);
- if (val)
- mir_free(val);
- else
- mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)ghMenuItem, (LPARAM)&mi);
+ Menu_ShowItem(ghMenuItem, val != NULL);
+ mir_free(val);
return 0;
}
diff --git a/plugins/UserInfoEx/src/svc_homepage.cpp b/plugins/UserInfoEx/src/svc_homepage.cpp index 5e8aeddc73..9ed2639af1 100644 --- a/plugins/UserInfoEx/src/svc_homepage.cpp +++ b/plugins/UserInfoEx/src/svc_homepage.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h"
-static HANDLE ghMenuItem = NULL;
+static HGENMENU ghMenuItem = NULL;
static HANDLE ghExtraIconDef = INVALID_HANDLE_VALUE;
static HANDLE ghExtraIconSvc = INVALID_HANDLE_VALUE;
@@ -134,19 +134,9 @@ static int OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw **/
static int OnPreBuildMenu(WPARAM wParam, LPARAM lParam)
{
- LPSTR val;
-
- CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS;
-
- val = Get((HANDLE)wParam);
- if (val)
- {
- MIR_FREE(val);
- }
- else mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)ghMenuItem, (LPARAM)&mi);
+ LPSTR val = Get((HANDLE)wParam);
+ Menu_ShowItem(ghMenuItem, val != 0);
+ mir_free(val);
return 0;
}
diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp index a32ea2fe91..1905435b41 100644 --- a/plugins/Utils/mir_options.cpp +++ b/plugins/Utils/mir_options.cpp @@ -115,19 +115,19 @@ static void LoadOpt(OptPageControl *ctrl, char *module) break;
case CONTROL_SPIN:
- *((WORD *) ctrl->var) = DBGetContactSettingWord(NULL, module, ctrl->setting, ctrl->dwDefValue);
+ *((WORD *) ctrl->var) = db_get_w(NULL, module, ctrl->setting, ctrl->dwDefValue);
break;
case CONTROL_COLOR:
- *((COLORREF *) ctrl->var) = (COLORREF) DBGetContactSettingDword(NULL, module, ctrl->setting, ctrl->dwDefValue);
+ *((COLORREF *) ctrl->var) = (COLORREF) db_get_dw(NULL, module, ctrl->setting, ctrl->dwDefValue);
break;
case CONTROL_RADIO:
- *((WORD *) ctrl->var) = DBGetContactSettingWord(NULL, module, ctrl->setting, ctrl->dwDefValue);
+ *((WORD *) ctrl->var) = db_get_w(NULL, module, ctrl->setting, ctrl->dwDefValue);
break;
case CONTROL_COMBO:
- *((WORD *) ctrl->var) = DBGetContactSettingWord(NULL, module, ctrl->setting, ctrl->dwDefValue);
+ *((WORD *) ctrl->var) = db_get_w(NULL, module, ctrl->setting, ctrl->dwDefValue);
break;
case CONTROL_PROTOCOL_LIST:
@@ -143,7 +143,7 @@ static void LoadOpt(OptPageControl *ctrl, char *module) tmp[0]=0;
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingString(NULL, module, ctrl->setting, &dbv))
+ if ( !db_get_s(NULL, module, ctrl->setting, &dbv))
{
lstrcpynA(tmp, dbv.pszVal, SIZEOF(tmp));
db_free(&dbv);
@@ -161,7 +161,7 @@ static void LoadOpt(OptPageControl *ctrl, char *module) break;
case CONTROL_INT:
- *((int *) ctrl->var) = (int) DBGetContactSettingDword(NULL, module, ctrl->setting, ctrl->dwDefValue);
+ *((int *) ctrl->var) = (int) db_get_dw(NULL, module, ctrl->setting, ctrl->dwDefValue);
break;
case CONTROL_FILE:
@@ -205,19 +205,19 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha case CONTROL_SPIN:
SendDlgItemMessage(hwndDlg, ctrl->nIDSpin, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, ctrl->nID),0);
SendDlgItemMessage(hwndDlg, ctrl->nIDSpin, UDM_SETRANGE, 0, MAKELONG(ctrl->max, ctrl->min));
- SendDlgItemMessage(hwndDlg, ctrl->nIDSpin, UDM_SETPOS,0, MAKELONG(DBGetContactSettingWord(NULL, module, ctrl->setting, ctrl->dwDefValue), 0));
+ SendDlgItemMessage(hwndDlg, ctrl->nIDSpin, UDM_SETPOS,0, MAKELONG(db_get_w(NULL, module, ctrl->setting, ctrl->dwDefValue), 0));
break;
case CONTROL_COLOR:
- SendDlgItemMessage(hwndDlg, ctrl->nID, CPM_SETCOLOUR, 0, (COLORREF) DBGetContactSettingDword(NULL, module, ctrl->setting, ctrl->dwDefValue));
+ SendDlgItemMessage(hwndDlg, ctrl->nID, CPM_SETCOLOUR, 0, (COLORREF) db_get_dw(NULL, module, ctrl->setting, ctrl->dwDefValue));
break;
case CONTROL_RADIO:
- CheckDlgButton(hwndDlg, ctrl->nID, DBGetContactSettingWord(NULL, module, ctrl->setting, ctrl->dwDefValue) == ctrl->value ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, ctrl->nID, db_get_w(NULL, module, ctrl->setting, ctrl->dwDefValue) == ctrl->value ? BST_CHECKED : BST_UNCHECKED);
break;
case CONTROL_COMBO:
- SendDlgItemMessage(hwndDlg, ctrl->nID, CB_SETCURSEL, DBGetContactSettingWord(NULL, module, ctrl->setting, ctrl->dwDefValue), 0);
+ SendDlgItemMessage(hwndDlg, ctrl->nID, CB_SETCURSEL, db_get_w(NULL, module, ctrl->setting, ctrl->dwDefValue), 0);
break;
case CONTROL_PROTOCOL_LIST:
@@ -279,7 +279,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha tmp[0]=0;
DBVARIANT dbv = {0};
- if ( !DBGetContactSettingString(NULL, module, ctrl->setting, &dbv)) {
+ if ( !db_get_s(NULL, module, ctrl->setting, &dbv)) {
lstrcpynA(tmp, dbv.pszVal, SIZEOF(tmp));
db_free(&dbv);
}
@@ -295,7 +295,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha break;
case CONTROL_INT:
{
- DWORD var = DBGetContactSettingDword(NULL, module, ctrl->setting, ctrl->dwDefValue);
+ DWORD var = db_get_dw(NULL, module, ctrl->setting, ctrl->dwDefValue);
SetDlgItemInt(hwndDlg, ctrl->nID, var, ctrl->min <= 0);
SendDlgItemMessage(hwndDlg, ctrl->nID, EM_LIMITTEXT, 9, 0);
}
@@ -381,24 +381,24 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha switch(ctrl->type) {
case CONTROL_CHECKBOX:
- DBWriteContactSettingByte(NULL, module, ctrl->setting, (BYTE) IsDlgButtonChecked(hwndDlg, ctrl->nID));
+ db_set_b(NULL, module, ctrl->setting, (BYTE) IsDlgButtonChecked(hwndDlg, ctrl->nID));
break;
case CONTROL_SPIN:
- DBWriteContactSettingWord(NULL, module, ctrl->setting, (WORD) SendDlgItemMessage(hwndDlg, ctrl->nIDSpin, UDM_GETPOS, 0, 0));
+ db_set_w(NULL, module, ctrl->setting, (WORD) SendDlgItemMessage(hwndDlg, ctrl->nIDSpin, UDM_GETPOS, 0, 0));
break;
case CONTROL_COLOR:
- DBWriteContactSettingDword(NULL, module, ctrl->setting, (DWORD) SendDlgItemMessage(hwndDlg, ctrl->nID, CPM_GETCOLOUR, 0, 0));
+ db_set_dw(NULL, module, ctrl->setting, (DWORD) SendDlgItemMessage(hwndDlg, ctrl->nID, CPM_GETCOLOUR, 0, 0));
break;
case CONTROL_RADIO:
if (IsDlgButtonChecked(hwndDlg, ctrl->nID))
- DBWriteContactSettingWord(NULL, module, ctrl->setting, (BYTE) ctrl->value);
+ db_set_w(NULL, module, ctrl->setting, (BYTE) ctrl->value);
break;
case CONTROL_COMBO:
- DBWriteContactSettingWord(NULL, module, ctrl->setting, (WORD) SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETCURSEL, 0, 0));
+ db_set_w(NULL, module, ctrl->setting, (WORD) SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETCURSEL, 0, 0));
break;
case CONTROL_PROTOCOL_LIST:
@@ -415,7 +415,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha ListView_GetItem(hwndProtocols, &lvi);
char *setting = (char *)lvi.lParam;
- DBWriteContactSettingByte(NULL, module, setting, (BYTE)ListView_GetCheckState(hwndProtocols, i));
+ db_set_b(NULL, module, setting, (BYTE)ListView_GetCheckState(hwndProtocols, i));
}
}
break;
@@ -424,7 +424,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha {
TCHAR tmp[1024];
GetDlgItemText(hwndDlg, ctrl->nID, tmp, SIZEOF(tmp));
- DBWriteContactSettingTString(NULL, module, ctrl->setting, tmp);
+ db_set_ts(NULL, module, ctrl->setting, tmp);
}
break;
@@ -445,7 +445,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha }
CallService(MS_DB_CRYPT_ENCODESTRING, SIZEOF(tmp), (LPARAM) tmp);
- DBWriteContactSettingString(NULL, module, ctrl->setting, tmp);
+ db_set_s(NULL, module, ctrl->setting, tmp);
// Don't load from DB
continue;
@@ -460,7 +460,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha val = min(val, ctrl->max);
if (ctrl->min != 0)
val = max(val, ctrl->min);
- DBWriteContactSettingDword(NULL, module, ctrl->setting, val);
+ db_set_dw(NULL, module, ctrl->setting, val);
}
break;
case CONTROL_FILE:
@@ -469,20 +469,20 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha GetDlgItemText(hwndDlg, ctrl->nID, tmp, 1024);
TCHAR rel[1024];
PathToRelative(rel, 1024, tmp);
- DBWriteContactSettingTString(NULL, module, ctrl->setting, rel);
+ db_set_ts(NULL, module, ctrl->setting, rel);
}
break;
case CONTROL_COMBO_TEXT:
{
TCHAR tmp[1024];
GetDlgItemText(hwndDlg, ctrl->nID, tmp, 1024);
- DBWriteContactSettingTString(NULL, module, ctrl->setting, tmp);
+ db_set_ts(NULL, module, ctrl->setting, tmp);
}
break;
case CONTROL_COMBO_ITEMDATA:
{
int sel = SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETCURSEL, 0, 0);
- DBWriteContactSettingTString(NULL, module, ctrl->setting, (TCHAR *) SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM) sel, 0));
+ db_set_ts(NULL, module, ctrl->setting, (TCHAR *) SendDlgItemMessage(hwndDlg, ctrl->nID, CB_GETITEMDATA, (WPARAM) sel, 0));
}
break;
}
diff --git a/plugins/Variables/src/action_variables.cpp b/plugins/Variables/src/action_variables.cpp index 2d7f60a015..deb9a1b3fb 100644 --- a/plugins/Variables/src/action_variables.cpp +++ b/plugins/Variables/src/action_variables.cpp @@ -66,7 +66,7 @@ int ParseStringAction(DWORD actionID, REPORTINFO *ri) { else {
mir_free(variables_parsedup(dbv.ptszVal, ((ri->td!=NULL)&&(ri->td->dFlags&DF_TEXT))?ri->td->tszText:NULL, ((ri->td!=NULL)&&(ri->td->dFlags&DF_CONTACT))?ri->td->hContact:NULL));
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
if (ri->flags&ACT_CLEANUP) {
@@ -94,7 +94,7 @@ INT_PTR CALLBACK DlgProcOptsParseString(HWND hwndDlg, UINT msg, WPARAM wParam, L actionID = (DWORD)lParam;
if (!DBGetActionSettingTString(actionID, NULL, MODULENAME, SETTING_PARSESTRING, &dbv)) {
SetDlgItemText(hwndDlg, IDC_PARSESTRING, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
CheckDlgButton(hwndDlg, IDC_PARSEASYNC, DBGetActionSettingByte(actionID, NULL, MODULENAME, SETTING_PARSEASYNC, 0)?BST_CHECKED:BST_UNCHECKED);
variables_skin_helpbutton(hwndDlg, IDC_SHOWHELP);
diff --git a/plugins/Variables/src/condition_variables.cpp b/plugins/Variables/src/condition_variables.cpp index 4ebe86a05d..964e34bec7 100644 --- a/plugins/Variables/src/condition_variables.cpp +++ b/plugins/Variables/src/condition_variables.cpp @@ -40,7 +40,7 @@ int ParseStringCondition(DWORD conditionID, REPORTINFO *ri) { mir_free((TCHAR*)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0));
log_debugA("err: %d", fi.eCount);
res = fi.eCount==0?CRV_TRUE:CRV_FALSE;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
if (ri->flags&CND_CLEANUP) {
@@ -68,7 +68,7 @@ INT_PTR CALLBACK DlgProcOptsCondition(HWND hwndDlg, UINT msg, WPARAM wParam, LPA conditionID = (DWORD)lParam;
if (!DBGetConditionSettingTString(conditionID, NULL, MODULENAME, SETTING_PARSESTRING, &dbv)) {
SetDlgItemText(hwndDlg, IDC_PARSESTRING, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
break;
}
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index f83653836e..c281d02ed3 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -143,7 +143,7 @@ TCHAR* getContactInfoT(BYTE type, HANDLE hContact) case CCNF_STATUS:
szStatus = (TCHAR*)CallService(
MS_CLIST_GETSTATUSMODEDESCRIPTION,
- (WPARAM)DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE),
+ (WPARAM)db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE),
(LPARAM)GSMDF_UNICODE);
if (szStatus == NULL)
return NULL;
@@ -152,7 +152,7 @@ TCHAR* getContactInfoT(BYTE type, HANDLE hContact) case CCNF_INTERNALIP:
case CCNF_EXTERNALIP:
{
- DWORD ip = DBGetContactSettingDword(hContact, szProto, (type == CCNF_INTERNALIP) ? "RealIP" : "IP", 0);
+ DWORD ip = db_get_dw(hContact, szProto, (type == CCNF_INTERNALIP) ? "RealIP" : "IP", 0);
if (ip == 0)
return NULL;
@@ -165,23 +165,23 @@ TCHAR* getContactInfoT(BYTE type, HANDLE hContact) }
case CCNF_GROUP:
- if (!DBGetContactSettingTString(hContact, "CList", "Group", &dbv))
+ if (!db_get_ts(hContact, "CList", "Group", &dbv))
{
res = (TCHAR*)mir_wstrdup(dbv.pwszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return res;
}
break;
case CNF_UNIQUEID:
//UID for ChatRoom
- if (DBGetContactSettingByte(hContact, szProto, "ChatRoom", 0) == 1)
+ if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1)
{
DBVARIANT dbv;
- if (!DBGetContactSettingTString(hContact, szProto, "ChatRoomID", &dbv ))
+ if (!db_get_ts(hContact, szProto, "ChatRoomID", &dbv ))
{
res = mir_tstrdup( dbv.ptszVal );
- DBFreeVariant( &dbv );
+ db_free( &dbv );
return res;
}
diff --git a/plugins/Variables/src/dbhelpers.h b/plugins/Variables/src/dbhelpers.h index c121d9c0a3..2315d2eab4 100644 --- a/plugins/Variables/src/dbhelpers.h +++ b/plugins/Variables/src/dbhelpers.h @@ -27,7 +27,7 @@ static int __inline DBWriteIthSettingByte(DWORD i, HANDLE hContact,const char *s char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
- return DBWriteContactSettingByte(hContact, szModule, dbSetting, val);
+ return db_set_b(hContact, szModule, dbSetting, val);
}
static int __inline DBWriteIthSettingWord(DWORD i, HANDLE hContact,const char *szModule,const char *szSetting,WORD val) {
@@ -35,7 +35,7 @@ static int __inline DBWriteIthSettingWord(DWORD i, HANDLE hContact,const char *s char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
- return DBWriteContactSettingWord(hContact, szModule, dbSetting, val);
+ return db_set_w(hContact, szModule, dbSetting, val);
}
static int __inline DBWriteIthSettingDword(DWORD i, HANDLE hContact,const char *szModule,const char *szSetting,DWORD val) {
@@ -43,7 +43,7 @@ static int __inline DBWriteIthSettingDword(DWORD i, HANDLE hContact,const char * char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
- return DBWriteContactSettingDword(hContact, szModule, dbSetting, val);
+ return db_set_dw(hContact, szModule, dbSetting, val);
}
static int __inline DBWriteIthSettingString(DWORD i, HANDLE hContact,const char *szModule,const char *szSetting,const char *val) {
@@ -51,7 +51,7 @@ static int __inline DBWriteIthSettingString(DWORD i, HANDLE hContact,const char char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
- return DBWriteContactSettingString(hContact, szModule, dbSetting, val);
+ return db_set_s(hContact, szModule, dbSetting, val);
}
static int __inline DBGetIthSettingByte(DWORD i, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
@@ -60,7 +60,7 @@ static int __inline DBGetIthSettingByte(DWORD i, HANDLE hContact, const char *sz char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
- return DBGetContactSettingByte(hContact, szModule, dbSetting, errorValue);
+ return db_get_b(hContact, szModule, dbSetting, errorValue);
}
static WORD __inline DBGetIthSettingWord(DWORD i, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
@@ -69,7 +69,7 @@ static WORD __inline DBGetIthSettingWord(DWORD i, HANDLE hContact, const char *s char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
- return DBGetContactSettingWord(hContact, szModule, dbSetting, errorValue);
+ return db_get_w(hContact, szModule, dbSetting, errorValue);
}
static DWORD __inline DBGetIthSettingDword(DWORD i, HANDLE hContact, const char *szModule, const char *szSetting, int errorValue) {
@@ -78,7 +78,7 @@ static DWORD __inline DBGetIthSettingDword(DWORD i, HANDLE hContact, const char char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
- return DBGetContactSettingDword(hContact, szModule, dbSetting, errorValue);
+ return db_get_dw(hContact, szModule, dbSetting, errorValue);
}
static int __inline DBGetIthSetting(DWORD i, HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) {
@@ -87,7 +87,7 @@ static int __inline DBGetIthSetting(DWORD i, HANDLE hContact, const char *szModu char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
- return DBGetContactSetting(hContact, szModule, dbSetting, dbv);
+ return db_get(hContact, szModule, dbSetting, dbv);
}
static int __inline DBDeleteIthSetting(DWORD i, HANDLE hContact,const char *szModule,const char *szSetting) {
@@ -95,19 +95,19 @@ static int __inline DBDeleteIthSetting(DWORD i, HANDLE hContact,const char *szMo char dbSetting[128];
_snprintf(dbSetting, sizeof(dbSetting), "%s%u_%s", PREFIX_ITH, i, szSetting);
- return DBDeleteContactSetting(hContact, szModule, dbSetting);
+ return db_unset(hContact, szModule, dbSetting);
}
-#define db_getb(a,b) DBGetContactSettingByte(NULL, MODULENAME, a, b)
-#define db_getw(a,b) DBGetContactSettingWord(NULL, MODULENAME, a, b)
-#define db_getd(a,b) DBGetContactSettingDword(NULL, MODULENAME, a, b)
-#define db_gets(a,b) DBGetContactSetting(NULL, MODULENAME, a, b)
-#define db_setb(a,b) DBWriteContactSettingByte(NULL, MODULENAME, a, (BYTE)(b))
-#define db_sets(a,b) DBWriteContactSettingString(NULL, MODULENAME, a, b)
-#define db_setts(a,b) DBWriteContactSettingTString(NULL, MODULENAME, a, b)
-#define db_setw(a,b) DBWriteContactSettingWord(NULL, MODULENAME, a, (WORD)(b))
-#define db_setd(a,b) DBWriteContactSettingDword(NULL, MODULENAME, a, (DWORD)(b))
-#define db_del(a) DBDeleteContactSetting(NULL, MODULENAME, a);
+#define db_getb(a,b) db_get_b(NULL, MODULENAME, a, b)
+#define db_getw(a,b) db_get_w(NULL, MODULENAME, a, b)
+#define db_getd(a,b) db_get_dw(NULL, MODULENAME, a, b)
+#define db_gets(a,b) db_get(NULL, MODULENAME, a, b)
+#define db_setb(a,b) db_set_b(NULL, MODULENAME, a, (BYTE)(b))
+#define db_sets(a,b) db_set_s(NULL, MODULENAME, a, b)
+#define db_setts(a,b) db_set_ts(NULL, MODULENAME, a, b)
+#define db_setw(a,b) db_set_w(NULL, MODULENAME, a, (WORD)(b))
+#define db_setd(a,b) db_set_dw(NULL, MODULENAME, a, (DWORD)(b))
+#define db_del(a) db_unset(NULL, MODULENAME, a);
#define dbi_getb(a,b,c) DBGetIthSettingByte(a, NULL, MODULENAME, b, c)
#define dbi_getw(a,b,c) DBGetIthSettingWord(a, NULL, MODULENAME, b, c)
diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp index 5569ef522d..59476e1a77 100644 --- a/plugins/Variables/src/help.cpp +++ b/plugins/Variables/src/help.cpp @@ -102,7 +102,7 @@ void ResetCList(HWND hwndDlg) { int i;
- if ((CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_DISABLEGROUPS && !DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT)) || !(GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE)&CLS_USEGROUPS))
+ if ((CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_DISABLEGROUPS && !db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT)) || !(GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE)&CLS_USEGROUPS))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETUSEGROUPS, (WPARAM) FALSE, 0);
else
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETUSEGROUPS, (WPARAM) TRUE, 0);
diff --git a/plugins/Variables/src/options.cpp b/plugins/Variables/src/options.cpp index e6d3577fb3..047ec195e9 100644 --- a/plugins/Variables/src/options.cpp +++ b/plugins/Variables/src/options.cpp @@ -26,9 +26,9 @@ static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA TranslateDialogDefault(hwndDlg);
{
DBVARIANT dbv;
- if (!DBGetContactSettingTString( NULL, MODULENAME, SETTING_STARTUPTEXT, &dbv )) {
+ if (!db_get_ts( NULL, MODULENAME, SETTING_STARTUPTEXT, &dbv )) {
SetDlgItemText(hwndDlg, IDC_FORMATTEXT, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
CheckDlgButton(hwndDlg, IDC_PARSEATSTARTUP, db_get_b(NULL, MODULENAME, SETTING_PARSEATSTARTUP, 0));
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 3a28fcde05..acd369ec6a 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -201,7 +201,7 @@ static TCHAR* getDBSetting(HANDLE hContact, char* module, char* setting, TCHAR* break;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return var;
}
@@ -272,21 +272,21 @@ static TCHAR *parseLastSeenDate(ARGUMENTSINFO *ai) SYSTEMTIME lsTime = { 0 };
char *szModule = CEX_MODULE;
- lsTime.wYear = DBGetContactSettingWord(hContact, szModule, "Year", 0);
+ lsTime.wYear = db_get_w(hContact, szModule, "Year", 0);
if (lsTime.wYear == 0)
szModule = SEEN_MODULE;
- lsTime.wYear = DBGetContactSettingWord(hContact, szModule, "Year", 0);
+ lsTime.wYear = db_get_w(hContact, szModule, "Year", 0);
if (lsTime.wYear == 0)
return NULL;
lsTime.wMilliseconds = 0;
- lsTime.wSecond = DBGetContactSettingWord(hContact, szModule, "Seconds", 0);
- lsTime.wMinute = DBGetContactSettingWord(hContact, szModule, "Minutes", 0);
- lsTime.wHour = DBGetContactSettingWord(hContact, szModule, "Hours", 0);
- lsTime.wDay = DBGetContactSettingWord(hContact, szModule, "Day", 0);
- lsTime.wDayOfWeek = DBGetContactSettingWord(hContact, szModule, "WeekDay", 0);
- lsTime.wMonth = DBGetContactSettingWord(hContact, szModule, "Month", 0);
+ lsTime.wSecond = db_get_w(hContact, szModule, "Seconds", 0);
+ lsTime.wMinute = db_get_w(hContact, szModule, "Minutes", 0);
+ lsTime.wHour = db_get_w(hContact, szModule, "Hours", 0);
+ lsTime.wDay = db_get_w(hContact, szModule, "Day", 0);
+ lsTime.wDayOfWeek = db_get_w(hContact, szModule, "WeekDay", 0);
+ lsTime.wMonth = db_get_w(hContact, szModule, "Month", 0);
int len = GetDateFormat(LOCALE_USER_DEFAULT, 0, &lsTime, szFormat, NULL, 0);
TCHAR *res = (TCHAR*)mir_alloc((len+1)*sizeof(TCHAR));
@@ -330,22 +330,22 @@ static TCHAR *parseLastSeenTime(ARGUMENTSINFO *ai) SYSTEMTIME lsTime = { 0 };
char *szModule = CEX_MODULE;
- lsTime.wYear = DBGetContactSettingWord(hContact, szModule, "Year", 0);
+ lsTime.wYear = db_get_w(hContact, szModule, "Year", 0);
if (lsTime.wYear == 0)
szModule = SEEN_MODULE;
- lsTime.wYear = DBGetContactSettingWord(hContact, szModule, "Year", 0);
+ lsTime.wYear = db_get_w(hContact, szModule, "Year", 0);
if (lsTime.wYear == 0)
return NULL;
lsTime.wMilliseconds = 0;
- lsTime.wSecond = DBGetContactSettingWord(hContact, szModule, "Seconds", 0);
- lsTime.wMinute = DBGetContactSettingWord(hContact, szModule, "Minutes", 0);
- lsTime.wHour = DBGetContactSettingWord(hContact, szModule, "Hours", 0);
- lsTime.wDay = DBGetContactSettingWord(hContact, szModule, "Day", 0);
- lsTime.wDayOfWeek = DBGetContactSettingWord(hContact, szModule, "WeekDay", 0);
- lsTime.wMonth = DBGetContactSettingWord(hContact, szModule, "Month", 0);
- lsTime.wYear = DBGetContactSettingWord(hContact, szModule, "Year", 0);
+ lsTime.wSecond = db_get_w(hContact, szModule, "Seconds", 0);
+ lsTime.wMinute = db_get_w(hContact, szModule, "Minutes", 0);
+ lsTime.wHour = db_get_w(hContact, szModule, "Hours", 0);
+ lsTime.wDay = db_get_w(hContact, szModule, "Day", 0);
+ lsTime.wDayOfWeek = db_get_w(hContact, szModule, "WeekDay", 0);
+ lsTime.wMonth = db_get_w(hContact, szModule, "Month", 0);
+ lsTime.wYear = db_get_w(hContact, szModule, "Year", 0);
int len = GetTimeFormat(LOCALE_USER_DEFAULT, 0, &lsTime, szFormat, NULL, 0);
TCHAR *res = (TCHAR*)mir_alloc((len+1)*sizeof(TCHAR));
@@ -380,11 +380,11 @@ static TCHAR *parseLastSeenStatus(ARGUMENTSINFO *ai) return NULL;
}
char *szModule = CEX_MODULE;
- int status = DBGetContactSettingWord(hContact, szModule, "Status", 0);
+ int status = db_get_w(hContact, szModule, "Status", 0);
if (status == 0)
szModule = SEEN_MODULE;
- status = DBGetContactSettingWord(hContact, szModule, "Status", 0);
+ status = db_get_w(hContact, szModule, "Status", 0);
if (status == 0)
return NULL;
diff --git a/plugins/Variables/src/trigger_variables.cpp b/plugins/Variables/src/trigger_variables.cpp index f00b02d969..75920eb453 100644 --- a/plugins/Variables/src/trigger_variables.cpp +++ b/plugins/Variables/src/trigger_variables.cpp @@ -49,7 +49,7 @@ static int addToCache(DWORD triggerID) return -1;
tvcCount += 1;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return 0;
}
@@ -106,7 +106,7 @@ static VOID CALLBACK checkStringsTimer(HWND hwnd,UINT message,UINT_PTR idEvent,D CallService(MS_TRIGGER_REPORTEVENT, 0, (LPARAM)&ri);
mir_free(tvc[i].parsedText);
tvc[i].parsedText = parsedText;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -125,7 +125,7 @@ INT_PTR CALLBACK DlgProcOptsStringChange(HWND hwndDlg, UINT msg, WPARAM wParam, triggerID = (DWORD)lParam;
if (!DBGetTriggerSetting(triggerID, NULL, MODULENAME, SETTING_TRIGGERTEXT, &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_FORMATTEXT, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
variables_skin_helpbutton(hwndDlg, IDC_SHOWHELP);
}
diff --git a/plugins/VersionInfo/src/CVersionInfo.cpp b/plugins/VersionInfo/src/CVersionInfo.cpp index c67099874f..a477ae1258 100644 --- a/plugins/VersionInfo/src/CVersionInfo.cpp +++ b/plugins/VersionInfo/src/CVersionInfo.cpp @@ -532,7 +532,7 @@ bool CVersionInfo::GetOSLanguages() lpzOSLanguages += _T("/");
lpzOSLanguages += GetLanguageName(LOCALE_SYSTEM_DEFAULT);
- if (DBGetContactSettingByte(NULL, ModuleName, "ShowInstalledLanguages", 0)) {
+ if (db_get_b(NULL, ModuleName, "ShowInstalledLanguages", 0)) {
szSystemLocales[0] = '\0';
lpzOSLanguages += _T(" [");
EnumSystemLocales(EnumSystemLocalesProc, LCID_INSTALLED);
@@ -701,7 +701,7 @@ bool CVersionInfo::GetPluginLists() int bUnknownError = 1; //assume plugin didn't load because of unknown error
//Some error messages.
//get the dlls the plugin statically links to
- if (DBGetContactSettingByte(NULL, ModuleName, "CheckForDependencies", TRUE))
+ if (db_get_b(NULL, ModuleName, "CheckForDependencies", TRUE))
{
std::tstring linkedModules;
@@ -890,7 +890,7 @@ std::tstring CVersionInfo::GetListAsString(std::list<CPlugin> &aList, DWORD flag TCHAR szHeader[32] = {0};
TCHAR szFooter[32] = {0};
- if ((((flags & VISF_FORUMSTYLE) == VISF_FORUMSTYLE) || beautify) && (DBGetContactSettingByte(NULL, ModuleName, "BoldVersionNumber", TRUE))) {
+ if ((((flags & VISF_FORUMSTYLE) == VISF_FORUMSTYLE) || beautify) && (db_get_b(NULL, ModuleName, "BoldVersionNumber", TRUE))) {
GetStringFromDatabase("BoldBegin", _T("[b]"), szHeader, SIZEOF(szHeader));
GetStringFromDatabase("BoldEnd", _T("[/b]"), szFooter, SIZEOF(szFooter));
}
@@ -1034,10 +1034,10 @@ static void AddSectionAndCount(std::list<CPlugin> list, LPCTSTR listText, std::t std::tstring CVersionInfo::GetInformationsAsString(int bDisableForumStyle) {
//Begin of report
std::tstring out;
- int forumStyle = (bDisableForumStyle) ? 0 : DBGetContactSettingByte(NULL, ModuleName, "ForumStyle", TRUE);
- int showUUID = DBGetContactSettingByte(NULL, ModuleName, "ShowUUIDs", FALSE);
- int beautify = DBGetContactSettingByte(NULL, ModuleName, "Beautify", 0) & (!forumStyle);
- int suppressHeader = DBGetContactSettingByte(NULL, ModuleName, "SuppressHeader", TRUE);
+ int forumStyle = (bDisableForumStyle) ? 0 : db_get_b(NULL, ModuleName, "ForumStyle", TRUE);
+ int showUUID = db_get_b(NULL, ModuleName, "ShowUUIDs", FALSE);
+ int beautify = db_get_b(NULL, ModuleName, "Beautify", 0) & (!forumStyle);
+ int suppressHeader = db_get_b(NULL, ModuleName, "SuppressHeader", TRUE);
DWORD flags = (forumStyle) | (showUUID << 1);
@@ -1073,7 +1073,7 @@ std::tstring CVersionInfo::GetInformationsAsString(int bDisableForumStyle) { GetStringFromDatabase("BeautifyPluginsEnd", _T("</font>"), normalPluginsEnd, SIZEOF(normalPluginsEnd));
BeautifyReport(beautify, normalPluginsEnd, _T(""), out);
//Plugins: list of inactive (disabled) plugins.
- if ((!forumStyle) && ((DBGetContactSettingByte(NULL, ModuleName, "ShowInactive", TRUE)) || (bServiceMode))) {
+ if ((!forumStyle) && ((db_get_b(NULL, ModuleName, "ShowInactive", TRUE)) || (bServiceMode))) {
BeautifyReport(beautify, horizLine, _T("\r\n"), out);
GetStringFromDatabase("BeautifyInactiveHeaderBegin", _T("<b><font size=\"-1\" color=\"DarkRed\">"), buffer, SIZEOF(buffer));
BeautifyReport(beautify, buffer, headerHighlightStart, out);
diff --git a/plugins/VersionInfo/src/dlgHandlers.cpp b/plugins/VersionInfo/src/dlgHandlers.cpp index 3fb436b04e..6ffb2cf332 100644 --- a/plugins/VersionInfo/src/dlgHandlers.cpp +++ b/plugins/VersionInfo/src/dlgHandlers.cpp @@ -65,7 +65,7 @@ INT_PTR CALLBACK AskDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) TranslateDialogDefault(hWnd);
- oldFSFValue = DBGetContactSettingByte(NULL, ModuleName, "ForumStyle", 1);
+ oldFSFValue = db_get_b(NULL, ModuleName, "ForumStyle", 1);
AddInfoToComboboxes(hWnd, IDC_ASK_QUOTECOMBOBOX, IDC_ASK_SIZECOMBOBOX, IDC_ASK_BOLDCOMBOBOX);
@@ -122,17 +122,17 @@ INT_PTR CALLBACK AskDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) int newFSFValue = IsDlgButtonChecked(hWnd, IDC_ASK_FORUMSTYLE);
if (newFSFValue != oldFSFValue)
- DBWriteContactSettingByte(NULL, ModuleName, "ForumStyle", newFSFValue); //temporary store the new value
+ db_set_b(NULL, ModuleName, "ForumStyle", newFSFValue); //temporary store the new value
if (newFSFValue) {
- DBWriteContactSettingTString(NULL, ModuleName, "QuoteBegin", quoteBegin);
- DBWriteContactSettingTString(NULL, ModuleName, "QuoteEnd", quoteEnd);
+ db_set_ts(NULL, ModuleName, "QuoteBegin", quoteBegin);
+ db_set_ts(NULL, ModuleName, "QuoteEnd", quoteEnd);
- DBWriteContactSettingTString(NULL, ModuleName, "SizeBegin", sizeBegin);
- DBWriteContactSettingTString(NULL, ModuleName, "SizeEnd", sizeEnd);
+ db_set_ts(NULL, ModuleName, "SizeBegin", sizeBegin);
+ db_set_ts(NULL, ModuleName, "SizeEnd", sizeEnd);
- DBWriteContactSettingTString(NULL, ModuleName, "BoldBegin", boldBegin);
- DBWriteContactSettingTString(NULL, ModuleName, "BoldEnd", boldEnd);
+ db_set_ts(NULL, ModuleName, "BoldBegin", boldBegin);
+ db_set_ts(NULL, ModuleName, "BoldEnd", boldEnd);
}
int debugTo = TO_DIALOGBOX; //just to be safe
@@ -152,17 +152,17 @@ INT_PTR CALLBACK AskDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) DoDebugTo(debugTo);
if (newFSFValue != oldFSFValue)
- DBWriteContactSettingByte(NULL, ModuleName, "ForumStyle", oldFSFValue);
+ db_set_b(NULL, ModuleName, "ForumStyle", oldFSFValue);
if (newFSFValue) {
- DBWriteContactSettingTString(NULL, ModuleName, "QuoteBegin", oldQuoteBegin);
- DBWriteContactSettingTString(NULL, ModuleName, "QuoteEnd", oldQuoteEnd);
+ db_set_ts(NULL, ModuleName, "QuoteBegin", oldQuoteBegin);
+ db_set_ts(NULL, ModuleName, "QuoteEnd", oldQuoteEnd);
- DBWriteContactSettingTString(NULL, ModuleName, "SizeBegin", oldSizeBegin);
- DBWriteContactSettingTString(NULL, ModuleName, "SizeEnd", oldSizeEnd);
+ db_set_ts(NULL, ModuleName, "SizeBegin", oldSizeBegin);
+ db_set_ts(NULL, ModuleName, "SizeEnd", oldSizeEnd);
- DBWriteContactSettingTString(NULL, ModuleName, "BoldBegin", oldBoldBegin);
- DBWriteContactSettingTString(NULL, ModuleName, "BoldEnd", oldBoldEnd);
+ db_set_ts(NULL, ModuleName, "BoldBegin", oldBoldBegin);
+ db_set_ts(NULL, ModuleName, "BoldEnd", oldBoldEnd);
}
DestroyWindow(hWnd);
@@ -215,7 +215,7 @@ int DoDebugTo(int debugTo) break;
}
- if ((debugTo != TO_CLIPBOARD) && (DBGetContactSettingByte(NULL, ModuleName, "ClipboardAlways", FALSE)))
+ if ((debugTo != TO_CLIPBOARD) && (db_get_b(NULL, ModuleName, "ClipboardAlways", FALSE)))
myInfo.PrintInformationsToClipboard(false);
if ((bServiceMode) && (debugTo != TO_DIALOGBOX) && (debugTo != TO_ASK)) //close miranda if in service mode and no dialog was shown
@@ -241,16 +241,16 @@ INT_PTR CALLBACK DlgProcOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) TranslateDialogDefault(hWnd);
AddInfoToComboboxes(hWnd, IDC_QUOTECOMBOBOX, IDC_SIZECOMBOBOX, IDC_BOLDCOMBOBOX);
- CheckDlgButton(hWnd, IDC_FORUMSTYLE, (BOOL) DBGetContactSettingByte(NULL, ModuleName, "ForumStyle", TRUE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_DISABLEDTOO, (BOOL) DBGetContactSettingByte(NULL, ModuleName, "ShowInactive", TRUE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_SHOWUUIDS, (BOOL) DBGetContactSettingByte(NULL, ModuleName, "ShowUUIDs", FALSE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_SHOWINSTALLEDLANGUAGES, (BOOL) DBGetContactSettingByte(NULL, ModuleName, "ShowInstalledLanguages", FALSE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_SUPPRESSHEADER, (BOOL) DBGetContactSettingByte(NULL, ModuleName, "SuppressHeader", TRUE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_FORUMSTYLE, (BOOL) db_get_b(NULL, ModuleName, "ForumStyle", TRUE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_DISABLEDTOO, (BOOL) db_get_b(NULL, ModuleName, "ShowInactive", TRUE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_SHOWUUIDS, (BOOL) db_get_b(NULL, ModuleName, "ShowUUIDs", FALSE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_SHOWINSTALLEDLANGUAGES, (BOOL) db_get_b(NULL, ModuleName, "ShowInstalledLanguages", FALSE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_SUPPRESSHEADER, (BOOL) db_get_b(NULL, ModuleName, "SuppressHeader", TRUE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_SHOWINTASKBAR, (BOOL) DBGetContactSettingByte(NULL, ModuleName, "ShowInTaskbar", TRUE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_CLIPBOARDALSO, (BOOL) DBGetContactSettingByte(NULL, ModuleName, "ClipboardAlways", FALSE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_BOLDVERSION, (BOOL) DBGetContactSettingByte(NULL, ModuleName, "BoldVersionNumber", TRUE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_CHECKUNLOADABLE, (BOOL) DBGetContactSettingByte(NULL, ModuleName, "CheckForDependencies", TRUE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_SHOWINTASKBAR, (BOOL) db_get_b(NULL, ModuleName, "ShowInTaskbar", TRUE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_CLIPBOARDALSO, (BOOL) db_get_b(NULL, ModuleName, "ClipboardAlways", FALSE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_BOLDVERSION, (BOOL) db_get_b(NULL, ModuleName, "BoldVersionNumber", TRUE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_CHECKUNLOADABLE, (BOOL) db_get_b(NULL, ModuleName, "CheckForDependencies", TRUE) ? BST_CHECKED : BST_UNCHECKED);
SetFocus(GetDlgItem(hWnd, IDC_FORUMSTYLE));
{
DBVARIANT dbv = { 0 };
@@ -258,7 +258,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) TCHAR buffer[1024];
TCHAR notFound[1024];
- if (DBGetContactSettingTString(NULL, ModuleName, "OutputFile", &dbv) == 0)
+ if (db_get_ts(NULL, ModuleName, "OutputFile", &dbv) == 0)
RelativePathToAbsolute(dbv.ptszVal, notFound, SIZEOF(notFound));
else
RelativePathToAbsolute( _T("VersionInfo.txt"), notFound, SIZEOF(notFound));
@@ -291,7 +291,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) GetStringFromDatabase("UploadServer", _T("vi.cass.cz"), buffer, SIZEOF(buffer));
SetWindowText(GetDlgItem(hWnd, IDC_UPLOAD_SERVER), buffer);
- int port = DBGetContactSettingWord(NULL, ModuleName, "UploadPort", DEFAULT_UPLOAD_PORT);
+ int port = db_get_w(NULL, ModuleName, "UploadPort", DEFAULT_UPLOAD_PORT);
_itot(port, buffer, 10);
SetWindowText(GetDlgItem(hWnd, IDC_UPLOAD_PORT), buffer);
@@ -303,7 +303,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) SetWindowText(GetDlgItem(hWnd, IDC_UPLOAD_PASSWORD), buffer);
}
- switch(DBGetContactSettingByte(NULL, ModuleName, "DebugTo", TO_DIALOGBOX)) {
+ switch(db_get_b(NULL, ModuleName, "DebugTo", TO_DIALOGBOX)) {
case TO_FILE:
CheckDlgButton(hWnd, IDC_TOFILE, BST_CHECKED);
break;
@@ -440,53 +440,53 @@ INT_PTR CALLBACK DlgProcOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) TCHAR start[256], end[256];
SendDlgItemMessage(hWnd, IDC_QUOTECOMBOBOX, WM_GETTEXT, SIZEOF(buffer), (LPARAM) buffer);
SplitStringInfo(buffer, start, end);
- DBWriteContactSettingTString(NULL, ModuleName, "QuoteBegin", start);
- DBWriteContactSettingTString(NULL, ModuleName, "QuoteEnd", end);
+ db_set_ts(NULL, ModuleName, "QuoteBegin", start);
+ db_set_ts(NULL, ModuleName, "QuoteEnd", end);
SendDlgItemMessage(hWnd, IDC_SIZECOMBOBOX, WM_GETTEXT, SIZEOF(buffer), (LPARAM) buffer);
SplitStringInfo(buffer, start, end);
- DBWriteContactSettingTString(NULL, ModuleName, "SizeBegin", start);
- DBWriteContactSettingTString(NULL, ModuleName, "SizeEnd", end);
+ db_set_ts(NULL, ModuleName, "SizeBegin", start);
+ db_set_ts(NULL, ModuleName, "SizeEnd", end);
SendDlgItemMessage(hWnd, IDC_BOLDCOMBOBOX, WM_GETTEXT, SIZEOF(buffer), (LPARAM) buffer);
SplitStringInfo(buffer, start, end);
- DBWriteContactSettingTString(NULL, ModuleName, "BoldBegin", start);
- DBWriteContactSettingTString(NULL, ModuleName, "BoldEnd", end);
+ db_set_ts(NULL, ModuleName, "BoldBegin", start);
+ db_set_ts(NULL, ModuleName, "BoldEnd", end);
}
- DBWriteContactSettingByte(NULL, ModuleName, "CheckForDependencies", IsDlgButtonChecked(hWnd, IDC_CHECKUNLOADABLE) ? TRUE : FALSE);
- DBWriteContactSettingByte(NULL, ModuleName, "BoldVersionNumber", IsDlgButtonChecked(hWnd, IDC_BOLDVERSION) ? TRUE : FALSE);
- DBWriteContactSettingByte(NULL, ModuleName, "ForumStyle", IsDlgButtonChecked(hWnd, IDC_FORUMSTYLE) ? TRUE : FALSE);
- DBWriteContactSettingByte(NULL, ModuleName, "ClipboardAlways", IsDlgButtonChecked(hWnd, IDC_CLIPBOARDALSO) ? TRUE : FALSE);
- DBWriteContactSettingByte(NULL, ModuleName, "SuppressHeader", IsDlgButtonChecked(hWnd, IDC_SUPPRESSHEADER) ? TRUE : FALSE);
- DBWriteContactSettingByte(NULL, ModuleName, "ShowUUIDs", IsDlgButtonChecked(hWnd, IDC_SHOWUUIDS) ? TRUE : FALSE);
- DBWriteContactSettingByte(NULL, ModuleName, "ShowInstalledLanguages", IsDlgButtonChecked(hWnd, IDC_SHOWINSTALLEDLANGUAGES) ? TRUE : FALSE);
+ db_set_b(NULL, ModuleName, "CheckForDependencies", IsDlgButtonChecked(hWnd, IDC_CHECKUNLOADABLE) ? TRUE : FALSE);
+ db_set_b(NULL, ModuleName, "BoldVersionNumber", IsDlgButtonChecked(hWnd, IDC_BOLDVERSION) ? TRUE : FALSE);
+ db_set_b(NULL, ModuleName, "ForumStyle", IsDlgButtonChecked(hWnd, IDC_FORUMSTYLE) ? TRUE : FALSE);
+ db_set_b(NULL, ModuleName, "ClipboardAlways", IsDlgButtonChecked(hWnd, IDC_CLIPBOARDALSO) ? TRUE : FALSE);
+ db_set_b(NULL, ModuleName, "SuppressHeader", IsDlgButtonChecked(hWnd, IDC_SUPPRESSHEADER) ? TRUE : FALSE);
+ db_set_b(NULL, ModuleName, "ShowUUIDs", IsDlgButtonChecked(hWnd, IDC_SHOWUUIDS) ? TRUE : FALSE);
+ db_set_b(NULL, ModuleName, "ShowInstalledLanguages", IsDlgButtonChecked(hWnd, IDC_SHOWINSTALLEDLANGUAGES) ? TRUE : FALSE);
if (!hOutputLocation) {
TCHAR filePath[MAX_PATH], fileName[MAX_PATH];
GetDlgItemText(hWnd, IDC_FILENAME, fileName, MAX_PATH);
AbsolutePathToRelative(fileName, filePath, SIZEOF(filePath));
- DBWriteContactSettingTString(NULL, ModuleName, "OutputFile", filePath); //store relative path
+ db_set_ts(NULL, ModuleName, "OutputFile", filePath); //store relative path
}
- DBWriteContactSettingByte(NULL, ModuleName, "ShowInTaskbar", IsDlgButtonChecked(hWnd, IDC_SHOWINTASKBAR) ? TRUE : FALSE);
+ db_set_b(NULL, ModuleName, "ShowInTaskbar", IsDlgButtonChecked(hWnd, IDC_SHOWINTASKBAR) ? TRUE : FALSE);
//Debug to:
if (IsDlgButtonChecked(hWnd, IDC_TOFILE))
- DBWriteContactSettingByte(NULL, ModuleName, "DebugTo", TO_FILE);
+ db_set_b(NULL, ModuleName, "DebugTo", TO_FILE);
else if (IsDlgButtonChecked(hWnd, IDC_TOMESSAGEBOX))
- DBWriteContactSettingByte(NULL, ModuleName, "DebugTo", TO_MESSAGEBOX);
+ db_set_b(NULL, ModuleName, "DebugTo", TO_MESSAGEBOX);
else if (IsDlgButtonChecked(hWnd, IDC_TODIALOGBOX))
- DBWriteContactSettingByte(NULL, ModuleName, "DebugTo", TO_DIALOGBOX);
+ db_set_b(NULL, ModuleName, "DebugTo", TO_DIALOGBOX);
else if (IsDlgButtonChecked(hWnd, IDC_TODEBUGSTRING))
- DBWriteContactSettingByte(NULL, ModuleName, "DebugTo", TO_DEBUGSTRING);
+ db_set_b(NULL, ModuleName, "DebugTo", TO_DEBUGSTRING);
else if (IsDlgButtonChecked(hWnd, IDC_TOCLIPBOARD))
- DBWriteContactSettingByte(NULL, ModuleName, "DebugTo", TO_CLIPBOARD);
+ db_set_b(NULL, ModuleName, "DebugTo", TO_CLIPBOARD);
else if (IsDlgButtonChecked(hWnd, IDC_TOUPLOAD))
- DBWriteContactSettingByte(NULL, ModuleName, "DebugTo", TO_UPLOAD);
+ db_set_b(NULL, ModuleName, "DebugTo", TO_UPLOAD);
else if (IsDlgButtonChecked(hWnd, IDC_ASKEVERYTIME))
- DBWriteContactSettingByte(NULL, ModuleName, "DebugTo", TO_ASK);
+ db_set_b(NULL, ModuleName, "DebugTo", TO_ASK);
EnableWindow(GetDlgItem(hWnd, IDC_GETINFONOW), TRUE);
//Disabled plugins too?
- DBWriteContactSettingByte(NULL, ModuleName, "ShowInactive", IsDlgButtonChecked(hWnd, IDC_DISABLEDTOO)?TRUE:FALSE);
+ db_set_b(NULL, ModuleName, "ShowInactive", IsDlgButtonChecked(hWnd, IDC_DISABLEDTOO)?TRUE:FALSE);
GetStringFromDatabase("UUIDCharMark", _T(DEF_UUID_CHARMARK), PLUGIN_UUID_MARK, cPLUGIN_UUID_MARK);
} }
@@ -504,7 +504,7 @@ INT_PTR CALLBACK DialogBoxProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM) hiVIIcon);
myInfo = (CVersionInfo *) lParam;
- if (DBGetContactSettingByte(NULL, ModuleName, "ShowInTaskbar", TRUE)) {
+ if (db_get_b(NULL, ModuleName, "ShowInTaskbar", TRUE)) {
DWORD ws;
ws = GetWindowLongPtr(hWnd, GWL_EXSTYLE);
SetWindowLongPtr(hWnd, GWL_EXSTYLE, ws | WS_EX_APPWINDOW);
@@ -517,7 +517,7 @@ INT_PTR CALLBACK DialogBoxProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam LOGFONT lf = { 0 };
dbv.type = DBVT_BLOB;
- if (DBGetContactSetting(NULL, "OptionFont", "Font", &dbv) == 0)
+ if (db_get(NULL, "OptionFont", "Font", &dbv) == 0)
lf=*(LOGFONT*)dbv.pbVal;
else {
HFONT hFont = (HFONT)SendDlgItemMessage(hWnd,IDC_CLOSE,WM_GETFONT,0,0);
diff --git a/plugins/VersionInfo/src/services.cpp b/plugins/VersionInfo/src/services.cpp index 2f7ad03534..3953af590a 100644 --- a/plugins/VersionInfo/src/services.cpp +++ b/plugins/VersionInfo/src/services.cpp @@ -32,7 +32,7 @@ int InitServices() INT_PTR PluginMenuCommand(WPARAM wParam, LPARAM lParam)
{
- int debugTo = DBGetContactSettingByte(NULL, ModuleName, "DebugTo", TO_DIALOGBOX);
+ int debugTo = db_get_b(NULL, ModuleName, "DebugTo", TO_DIALOGBOX);
DoDebugTo(debugTo);
if (verbose) PUShowMessage("I have printed the information.", SM_NOTIFY);
/* char *data;
diff --git a/plugins/VersionInfo/src/utils.cpp b/plugins/VersionInfo/src/utils.cpp index 1822880a3f..1573d3260c 100644 --- a/plugins/VersionInfo/src/utils.cpp +++ b/plugins/VersionInfo/src/utils.cpp @@ -63,7 +63,7 @@ int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult, DBVARIANT dbv = {0};
int res = 1;
size_t len;
- if ( DBGetContactSettingTString(NULL, ModuleName, szSettingName, &dbv) == 0) {
+ if ( db_get_ts(NULL, ModuleName, szSettingName, &dbv) == 0) {
res = 0;
size_t tmp = _tcslen(dbv.ptszVal);
len = (tmp < size - 1) ? tmp : size - 1;
diff --git a/plugins/Watrack_MPD/src/init.cpp b/plugins/Watrack_MPD/src/init.cpp index d83e142bed..9b33425cb7 100755 --- a/plugins/Watrack_MPD/src/init.cpp +++ b/plugins/Watrack_MPD/src/init.cpp @@ -50,7 +50,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda void InitVars()
{
- gbPort = DBGetContactSettingWord(NULL, szModuleName, "Port", 6600);
+ gbPort = db_get_w(NULL, szModuleName, "Port", 6600);
gbPassword = (TCHAR*)malloc(64*sizeof(TCHAR));
gbHost = (TCHAR*)malloc(128*sizeof(TCHAR));
gbHost = UniGetContactSettingUtf(NULL, szModuleName, "Server", _T("127.0.0.1"));
diff --git a/plugins/Watrack_MPD/src/options.cpp b/plugins/Watrack_MPD/src/options.cpp index 770d5988b0..9d9d755f8c 100755 --- a/plugins/Watrack_MPD/src/options.cpp +++ b/plugins/Watrack_MPD/src/options.cpp @@ -23,7 +23,7 @@ static INT_PTR CALLBACK DlgProcWaMpdOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case WM_INITDIALOG: { TranslateDialogDefault(hwndDlg); - SetDlgItemInt(hwndDlg, IDC_PORT, DBGetContactSettingWord(NULL, szModuleName, "Port", 6600), FALSE); + SetDlgItemInt(hwndDlg, IDC_PORT, db_get_w(NULL, szModuleName, "Port", 6600), FALSE); SetDlgItemText(hwndDlg, IDC_SERVER, UniGetContactSettingUtf(NULL, szModuleName, "Server", _T("127.0.0.1"))); SetDlgItemText(hwndDlg, IDC_PASSWORD, UniGetContactSettingUtf(NULL, szModuleName, "Password", _T(""))); return TRUE; @@ -44,13 +44,13 @@ static INT_PTR CALLBACK DlgProcWaMpdOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case PSN_APPLY: { TCHAR szText[128]; - DBWriteContactSettingWord(NULL, szModuleName, "Port", (WORD)GetDlgItemInt(hwndDlg, IDC_PORT, NULL, FALSE)); + db_set_w(NULL, szModuleName, "Port", (WORD)GetDlgItemInt(hwndDlg, IDC_PORT, NULL, FALSE)); gbPort = (WORD)GetDlgItemInt(hwndDlg, IDC_PORT, NULL, FALSE); GetDlgItemText(hwndDlg, IDC_SERVER, szText, sizeof(szText)); - DBWriteContactSettingTString(NULL, szModuleName, "Server", szText); + db_set_ts(NULL, szModuleName, "Server", szText); _tcscpy(gbHost, szText); GetDlgItemText(hwndDlg, IDC_PASSWORD, szText, sizeof(szText)); - DBWriteContactSettingTString(NULL, szModuleName, "Password", szText); + db_set_ts(NULL, szModuleName, "Password", szText); _tcscpy(gbPassword, szText); return TRUE; } diff --git a/plugins/Watrack_MPD/src/utilities.cpp b/plugins/Watrack_MPD/src/utilities.cpp index 4d63f1f7f4..fc5e621837 100755 --- a/plugins/Watrack_MPD/src/utilities.cpp +++ b/plugins/Watrack_MPD/src/utilities.cpp @@ -21,11 +21,11 @@ TCHAR* __stdcall UniGetContactSettingUtf(HANDLE hContact, const char *szModule,c { DBVARIANT dbv = {DBVT_DELETED}; TCHAR* szRes; - if (DBGetContactSettingTString(hContact, szModule, szSetting, &dbv)) + if (db_get_ts(hContact, szModule, szSetting, &dbv)) return _tcsdup(szDef); if(dbv.pszVal) szRes = _tcsdup(dbv.ptszVal); - DBFreeVariant(&dbv); + db_free(&dbv); return szRes; } diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index cd20bd423c..c543dd8576 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -25,7 +25,7 @@ void LoadOptions() DBVARIANT dbv = { 0 };
dbv.type = DBVT_TCHAR;
ZeroMemory(&WumfOptions, sizeof(WumfOptions));
- if (DBGetContactSetting(NULL, ModuleName, OPT_FILE, &dbv) == 0)
+ if (db_get(NULL, ModuleName, OPT_FILE, &dbv) == 0)
_tcsncpy(WumfOptions.LogFile, dbv.ptszVal, 255);
else
WumfOptions.LogFile[0] = '\0';
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index e1f4bb2989..fd59bbbad3 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -474,12 +474,7 @@ int PrebuildContactMenu(WPARAM wParam, LPARAM lParam) if (hContact) {
char* szProto = GetContactProto(hContact);
PROTOACCOUNT *pa = ProtoGetAccount(szProto);
- CLISTMENUITEM mi = { sizeof(mi) };
- if (IsSuitableProto(pa))
- mi.flags = CMIF_TCHAR | CMIM_FLAGS;
- else
- mi.flags = CMIF_TCHAR | CMIM_FLAGS | CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hChangeSound, (LPARAM)&mi);
+ Menu_ShowItem(hChangeSound, IsSuitableProto(pa));
}
return 0;
}
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
diff --git a/plugins/YAPP/src/options.cpp b/plugins/YAPP/src/options.cpp index 182504ac21..c47ea27311 100644 --- a/plugins/YAPP/src/options.cpp +++ b/plugins/YAPP/src/options.cpp @@ -452,7 +452,7 @@ static INT_PTR CALLBACK DlgProcOptsClasses(HWND hwndDlg, UINT msg, WPARAM wParam for (int i = 0; i < arClasses.getCount(); i++) {
POPUPCLASS *pc = arClasses[i];
mir_snprintf(setting, 256, "%s/Timeout", pc->pszName);
- DBWriteContactSettingWord(0, MODULE, setting, pc->iSeconds);
+ db_set_w(0, MODULE, setting, pc->iSeconds);
mir_snprintf(setting, 256, "%s/TextCol", pc->pszName);
db_set_dw(0, MODULE, setting, (DWORD)pc->colorText);
mir_snprintf(setting, 256, "%s/BgCol", pc->pszName);
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp index 4848788544..232ffb19e8 100644 --- a/plugins/YAPP/src/services.cpp +++ b/plugins/YAPP/src/services.cpp @@ -314,7 +314,7 @@ static INT_PTR RegisterPopupClass(WPARAM wParam, LPARAM lParam) char setting[256];
mir_snprintf(setting, 256, "%s/Timeout", pc->pszName);
- pc->iSeconds = DBGetContactSettingWord(0, MODULE, setting, pc->iSeconds);
+ pc->iSeconds = db_get_w(0, MODULE, setting, pc->iSeconds);
if (pc->iSeconds == (WORD)-1) pc->iSeconds = -1;
mir_snprintf(setting, 256, "%s/TextCol", pc->pszName);
pc->colorText = (COLORREF)db_get_dw(0, MODULE, setting, (DWORD)pc->colorText);
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp index ce1c802618..16238d43d2 100644 --- a/plugins/ZeroNotification/src/main.cpp +++ b/plugins/ZeroNotification/src/main.cpp @@ -96,7 +96,7 @@ static DWORD MakeCheckBoxTreeFlags(HWND hwndTree) static void UpdateMenuItem()
{
CLISTMENUITEM mi = { sizeof(mi) };
- if (DBGetContactSettingByte(NULL, "Skin", "UseSound", 1))
+ if (db_get_b(NULL, "Skin", "UseSound", 1))
mi.ptszName = DISABLE_SOUND;
else
mi.ptszName = ENABLE_SOUND;
@@ -116,9 +116,9 @@ static int SoundSettingChanged(WPARAM wParam,LPARAM lParam) static int SetNotify(const long status)
{
- DBWriteContactSettingByte(NULL,"Skin","UseSound", (BYTE) !(DBGetContactSettingDword(NULL, MODNAME, "NoSound",DEFAULT_NOSOUND) & status));
- DBWriteContactSettingByte(NULL,"CList","DisableTrayFlash", (BYTE) (DBGetContactSettingDword(NULL, MODNAME, "NoBlink",DEFAULT_NOBLINK) & status));
- DBWriteContactSettingByte(NULL,"CList","NoIconBlink", (BYTE) (DBGetContactSettingDword(NULL, MODNAME, "NoCLCBlink",DEFAULT_NOCLCBLINK) & status));
+ db_set_b(NULL,"Skin","UseSound", (BYTE) !(db_get_dw(NULL, MODNAME, "NoSound",DEFAULT_NOSOUND) & status));
+ db_set_b(NULL,"CList","DisableTrayFlash", (BYTE) (db_get_dw(NULL, MODNAME, "NoBlink",DEFAULT_NOBLINK) & status));
+ db_set_b(NULL,"CList","NoIconBlink", (BYTE) (db_get_dw(NULL, MODNAME, "NoCLCBlink",DEFAULT_NOCLCBLINK) & status));
UpdateMenuItem();
return 0;
@@ -155,11 +155,11 @@ static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_NOSOUND),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_NOSOUND),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_NOBLINK),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_NOBLINK),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_NOCLCBLINK),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_NOCLCBLINK),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES);
- CheckDlgButton(hwndDlg, IDC_HIDEMENU, DBGetContactSettingByte(NULL, MODNAME, "HideMenu",1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HIDEMENU, db_get_b(NULL, MODNAME, "HideMenu",1) ? BST_CHECKED : BST_UNCHECKED);
- FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_NOSOUND),statusValues,sizeof(statusValues)/sizeof(statusValues[0]),DBGetContactSettingDword(NULL, MODNAME, "NoSound",DEFAULT_NOSOUND));
- FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_NOBLINK),statusValues,sizeof(statusValues)/sizeof(statusValues[0]),DBGetContactSettingDword(NULL, MODNAME, "NoBlink",DEFAULT_NOBLINK));
- FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_NOCLCBLINK),statusValues,sizeof(statusValues)/sizeof(statusValues[0]),DBGetContactSettingDword(NULL, MODNAME, "NoCLCBlink",DEFAULT_NOCLCBLINK));
+ FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_NOSOUND),statusValues,sizeof(statusValues)/sizeof(statusValues[0]),db_get_dw(NULL, MODNAME, "NoSound",DEFAULT_NOSOUND));
+ FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_NOBLINK),statusValues,sizeof(statusValues)/sizeof(statusValues[0]),db_get_dw(NULL, MODNAME, "NoBlink",DEFAULT_NOBLINK));
+ FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_NOCLCBLINK),statusValues,sizeof(statusValues)/sizeof(statusValues[0]),db_get_dw(NULL, MODNAME, "NoCLCBlink",DEFAULT_NOCLCBLINK));
return TRUE;
case WM_COMMAND:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -190,14 +190,14 @@ static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- DBWriteContactSettingByte(NULL, MODNAME, "HideMenu",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEMENU));
+ db_set_b(NULL, MODNAME, "HideMenu",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEMENU));
- DBWriteContactSettingDword(NULL, MODNAME, "NoSound",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_NOSOUND)));
- DBWriteContactSettingDword(NULL, MODNAME, "NoBlink",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_NOBLINK)));
- DBWriteContactSettingDword(NULL, MODNAME, "NoCLCBlink",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_NOCLCBLINK)));
+ db_set_dw(NULL, MODNAME, "NoSound",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_NOSOUND)));
+ db_set_dw(NULL, MODNAME, "NoBlink",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_NOBLINK)));
+ db_set_dw(NULL, MODNAME, "NoCLCBlink",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_NOCLCBLINK)));
- test = DBGetContactSettingWord(NULL,"CList","Status",0);
- SetNotify(Proto_Status2Flag(DBGetContactSettingWord(NULL,"CList","Status",0)));
+ test = db_get_w(NULL,"CList","Status",0);
+ SetNotify(Proto_Status2Flag(db_get_w(NULL,"CList","Status",0)));
return TRUE;
}
break;
@@ -225,10 +225,10 @@ static int OptionsInitialize(WPARAM wParam,LPARAM lParam) static INT_PTR NoSoundMenuCommand(WPARAM wParam,LPARAM lParam)
{
- if (DBGetContactSettingByte(NULL,"Skin","UseSound",1))
- DBWriteContactSettingByte(NULL,"Skin","UseSound",0);
+ if (db_get_b(NULL,"Skin","UseSound",1))
+ db_set_b(NULL,"Skin","UseSound",0);
// else
-// DBWriteContactSettingByte(NULL,"Skin","UseSound",1);
+// db_set_b(NULL,"Skin","UseSound",1);
return 0;
}
@@ -238,7 +238,7 @@ extern "C" __declspec(dllexport) int Load(void) mir_getLP(&pluginInfoEx);
//The menu item - begin
- if (!DBGetContactSettingByte(NULL, MODNAME, "HideMenu", 1)) {
+ if (!db_get_b(NULL, MODNAME, "HideMenu", 1)) {
hSoundMenu = CreateServiceFunction(MODNAME "/MenuCommand", NoSoundMenuCommand);
CLISTMENUITEM mi = { sizeof(mi) };
@@ -257,7 +257,7 @@ extern "C" __declspec(dllexport) int Load(void) hEventOptionsInitialize = HookEvent(ME_OPT_INITIALISE, OptionsInitialize);
//Uninstall info
- DBWriteContactSettingString(NULL, "Uninstall", MODNAME, MODNAME);
+ db_set_s(NULL, "Uninstall", MODNAME, MODNAME);
return 0;
}
diff --git a/plugins/mTextControl/src/textusers.cpp b/plugins/mTextControl/src/textusers.cpp index 60b849252a..3f2c2f0f0f 100644 --- a/plugins/mTextControl/src/textusers.cpp +++ b/plugins/mTextControl/src/textusers.cpp @@ -47,8 +47,8 @@ MTI_TextUserAdd(const char *userTitle, DWORD options) textUserNew->name = new char [lstrlenA(userTitle)+1];
lstrcpyA(textUserNew->name, userTitle);
textUserNew->options =
- (DBGetContactSettingDword(0, MODULNAME, userTitle, options)&MTEXT_FANCY_MASK) | (textUserNew->options&MTEXT_SYSTEM_MASK);
- DBWriteContactSettingDword(0, MODULNAME, userTitle, textUserNew->options);
+ (db_get_dw(0, MODULNAME, userTitle, options)&MTEXT_FANCY_MASK) | (textUserNew->options&MTEXT_SYSTEM_MASK);
+ db_set_dw(0, MODULNAME, userTitle, textUserNew->options);
textUserNew->prev = textUserLast;
textUserNew->next = 0;
if (textUserLast)
@@ -77,12 +77,12 @@ void TextUserSetOptions(HANDLE userHandle, DWORD options) void TextUsersSave()
{
for (TextUser *textUser = textUserFirst; textUser; textUser = textUser->next)
- DBWriteContactSettingDword(0, MODULNAME, textUser->name, textUser->options);
+ db_set_dw(0, MODULNAME, textUser->name, textUser->options);
}
void TextUsersReset()
{
for (TextUser *textUser = textUserFirst; textUser; textUser = textUser->next)
textUser->options =
- (DBGetContactSettingDword(0, MODULNAME, textUser->name, 0)&MTEXT_FANCY_MASK) | (textUser->options&MTEXT_SYSTEM_MASK);
+ (db_get_dw(0, MODULNAME, textUser->name, 0)&MTEXT_FANCY_MASK) | (textUser->options&MTEXT_SYSTEM_MASK);
}
|