summaryrefslogtreecommitdiff
path: root/plugins/ProxySwitch/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-12 21:44:56 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-12 21:44:56 +0300
commit53fe3e46177d17b4941610de19f5cc6210700cb4 (patch)
treeb67a6bc208dad141f9db14035cd7e42ff2a51872 /plugins/ProxySwitch/src
parent488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (diff)
db_* functions replaced with g_plugin calls
Diffstat (limited to 'plugins/ProxySwitch/src')
-rw-r--r--plugins/ProxySwitch/src/main.cpp8
-rw-r--r--plugins/ProxySwitch/src/opt.cpp48
-rw-r--r--plugins/ProxySwitch/src/proxy.cpp4
3 files changed, 30 insertions, 30 deletions
diff --git a/plugins/ProxySwitch/src/main.cpp b/plugins/ProxySwitch/src/main.cpp
index 2b28f39993..b5c8f01d3e 100644
--- a/plugins/ProxySwitch/src/main.cpp
+++ b/plugins/ProxySwitch/src/main.cpp
@@ -264,10 +264,10 @@ int Init(WPARAM, LPARAM)
HGENMENU hMenu = Menu_AddMainMenuItem(&mi);
hSvcShowMyIP = CreateServiceFunction(mi.pszService, ShowMyIPAddrs);
- int opt_showMyIP = db_get_b(NULL, MODULENAME, "ShowMyIP", 100);
+ int opt_showMyIP = g_plugin.getByte("ShowMyIP", 100);
if (opt_showMyIP != 100) {
Menu_SetVisible(hMenu, opt_showMyIP != 0);
- db_unset(NULL, MODULENAME, "ShowMyIP");
+ g_plugin.delSetting("ShowMyIP");
}
hMenuRoot = mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Proxy settings && interfaces"), 0xC0000000);
@@ -287,10 +287,10 @@ int Init(WPARAM, LPARAM)
Menu_AddMainMenuItem(&mi);
hSvcProxyEnable = CreateServiceFunction(mi.pszService, ProxyEnable);
- int opt_showProxyIP = db_get_b(NULL, MODULENAME, "ShowProxyIP", 100);
+ int opt_showProxyIP = g_plugin.getByte("ShowProxyIP", 100);
if (opt_showProxyIP != 100) {
Menu_SetVisible(mi.root, opt_showProxyIP != 0);
- db_unset(NULL, MODULENAME, "ShowProxyIP");
+ g_plugin.delSetting("ShowProxyIP");
}
UpdateInterfacesMenu();
diff --git a/plugins/ProxySwitch/src/opt.cpp b/plugins/ProxySwitch/src/opt.cpp
index 2a071da495..e78de5e9b7 100644
--- a/plugins/ProxySwitch/src/opt.cpp
+++ b/plugins/ProxySwitch/src/opt.cpp
@@ -142,47 +142,47 @@ int OptInit(WPARAM wParam, LPARAM)
void LoadSettings(void)
{
- ptrW wszStr(db_get_wsa(NULL, MODULENAME, "UseProxyIPNets"));
+ ptrW wszStr(g_plugin.getWStringA("UseProxyIPNets"));
if (!wszStr)
opt_useProxy[0] = 0;
else
wcsncpy_s(opt_useProxy, wszStr, _TRUNCATE);
- wszStr = db_get_wsa(NULL, MODULENAME, "NoProxyIPNets");
+ wszStr = g_plugin.getWStringA("NoProxyIPNets");
if (!wszStr)
opt_noProxy[0] = 0;
else
wcsncpy_s(opt_noProxy, wszStr, _TRUNCATE);
- wszStr = db_get_wsa(NULL, MODULENAME, "HideInterfaces");
+ wszStr = g_plugin.getWStringA("HideInterfaces");
if (!wszStr)
opt_hideIntf[0] = 0;
else
wcsncpy_s(opt_hideIntf, wszStr, _TRUNCATE);
- opt_miranda = db_get_b(NULL, MODULENAME, "ManageMirandaProxy", TRUE);
- opt_ie = db_get_b(NULL, MODULENAME, "ManageIEProxy", FALSE);
- opt_firefox = db_get_b(NULL, MODULENAME, "ManageFirefoxProxy", FALSE) && Firefox_Installed();
- opt_alwayReconnect = db_get_b(NULL, MODULENAME, "AlwaysReconnect", FALSE);
- opt_popups = db_get_b(NULL, MODULENAME, "PopupEnabled", TRUE);
- opt_defaultColors = db_get_b(NULL, MODULENAME, "PopupDefaultColors", TRUE);
- opt_showProxyState = db_get_b(NULL, MODULENAME, "ShowProxyStatus", TRUE);
- opt_bgColor = db_get_dw(NULL, MODULENAME, "PopupBgColor", GetSysColor(COLOR_BTNFACE));
- opt_txtColor = db_get_dw(NULL, MODULENAME, "PopupTxtColor", GetSysColor(COLOR_WINDOWTEXT));
+ opt_miranda = g_plugin.getByte("ManageMirandaProxy", TRUE);
+ opt_ie = g_plugin.getByte("ManageIEProxy", FALSE);
+ opt_firefox = g_plugin.getByte("ManageFirefoxProxy", FALSE) && Firefox_Installed();
+ opt_alwayReconnect = g_plugin.getByte("AlwaysReconnect", FALSE);
+ opt_popups = g_plugin.getByte("PopupEnabled", TRUE);
+ opt_defaultColors = g_plugin.getByte("PopupDefaultColors", TRUE);
+ opt_showProxyState = g_plugin.getByte("ShowProxyStatus", TRUE);
+ opt_bgColor = g_plugin.getDword("PopupBgColor", GetSysColor(COLOR_BTNFACE));
+ opt_txtColor = g_plugin.getDword("PopupTxtColor", GetSysColor(COLOR_WINDOWTEXT));
}
void SaveSettings(void)
{
- db_set_ws(NULL, MODULENAME, "UseProxyIPNets", opt_useProxy);
- db_set_ws(NULL, MODULENAME, "NoProxyIPNets", opt_noProxy);
- db_set_ws(NULL, MODULENAME, "HideInterfaces", opt_hideIntf);
- db_set_b(NULL, MODULENAME, "ManageMirandaProxy", (BYTE)opt_miranda);
- db_set_b(NULL, MODULENAME, "ManageIEProxy", (BYTE)opt_ie);
- db_set_b(NULL, MODULENAME, "ManageFirefoxProxy", (BYTE)opt_firefox);
- db_set_b(NULL, MODULENAME, "AlwaysReconnect", (BYTE)opt_alwayReconnect);
- db_set_b(NULL, MODULENAME, "PopupEnabled", (BYTE)opt_popups);
- db_set_b(NULL, MODULENAME, "PopupDefaultColors", (BYTE)opt_defaultColors);
- db_set_b(NULL, MODULENAME, "ShowProxyStatus", (BYTE)opt_showProxyState);
- db_set_dw(NULL, MODULENAME, "PopupBgColor", (DWORD)opt_bgColor);
- db_set_dw(NULL, MODULENAME, "PopupTxtColor", (DWORD)opt_txtColor);
+ g_plugin.setWString("UseProxyIPNets", opt_useProxy);
+ g_plugin.setWString("NoProxyIPNets", opt_noProxy);
+ g_plugin.setWString("HideInterfaces", opt_hideIntf);
+ g_plugin.setByte("ManageMirandaProxy", (BYTE)opt_miranda);
+ g_plugin.setByte("ManageIEProxy", (BYTE)opt_ie);
+ g_plugin.setByte("ManageFirefoxProxy", (BYTE)opt_firefox);
+ g_plugin.setByte("AlwaysReconnect", (BYTE)opt_alwayReconnect);
+ g_plugin.setByte("PopupEnabled", (BYTE)opt_popups);
+ g_plugin.setByte("PopupDefaultColors", (BYTE)opt_defaultColors);
+ g_plugin.setByte("ShowProxyStatus", (BYTE)opt_showProxyState);
+ g_plugin.setDword("PopupBgColor", (DWORD)opt_bgColor);
+ g_plugin.setDword("PopupTxtColor", (DWORD)opt_txtColor);
}
diff --git a/plugins/ProxySwitch/src/proxy.cpp b/plugins/ProxySwitch/src/proxy.cpp
index bed73e9fb6..45ac91f303 100644
--- a/plugins/ProxySwitch/src/proxy.cpp
+++ b/plugins/ProxySwitch/src/proxy.cpp
@@ -82,7 +82,7 @@ char Get_Miranda_Proxy_Status(void)
Create_Proxy_Settings_List(&ps);
for (i = 0; i < ps.count; i++) {
- p = db_get_b(NULL, ps.item[i].ModuleName, ps.item[i].SettingName, FALSE);
+ p = db_get_b(0, ps.item[i].ModuleName, ps.item[i].SettingName, FALSE);
if (proxy == PROXY_NO_CONFIG) {
proxy = p;
continue;
@@ -109,7 +109,7 @@ void Set_Miranda_Proxy_Status(char proxy)
Create_Proxy_Settings_List(&ps);
for (i = 0; i < ps.count; i++) {
if (ps.item[i].SettingName[0] != 0)
- db_set_b(NULL, ps.item[i].ModuleName, ps.item[i].SettingName, proxy);
+ db_set_b(0, ps.item[i].ModuleName, ps.item[i].SettingName, proxy);
ZeroMemory(&nlus, sizeof(nlus));
nlus.cbSize = sizeof(nlus);
if (Netlib_GetUserSettingsByName(ps.item[i].ModuleName, &nlus)) {