summaryrefslogtreecommitdiff
path: root/plugins/KeyboardNotify/src/main.cpp
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/KeyboardNotify/src/main.cpp
parent488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (diff)
db_* functions replaced with g_plugin calls
Diffstat (limited to 'plugins/KeyboardNotify/src/main.cpp')
-rw-r--r--plugins/KeyboardNotify/src/main.cpp80
1 files changed, 40 insertions, 40 deletions
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();