summaryrefslogtreecommitdiff
path: root/Nudge/nudge.cpp
diff options
context:
space:
mode:
authormataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-12-24 20:50:18 +0000
committermataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-12-24 20:50:18 +0000
commit85863331bd2920991e8e7093a472e60d749b4a7a (patch)
tree09e055b2e4a11299993dcc620e6618ae30ffd573 /Nudge/nudge.cpp
parentd185b144ca91d835fbf442d1198bddf4c70f8db7 (diff)
patch by FREAK_THEMIGHTY:
- fixed navigation in options + new option: "Open message window" + New option: "Open contact list" + new option: "Respect ignore settings (status changes)" * status changes are now stored in UTF8 - Removed popup on sending nudges (on popular request) * popup options are moved into popup classes, needs a recent version of popup+ or YAPP git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@251 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
Diffstat (limited to 'Nudge/nudge.cpp')
-rw-r--r--Nudge/nudge.cpp50
1 files changed, 14 insertions, 36 deletions
diff --git a/Nudge/nudge.cpp b/Nudge/nudge.cpp
index 9455ec6..0d603bb 100644
--- a/Nudge/nudge.cpp
+++ b/Nudge/nudge.cpp
@@ -43,16 +43,12 @@ int CNudgeElement::ShowContactMenu(bool show)
void CNudgeElement::Save(void)
{
char SectionName[512];
- mir_snprintf(SectionName,512,"%s-popupBackColor", ProtocolName);
- DBWriteContactSettingDword(NULL, "Nudge", SectionName, this->popupBackColor);
- mir_snprintf(SectionName,512,"%s-popupTextColor", ProtocolName);
- DBWriteContactSettingDword(NULL, "Nudge", SectionName, this->popupTextColor);
- mir_snprintf(SectionName,512,"%s-popupTimeSec", ProtocolName);
- DBWriteContactSettingDword(NULL, "Nudge", SectionName, this->popupTimeSec);
- mir_snprintf(SectionName,512,"%s-popupWindowColor", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->popupWindowColor);
- mir_snprintf(SectionName,512,"%s-showEvent", ProtocolName);
- DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->showEvent);
+ mir_snprintf(SectionName,512,"%s-openMessageWindow", ProtocolName);
+ DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->openMessageWindow);
+ mir_snprintf(SectionName,512,"%s-openContactList", ProtocolName);
+ DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->openContactList);
+ mir_snprintf(SectionName,512,"%s-useIgnore", ProtocolName);
+ DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->useIgnoreSettings);
mir_snprintf(SectionName,512,"%s-showStatus", ProtocolName);
DBWriteContactSettingByte(NULL, "Nudge", SectionName, this->showStatus);
mir_snprintf(SectionName,512,"%s-showPopup", ProtocolName);
@@ -68,23 +64,9 @@ void CNudgeElement::Save(void)
mir_snprintf(SectionName,512,"%s-statusFlags", ProtocolName);
DBWriteContactSettingDword(NULL, "Nudge", SectionName, this->statusFlags);
mir_snprintf(SectionName,512,"%s-recText", ProtocolName);
- if(DBWriteContactSettingTString(NULL, "Nudge", SectionName, this->recText)) {
- #if defined( _UNICODE )
- char buff[TEXT_LEN];
- WideCharToMultiByte(code_page, 0, this->recText, -1, buff, TEXT_LEN, 0, 0);
- buff[TEXT_LEN] = 0;
- DBWriteContactSettingString(0, "Nudge", SectionName, buff);
- #endif
- }
+ DBWriteContactSettingTString(NULL, "Nudge", SectionName, this->recText);
mir_snprintf(SectionName,512,"%s-senText", ProtocolName);
- if(DBWriteContactSettingTString(NULL, "Nudge", SectionName, this->senText)) {
- #if defined( _UNICODE )
- char buff[TEXT_LEN];
- WideCharToMultiByte(code_page, 0, this->senText, -1, buff, TEXT_LEN, 0, 0);
- buff[TEXT_LEN] = 0;
- DBWriteContactSettingString(0, "Nudge", SectionName, buff);
- #endif
- }
+ DBWriteContactSettingTString(NULL, "Nudge", SectionName, this->senText);
}
@@ -92,16 +74,12 @@ void CNudgeElement::Load(void)
{
DBVARIANT dbv;
char SectionName[512];
- mir_snprintf(SectionName,512,"%s-popupBackColor", ProtocolName);
- this->popupBackColor = DBGetContactSettingDword(NULL, "Nudge", SectionName, GetSysColor(COLOR_BTNFACE));
- mir_snprintf(SectionName,512,"%s-popupTextColor", ProtocolName);
- this->popupTextColor = DBGetContactSettingDword(NULL, "Nudge", SectionName, GetSysColor(COLOR_WINDOWTEXT));
- mir_snprintf(SectionName,512,"%s-popupTimeSec", ProtocolName);
- this->popupTimeSec = DBGetContactSettingDword(NULL, "Nudge", SectionName, 4);
- mir_snprintf(SectionName,512,"%s-popupWindowColor", ProtocolName);
- this->popupWindowColor = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
- mir_snprintf(SectionName,512,"%s-showEvent", ProtocolName);
- this->showEvent = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ mir_snprintf(SectionName,512,"%s-openMessageWindow", ProtocolName);
+ this->openMessageWindow = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ mir_snprintf(SectionName,512,"%s-openContactList", ProtocolName);
+ this->openContactList = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
+ mir_snprintf(SectionName,512,"%s-useIgnore", ProtocolName);
+ this->useIgnoreSettings = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-showStatus", ProtocolName);
this->showStatus = DBGetContactSettingByte(NULL, "Nudge", SectionName, TRUE) != 0;
mir_snprintf(SectionName,512,"%s-showPopup", ProtocolName);