summaryrefslogtreecommitdiff
path: root/plugins/ZeroNotification/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/ZeroNotification/src
parent488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (diff)
db_* functions replaced with g_plugin calls
Diffstat (limited to 'plugins/ZeroNotification/src')
-rw-r--r--plugins/ZeroNotification/src/main.cpp12
-rw-r--r--plugins/ZeroNotification/src/options.cpp16
2 files changed, 14 insertions, 14 deletions
diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp
index eacb760c32..d9ae7f3020 100644
--- a/plugins/ZeroNotification/src/main.cpp
+++ b/plugins/ZeroNotification/src/main.cpp
@@ -37,7 +37,7 @@ CMPlugin::CMPlugin() :
static void UpdateMenuItem()
{
- Menu_ModifyItem(noSoundMenu, db_get_b(NULL, "Skin", "UseSound", 1) ? DISABLE_SOUND : ENABLE_SOUND);
+ Menu_ModifyItem(noSoundMenu, db_get_b(0, "Skin", "UseSound", 1) ? DISABLE_SOUND : ENABLE_SOUND);
}
// Called when the sound setting in the database is changed
@@ -51,9 +51,9 @@ static int SoundSettingChanged(WPARAM, LPARAM lParam)
int SetNotify(const long status)
{
- db_set_b(NULL, "Skin", "UseSound", (BYTE)!(db_get_dw(NULL, MODULENAME, "NoSound", DEFAULT_NOSOUND) & status));
- db_set_b(NULL, "CList", "DisableTrayFlash", (BYTE)(db_get_dw(NULL, MODULENAME, "NoBlink", DEFAULT_NOBLINK) & status));
- db_set_b(NULL, "CList", "NoIconBlink", (BYTE)(db_get_dw(NULL, MODULENAME, "NoCLCBlink", DEFAULT_NOCLCBLINK) & status));
+ db_set_b(0, "Skin", "UseSound", (BYTE)!(g_plugin.getDword("NoSound", DEFAULT_NOSOUND) & status));
+ db_set_b(0, "CList", "DisableTrayFlash", (BYTE)(g_plugin.getDword("NoBlink", DEFAULT_NOBLINK) & status));
+ db_set_b(0, "CList", "NoIconBlink", (BYTE)(g_plugin.getDword("NoCLCBlink", DEFAULT_NOCLCBLINK) & status));
UpdateMenuItem();
return 0;
@@ -93,10 +93,10 @@ int CMPlugin::Load()
noSoundMenu = Menu_AddMainMenuItem(&mi);
CreateServiceFunction(mi.pszService, NoSoundMenuCommand);
- int bHideMenu = db_get_b(NULL, MODULENAME, "HideMenu", 100);
+ int bHideMenu = g_plugin.getByte("HideMenu", 100);
if (bHideMenu != 100) {
Menu_SetVisible(noSoundMenu, !bHideMenu);
- db_unset(0, MODULENAME, "HideMenu");
+ g_plugin.delSetting("HideMenu");
}
UpdateMenuItem();
diff --git a/plugins/ZeroNotification/src/options.cpp b/plugins/ZeroNotification/src/options.cpp
index ba4970f54b..aa42e238a3 100644
--- a/plugins/ZeroNotification/src/options.cpp
+++ b/plugins/ZeroNotification/src/options.cpp
@@ -76,9 +76,9 @@ static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM, LPARA
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);
- FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOSOUND), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), db_get_dw(NULL, MODULENAME, "NoSound", DEFAULT_NOSOUND));
- FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOBLINK), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), db_get_dw(NULL, MODULENAME, "NoBlink", DEFAULT_NOBLINK));
- FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOCLCBLINK), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), db_get_dw(NULL, MODULENAME, "NoCLCBlink", DEFAULT_NOCLCBLINK));
+ FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOSOUND), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), g_plugin.getDword("NoSound", DEFAULT_NOSOUND));
+ FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOBLINK), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), g_plugin.getDword("NoBlink", DEFAULT_NOBLINK));
+ FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_NOCLCBLINK), statusValues, sizeof(statusValues) / sizeof(statusValues[0]), g_plugin.getDword("NoCLCBlink", DEFAULT_NOCLCBLINK));
return TRUE;
case WM_COMMAND:
@@ -111,12 +111,12 @@ static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM, LPARA
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_dw(NULL, MODULENAME, "NoSound", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOSOUND)));
- db_set_dw(NULL, MODULENAME, "NoBlink", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOBLINK)));
- db_set_dw(NULL, MODULENAME, "NoCLCBlink", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOCLCBLINK)));
+ g_plugin.setDword("NoSound", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOSOUND)));
+ g_plugin.setDword("NoBlink", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOBLINK)));
+ g_plugin.setDword("NoCLCBlink", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_NOCLCBLINK)));
- test = db_get_w(NULL, "CList", "Status", 0);
- SetNotify(Proto_Status2Flag(db_get_w(NULL, "CList", "Status", 0)));
+ test = db_get_w(0, "CList", "Status", 0);
+ SetNotify(Proto_Status2Flag(db_get_w(0, "CList", "Status", 0)));
return TRUE;
}
break;