summaryrefslogtreecommitdiff
path: root/plugins/Nudge/src/nudge.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-12-27 19:48:21 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-12-27 19:48:21 +0000
commit08997af71f3b28d1fc23f22b63552de23b0ab883 (patch)
treed741b4a5639a96fc02bcbaeeabad50125a8d6017 /plugins/Nudge/src/nudge.cpp
parent8d164e182630c7077055ac779de5f1ae5610f694 (diff)
Nudge to create its own type of events
git-svn-id: http://svn.miranda-ng.org/main/trunk@7398 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Nudge/src/nudge.cpp')
-rw-r--r--plugins/Nudge/src/nudge.cpp152
1 files changed, 74 insertions, 78 deletions
diff --git a/plugins/Nudge/src/nudge.cpp b/plugins/Nudge/src/nudge.cpp
index 5c83b6cfe9..66f8c47fbb 100644
--- a/plugins/Nudge/src/nudge.cpp
+++ b/plugins/Nudge/src/nudge.cpp
@@ -3,102 +3,98 @@
void CNudge::Save(void)
{
char SectionName[512];
- mir_snprintf(SectionName,512,"useByProtocol");
- db_set_b(NULL, "Nudge", SectionName, this->useByProtocol);
- mir_snprintf(SectionName,512,"RecvTimeSec");
- db_set_dw(NULL, "Nudge", SectionName, this->recvTimeSec);
- mir_snprintf(SectionName,512,"SendTimeSec");
- db_set_dw(NULL, "Nudge", SectionName, this->sendTimeSec);
- mir_snprintf(SectionName,512,"ResendDelaySec");
- db_set_dw(NULL, "Nudge", SectionName, this->resendDelaySec);
+ mir_snprintf(SectionName, 512, "useByProtocol");
+ db_set_b(NULL, MODULENAME, SectionName, this->useByProtocol);
+ mir_snprintf(SectionName, 512, "RecvTimeSec");
+ db_set_dw(NULL, MODULENAME, SectionName, this->recvTimeSec);
+ mir_snprintf(SectionName, 512, "SendTimeSec");
+ db_set_dw(NULL, MODULENAME, SectionName, this->sendTimeSec);
+ mir_snprintf(SectionName, 512, "ResendDelaySec");
+ db_set_dw(NULL, MODULENAME, SectionName, this->resendDelaySec);
}
-
void CNudge::Load(void)
{
char SectionName[512];
- mir_snprintf(SectionName,512,"useByProtocol");
- this->useByProtocol = db_get_b(NULL, "Nudge", SectionName, FALSE) != 0;
- mir_snprintf(SectionName,512,"RecvTimeSec");
- this->recvTimeSec = db_get_dw(NULL, "Nudge", SectionName, 30);
- mir_snprintf(SectionName,512,"SendTimeSec");
- this->sendTimeSec = db_get_dw(NULL, "Nudge", SectionName, 30);
- mir_snprintf(SectionName,512,"ResendDelaySec");
- this->resendDelaySec = db_get_dw(NULL, "Nudge", SectionName, 3);
+ mir_snprintf(SectionName, 512, "useByProtocol");
+ this->useByProtocol = db_get_b(NULL, MODULENAME, SectionName, FALSE) != 0;
+ mir_snprintf(SectionName, 512, "RecvTimeSec");
+ this->recvTimeSec = db_get_dw(NULL, MODULENAME, SectionName, 30);
+ mir_snprintf(SectionName, 512, "SendTimeSec");
+ this->sendTimeSec = db_get_dw(NULL, MODULENAME, SectionName, 30);
+ mir_snprintf(SectionName, 512, "ResendDelaySec");
+ this->resendDelaySec = db_get_dw(NULL, MODULENAME, SectionName, 3);
}
void CNudgeElement::Save(void)
{
char SectionName[512];
- mir_snprintf(SectionName,512,"%s-openMessageWindow", ProtocolName);
- db_set_b(NULL, "Nudge", SectionName, this->openMessageWindow);
- mir_snprintf(SectionName,512,"%s-openContactList", ProtocolName);
- db_set_b(NULL, "Nudge", SectionName, this->openContactList);
- mir_snprintf(SectionName,512,"%s-useIgnore", ProtocolName);
- db_set_b(NULL, "Nudge", SectionName, this->useIgnoreSettings);
- mir_snprintf(SectionName,512,"%s-showStatus", ProtocolName);
- db_set_b(NULL, "Nudge", SectionName, this->showStatus);
- mir_snprintf(SectionName,512,"%s-showPopup", ProtocolName);
- db_set_b(NULL, "Nudge", SectionName, this->showPopup);
- mir_snprintf(SectionName,512,"%s-shakeClist", ProtocolName);
- db_set_b(NULL, "Nudge", SectionName, this->shakeClist);
- mir_snprintf(SectionName,512,"%s-shakeChat", ProtocolName);
- db_set_b(NULL, "Nudge", SectionName, this->shakeChat);
- mir_snprintf(SectionName,512,"%s-enabled", ProtocolName);
- db_set_b(NULL, "Nudge", SectionName, this->enabled);
- mir_snprintf(SectionName,512,"%s-autoResend", ProtocolName);
- db_set_b(NULL, "Nudge", SectionName, this->autoResend);
- mir_snprintf(SectionName,512,"%s-statusFlags", ProtocolName);
- db_set_dw(NULL, "Nudge", SectionName, this->statusFlags);
- mir_snprintf(SectionName,512,"%s-recText", ProtocolName);
- db_set_ts(NULL, "Nudge", SectionName, this->recText);
- mir_snprintf(SectionName,512,"%s-senText", ProtocolName);
- db_set_ts(NULL, "Nudge", SectionName, this->senText);
+ mir_snprintf(SectionName, 512, "%s-openMessageWindow", ProtocolName);
+ db_set_b(NULL, MODULENAME, SectionName, this->openMessageWindow);
+ mir_snprintf(SectionName, 512, "%s-openContactList", ProtocolName);
+ db_set_b(NULL, MODULENAME, SectionName, this->openContactList);
+ mir_snprintf(SectionName, 512, "%s-useIgnore", ProtocolName);
+ db_set_b(NULL, MODULENAME, SectionName, this->useIgnoreSettings);
+ mir_snprintf(SectionName, 512, "%s-showStatus", ProtocolName);
+ db_set_b(NULL, MODULENAME, SectionName, this->showStatus);
+ mir_snprintf(SectionName, 512, "%s-showPopup", ProtocolName);
+ db_set_b(NULL, MODULENAME, SectionName, this->showPopup);
+ mir_snprintf(SectionName, 512, "%s-shakeClist", ProtocolName);
+ db_set_b(NULL, MODULENAME, SectionName, this->shakeClist);
+ mir_snprintf(SectionName, 512, "%s-shakeChat", ProtocolName);
+ db_set_b(NULL, MODULENAME, SectionName, this->shakeChat);
+ mir_snprintf(SectionName, 512, "%s-enabled", ProtocolName);
+ db_set_b(NULL, MODULENAME, SectionName, this->enabled);
+ mir_snprintf(SectionName, 512, "%s-autoResend", ProtocolName);
+ db_set_b(NULL, MODULENAME, SectionName, this->autoResend);
+ mir_snprintf(SectionName, 512, "%s-statusFlags", ProtocolName);
+ db_set_dw(NULL, MODULENAME, SectionName, this->statusFlags);
+ mir_snprintf(SectionName, 512, "%s-recText", ProtocolName);
+ db_set_ts(NULL, MODULENAME, SectionName, this->recText);
+ mir_snprintf(SectionName, 512, "%s-senText", ProtocolName);
+ db_set_ts(NULL, MODULENAME, SectionName, this->senText);
}
-
void CNudgeElement::Load(void)
{
DBVARIANT dbv;
char SectionName[512];
- mir_snprintf(SectionName,512,"%s-openMessageWindow", ProtocolName);
- this->openMessageWindow = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
- mir_snprintf(SectionName,512,"%s-openContactList", ProtocolName);
- this->openContactList = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
- mir_snprintf(SectionName,512,"%s-useIgnore", ProtocolName);
- this->useIgnoreSettings = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
- mir_snprintf(SectionName,512,"%s-showStatus", ProtocolName);
- this->showStatus = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
- mir_snprintf(SectionName,512,"%s-showPopup", ProtocolName);
- this->showPopup = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
- mir_snprintf(SectionName,512,"%s-shakeClist", ProtocolName);
- this->shakeClist = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
- mir_snprintf(SectionName,512,"%s-shakeChat", ProtocolName);
- this->shakeChat = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
- mir_snprintf(SectionName,512,"%s-enabled", ProtocolName);
- this->enabled = db_get_b(NULL, "Nudge", SectionName, TRUE) != 0;
- mir_snprintf(SectionName,512,"%s-autoResend", ProtocolName);
- this->autoResend = db_get_b(NULL, "Nudge", SectionName, FALSE) != 0;
- mir_snprintf(SectionName,512,"%s-statusFlags", ProtocolName);
- this->statusFlags = db_get_dw(NULL, "Nudge", SectionName, 967);
+ mir_snprintf(SectionName, 512, "%s-openMessageWindow", ProtocolName);
+ this->openMessageWindow = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
+ mir_snprintf(SectionName, 512, "%s-openContactList", ProtocolName);
+ this->openContactList = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
+ mir_snprintf(SectionName, 512, "%s-useIgnore", ProtocolName);
+ this->useIgnoreSettings = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
+ mir_snprintf(SectionName, 512, "%s-showStatus", ProtocolName);
+ this->showStatus = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
+ mir_snprintf(SectionName, 512, "%s-showPopup", ProtocolName);
+ this->showPopup = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
+ mir_snprintf(SectionName, 512, "%s-shakeClist", ProtocolName);
+ this->shakeClist = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
+ mir_snprintf(SectionName, 512, "%s-shakeChat", ProtocolName);
+ this->shakeChat = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
+ mir_snprintf(SectionName, 512, "%s-enabled", ProtocolName);
+ this->enabled = db_get_b(NULL, MODULENAME, SectionName, TRUE) != 0;
+ mir_snprintf(SectionName, 512, "%s-autoResend", ProtocolName);
+ this->autoResend = db_get_b(NULL, MODULENAME, SectionName, FALSE) != 0;
+ mir_snprintf(SectionName, 512, "%s-statusFlags", ProtocolName);
+ this->statusFlags = db_get_dw(NULL, MODULENAME, SectionName, 967);
+
mir_snprintf(SectionName,512,"%s-recText", ProtocolName);
- if (!db_get_ts(NULL,"Nudge",SectionName,&dbv))
- {
- _tcsncpy(this->recText,dbv.ptszVal,TEXT_LEN);
- if(_tcsclen(this->recText) < 1)
- _tcsncpy(this->recText,TranslateT("You received a nudge"),TEXT_LEN);
+ if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
+ _tcsncpy(this->recText, dbv.ptszVal, TEXT_LEN);
+ if (_tcsclen(this->recText) < 1)
+ _tcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
db_free(&dbv);
}
- else
- _tcsncpy(this->recText,TranslateT("You received a nudge"),TEXT_LEN);
- mir_snprintf(SectionName,512,"%s-senText", ProtocolName);
- if (!db_get_ts(NULL,"Nudge",SectionName,&dbv))
- {
- _tcsncpy(this->senText,dbv.ptszVal,TEXT_LEN);
- if(_tcsclen(this->senText) < 1)
- _tcsncpy(this->senText,TranslateT("You sent a nudge"),TEXT_LEN);
+ else _tcsncpy(this->recText, TranslateT("You received a nudge"), TEXT_LEN);
+
+ mir_snprintf(SectionName, 512, "%s-senText", ProtocolName);
+ if (!db_get_ts(NULL, MODULENAME, SectionName, &dbv)) {
+ _tcsncpy(this->senText, dbv.ptszVal, TEXT_LEN);
+ if (_tcsclen(this->senText) < 1)
+ _tcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
db_free(&dbv);
}
- else
- _tcsncpy(this->senText,TranslateT("You sent a nudge"),TEXT_LEN);
-} \ No newline at end of file
+ else _tcsncpy(this->senText, TranslateT("You sent a nudge"), TEXT_LEN);
+}