From 53fe3e46177d17b4941610de19f5cc6210700cb4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 12 Nov 2018 21:44:56 +0300 Subject: db_* functions replaced with g_plugin calls --- plugins/KeyboardNotify/src/flash.cpp | 6 +- plugins/KeyboardNotify/src/ignore.cpp | 4 +- plugins/KeyboardNotify/src/main.cpp | 80 ++++++++++++------------ plugins/KeyboardNotify/src/options.cpp | 110 ++++++++++++++++----------------- 4 files changed, 100 insertions(+), 100 deletions(-) (limited to 'plugins/KeyboardNotify/src') diff --git a/plugins/KeyboardNotify/src/flash.cpp b/plugins/KeyboardNotify/src/flash.cpp index 20c7888ba7..86b8c528aa 100644 --- a/plugins/KeyboardNotify/src/flash.cpp +++ b/plugins/KeyboardNotify/src/flash.cpp @@ -88,7 +88,7 @@ void setFlashingSequence(void) FLASHING_SEQUENCE *getCustomSeq(void) { - ptrW tszSeq( db_get_wsa(NULL, MODULENAME, fmtDBSettingName("custom%d", wCustomTheme))); + ptrW tszSeq( g_plugin.getWStringA(fmtDBSettingName("custom%d", wCustomTheme))); static FLASHING_SEQUENCE Custom = {0}; Custom = str2FS((tszSeq != 0) ? tszSeq : L""); @@ -317,8 +317,8 @@ void testSequence(wchar_t *testStr) static void __cdecl TestThread(void *param) { FLASHING_SEQUENCE *pTest = (FLASHING_SEQUENCE *)param; - unsigned int testNum = (unsigned int)db_get_b(NULL, MODULENAME, "testnum", DEF_SETTING_TESTNUM); - unsigned int testSecs = (unsigned int)db_get_b(NULL, MODULENAME, "testsecs", DEF_SETTING_TESTSECS); + unsigned int testNum = (unsigned int)g_plugin.getByte("testnum", DEF_SETTING_TESTNUM); + unsigned int testSecs = (unsigned int)g_plugin.getByte("testsecs", DEF_SETTING_TESTSECS); for (unsigned 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 35abefc6d4..063a5a9432 100644 --- a/plugins/KeyboardNotify/src/ignore.cpp +++ b/plugins/KeyboardNotify/src/ignore.cpp @@ -33,9 +33,9 @@ static DWORD GetMask(MCONTACT hContact) mask=0; else { if(db_get_b(hContact, "CList", "Hidden", 0) || db_get_b(hContact, "CList", "NotOnList", 0)) - mask = db_get_dw(NULL, MODULENAME, "Mask1", 0); + mask = g_plugin.getDword("Mask1", 0); else - mask = db_get_dw(NULL, MODULENAME, "Default1", 0); + mask = g_plugin.getDword("Default1", 0); } } return mask; diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index b243cd9c43..a551012d29 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -509,13 +509,13 @@ void StartBlinkAction(char *flashSequence, WORD eventMaxSeconds) void createProcessList(void) { - int count = db_get_w(NULL, MODULENAME, "processcount", 0); + int count = g_plugin.getWord("processcount", 0); ProcessList.count = 0; ProcessList.szFileName = (wchar_t **)mir_alloc(count * sizeof(wchar_t *)); if (ProcessList.szFileName) { for (int i = 0; i < count; i++) - ProcessList.szFileName[i] = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("process%d", i)); + ProcessList.szFileName[i] = g_plugin.getWStringA(fmtDBSettingName("process%d", i)); ProcessList.count = count; } @@ -665,36 +665,36 @@ int UnhookWindowsHooks() void LoadSettings(void) { - bFlashOnMsg = db_get_b(NULL, MODULENAME, "onmsg", DEF_SETTING_ONMSG); - bFlashOnURL = db_get_b(NULL, MODULENAME, "onurl", DEF_SETTING_ONURL); - bFlashOnFile = db_get_b(NULL, MODULENAME, "onfile", DEF_SETTING_ONFILE); - bFlashOnOther = db_get_b(NULL, MODULENAME, "onother", DEF_SETTING_OTHER); - bFullScreenMode = db_get_b(NULL, MODULENAME, "fscreenmode", DEF_SETTING_FSCREEN); - bScreenSaverRunning = db_get_b(NULL, MODULENAME, "ssaverrunning", DEF_SETTING_SSAVER); - bWorkstationLocked = db_get_b(NULL, MODULENAME, "wstationlocked", DEF_SETTING_LOCKED); - bProcessesAreRunning = db_get_b(NULL, MODULENAME, "procsrunning", DEF_SETTING_PROCS); - bWorkstationActive = db_get_b(NULL, MODULENAME, "wstationactive", DEF_SETTING_ACTIVE); - bFlashIfMsgOpen = db_get_b(NULL, MODULENAME, "ifmsgopen", DEF_SETTING_IFMSGOPEN); - bFlashIfMsgWinNotTop = db_get_b(NULL, MODULENAME, "ifmsgnottop", DEF_SETTING_IFMSGNOTTOP); - bFlashIfMsgOlder = db_get_b(NULL, MODULENAME, "ifmsgolder", DEF_SETTING_IFMSGOLDER); - wSecondsOlder = db_get_w(NULL, MODULENAME, "secsolder", DEF_SETTING_SECSOLDER); - bFlashUntil = db_get_b(NULL, MODULENAME, "funtil", DEF_SETTING_FLASHUNTIL); - wBlinksNumber = db_get_w(NULL, MODULENAME, "nblinks", DEF_SETTING_NBLINKS); - bMirandaOrWindows = db_get_b(NULL, MODULENAME, "mirorwin", DEF_SETTING_MIRORWIN); - wStatusMap = db_get_w(NULL, MODULENAME, "status", DEF_SETTING_STATUS); - wReminderCheck = db_get_w(NULL, MODULENAME, "remcheck", DEF_SETTING_CHECKTIME); - bFlashLed[0] = db_get_b(NULL, MODULENAME, "fnum", DEF_SETTING_FLASHNUM); - bFlashLed[1] = db_get_b(NULL, MODULENAME, "fcaps", DEF_SETTING_FLASHCAPS); - bFlashLed[2] = db_get_b(NULL, MODULENAME, "fscroll", DEF_SETTING_FLASHSCROLL); - bFlashEffect = db_get_b(NULL, MODULENAME, "feffect", DEF_SETTING_FLASHEFFECT); - bSequenceOrder = db_get_b(NULL, MODULENAME, "order", DEF_SETTING_SEQORDER); - wCustomTheme = db_get_w(NULL, MODULENAME, "custom", DEF_SETTING_CUSTOMTHEME); - bTrillianLedsMsg = db_get_b(NULL, MODULENAME, "ledsmsg", DEF_SETTING_LEDSMSG); - bTrillianLedsURL = db_get_b(NULL, MODULENAME, "ledsurl", DEF_SETTING_LEDSURL); - bTrillianLedsFile = db_get_b(NULL, MODULENAME, "ledsfile", DEF_SETTING_LEDSFILE); - bTrillianLedsOther = db_get_b(NULL, MODULENAME, "ledsother", DEF_SETTING_LEDSOTHER); - wStartDelay = db_get_w(NULL, MODULENAME, "sdelay", DEF_SETTING_STARTDELAY); - bFlashSpeed = db_get_b(NULL, MODULENAME, "speed", DEF_SETTING_FLASHSPEED); + bFlashOnMsg = g_plugin.getByte("onmsg", DEF_SETTING_ONMSG); + bFlashOnURL = g_plugin.getByte("onurl", DEF_SETTING_ONURL); + bFlashOnFile = g_plugin.getByte("onfile", DEF_SETTING_ONFILE); + bFlashOnOther = g_plugin.getByte("onother", DEF_SETTING_OTHER); + bFullScreenMode = g_plugin.getByte("fscreenmode", DEF_SETTING_FSCREEN); + bScreenSaverRunning = g_plugin.getByte("ssaverrunning", DEF_SETTING_SSAVER); + bWorkstationLocked = g_plugin.getByte("wstationlocked", DEF_SETTING_LOCKED); + bProcessesAreRunning = g_plugin.getByte("procsrunning", DEF_SETTING_PROCS); + bWorkstationActive = g_plugin.getByte("wstationactive", DEF_SETTING_ACTIVE); + bFlashIfMsgOpen = g_plugin.getByte("ifmsgopen", DEF_SETTING_IFMSGOPEN); + bFlashIfMsgWinNotTop = g_plugin.getByte("ifmsgnottop", DEF_SETTING_IFMSGNOTTOP); + bFlashIfMsgOlder = g_plugin.getByte("ifmsgolder", DEF_SETTING_IFMSGOLDER); + wSecondsOlder = g_plugin.getWord("secsolder", DEF_SETTING_SECSOLDER); + bFlashUntil = g_plugin.getByte("funtil", DEF_SETTING_FLASHUNTIL); + wBlinksNumber = g_plugin.getWord("nblinks", DEF_SETTING_NBLINKS); + bMirandaOrWindows = g_plugin.getByte("mirorwin", DEF_SETTING_MIRORWIN); + wStatusMap = g_plugin.getWord("status", DEF_SETTING_STATUS); + wReminderCheck = g_plugin.getWord("remcheck", DEF_SETTING_CHECKTIME); + bFlashLed[0] = g_plugin.getByte("fnum", DEF_SETTING_FLASHNUM); + bFlashLed[1] = g_plugin.getByte("fcaps", DEF_SETTING_FLASHCAPS); + bFlashLed[2] = g_plugin.getByte("fscroll", DEF_SETTING_FLASHSCROLL); + bFlashEffect = g_plugin.getByte("feffect", DEF_SETTING_FLASHEFFECT); + bSequenceOrder = g_plugin.getByte("order", DEF_SETTING_SEQORDER); + wCustomTheme = g_plugin.getWord("custom", DEF_SETTING_CUSTOMTHEME); + bTrillianLedsMsg = g_plugin.getByte("ledsmsg", DEF_SETTING_LEDSMSG); + bTrillianLedsURL = g_plugin.getByte("ledsurl", DEF_SETTING_LEDSURL); + bTrillianLedsFile = g_plugin.getByte("ledsfile", DEF_SETTING_LEDSFILE); + bTrillianLedsOther = g_plugin.getByte("ledsother", DEF_SETTING_LEDSOTHER); + wStartDelay = g_plugin.getWord("sdelay", DEF_SETTING_STARTDELAY); + bFlashSpeed = g_plugin.getByte("speed", DEF_SETTING_FLASHSPEED); switch (bFlashSpeed) { case 0: nWaitDelay = 1500; break; case 1: nWaitDelay = 0750; break; @@ -704,19 +704,19 @@ void LoadSettings(void) default: nWaitDelay = 0050; break; } setFlashingSequence(); - bEmulateKeypresses = db_get_b(NULL, MODULENAME, "keypresses", DEF_SETTING_KEYPRESSES); - bOverride = db_get_b(NULL, MODULENAME, "override", DEF_SETTING_OVERRIDE); + bEmulateKeypresses = g_plugin.getByte("keypresses", DEF_SETTING_KEYPRESSES); + bOverride = g_plugin.getByte("override", DEF_SETTING_OVERRIDE); // Create hidden settings (for test button) if needed - if (db_get_b(NULL, MODULENAME, "testnum", -1) == -1) - db_set_b(NULL, MODULENAME, "testnum", DEF_SETTING_TESTNUM); - if (db_get_b(NULL, MODULENAME, "testsecs", -1) == -1) - db_set_b(NULL, MODULENAME, "testsecs", DEF_SETTING_TESTSECS); + if (g_plugin.getByte("testnum", -1) == -1) + g_plugin.setByte("testnum", DEF_SETTING_TESTNUM); + if (g_plugin.getByte("testsecs", -1) == -1) + g_plugin.setByte("testsecs", DEF_SETTING_TESTSECS); for (int i = 0; i < ProtoList.protoCount; i++) if (ProtoList.protoInfo[i].visible) { unsigned int j; - ProtoList.protoInfo[i].enabled = db_get_b(NULL, MODULENAME, ProtoList.protoInfo[i].szProto, DEF_SETTING_PROTOCOL); + ProtoList.protoInfo[i].enabled = g_plugin.getByte(ProtoList.protoInfo[i].szProto, DEF_SETTING_PROTOCOL); for (j = 0; j < ProtoList.protoInfo[i].xstatus.count; j++) - ProtoList.protoInfo[i].xstatus.enabled[j] = db_get_b(NULL, MODULENAME, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), DEF_SETTING_XSTATUS); + ProtoList.protoInfo[i].xstatus.enabled[j] = g_plugin.getByte(fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), DEF_SETTING_XSTATUS); } bMetaProtoEnabled = db_mc_isEnabled(); diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index a7cb0b5128..273d87793c 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -65,10 +65,10 @@ void exportThemes(const wchar_t *filename) fwprintf(fExport, TranslateT("\n; Automatically generated Keyboard Notify Theme file\n\n\n")); wchar_t *szTheme; - for (int i = 0; szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("theme%d", i)); i++) { + for (int i = 0; szTheme = g_plugin.getWStringA(fmtDBSettingName("theme%d", i)); i++) { fwprintf(fExport, L"[%s]\n", szTheme); mir_free(szTheme); - if (szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("custom%d", i))) { + if (szTheme = g_plugin.getWStringA(fmtDBSettingName("custom%d", i))) { fwprintf(fExport, L"%s\n\n", szTheme); mir_free(szTheme); } @@ -551,7 +551,7 @@ static INT_PTR CALLBACK DlgProcProtoOptions(HWND hwndDlg, UINT msg, WPARAM, LPAR for (int i = 0; i < ListView_GetItemCount(hList); i++) { lvItem.iItem = i; ListView_GetItem(hList, &lvItem); - db_set_b(NULL, MODULENAME, (char *)lvItem.lParam, (BYTE)ListView_GetCheckState(hList, lvItem.iItem)); + g_plugin.setByte((char *)lvItem.lParam, (BYTE)ListView_GetCheckState(hList, lvItem.iItem)); } } @@ -750,21 +750,21 @@ static INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wPara case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - db_set_b(NULL, MODULENAME, "onmsg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONMESSAGE) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, MODULENAME, "onurl", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONURL) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, MODULENAME, "onfile", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONFILE) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, MODULENAME, "onother", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONOTHER) == BST_CHECKED ? 1 : 0)); - - db_set_b(NULL, MODULENAME, "fscreenmode", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_FSCREEN) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, MODULENAME, "ssaverrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SSAVER) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, MODULENAME, "wstationlocked", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_LOCKED) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, MODULENAME, "procsrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PGMS) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, MODULENAME, "wstationactive", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ACTIVE) == BST_CHECKED ? 1 : 0)); - - db_set_b(NULL, MODULENAME, "ifmsgopen", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOPEN) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, MODULENAME, "ifmsgnottop", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFNOTTOP) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, MODULENAME, "ifmsgolder", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOLDER) == BST_CHECKED ? 1 : 0)); - db_set_w(NULL, MODULENAME, "secsolder", (WORD)SendDlgItemMessage(hwndDlg, IDC_OLDERSPIN, UDM_GETPOS, 0, 0)); + g_plugin.setByte("onmsg", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONMESSAGE) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("onurl", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONURL) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("onfile", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONFILE) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("onother", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ONOTHER) == BST_CHECKED ? 1 : 0)); + + g_plugin.setByte("fscreenmode", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_FSCREEN) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("ssaverrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SSAVER) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("wstationlocked", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_LOCKED) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("procsrunning", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PGMS) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("wstationactive", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_ACTIVE) == BST_CHECKED ? 1 : 0)); + + g_plugin.setByte("ifmsgopen", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOPEN) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("ifmsgnottop", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFNOTTOP) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("ifmsgolder", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_IFOLDER) == BST_CHECKED ? 1 : 0)); + g_plugin.setWord("secsolder", (WORD)SendDlgItemMessage(hwndDlg, IDC_OLDERSPIN, UDM_GETPOS, 0, 0)); if (IsDlgButtonChecked(hwndDlg, IDC_UNTILBLK) == BST_CHECKED) untilMap |= UNTIL_NBLINKS; @@ -774,9 +774,9 @@ static INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wPara untilMap |= UNTIL_EVENTSOPEN; if (IsDlgButtonChecked(hwndDlg, IDC_UNTILCOND) == BST_CHECKED) untilMap |= UNTIL_CONDITIONS; - db_set_b(NULL, MODULENAME, "funtil", untilMap); - db_set_w(NULL, MODULENAME, "nblinks", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0)); - db_set_b(NULL, MODULENAME, "mirorwin", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_MIRORWIN, CB_GETCURSEL, 0, 0), 0)); + g_plugin.setByte("funtil", untilMap); + g_plugin.setWord("nblinks", (WORD)SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0)); + g_plugin.setByte("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; @@ -798,21 +798,21 @@ static INT_PTR CALLBACK DlgProcBasicOptions(HWND hwndDlg, UINT msg, WPARAM wPara statusMap |= MAP_OUTTOLUNCH; if (IsDlgButtonChecked(hwndDlg, IDC_OFFLINE) == BST_CHECKED) statusMap |= MAP_OFFLINE; - db_set_w(NULL, MODULENAME, "status", statusMap); + g_plugin.setWord("status", statusMap); - db_set_w(NULL, MODULENAME, "remcheck", (WORD)SendDlgItemMessage(hwndDlg, IDC_REMCHECK, UDM_GETPOS, 0, 0)); + g_plugin.setWord("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]) - db_set_ws(NULL, MODULENAME, fmtDBSettingName("process%d", i++), ProcessListAux.szFileName[j]); - db_set_w(NULL, MODULENAME, "processcount", (WORD)i); - while (!db_unset(NULL, MODULENAME, fmtDBSettingName("process%d", i++))); + g_plugin.setWString(fmtDBSettingName("process%d", i++), ProcessListAux.szFileName[j]); + g_plugin.setWord("processcount", (WORD)i); + while (!g_plugin.delSetting(fmtDBSettingName("process%d", i++))); if (XstatusListAux) for (i = 0; i < ProtoList.protoCount; i++) for (int j = 0; j < (int)XstatusListAux[i].count; j++) - db_set_b(NULL, MODULENAME, fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), (BYTE)XstatusListAux[i].enabled[j]); + g_plugin.setByte(fmtDBSettingName("%sxstatus%d", ProtoList.protoInfo[i].szProto, j), (BYTE)XstatusListAux[i].enabled[j]); LoadSettings(); @@ -863,7 +863,7 @@ static INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wPar CheckDlgButton(hwndDlg, IDC_CUSTOM, bFlashEffect == FLASH_CUSTOM ? BST_CHECKED : BST_UNCHECKED); wchar_t *szTheme; - for (int i = 0; szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("theme%d", i)); i++) { + for (int i = 0; szTheme = g_plugin.getWStringA(fmtDBSettingName("theme%d", i)); i++) { int index = SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)szTheme); mir_free(szTheme); if (index != CB_ERR && index != CB_ERRSPACE) @@ -941,33 +941,33 @@ static INT_PTR CALLBACK DlgProcEffectOptions(HWND hwndDlg, UINT msg, WPARAM wPar case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - db_set_b(NULL, MODULENAME, "fnum", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NUM) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, MODULENAME, "fcaps", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CAPS) == BST_CHECKED ? 1 : 0)); - db_set_b(NULL, MODULENAME, "fscroll", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCROLL) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("fnum", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NUM) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("fcaps", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CAPS) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("fscroll", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SCROLL) == BST_CHECKED ? 1 : 0)); if (IsDlgButtonChecked(hwndDlg, IDC_INTURN) == BST_CHECKED) - db_set_b(NULL, MODULENAME, "feffect", FLASH_INTURN); + g_plugin.setByte("feffect", FLASH_INTURN); else if (IsDlgButtonChecked(hwndDlg, IDC_INSEQUENCE) == BST_CHECKED) - db_set_b(NULL, MODULENAME, "feffect", FLASH_INSEQUENCE); + g_plugin.setByte("feffect", FLASH_INSEQUENCE); else if (IsDlgButtonChecked(hwndDlg, IDC_CUSTOM) == BST_CHECKED) - db_set_b(NULL, MODULENAME, "feffect", FLASH_CUSTOM); + g_plugin.setByte("feffect", FLASH_CUSTOM); else if (IsDlgButtonChecked(hwndDlg, IDC_TRILLIAN) == BST_CHECKED) - db_set_b(NULL, MODULENAME, "feffect", FLASH_TRILLIAN); + g_plugin.setByte("feffect", FLASH_TRILLIAN); else - db_set_b(NULL, MODULENAME, "feffect", FLASH_SAMETIME); - db_set_b(NULL, MODULENAME, "order", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETCURSEL, 0, 0), 0)); - db_set_w(NULL, MODULENAME, "custom", (WORD)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETCURSEL, 0, 0), 0)); + g_plugin.setByte("feffect", FLASH_SAMETIME); + g_plugin.setByte("order", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SEQORDER, CB_GETCURSEL, 0, 0), 0)); + g_plugin.setWord("custom", (WORD)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_SCUSTOM, CB_GETCURSEL, 0, 0), 0)); - db_set_b(NULL, MODULENAME, "ledsmsg", trillianLedsMsg); - db_set_b(NULL, MODULENAME, "ledsfile", trillianLedsFile); - db_set_b(NULL, MODULENAME, "ledsurl", trillianLedsURL); - db_set_b(NULL, MODULENAME, "ledsother", trillianLedsOther); + g_plugin.setByte("ledsmsg", trillianLedsMsg); + g_plugin.setByte("ledsfile", trillianLedsFile); + g_plugin.setByte("ledsurl", trillianLedsURL); + g_plugin.setByte("ledsother", trillianLedsOther); - db_set_w(NULL, MODULENAME, "sdelay", (WORD)SendDlgItemMessage(hwndDlg, IDC_DELAYSPIN, UDM_GETPOS, 0, 0)); + g_plugin.setWord("sdelay", (WORD)SendDlgItemMessage(hwndDlg, IDC_DELAYSPIN, UDM_GETPOS, 0, 0)); - db_set_b(NULL, MODULENAME, "speed", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SPEED, TBM_GETPOS, 0, 0)); + g_plugin.setByte("speed", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SPEED, TBM_GETPOS, 0, 0)); - db_set_b(NULL, MODULENAME, "keypresses", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_KEYPRESSES) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("keypresses", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_KEYPRESSES) == BST_CHECKED ? 1 : 0)); LoadSettings(); @@ -999,11 +999,11 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara SendDlgItemMessage(hwndDlg, IDC_CUSTOMSTRING, EM_LIMITTEXT, MAX_PATH, 0); wchar_t *szTheme; - for (int i = 0; szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("theme%d", i)); i++) { + for (int i = 0; szTheme = g_plugin.getWStringA(fmtDBSettingName("theme%d", i)); i++) { int index = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)szTheme); mir_free(szTheme); if (index != CB_ERR && index != CB_ERRSPACE) { - wchar_t *str = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("custom%d", i)); + wchar_t *str = g_plugin.getWStringA(fmtDBSettingName("custom%d", i)); if (str) SendDlgItemMessage(hwndDlg, IDC_THEME, CB_SETITEMDATA, (WPARAM)index, (LPARAM)str); } @@ -1224,7 +1224,7 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: - if (szTheme = db_get_wsa(NULL, MODULENAME, fmtDBSettingName("theme%d", wCustomTheme))) { + if (szTheme = g_plugin.getWStringA(fmtDBSettingName("theme%d", wCustomTheme))) { mir_wstrcpy(theme, szTheme); mir_free(szTheme); } @@ -1237,12 +1237,12 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara count = SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETCOUNT, 0, 0); for (int i = 0; i < count; i++) { SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETLBTEXT, (WPARAM)i, (LPARAM)themeAux); - db_set_ws(NULL, MODULENAME, fmtDBSettingName("theme%d", i), themeAux); + g_plugin.setWString(fmtDBSettingName("theme%d", i), themeAux); wchar_t *str = (wchar_t *)SendDlgItemMessage(hwndDlg, IDC_THEME, CB_GETITEMDATA, (WPARAM)i, 0); if (str) - db_set_ws(NULL, MODULENAME, fmtDBSettingName("custom%d", i), str); + g_plugin.setWString(fmtDBSettingName("custom%d", i), str); else - db_set_ws(NULL, MODULENAME, fmtDBSettingName("custom%d", i), L""); + g_plugin.setWString(fmtDBSettingName("custom%d", i), L""); if (!mir_wstrcmp(theme, themeAux)) wCustomTheme = i; @@ -1251,14 +1251,14 @@ static INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wPara SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_INSERTSTRING, (WPARAM)i, (LPARAM)themeAux); SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_SETITEMDATA, (WPARAM)i, (LPARAM)i); } - for (int i = count; !db_unset(NULL, MODULENAME, fmtDBSettingName("theme%d", i)); i++) - db_unset(NULL, MODULENAME, fmtDBSettingName("custom%d", i)); + for (int i = count; !g_plugin.delSetting(fmtDBSettingName("theme%d", i)); i++) + g_plugin.delSetting(fmtDBSettingName("custom%d", i)); - db_set_w(NULL, MODULENAME, "custom", wCustomTheme); + g_plugin.setWord("custom", wCustomTheme); // Still updating here the the Flashing tab's controls SendDlgItemMessage(hwndEffect, IDC_SCUSTOM, CB_SETCURSEL, (WPARAM)wCustomTheme, 0); - db_set_b(NULL, MODULENAME, "override", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_OVERRIDE) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte("override", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_OVERRIDE) == BST_CHECKED ? 1 : 0)); return TRUE; } // switch code -- cgit v1.2.3