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/BossKeyPlus/src | |
parent | f4a1bbc6ba4b8137cb868639ac146aa97e97e9df (diff) |
- rest of menus cleared;
- old database macroses wiped out from all plugins (left in m_database.h for compatibility)
git-svn-id: http://svn.miranda-ng.org/main/trunk@4324 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BossKeyPlus/src')
-rw-r--r-- | plugins/BossKeyPlus/src/BossKey.cpp | 46 | ||||
-rw-r--r-- | plugins/BossKeyPlus/src/BossKeyIdle.cpp | 2 | ||||
-rw-r--r-- | plugins/BossKeyPlus/src/Options.cpp | 26 |
3 files changed, 37 insertions, 37 deletions
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);
|