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/SplashScreen/src/main.cpp | 10 +++--- plugins/SplashScreen/src/options.cpp | 70 ++++++++++++++++++------------------ 2 files changed, 40 insertions(+), 40 deletions(-) (limited to 'plugins/SplashScreen/src') diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index 08b15eb9b6..403e9a7d04 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -77,14 +77,14 @@ void SplashMain() if (bstartup & (options.active == 1)) { DBVARIANT dbv = { 0 }; - if (!db_get_ws(NULL, MODULENAME, "VersionPrefix", &dbv)) { + if (!g_plugin.getWString("VersionPrefix", &dbv)) { mir_wstrcpy(szPrefix, dbv.pwszVal); db_free(&dbv); } else mir_wstrcpy(szPrefix, L""); - if (!db_get_ws(NULL, MODULENAME, "Path", &dbv)) { + if (!g_plugin.getWString("Path", &dbv)) { mir_wstrcpy(inBuf, dbv.pwszVal); db_free(&dbv); } @@ -101,7 +101,7 @@ void SplashMain() else mir_wstrcpy(szSplashFile, inBuf); - if (!db_get_ws(NULL, MODULENAME, "Sound", &dbv)) { + if (!g_plugin.getWString("Sound", &dbv)) { mir_wstrcpy(inBuf, dbv.pwszVal); db_free(&dbv); } @@ -192,10 +192,10 @@ int PlugDisableHook(WPARAM wParam, LPARAM lParam) if (options.inheritGS) { if (!strcmp(cws->szModule, "Skin") && !strcmp(cws->szSetting, "UseSound")) - db_set_b(NULL, MODULENAME, "PlaySound", cws->value.bVal); + g_plugin.setByte("PlaySound", cws->value.bVal); if (!strcmp(cws->szModule, "PluginDisable") && !strcmp(cws->szSetting, _T2A(szDllName))) - db_set_b(NULL, MODULENAME, "Active", cws->value.bVal); + g_plugin.setByte("Active", cws->value.bVal); } return 0; diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp index 37758b59e5..8925965151 100644 --- a/plugins/SplashScreen/src/options.cpp +++ b/plugins/SplashScreen/src/options.cpp @@ -24,16 +24,16 @@ wchar_t szPath2Spash[MAX_PATH], szSoundFilePath[MAX_PATH]; // Reads values from db void ReadDbConfig() { - options.active = db_get_b(NULL, MODULENAME, "Active", 1); - options.playsnd = db_get_b(NULL, MODULENAME, "PlaySound", 0); - options.fadein = db_get_b(NULL, MODULENAME, "FadeIn", 1); - options.fadeout = db_get_b(NULL, MODULENAME, "FadeOut", 1); - options.showtime = db_get_dw(NULL, MODULENAME, "TimeToShow", 2000); - options.fisteps = db_get_dw(NULL, MODULENAME, "FadeinSpeed", 5); - options.fosteps = db_get_dw(NULL, MODULENAME, "FadeoutSpeed", 5); - options.inheritGS = db_get_b(NULL, MODULENAME, "InheritGlobalSound", 1); - options.showversion = db_get_b(NULL, MODULENAME, "ShowVersion", 0); - options.random = db_get_b(NULL, MODULENAME, "Random", 0); + options.active = g_plugin.getByte("Active", 1); + options.playsnd = g_plugin.getByte("PlaySound", 0); + options.fadein = g_plugin.getByte("FadeIn", 1); + options.fadeout = g_plugin.getByte("FadeOut", 1); + options.showtime = g_plugin.getDword("TimeToShow", 2000); + options.fisteps = g_plugin.getDword("FadeinSpeed", 5); + options.fosteps = g_plugin.getDword("FadeoutSpeed", 5); + options.inheritGS = g_plugin.getByte("InheritGlobalSound", 1); + options.showversion = g_plugin.getByte("ShowVersion", 0); + options.random = g_plugin.getByte("Random", 0); } BOOL Exists(LPCTSTR strName) @@ -53,21 +53,21 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP wchar_t inBuf[80]; { DBVARIANT dbv = { 0 }; - if (!db_get_ws(NULL, MODULENAME, "Path", &dbv)) { + if (!g_plugin.getWString("Path", &dbv)) { mir_wstrcpy(inBuf, dbv.pwszVal); db_free(&dbv); } else mir_wstrcpy(inBuf, L"splash\\splash.png"); SetDlgItemText(hwndDlg, IDC_SPLASHPATH, inBuf); - if (!db_get_ws(NULL, MODULENAME, "Sound", &dbv)) { + if (!g_plugin.getWString("Sound", &dbv)) { mir_wstrcpy(inBuf, dbv.pwszVal); db_free(&dbv); } else mir_wstrcpy(inBuf, L"sounds\\startup.wav"); SetDlgItemText(hwndDlg, IDC_SNDPATH, inBuf); - if (!db_get_ws(NULL, MODULENAME, "VersionPrefix", &dbv)) { + if (!g_plugin.getWString("VersionPrefix", &dbv)) { mir_wstrcpy(inBuf, dbv.pwszVal); db_free(&dbv); } @@ -243,86 +243,86 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: GetDlgItemText(hwndDlg, IDC_SPLASHPATH, tmp, _countof(tmp)); - db_set_ws(NULL, MODULENAME, "Path", tmp); + g_plugin.setWString("Path", tmp); GetDlgItemText(hwndDlg, IDC_SNDPATH, tmp, _countof(tmp)); - db_set_ws(NULL, MODULENAME, "Sound", tmp); + g_plugin.setWString("Sound", tmp); GetDlgItemText(hwndDlg, IDC_VERSIONPREFIX, tmp, _countof(tmp)); - db_set_ws(NULL, MODULENAME, "VersionPrefix", tmp); + g_plugin.setWString("VersionPrefix", tmp); mir_wstrcpy(szPrefix, tmp); GetDlgItemText(hwndDlg, IDC_SHOWTIME, tmp, _countof(tmp)); - db_set_dw(NULL, MODULENAME, "TimeToShow", _wtoi(tmp)); + g_plugin.setDword("TimeToShow", _wtoi(tmp)); options.showtime = _wtoi(tmp); GetDlgItemText(hwndDlg, IDC_FISTEP, tmp, _countof(tmp)); - db_set_dw(NULL, MODULENAME, "FadeinSpeed", _wtoi(tmp)); + g_plugin.setDword("FadeinSpeed", _wtoi(tmp)); options.fisteps = _wtoi(tmp); GetDlgItemText(hwndDlg, IDC_FOSTEP, tmp, _countof(tmp)); - db_set_dw(NULL, MODULENAME, "FadeoutSpeed", _wtoi(tmp)); + g_plugin.setDword("FadeoutSpeed", _wtoi(tmp)); options.fosteps = _wtoi(tmp); if (IsDlgButtonChecked(hwndDlg, IDC_ACTIVE)) { - db_set_b(NULL, MODULENAME, "Active", 1); + g_plugin.setByte("Active", 1); options.active = 1; } else { - db_set_b(NULL, MODULENAME, "Active", 0); + g_plugin.setByte("Active", 0); options.active = 0; } if (IsDlgButtonChecked(hwndDlg, IDC_PLAYSND)) { - db_set_b(NULL, MODULENAME, "PlaySound", 1); + g_plugin.setByte("PlaySound", 1); options.playsnd = 1; - db_set_b(NULL, MODULENAME, "InheritGlobalSound", 1); + g_plugin.setByte("InheritGlobalSound", 1); options.inheritGS = 1; } else { - db_set_b(NULL, MODULENAME, "PlaySound", 0); + g_plugin.setByte("PlaySound", 0); options.playsnd = 0; - db_set_b(NULL, MODULENAME, "InheritGlobalSound", 0); + g_plugin.setByte("InheritGlobalSound", 0); options.inheritGS = 0; } if (IsDlgButtonChecked(hwndDlg, IDC_PLAYSND) == BST_INDETERMINATE) { - db_set_b(NULL, MODULENAME, "PlaySound", 1); + g_plugin.setByte("PlaySound", 1); options.playsnd = 1; - db_set_b(NULL, MODULENAME, "InheritGlobalSound", 0); + g_plugin.setByte("InheritGlobalSound", 0); options.inheritGS = 0; } if (IsDlgButtonChecked(hwndDlg, IDC_FADEIN)) { - db_set_b(NULL, MODULENAME, "FadeIn", 1); + g_plugin.setByte("FadeIn", 1); options.fadein = 1; } else { - db_set_b(NULL, MODULENAME, "FadeIn", 0); + g_plugin.setByte("FadeIn", 0); options.fadein = 0; } if (IsDlgButtonChecked(hwndDlg, IDC_FADEOUT)) { - db_set_b(NULL, MODULENAME, "FadeOut", 1); + g_plugin.setByte("FadeOut", 1); options.fadeout = 1; } else { - db_set_b(NULL, MODULENAME, "FadeOut", 0); + g_plugin.setByte("FadeOut", 0); options.fadeout = 0; } if (IsDlgButtonChecked(hwndDlg, IDC_RANDOM)) { - db_set_b(NULL, MODULENAME, "Random", 1); + g_plugin.setByte("Random", 1); options.random = 1; } else { - db_set_b(NULL, MODULENAME, "Random", 0); + g_plugin.setByte("Random", 0); options.random = 0; } if (IsDlgButtonChecked(hwndDlg, IDC_SHOWVERSION)) { - db_set_b(NULL, MODULENAME, "ShowVersion", 1); + g_plugin.setByte("ShowVersion", 1); options.showversion = 1; } else { - db_set_b(NULL, MODULENAME, "ShowVersion", 0); + g_plugin.setByte("ShowVersion", 0); options.showversion = 0; } return TRUE; -- cgit v1.2.3