diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-14 14:42:43 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-14 14:42:43 +0000 |
commit | 67a6632c79ee755a468b2d2bd28d470104f2b4da (patch) | |
tree | c4167613efce0c8f4d02ffcdb86af01958004552 /plugins/BuddyExpectator | |
parent | 406de4af82891ae5d30280917721a88f4d43abeb (diff) |
BuddyExpectator: changed warning lavel to w4
git-svn-id: http://svn.miranda-ng.org/main/trunk@11409 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BuddyExpectator')
-rw-r--r-- | plugins/BuddyExpectator/BuddyExpectator_12.vcxproj | 8 | ||||
-rw-r--r-- | plugins/BuddyExpectator/src/BuddyExpectator.cpp | 124 | ||||
-rw-r--r-- | plugins/BuddyExpectator/src/common.h | 2 | ||||
-rw-r--r-- | plugins/BuddyExpectator/src/options.cpp | 362 | ||||
-rw-r--r-- | plugins/BuddyExpectator/src/options.h | 7 |
5 files changed, 249 insertions, 254 deletions
diff --git a/plugins/BuddyExpectator/BuddyExpectator_12.vcxproj b/plugins/BuddyExpectator/BuddyExpectator_12.vcxproj index 827cd459f5..71009d6a78 100644 --- a/plugins/BuddyExpectator/BuddyExpectator_12.vcxproj +++ b/plugins/BuddyExpectator/BuddyExpectator_12.vcxproj @@ -81,7 +81,7 @@ <StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
@@ -107,7 +107,7 @@ <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
@@ -135,7 +135,7 @@ <StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>common.h</PrecompiledHeaderFile>
@@ -159,7 +159,7 @@ <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index e363ee2eeb..63bc61d4b8 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+ */
#include "common.h"
@@ -49,19 +49,19 @@ PLUGININFOEX pluginInfo = { __AUTHORWEB,
UNICODE_AWARE,
// {DDF8AEC9-7D37-49AF-9D22-BBBC920E6F05}
- {0xddf8aec9, 0x7d37, 0x49af, {0x9d, 0x22, 0xbb, 0xbc, 0x92, 0x0e, 0x6f, 0x05}}
+ { 0xddf8aec9, 0x7d37, 0x49af, { 0x9d, 0x22, 0xbb, 0xbc, 0x92, 0x0e, 0x6f, 0x05 } }
};
static IconItem iconList[] =
{
- { LPGEN("Tray/popup icon"), "main_icon", IDI_MAINICON },
- { LPGEN("Enabled"), "enabled_icon", IDI_ENABLED },
- { LPGEN("Disabled"), "disabled_icon", IDI_DISABLED },
- { LPGEN("Hide"), "hide_icon", IDI_HIDE },
- { LPGEN("Never hide"), "neverhide_icon", IDI_NEVERHIDE }
+ { LPGEN("Tray/popup icon"), "main_icon", IDI_MAINICON },
+ { LPGEN("Enabled"), "enabled_icon", IDI_ENABLED },
+ { LPGEN("Disabled"), "disabled_icon", IDI_DISABLED },
+ { LPGEN("Hide"), "hide_icon", IDI_HIDE },
+ { LPGEN("Never hide"), "neverhide_icon", IDI_NEVERHIDE }
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
return TRUE;
@@ -134,7 +134,7 @@ LRESULT CALLBACK MissYouPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case WM_COMMAND:
if (HIWORD(wParam) == STN_CLICKED) {
CallServiceSync("BuddyExpectator/actionMissYou", (WPARAM)PUGetContact(hWnd), 0);
- if ( !db_get_b(PUGetContact(hWnd), MODULE_NAME, "MissYouNotifyAlways", 0)) {
+ if (!db_get_b(PUGetContact(hWnd), MODULE_NAME, "MissYouNotifyAlways", 0)) {
db_set_b(PUGetContact(hWnd), MODULE_NAME, "MissYou", 0);
ExtraIcon_Clear(hExtraIcon, PUGetContact(hWnd));
}
@@ -217,40 +217,40 @@ bool isContactGoneFor(MCONTACT hContact, int days) time_t currentTime = time(NULL);
int daysSinceOnline = -1;
- if (lastSeen != -1) daysSinceOnline = (int)((currentTime - lastSeen)/(60*60*24));
+ if (lastSeen != -1) daysSinceOnline = (int)((currentTime - lastSeen) / (60 * 60 * 24));
int daysSinceMessage = -1;
- if (lastInputMsg != -1) daysSinceMessage = (int)((currentTime - lastInputMsg)/(60*60*24));
+ if (lastInputMsg != -1) daysSinceMessage = (int)((currentTime - lastInputMsg) / (60 * 60 * 24));
if (options.hideInactive)
- if (daysSinceMessage >= options.iSilencePeriod)
- if (!db_get_b(hContact, "CList", "Hidden", 0) && !db_get_b(hContact, MODULE_NAME, "NeverHide", 0)) {
- POPUPDATAT_V2 ppd = {0};
- ppd.cbSize = sizeof(ppd);
- ppd.lchContact = hContact;
- ppd.lchIcon = Skin_GetIcon("enabled_icon");
-
- mir_sntprintf(ppd.lptzContactName, SIZEOF(ppd.lptzContactName), TranslateT("Hiding %s (%S)"),
- CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR),
- GetContactProto(hContact));
-
- mir_sntprintf(ppd.lptzText, SIZEOF(ppd.lptzText), TranslateT("%d days since last message"), daysSinceMessage);
-
- if (!options.iUsePopupColors) {
- ppd.colorBack = options.iPopupColorBack;
- ppd.colorText = options.iPopupColorFore;
- }
- ppd.PluginWindowProc = HidePopupDlgProc;
- ppd.iSeconds = -1;
+ if (daysSinceMessage >= options.iSilencePeriod)
+ if (!db_get_b(hContact, "CList", "Hidden", 0) && !db_get_b(hContact, MODULE_NAME, "NeverHide", 0)) {
+ POPUPDATAT_V2 ppd = { 0 };
+ ppd.cbSize = sizeof(ppd);
+ ppd.lchContact = hContact;
+ ppd.lchIcon = Skin_GetIcon("enabled_icon");
+
+ mir_sntprintf(ppd.lptzContactName, SIZEOF(ppd.lptzContactName), TranslateT("Hiding %s (%S)"),
+ CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR),
+ GetContactProto(hContact));
+
+ mir_sntprintf(ppd.lptzText, SIZEOF(ppd.lptzText), TranslateT("%d days since last message"), daysSinceMessage);
+
+ if (!options.iUsePopupColors) {
+ ppd.colorBack = options.iPopupColorBack;
+ ppd.colorText = options.iPopupColorFore;
+ }
+ ppd.PluginWindowProc = HidePopupDlgProc;
+ ppd.iSeconds = -1;
- hideactions[0].flags = hideactions[1].flags = PAF_ENABLED;
- ppd.lpActions = hideactions;
- ppd.actionCount = 2;
+ hideactions[0].flags = hideactions[1].flags = PAF_ENABLED;
+ ppd.lpActions = hideactions;
+ ppd.actionCount = 2;
- CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NEWDATA);
+ CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NEWDATA);
- SkinPlaySound("buddyExpectatorHide");
- }
+ SkinPlaySound("buddyExpectatorHide");
+ }
return (daysSinceOnline >= days && (daysSinceMessage == -1 || daysSinceMessage >= days));
}
@@ -267,7 +267,7 @@ void ReturnNotify(MCONTACT hContact, TCHAR *message) POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
- _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,hContact,GCDNF_TCHAR), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), MAX_CONTACTNAME);
_tcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
@@ -286,12 +286,12 @@ void ReturnNotify(MCONTACT hContact, TCHAR *message) cle.pszService = "BuddyExpectator/actionReturned";
cle.flags = CLEF_TCHAR;
- TCHAR* nick = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,hContact,GCDNF_TCHAR);
+ TCHAR* nick = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR);
TCHAR tmpMsg[512];
mir_sntprintf(tmpMsg, SIZEOF(tmpMsg), _T("%s %s"), nick, message);
cle.ptszTooltip = tmpMsg;
- CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM) &cle);
+ CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
}
@@ -302,10 +302,10 @@ void GoneNotify(MCONTACT hContact, TCHAR *message) if (options.iShowPopup2 > 0) {
// Display Popup
- POPUPDATAT ppd = {0};
+ POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
- _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,hContact,GCDNF_TCHAR), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), MAX_CONTACTNAME);
_tcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
@@ -324,13 +324,13 @@ void GoneNotify(MCONTACT hContact, TCHAR *message) cle.hIcon = hIcon;
cle.pszService = "BuddyExpectator/actionStillAbsent";
- TCHAR* nick = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,hContact,GCDNF_TCHAR);
+ TCHAR* nick = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR);
TCHAR tmpMsg[512];
mir_sntprintf(tmpMsg, SIZEOF(tmpMsg), _T("%s %s"), nick, message);
cle.ptszTooltip = tmpMsg;
cle.flags = CLEF_TCHAR;
- CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM) &cle);
+ CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
}
@@ -364,10 +364,10 @@ INT_PTR ContactReturnedAction(WPARAM hContact, LPARAM lParam) hContact = cle->hContact;
}
- if (options.iShowMessageWindow>0)
+ if (options.iShowMessageWindow > 0)
CallService(MS_MSG_SENDMESSAGET, hContact, 0);
- if (options.iShowUDetails>0)
+ if (options.iShowUDetails > 0)
CallService(MS_USERINFO_SHOWDIALOG, hContact, 0);
setLastSeen(hContact);
@@ -434,31 +434,31 @@ INT_PTR MenuMissYouClick(WPARAM hContact, LPARAM) */
int onPrebuildContactMenu(WPARAM hContact, LPARAM)
{
- char *proto = GetContactProto(hContact);
- if (!proto)
+ char *proto = GetContactProto(hContact);
+ if (!proto)
return 0;
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON | CMIM_NAME | CMIF_TCHAR;
- if (db_get_b(hContact, MODULE_NAME, "MissYou", 0)) {
+ if (db_get_b(hContact, MODULE_NAME, "MissYou", 0)) {
mi.ptszName = LPGENT("Disable Miss You");
mi.icolibItem = iconList[1].hIcolib;
- }
- else {
+ }
+ else {
mi.ptszName = LPGENT("Enable Miss You");
mi.icolibItem = iconList[2].hIcolib;
- }
+ }
Menu_ModifyItem(hContactMenu, &mi);
Menu_ShowItem(hContactMenu, !db_get_b(hContact, proto, "ChatRoom", 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND));
- return 0;
+ return 0;
}
int onExtraImageApplying(WPARAM hContact, LPARAM)
{
- if ( db_get_b(hContact, MODULE_NAME, "MissYou", 0))
+ if (db_get_b(hContact, MODULE_NAME, "MissYou", 0))
ExtraIcon_SetIcon(hExtraIcon, hContact, "enabled_icon");
- return 0;
+ return 0;
}
/**
@@ -490,12 +490,12 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) if (prevStatus == ID_STATUS_OFFLINE) {
if (db_get_b(hContact, MODULE_NAME, "MissYou", 0)) {
// Display Popup
- POPUPDATAT_V2 ppd = {0};
+ POPUPDATAT_V2 ppd = { 0 };
ppd.cbSize = sizeof(ppd);
ppd.lchContact = hContact;
ppd.lchIcon = Skin_GetIcon("enabled_icon");
- _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,hContact,GCDNF_TCHAR), MAX_CONTACTNAME);
+ _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), MAX_CONTACTNAME);
_tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopupColorBack;
@@ -509,7 +509,7 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) ppd.lpActions = missyouactions;
ppd.actionCount = 1;
- CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NEWDATA);
+ CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NEWDATA);
SkinPlaySound("buddyExpectatorMissYou");
}
@@ -528,7 +528,7 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) unsigned int AbsencePeriod = db_get_dw(hContact, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
if (isContactGoneFor(hContact, AbsencePeriod)) {
TCHAR* message = TranslateT("has returned after a long absence.");
- TCHAR tmpBuf[251] = {0};
+ TCHAR tmpBuf[251] = { 0 };
time_t tmpTime = getLastSeen(hContact);
if (tmpTime != -1) {
_tcsftime(tmpBuf, 250, TranslateT("has returned after being absent since %#x"), gmtime(&tmpTime));
@@ -563,7 +563,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) TCHAR* message = TranslateT("has not returned after a long absence.");
time_t tmpTime;
- TCHAR tmpBuf[251] = {0};
+ TCHAR tmpBuf[251] = { 0 };
tmpTime = getLastSeen(hContact);
if (tmpTime != -1)
{
@@ -644,7 +644,7 @@ int ModulesLoaded(WPARAM, LPARAM) return 0;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
@@ -674,7 +674,7 @@ extern "C" int __declspec(dllexport) Load(void) InitOptions();
- hContactReturnedAction = CreateServiceFunction("BuddyExpectator/actionReturned", ContactReturnedAction);
+ hContactReturnedAction = CreateServiceFunction("BuddyExpectator/actionReturned", ContactReturnedAction);
hContactStillAbsentAction = CreateServiceFunction("BuddyExpectator/actionStillAbsent", ContactStillAbsentAction);
hMissYouAction = CreateServiceFunction("BuddyExpectator/actionMissYou", MissYouAction);
hMenuMissYouClick = CreateServiceFunction("BuddyExpectator/actionMissYouClick", MenuMissYouClick);
@@ -690,7 +690,7 @@ extern "C" int __declspec(dllexport) Load(void) DWORD current_time = (DWORD)time(0);
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- if ( !db_get(hContact, MODULE_NAME, "CreationTime", &dbv))
+ if (!db_get(hContact, MODULE_NAME, "CreationTime", &dbv))
db_free(&dbv);
else
db_set_dw(hContact, MODULE_NAME, "CreationTime", current_time);
diff --git a/plugins/BuddyExpectator/src/common.h b/plugins/BuddyExpectator/src/common.h index bf14a631a5..128fce7859 100644 --- a/plugins/BuddyExpectator/src/common.h +++ b/plugins/BuddyExpectator/src/common.h @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+ */
#define _CRT_SECURE_NO_WARNINGS
#ifndef _COMMON_INC
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index aa2d525568..292751a024 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+ */
#include "common.h"
@@ -32,28 +32,28 @@ Options options; void LoadOptions()
{
- options.iAbsencePeriod = db_get_dw(NULL, MODULE_NAME, "iAbsencePeriod", 14);
- options.iAbsencePeriod2 = db_get_dw(NULL, MODULE_NAME, "iAbsencePeriod2", 30 * 3);
- options.iSilencePeriod = db_get_dw(NULL, MODULE_NAME, "iSilencePeriod", 30);
+ options.iAbsencePeriod = db_get_dw(NULL, MODULE_NAME, "iAbsencePeriod", 14);
+ options.iAbsencePeriod2 = db_get_dw(NULL, MODULE_NAME, "iAbsencePeriod2", 30 * 3);
+ options.iSilencePeriod = db_get_dw(NULL, MODULE_NAME, "iSilencePeriod", 30);
- options.iShowPopup = db_get_b(NULL, MODULE_NAME, "iShowPopUp", 1);
- options.iShowEvent = db_get_b(NULL, MODULE_NAME, "iShowEvent", 0);
- options.iShowUDetails = db_get_b(NULL, MODULE_NAME, "iShowUDetails", 0);
+ options.iShowPopup = db_get_b(NULL, MODULE_NAME, "iShowPopUp", 1);
+ options.iShowEvent = db_get_b(NULL, MODULE_NAME, "iShowEvent", 0);
+ options.iShowUDetails = db_get_b(NULL, MODULE_NAME, "iShowUDetails", 0);
options.iShowMessageWindow = db_get_b(NULL, MODULE_NAME, "iShowMessageWindow", 1);
- options.iPopupColorBack = db_get_dw(NULL, MODULE_NAME, "iPopUpColorBack", DEF_COLOR_BACK);
- options.iPopupColorFore = db_get_dw(NULL, MODULE_NAME, "iPopUpColorFore", DEF_COLOR_FORE);
+ options.iPopupColorBack = db_get_dw(NULL, MODULE_NAME, "iPopUpColorBack", DEF_COLOR_BACK);
+ options.iPopupColorFore = db_get_dw(NULL, MODULE_NAME, "iPopUpColorFore", DEF_COLOR_FORE);
- options.iUsePopupColors = db_get_b(NULL, MODULE_NAME, "iUsePopupColors", 0);
- options.iUseWinColors = db_get_b(NULL, MODULE_NAME, "iUseWinColors", 0);
- options.iPopupDelay = db_get_b(NULL, MODULE_NAME, "iPopUpDelay", 0);
+ options.iUsePopupColors = db_get_b(NULL, MODULE_NAME, "iUsePopupColors", 0);
+ options.iUseWinColors = db_get_b(NULL, MODULE_NAME, "iUseWinColors", 0);
+ options.iPopupDelay = db_get_b(NULL, MODULE_NAME, "iPopUpDelay", 0);
- options.iShowPopup2 = db_get_b(NULL, MODULE_NAME, "iShowPopUp2", 1);
- options.iShowEvent2 = db_get_b(NULL, MODULE_NAME, "iShowEvent2", 0);
- options.action2 = (GoneContactAction)db_get_b(NULL, MODULE_NAME, "Action2", (BYTE)GCA_NOACTION);
- options.notifyFirstOnline = db_get_b(NULL, MODULE_NAME, "bShowFirstSight", 0) ? true : false;
- options.hideInactive = db_get_b(NULL, MODULE_NAME, "bHideInactive", 0) ? true : false;
- options.enableMissYou = db_get_b(NULL, MODULE_NAME, "bMissYouEnabled", 1) ? true : false;
+ options.iShowPopup2 = db_get_b(NULL, MODULE_NAME, "iShowPopUp2", 1);
+ options.iShowEvent2 = db_get_b(NULL, MODULE_NAME, "iShowEvent2", 0);
+ options.action2 = (GoneContactAction)db_get_b(NULL, MODULE_NAME, "Action2", (BYTE)GCA_NOACTION);
+ options.notifyFirstOnline = db_get_b(NULL, MODULE_NAME, "bShowFirstSight", 0) ? true : false;
+ options.hideInactive = db_get_b(NULL, MODULE_NAME, "bHideInactive", 0) ? true : false;
+ options.enableMissYou = db_get_b(NULL, MODULE_NAME, "bMissYouEnabled", 1) ? true : false;
}
void SaveOptions()
@@ -94,25 +94,25 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- if ( !ServiceExists(MS_POPUP_ADDPOPUPT))
+ if (!ServiceExists(MS_POPUP_ADDPOPUPT))
EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), FALSE);
//iAbsencePeriod
SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_RESETCONTENT, 0, 0);
- SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
- SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
- SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
- SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_ADDSTRING, 0, (LPARAM)TranslateT("days"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_ADDSTRING, 0, (LPARAM)TranslateT("weeks"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_ADDSTRING, 0, (LPARAM)TranslateT("months"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_ADDSTRING, 0, (LPARAM)TranslateT("years"));
if (options.iAbsencePeriod % 365 == 0) {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/365, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod / 365, FALSE);
SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_SETCURSEL, 3, 0);
}
else if (options.iAbsencePeriod % 30 == 0) {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/30, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod / 30, FALSE);
SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_SETCURSEL, 2, 0);
}
else if (options.iAbsencePeriod % 7 == 0) {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/7, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod / 7, FALSE);
SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_SETCURSEL, 1, 0);
}
else {
@@ -122,49 +122,49 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, //iAbsencePeriod2
SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_RESETCONTENT, 0, 0);
- SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
- SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
- SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
- SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_ADDSTRING, 0, (LPARAM)TranslateT("days"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_ADDSTRING, 0, (LPARAM)TranslateT("weeks"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_ADDSTRING, 0, (LPARAM)TranslateT("months"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_ADDSTRING, 0, (LPARAM)TranslateT("years"));
if (options.iAbsencePeriod2 % 365 == 0) {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/365, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2 / 365, FALSE);
SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_SETCURSEL, 3, 0);
}
else if (options.iAbsencePeriod2 % 30 == 0) {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/30, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2 / 30, FALSE);
SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_SETCURSEL, 2, 0);
}
else if (options.iAbsencePeriod2 % 7 == 0) {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/7, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2 / 7, FALSE);
SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_SETCURSEL, 1, 0);
}
else {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2,options.iAbsencePeriod2, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2, FALSE);
SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_SETCURSEL, 0, 0);
}
//iSilencePeriod
SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_RESETCONTENT, 0, 0);
- SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
- SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
- SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
- SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_ADDSTRING, 0, (LPARAM)TranslateT("days"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_ADDSTRING, 0, (LPARAM)TranslateT("weeks"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_ADDSTRING, 0, (LPARAM)TranslateT("months"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_ADDSTRING, 0, (LPARAM)TranslateT("years"));
if (options.iSilencePeriod % 365 == 0) {
- SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/365, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod / 365, FALSE);
SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_SETCURSEL, 3, 0);
}
else if (options.iSilencePeriod % 30 == 0) {
- SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/30, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod / 30, FALSE);
SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_SETCURSEL, 2, 0);
}
else if (options.iSilencePeriod % 7 == 0) {
- SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/7, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod / 7, FALSE);
SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_SETCURSEL, 1, 0);
}
else {
- SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR,options.iSilencePeriod, FALSE);
+ SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod, FALSE);
SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_SETCURSEL, 0, 0);
}
@@ -180,10 +180,10 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, CheckDlgButton(hwndDlg, IDC_CHECK_FLASHICON2, options.iShowEvent2 > 0 ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_RESETCONTENT, 0, 0);
- SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_ADDSTRING, 0, (LPARAM) TranslateT("Do nothing"));
- SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_ADDSTRING, 0, (LPARAM) TranslateT("Delete the contact"));
- SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_ADDSTRING, 0, (LPARAM) TranslateT("Open User Details"));
- SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_ADDSTRING, 0, (LPARAM) TranslateT("Open message window"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Do nothing"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Delete the contact"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Open User Details"));
+ SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_ADDSTRING, 0, (LPARAM)TranslateT("Open message window"));
SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_SETCURSEL, options.action2, 0);
return TRUE;
@@ -193,71 +193,71 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, || ((HIWORD(wParam) == EN_CHANGE) && (SendDlgItemMessage(hwndDlg, IDC_EDIT_ABSENCE2, EM_GETMODIFY, 0, 0)))
|| ((HIWORD(wParam) == EN_CHANGE) && (SendDlgItemMessage(hwndDlg, IDC_EDIT_SILENTFOR, EM_GETMODIFY, 0, 0))))
{
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
case WM_NOTIFY:
- {
- NMHDR* nmhdr = (NMHDR*)lParam;
- switch (nmhdr->code) {
- case PSN_APPLY:
- //iAbsencePeriod
- int num = GetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, 0, FALSE);
- switch (SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_GETCURSEL, 0, 0)) {
- case 1: options.iAbsencePeriod = 7 * num; break;
- case 2: options.iAbsencePeriod = 30 * num; break;
- case 3: options.iAbsencePeriod = 365 * num; break;
- default: options.iAbsencePeriod = num; break;
- }
+ {
+ NMHDR* nmhdr = (NMHDR*)lParam;
+ switch (nmhdr->code) {
+ case PSN_APPLY:
+ //iAbsencePeriod
+ int num = GetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, 0, FALSE);
+ switch (SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD, CB_GETCURSEL, 0, 0)) {
+ case 1: options.iAbsencePeriod = 7 * num; break;
+ case 2: options.iAbsencePeriod = 30 * num; break;
+ case 3: options.iAbsencePeriod = 365 * num; break;
+ default: options.iAbsencePeriod = num; break;
+ }
- //iAbsencePeriod2
- num = GetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, 0, FALSE);
- switch (SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_GETCURSEL, 0, 0)) {
- case 1: options.iAbsencePeriod2 = 7 * num; break;
- case 2: options.iAbsencePeriod2 = 30 * num; break;
- case 3: options.iAbsencePeriod2 = 365 * num; break;
- default: options.iAbsencePeriod2 = num; break;
- }
+ //iAbsencePeriod2
+ num = GetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, 0, FALSE);
+ switch (SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD2, CB_GETCURSEL, 0, 0)) {
+ case 1: options.iAbsencePeriod2 = 7 * num; break;
+ case 2: options.iAbsencePeriod2 = 30 * num; break;
+ case 3: options.iAbsencePeriod2 = 365 * num; break;
+ default: options.iAbsencePeriod2 = num; break;
+ }
- //iSilencePeriod
- num = GetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, 0, FALSE);
- switch (SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_GETCURSEL, 0, 0)) {
- case 1: options.iSilencePeriod = 7 * num; break;
- case 2: options.iSilencePeriod = 30 * num; break;
- case 3: options.iSilencePeriod = 365 * num; break;
- default: options.iSilencePeriod = num; break;
- }
+ //iSilencePeriod
+ num = GetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, 0, FALSE);
+ switch (SendDlgItemMessage(hwndDlg, IDC_COMBO_PERIOD3, CB_GETCURSEL, 0, 0)) {
+ case 1: options.iSilencePeriod = 7 * num; break;
+ case 2: options.iSilencePeriod = 30 * num; break;
+ case 3: options.iSilencePeriod = 365 * num; break;
+ default: options.iSilencePeriod = num; break;
+ }
- options.iShowPopup = IsDlgButtonChecked(hwndDlg, IDC_CHECK_POPUP) == BST_CHECKED ? 1:0;
- options.iShowEvent = IsDlgButtonChecked(hwndDlg, IDC_CHECK_FLASHICON) == BST_CHECKED ? 1:0;
- options.iShowUDetails = IsDlgButtonChecked(hwndDlg, IDC_CHECK_UDETAILS) == BST_CHECKED ? 1:0;
- options.iShowMessageWindow = IsDlgButtonChecked(hwndDlg, IDC_CHECK_MSGWINDOW) == BST_CHECKED ? 1:0;
- options.notifyFirstOnline = IsDlgButtonChecked(hwndDlg, IDC_CHECK_FIRSTSIGHT) == BST_CHECKED ? true : false;
- options.hideInactive = IsDlgButtonChecked(hwndDlg, IDC_CHECK_NOMSGS) == BST_CHECKED ? true : false;
- options.enableMissYou = IsDlgButtonChecked(hwndDlg, IDC_CHECK_MISSYOU) == BST_CHECKED ? true : false;
+ options.iShowPopup = IsDlgButtonChecked(hwndDlg, IDC_CHECK_POPUP) == BST_CHECKED ? 1 : 0;
+ options.iShowEvent = IsDlgButtonChecked(hwndDlg, IDC_CHECK_FLASHICON) == BST_CHECKED ? 1 : 0;
+ options.iShowUDetails = IsDlgButtonChecked(hwndDlg, IDC_CHECK_UDETAILS) == BST_CHECKED ? 1 : 0;
+ options.iShowMessageWindow = IsDlgButtonChecked(hwndDlg, IDC_CHECK_MSGWINDOW) == BST_CHECKED ? 1 : 0;
+ options.notifyFirstOnline = IsDlgButtonChecked(hwndDlg, IDC_CHECK_FIRSTSIGHT) == BST_CHECKED ? true : false;
+ options.hideInactive = IsDlgButtonChecked(hwndDlg, IDC_CHECK_NOMSGS) == BST_CHECKED ? true : false;
+ options.enableMissYou = IsDlgButtonChecked(hwndDlg, IDC_CHECK_MISSYOU) == BST_CHECKED ? true : false;
- options.iShowPopup2 = IsDlgButtonChecked(hwndDlg, IDC_CHECK_POPUP2) == BST_CHECKED ? 1:0;
- options.iShowEvent2 = IsDlgButtonChecked(hwndDlg, IDC_CHECK_FLASHICON2) == BST_CHECKED ? 1:0;
+ options.iShowPopup2 = IsDlgButtonChecked(hwndDlg, IDC_CHECK_POPUP2) == BST_CHECKED ? 1 : 0;
+ options.iShowEvent2 = IsDlgButtonChecked(hwndDlg, IDC_CHECK_FLASHICON2) == BST_CHECKED ? 1 : 0;
- options.action2 = (GoneContactAction)SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_GETCURSEL, 0, 0);
+ options.action2 = (GoneContactAction)SendDlgItemMessage(hwndDlg, IDC_COMBO_ACTIONS, CB_GETCURSEL, 0, 0);
- // save values to the DB
- SaveOptions();
+ // save values to the DB
+ SaveOptions();
- // clear all notified settings
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
- if(db_get_b(hContact, MODULE_NAME, "StillAbsentNotified", 0))
- db_set_b(hContact, MODULE_NAME, "StillAbsentNotified", 0);
+ // clear all notified settings
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ if (db_get_b(hContact, MODULE_NAME, "StillAbsentNotified", 0))
+ db_set_b(hContact, MODULE_NAME, "StillAbsentNotified", 0);
- // restart timer & run check
- KillTimer(0, timer_id);
- timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours
- TimerProc(0, 0, 0, 0);
- return TRUE;
- }
- break;
+ // restart timer & run check
+ KillTimer(0, timer_id);
+ timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours
+ TimerProc(0, 0, 0, 0);
+ return TRUE;
}
+ break;
+ }
}
return 0;
}
@@ -299,7 +299,7 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP CheckDlgButton(hwndDlg, IDC_DELAY_PERM, BST_CHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false);
}
- else if(options.iPopupDelay == 0) {
+ else if (options.iPopupDelay == 0) {
CheckDlgButton(hwndDlg, IDC_DELAY_DEF, BST_CHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false);
}
@@ -344,16 +344,16 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP ppd.PluginData = NULL;
ppd.iSeconds = options.iPopupDelay;
- CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NO_HISTORY);
+ CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NO_HISTORY);
_tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
ppd.lchIcon = Skin_GetIcon("enabled_icon");
- CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NO_HISTORY);
+ CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, APF_NO_HISTORY);
}
else {
if ((HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == CBN_SELCHANGE) || ((HIWORD(wParam) == EN_CHANGE) && !ChangeLock))
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
if (LOWORD(wParam) == IDC_COLORS_POPUP) {
if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP)) {
@@ -388,40 +388,40 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP break;
case WM_NOTIFY:
- {
- NMHDR* nmhdr = (NMHDR*)lParam;
- switch (nmhdr->code) {
- case PSN_APPLY:
- if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP)) {
- options.iUsePopupColors = 1;
- options.iUseWinColors = 0;
- }
- else if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_WIN)) {
- options.iUseWinColors = 1;
- options.iUsePopupColors = 0;
- options.iPopupColorBack = GetSysColor(COLOR_BTNFACE);
- options.iPopupColorFore = GetSysColor(COLOR_WINDOWTEXT);
- }
- else {
- options.iUseWinColors = options.iUsePopupColors = 0;
- options.iPopupColorBack = SendDlgItemMessage(hwndDlg, IDC_COLOR_BGR, CPM_GETCOLOUR, 0, 0);
- options.iPopupColorFore = SendDlgItemMessage(hwndDlg, IDC_COLOR_FRG, CPM_GETCOLOUR, 0, 0);
- }
+ {
+ NMHDR* nmhdr = (NMHDR*)lParam;
+ switch (nmhdr->code) {
+ case PSN_APPLY:
+ if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP)) {
+ options.iUsePopupColors = 1;
+ options.iUseWinColors = 0;
+ }
+ else if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_WIN)) {
+ options.iUseWinColors = 1;
+ options.iUsePopupColors = 0;
+ options.iPopupColorBack = GetSysColor(COLOR_BTNFACE);
+ options.iPopupColorFore = GetSysColor(COLOR_WINDOWTEXT);
+ }
+ else {
+ options.iUseWinColors = options.iUsePopupColors = 0;
+ options.iPopupColorBack = SendDlgItemMessage(hwndDlg, IDC_COLOR_BGR, CPM_GETCOLOUR, 0, 0);
+ options.iPopupColorFore = SendDlgItemMessage(hwndDlg, IDC_COLOR_FRG, CPM_GETCOLOUR, 0, 0);
+ }
- //iPopupDelay
- options.iPopupDelay = GetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 0, FALSE);
- if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_PERM) == BST_CHECKED)
- options.iPopupDelay = -1;
- else if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_DEF) == BST_CHECKED)
- options.iPopupDelay = 0;
+ //iPopupDelay
+ options.iPopupDelay = GetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 0, FALSE);
+ if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_PERM) == BST_CHECKED)
+ options.iPopupDelay = -1;
+ else if (IsDlgButtonChecked(hwndDlg, IDC_DELAY_DEF) == BST_CHECKED)
+ options.iPopupDelay = 0;
- // save value to the DB
- SavePopupOptions();
+ // save value to the DB
+ SavePopupOptions();
- return TRUE;
- }
- break;
+ return TRUE;
}
+ break;
+ }
}
return 0;
}
@@ -429,21 +429,21 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP /**
* Init options panel
*/
-static int OptionsInit(WPARAM wParam, LPARAM lParam)
+static int OptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
- odp.hInstance = hInst;
- odp.ptszGroup = LPGENT("Contacts");
+ odp.hInstance = hInst;
+ odp.ptszGroup = LPGENT("Contacts");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPANEL);
- odp.ptszTitle = LPGENT("Buddy Expectator");
- odp.pfnDlgProc = OptionsFrameProc;
- odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
+ odp.ptszTitle = LPGENT("Buddy Expectator");
+ odp.pfnDlgProc = OptionsFrameProc;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &odp);
- if ( ServiceExists(MS_POPUP_ADDPOPUPT)) {
- odp.ptszGroup = LPGENT("Popups");
+ if (ServiceExists(MS_POPUP_ADDPOPUPT)) {
+ odp.ptszGroup = LPGENT("Popups");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPPANEL);
- odp.pfnDlgProc = PopupOptionsFrameProc;
+ odp.pfnDlgProc = PopupOptionsFrameProc;
Options_AddPage(wParam, &odp);
}
@@ -454,42 +454,42 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar {
switch (msg) {
case WM_INITDIALOG:
- {
- time_t tmpTime;
- TCHAR tmpBuf[51] = {0};
- tmpTime = getLastSeen((MCONTACT)lparam);
- if (tmpTime == -1)
- SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, TranslateT("not detected"));
- else {
- _tcsftime(tmpBuf, 50, _T("%#x"), gmtime(&tmpTime));
- SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, tmpBuf);
- }
+ {
+ time_t tmpTime;
+ TCHAR tmpBuf[51] = { 0 };
+ tmpTime = getLastSeen((MCONTACT)lparam);
+ if (tmpTime == -1)
+ SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, TranslateT("not detected"));
+ else {
+ _tcsftime(tmpBuf, 50, _T("%#x"), gmtime(&tmpTime));
+ SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, tmpBuf);
+ }
- tmpTime = getLastInputMsg((MCONTACT)lparam);
- if (tmpTime == -1)
- SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, TranslateT("not found"));
- else {
- _tcsftime(tmpBuf, 50, _T("%#x"), gmtime(&tmpTime));
- SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, tmpBuf);
- }
+ tmpTime = getLastInputMsg((MCONTACT)lparam);
+ if (tmpTime == -1)
+ SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, TranslateT("not found"));
+ else {
+ _tcsftime(tmpBuf, 50, _T("%#x"), gmtime(&tmpTime));
+ SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, tmpBuf);
+ }
- unsigned int AbsencePeriod = db_get_dw((MCONTACT)lparam, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
+ unsigned int AbsencePeriod = db_get_dw((MCONTACT)lparam, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
- SendDlgItemMessage(hdlg, IDC_SPINABSENCE, UDM_SETRANGE, 0, MAKELONG(999, 1));
- SetDlgItemInt(hdlg, IDC_EDITABSENCE, AbsencePeriod, FALSE);
+ SendDlgItemMessage(hdlg, IDC_SPINABSENCE, UDM_SETRANGE, 0, MAKELONG(999, 1));
+ SetDlgItemInt(hdlg, IDC_EDITABSENCE, AbsencePeriod, FALSE);
- if (isContactGoneFor((MCONTACT)lparam, options.iAbsencePeriod2))
- SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, TranslateT("This contact has been absent for an extended period of time."));
- else
- SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, _T(""));
+ if (isContactGoneFor((MCONTACT)lparam, options.iAbsencePeriod2))
+ SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, TranslateT("This contact has been absent for an extended period of time."));
+ else
+ SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, _T(""));
- CheckDlgButton(hdlg, IDC_CHECK_MISSYOU, db_get_b((MCONTACT)lparam, MODULE_NAME, "MissYou", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hdlg, IDC_CHECK_NOTIFYALWAYS, db_get_b((MCONTACT)lparam, MODULE_NAME, "MissYouNotifyAlways", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hdlg, IDC_CHECK_NEVERHIDE, db_get_b((MCONTACT)lparam, MODULE_NAME, "NeverHide", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, IDC_CHECK_MISSYOU, db_get_b((MCONTACT)lparam, MODULE_NAME, "MissYou", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, IDC_CHECK_NOTIFYALWAYS, db_get_b((MCONTACT)lparam, MODULE_NAME, "MissYouNotifyAlways", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hdlg, IDC_CHECK_NEVERHIDE, db_get_b((MCONTACT)lparam, MODULE_NAME, "NeverHide", 0) ? BST_CHECKED : BST_UNCHECKED);
- TranslateDialogDefault(hdlg);
- return TRUE;
- }
+ TranslateDialogDefault(hdlg);
+ return TRUE;
+ }
case WM_NOTIFY:
switch (((LPNMHDR)lparam)->idFrom)
@@ -497,18 +497,18 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar case 0:
switch (((LPNMHDR)lparam)->code)
{
- case (PSN_APPLY):
+ case (PSN_APPLY) :
+ {
+ MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lparam)->lParam;
+ if (hContact)
{
- MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lparam)->lParam;
- if (hContact)
- {
- db_set_dw(hContact, MODULE_NAME, "iAbsencePeriod", GetDlgItemInt(hdlg, IDC_EDITABSENCE, 0, FALSE));
- db_set_b(hContact, MODULE_NAME, "MissYou", (IsDlgButtonChecked(hdlg, IDC_CHECK_MISSYOU) == BST_CHECKED) ? 1 : 0);
- db_set_b(hContact, MODULE_NAME, "MissYouNotifyAlways", (IsDlgButtonChecked(hdlg, IDC_CHECK_NOTIFYALWAYS) == BST_CHECKED) ? 1 : 0);
- db_set_b(hContact, MODULE_NAME, "NeverHide", (IsDlgButtonChecked(hdlg, IDC_CHECK_NEVERHIDE) == BST_CHECKED) ? 1 : 0);
- }
- break;
+ db_set_dw(hContact, MODULE_NAME, "iAbsencePeriod", GetDlgItemInt(hdlg, IDC_EDITABSENCE, 0, FALSE));
+ db_set_b(hContact, MODULE_NAME, "MissYou", (IsDlgButtonChecked(hdlg, IDC_CHECK_MISSYOU) == BST_CHECKED) ? 1 : 0);
+ db_set_b(hContact, MODULE_NAME, "MissYouNotifyAlways", (IsDlgButtonChecked(hdlg, IDC_CHECK_NOTIFYALWAYS) == BST_CHECKED) ? 1 : 0);
+ db_set_b(hContact, MODULE_NAME, "NeverHide", (IsDlgButtonChecked(hdlg, IDC_CHECK_NEVERHIDE) == BST_CHECKED) ? 1 : 0);
}
+ break;
+ }
}
break;
}
diff --git a/plugins/BuddyExpectator/src/options.h b/plugins/BuddyExpectator/src/options.h index dfc6a62e35..3b6f0a9c32 100644 --- a/plugins/BuddyExpectator/src/options.h +++ b/plugins/BuddyExpectator/src/options.h @@ -17,12 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- File name : $URL: http://svn.miranda.im/mainrepo/buddyexpectator/trunk/options.h $
- Revision : $Rev: 1003 $
- Last change on : $Date: 2008-01-12 17:15:47 +0200 (Сб, 12 янв 2008) $
- Last change by : $Author: Thief $
-*/
+ */
#ifndef _OPTIONS_INC
#define _OPTIONS_INC
|