diff options
author | George Hazan <george.hazan@gmail.com> | 2013-12-22 16:20:05 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-12-22 16:20:05 +0000 |
commit | f98e2216f98a31dbb0f77b97249aaaee75b345ed (patch) | |
tree | fa1033da7ca1b02a5238c958cfa6fb5da22ef2c4 /plugins/UserInfoEx | |
parent | 87cbc0b769f26286166201018c9e0e357c5caa66 (diff) |
massive garbage removal from extra icons module
git-svn-id: http://svn.miranda-ng.org/main/trunk@7340 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx')
-rw-r--r-- | plugins/UserInfoEx/UInfoEx_10.vcxproj | 7 | ||||
-rw-r--r-- | plugins/UserInfoEx/UInfoEx_10.vcxproj.filters | 15 | ||||
-rw-r--r-- | plugins/UserInfoEx/res/resource.rc | 30 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/Flags/svc_flags.cpp | 124 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/Flags/svc_flags.h | 1 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/init.cpp | 1 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/psp_options.cpp | 1258 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/resource.h | 1 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/svc_email.cpp | 24 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/svc_reminder.cpp | 6 |
10 files changed, 625 insertions, 842 deletions
diff --git a/plugins/UserInfoEx/UInfoEx_10.vcxproj b/plugins/UserInfoEx/UInfoEx_10.vcxproj index d790bb65e3..837deb8fda 100644 --- a/plugins/UserInfoEx/UInfoEx_10.vcxproj +++ b/plugins/UserInfoEx/UInfoEx_10.vcxproj @@ -279,6 +279,7 @@ <ClInclude Include="src\mir_menuitems.h" />
<ClInclude Include="src\mir_string.h" />
<ClInclude Include="src\psp_options.h" />
+ <ClInclude Include="src\resource.h" />
<ClInclude Include="src\svc_avatar.h" />
<ClInclude Include="src\svc_constants.h" />
<ClInclude Include="src\svc_contactinfo.h" />
@@ -320,6 +321,12 @@ <ResourceCompile Include="Res\resource.rc" />
<ResourceCompile Include="Res\version.rc" />
</ItemGroup>
+ <ItemGroup>
+ <None Include="Res\default.ico" />
+ <None Include="Res\dragcopy.cur" />
+ <None Include="Res\flags.png" />
+ <None Include="Res\main.ico" />
+ </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
diff --git a/plugins/UserInfoEx/UInfoEx_10.vcxproj.filters b/plugins/UserInfoEx/UInfoEx_10.vcxproj.filters index ab87a3a61d..a6a771e14b 100644 --- a/plugins/UserInfoEx/UInfoEx_10.vcxproj.filters +++ b/plugins/UserInfoEx/UInfoEx_10.vcxproj.filters @@ -358,6 +358,7 @@ <ClInclude Include="src\psp_options.h">
<Filter>Header Files\Dialogs\Details Pages</Filter>
</ClInclude>
+ <ClInclude Include="src\resource.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Res\resource.rc">
@@ -367,4 +368,18 @@ <Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
+ <ItemGroup>
+ <None Include="Res\main.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Res\default.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Res\dragcopy.cur">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Res\flags.png">
+ <Filter>Resource Files</Filter>
+ </None>
+ </ItemGroup>
</Project>
\ No newline at end of file diff --git a/plugins/UserInfoEx/res/resource.rc b/plugins/UserInfoEx/res/resource.rc index fa7f4d1b2d..37f55da632 100644 --- a/plugins/UserInfoEx/res/resource.rc +++ b/plugins/UserInfoEx/res/resource.rc @@ -7,8 +7,7 @@ //
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
-
+#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -444,14 +443,13 @@ BEGIN CONTROL "Off",RADIO_OPT_MI_ACCOUNT_NONE,"Button",BS_AUTORADIOBUTTON,161,84,31,10
CONTROL "Ex-/Import items",RADIO_OPT_MI_ACCOUNT_EXIMPORT,"Button",BS_AUTORADIOBUTTON,222,84,80,10
GROUPBOX "Extra Icons",GROUP_OPT_EXTRAICONS,6,105,144,117
- LTEXT "Gender:",TXT_OPT_GENDER,12,148,40,8
- LTEXT "Replace the following default icons:",TXT_OPT_DEFAULTICONS,12,180,132,8
- CONTROL "Homepage",CHECK_OPT_HOMEPAGEICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,192,68,10
- CONTROL "Phone",CHECK_OPT_PHONEICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,84,192,59,10
- CONTROL "E-Mail",CHECK_OPT_EMAILICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,204,68,10
- CONTROL "Gender",CHECK_OPT_GENDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,84,204,59,10
+ LTEXT "Replace the following default icons:",TXT_OPT_DEFAULTICONS,12,124,132,8
+ CONTROL "Homepage",CHECK_OPT_HOMEPAGEICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,140,130,10
+ CONTROL "Phone",CHECK_OPT_PHONEICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,157,130,10
+ CONTROL "E-Mail",CHECK_OPT_EMAILICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,174,130,10
+ CONTROL "Gender",CHECK_OPT_GENDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,191,130,10
GROUPBOX "Misc",GROUP_OPT_EXTRAICONS2,156,105,148,117
- CONTROL "Show 'Restart' menu item",CHECK_OPT_MI_RESTART,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,161,117,131,10
+ CONTROL "Show 'Restart' menu item",CHECK_OPT_MI_RESTART,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,161,117,132,10
CONTROL "Use Zodiac as default avatar",CHECK_OPT_ZODIACAVATAR,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,129,131,10
LTEXT "Country Flags",TXT_OPT_FLAGS,161,148,131,8
@@ -569,6 +567,10 @@ BEGIN VERTGUIDE, 144
VERTGUIDE, 290
END
+
+ IDD_OPT_COMMON, DIALOG
+ BEGIN
+ END
END
#endif // APSTUDIO_INVOKED
@@ -579,17 +581,17 @@ END // TEXTINCLUDE
//
-1 TEXTINCLUDE
+1 TEXTINCLUDE
BEGIN
"..\\src\\resource.h\0"
END
-3 TEXTINCLUDE
+3 TEXTINCLUDE
BEGIN
"\r\0"
END
-2 TEXTINCLUDE
+2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\0"
END
@@ -613,7 +615,7 @@ IDB_FLAGSPNG PNG "flags.png" //
// Generated from the TEXTINCLUDE 3 resource.
//
-
-
+
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index 7dc75e43a8..46907cc5ec 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -33,14 +33,10 @@ int nCountriesCount; struct CountryListEntry *countries;
static HANDLE hExtraIconSvc = INVALID_HANDLE_VALUE;
/* hook */
-static HANDLE hRebuildIconsHook = NULL;
static HANDLE hApplyIconHook = NULL;
static HANDLE hMsgWndEventHook = NULL;
-static HANDLE hIconsChangedHook = NULL;
static HANDLE hSettingChangedHook = NULL;
-static HANDLE hOptInitHook = NULL;
-
static int OnContactSettingChanged(WPARAM wParam,LPARAM lParam);
/***********************************************************************************************************
@@ -151,16 +147,16 @@ static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM lParam) char *pszProto = GetContactProto((HANDLE)wParam);
/* UserinfoEx */
if (countryNumber = db_get_w((HANDLE)wParam, USERINFO, SET_CONTACT_ORIGIN_COUNTRY, 0))
- return (INT_PTR)countryNumber;
- else if (countryNumber = db_get_w((HANDLE)wParam, USERINFO, SET_CONTACT_COUNTRY, 0))
- return (INT_PTR)countryNumber;
- else if (countryNumber = db_get_w((HANDLE)wParam, USERINFO, SET_CONTACT_COMPANY_COUNTRY, 0))
- return (INT_PTR)countryNumber;
+ return countryNumber;
+ if (countryNumber = db_get_w((HANDLE)wParam, USERINFO, SET_CONTACT_COUNTRY, 0))
+ return countryNumber;
+ if (countryNumber = db_get_w((HANDLE)wParam, USERINFO, SET_CONTACT_COMPANY_COUNTRY, 0))
+ return countryNumber;
/* fallback proto settings */
- else if (countryNumber = db_get_w((HANDLE)wParam, pszProto, "Country", 0))
- return (INT_PTR)countryNumber;
- else if (countryNumber = db_get_w((HANDLE)wParam, pszProto, "CompanyCountry", 0))
- return (INT_PTR)countryNumber;
+ if (countryNumber = db_get_w((HANDLE)wParam, pszProto, "Country", 0))
+ return countryNumber;
+ if (countryNumber = db_get_w((HANDLE)wParam, pszProto, "CompanyCountry", 0))
+ return countryNumber;
return (INT_PTR)0xFFFF;
}
@@ -172,67 +168,13 @@ static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM lParam) static void CALLBACK SetExtraImage(LPARAM lParam)
{
/* get contact's country */
- int countryNumber = ServiceDetectContactOriginCountry((WPARAM)lParam,0);
+ int countryNumber = ServiceDetectContactOriginCountry(lParam, 0);
ExtraIcon_SetIcon(hExtraIconSvc, (HANDLE)lParam, (countryNumber != 0xFFFF || gFlagsOpts.bUseUnknownFlag) ? LoadFlagHandle(countryNumber) : NULL);
}
-static void CALLBACK RemoveExtraImages(LPARAM lParam)
-{
- /* enum all contacts */
- for (HANDLE hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
- ExtraIcon_Clear(hExtraIconSvc, hContact);
-}
-
-// always call in context of main thread
-void EnsureExtraImages()
+static int OnCListApplyIcons(WPARAM wParam, LPARAM)
{
- for (HANDLE hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
- CallFunctionBuffered(SetExtraImage,(LPARAM)hContact,TRUE,EXTRAIMAGE_REFRESHDELAY);
-}
-
-static void CALLBACK UpdateExtraImages(LPARAM lParam) {
- if (!lParam)
- RemoveExtraImages(0);
- else
- EnsureExtraImages();
-}
-
-static int OnCListApplyIcons(WPARAM wParam,LPARAM lParam)
-{
- SetExtraImage((LPARAM)wParam); /* unbuffered */
- return 0;
-}
-
-//hookProc (ME_DB_CONTACT_SETTINGCHANGED) - workaround for missing event from ExtraIconSvc
-static int OnExtraIconSvcChanged(WPARAM wParam,LPARAM lParam)
-{
- DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
- if ((HANDLE)wParam != NULL)
- return 0;
-
- if (!lstrcmpA(dbcws->szModule, "ExtraIcons") && !lstrcmpA(dbcws->szSetting, "Slot_Flags")) {
- BOOL bEnable;
- switch (dbcws->value.type) {
- case DBVT_BYTE:
- bEnable = dbcws->value.bVal != (BYTE)-1;
- break;
- case DBVT_WORD:
- bEnable = dbcws->value.wVal != (WORD)-1;
- break;
- case DBVT_DWORD:
- bEnable = dbcws->value.dVal != (DWORD)-1;
- break;
- default:
- return 0;
- }
-
- if (bEnable && !hApplyIconHook)
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
- else if (!bEnable && hApplyIconHook)
- UnhookEvent(hApplyIconHook); hApplyIconHook = NULL;
-
- CallFunctionBuffered(UpdateExtraImages, (LPARAM)bEnable, FALSE, EXTRAIMAGE_REFRESHDELAY);
- }
+ SetExtraImage(wParam);
return 0;
}
@@ -254,8 +196,6 @@ void SvcFlagsEnableExtraIcons(BYTE bColumn, BYTE bUpdateDB) char szId[20];
mir_snprintf(szId, SIZEOF(szId), (langid == 0xFFFF) ? "%s_0x%X" : "%s_%i", "flags", langid); /* buffer safe */
hExtraIconSvc = ExtraIcon_Register("Flags", LPGEN("Flags (uinfoex)"), szId);
- if (hExtraIconSvc)
- HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnExtraIconSvcChanged);
}
// init hooks
@@ -363,7 +303,8 @@ static __inline int MessageAPI_AddIcon(const char* pszName, const char* szModul/ return res;
}
-void CALLBACK UpdateStatusIcons(LPARAM lParam) {
+void CALLBACK UpdateStatusIcons(LPARAM lParam)
+{
if (!lParam) {
/* enum all opened message windows */
for (int i = 0; i < gMsgWndList.getCount(); i++)
@@ -414,35 +355,21 @@ static int OnStatusIconsChanged(WPARAM wParam, LPARAM lParam) }
/***********************************************************************************************************
- * option page (not used yet)
+ * misc functions
***********************************************************************************************************/
-static INT_PTR CALLBACK ExtraImgOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- return FALSE;
-}
-//hookProc ME_OPT_INITIALISE
-static int ExtraImgOptInit(WPARAM wParam, LPARAM lParam)
+static int OnContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
- return 0;
-}
-
-/***********************************************************************************************************
- * misc functions
- ***********************************************************************************************************/
-//hookProc ME_DB_CONTACT_SETTINGCHANGED
-static int OnContactSettingChanged(WPARAM wParam, LPARAM lParam) {
if ((HANDLE)wParam == NULL) return 0;
DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
/* user details update */
- if (/*!lstrcmpA(dbcws->szSetting,"RealIP") || */
- !lstrcmpA(dbcws->szSetting, SET_CONTACT_COUNTRY) ||
+ if (!lstrcmpA(dbcws->szSetting, SET_CONTACT_COUNTRY) ||
!lstrcmpA(dbcws->szSetting, SET_CONTACT_ORIGIN_COUNTRY) ||
!lstrcmpA(dbcws->szSetting, SET_CONTACT_COMPANY_COUNTRY))
{
/* Extra Image */
- CallFunctionBuffered(SetExtraImage, (LPARAM)wParam, TRUE, EXTRAIMAGE_REFRESHDELAY);
+ CallFunctionBuffered(SetExtraImage, wParam, TRUE, EXTRAIMAGE_REFRESHDELAY);
/* Status Icon */
if (hMsgWndEventHook) {
int i = gMsgWndList.getIndex((MsgWndData*)&wParam);
@@ -455,7 +382,6 @@ static int OnContactSettingChanged(WPARAM wParam, LPARAM lParam) { return 0;
}
-
/***********************************************************************************************************
* module loading & unloading
***********************************************************************************************************/
@@ -473,15 +399,16 @@ void SvcFlagsLoadModule() if (CallService(MS_UTILS_GETCOUNTRYLIST, (WPARAM)&nCountriesCount, (LPARAM)&countries))
nCountriesCount = 0;
InitIcons(); /* load in iconlib */
+
//InitIpToCountry(); /* not implementet */
CreateServiceFunction(MS_FLAGS_DETECTCONTACTORIGINCOUNTRY, ServiceDetectContactOriginCountry);
+
//init settings
- gFlagsOpts.bShowExtraImgFlag = db_get_b(NULL, MODNAMEFLAGS, "ShowExtraImgFlag", SETTING_SHOWEXTRAIMGFLAG_DEFAULT);
gFlagsOpts.bUseUnknownFlag = db_get_b(NULL, MODNAMEFLAGS, "UseUnknownFlag", SETTING_USEUNKNOWNFLAG_DEFAULT);
+ gFlagsOpts.bShowExtraImgFlag = db_get_b(NULL, MODNAMEFLAGS, "ShowExtraImgFlag", SETTING_SHOWEXTRAIMGFLAG_DEFAULT);
gFlagsOpts.bShowStatusIconFlag = db_get_b(NULL, MODNAMEFLAGS, "ShowStatusIconFlag", SETTING_SHOWSTATUSICONFLAG_DEFAULT);
- hOptInitHook = HookEvent(ME_OPT_INITIALISE, ExtraImgOptInit);
- hIconsChangedHook = HookEvent(ME_SKIN2_ICONSCHANGED, OnStatusIconsChanged);
+ HookEvent(ME_SKIN2_ICONSCHANGED, OnStatusIconsChanged);
}
/**
@@ -510,9 +437,7 @@ void SvcFlagsUnloadModule() {
KillBufferedFunctions();
//Uninit ExtraImg
- UnhookEvent(hRebuildIconsHook);
UnhookEvent(hApplyIconHook);
- UnhookEvent(hIconsChangedHook);
//Uninit message winsow
UnhookEvent(hMsgWndEventHook);
for (int i = 0; i < gMsgWndList.getCount(); i++) {
@@ -522,11 +447,8 @@ void SvcFlagsUnloadModule() }
gMsgWndList.destroy();
gIListMW.destroy();
+
//Uninit misc
UnhookEvent(hSettingChangedHook);
- UnhookEvent(hOptInitHook);
UninitIcons();
-
- //UninitIpToCountry(); /* not implementet */
}
-
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.h b/plugins/UserInfoEx/src/Flags/svc_flags.h index 6d63f5146b..d8d7867125 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.h +++ b/plugins/UserInfoEx/src/Flags/svc_flags.h @@ -72,7 +72,6 @@ struct IconList typedef void (CALLBACK *BUFFEREDPROC)(LPARAM lParam);
void CallFunctionBuffered(BUFFEREDPROC pfnBuffProc, LPARAM lParam, BOOL fAccumulateSameParam, UINT uElapse);
-void EnsureExtraImages();
void SvcFlagsEnableExtraIcons(BYTE bEnable, BYTE bUpdateDB);
void CALLBACK UpdateStatusIcons(LPARAM lParam);
diff --git a/plugins/UserInfoEx/src/init.cpp b/plugins/UserInfoEx/src/init.cpp index 38cbd31b5a..dcbc3f6360 100644 --- a/plugins/UserInfoEx/src/init.cpp +++ b/plugins/UserInfoEx/src/init.cpp @@ -95,7 +95,6 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam) // build contact's menuitems
RebuildMenu();
HookEvent( ME_CLIST_PREBUILDSTATUSMENU, (MIRANDAHOOK)RebuildAccount);
-
return 0;
}
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index 2477eb66fc..77433e1779 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -29,7 +29,6 @@ static MenuOptionsList ctrl_Menu[]= {SET_MI_CONTACT, CHECK_OPT_MI_CONTACT, RADIO_OPT_MI_CONTACT_NONE, RADIO_OPT_MI_CONTACT_ALL, RADIO_OPT_MI_CONTACT_EXIMPORT},
{SET_MI_GROUP, CHECK_OPT_MI_GROUP, RADIO_OPT_MI_GROUP_NONE, RADIO_OPT_MI_GROUP_ALL, RADIO_OPT_MI_GROUP_EXIMPORT},
{SET_MI_SUBGROUP, CHECK_OPT_MI_SUBGROUP, RADIO_OPT_MI_SUBGROUP_NONE, RADIO_OPT_MI_SUBGROUP_ALL, RADIO_OPT_MI_SUBGROUP_EXIMPORT},
-// {SET_MI_STATUS, CHECK_OPT_MI_STATUS, RADIO_OPT_MI_STATUS_NONE, RADIO_OPT_MI_STATUS_ALL, RADIO_OPT_MI_STATUS_EXIMPORT},
{SET_MI_ACCOUNT, CHECK_OPT_MI_ACCOUNT, RADIO_OPT_MI_ACCOUNT_NONE, RADIO_OPT_MI_ACCOUNT_ALL, RADIO_OPT_MI_ACCOUNT_EXIMPORT},
};
@@ -293,173 +292,136 @@ static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam, {
static BYTE bInitialized = 0;
- switch (uMsg)
- {
- case WM_INITDIALOG:
- {
- //this controls depend on clist-typ
- //enable control if myGlobals.ExtraIconsServiceExist else disable
- const int idExtraIcons[] = {
- GROUP_OPT_EXTRAICONS,
- TXT_OPT_GENDER,
- TXT_OPT_DEFAULTICONS,
- CHECK_OPT_HOMEPAGEICON, CHECK_OPT_PHONEICON, CHECK_OPT_EMAILICON,
- CHECK_OPT_ZODIACAVATAR
- };
+ switch (uMsg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hDlg);
+ ShowWindow(GetDlgItem(hDlg, CHECK_OPT_ZODIACAVATAR), SW_HIDE);
+ SendNotify_InfoChanged(hDlg);
+ return TRUE;
- TranslateDialogDefault(hDlg);
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_INFOCHANGED:
+ bInitialized = 0;
+ {
+ // menu item settings
+ for (int i = 0; i < SIZEOF(ctrl_Menu); i++) {
+ int flag = db_get_b(NULL, MODNAME, ctrl_Menu[i].pszKey, 2);
+ // check button and enable / disable control
+ int idEnable[] = { ctrl_Menu[i].idCheckbox + 1, ctrl_Menu[i].idNONE, ctrl_Menu[i].idALL, ctrl_Menu[i].idEXIMPORT };
+ EnableControls(hDlg, idEnable, SIZEOF(idEnable), DBGetCheckBtn(hDlg, ctrl_Menu[i].idCheckbox, ctrl_Menu[i].pszKey, 0));
+ // set radio button state
+ int id = ctrl_Menu[i].idNONE; //default
+ if ((flag & 4) == 4) id = ctrl_Menu[i].idALL;
+ else if ((flag & 8) == 8) id = ctrl_Menu[i].idEXIMPORT;
+ CheckRadioButton(hDlg, ctrl_Menu[i].idNONE, ctrl_Menu[i].idEXIMPORT, id);
+ }
+ }
+ // extra icon settings
+ DBGetCheckBtn(hDlg, CHECK_OPT_GENDER, SET_CLIST_EXTRAICON_GENDER2, 0);
+ DBGetCheckBtn(hDlg, CHECK_OPT_HOMEPAGEICON, SET_CLIST_EXTRAICON_HOMEPAGE, DEFVAL_CLIST_EXTRAICON_HOMEPAGE);
+ DBGetCheckBtn(hDlg, CHECK_OPT_EMAILICON, SET_CLIST_EXTRAICON_EMAIL, DEFVAL_CLIST_EXTRAICON_EMAIL);
+ DBGetCheckBtn(hDlg, CHECK_OPT_PHONEICON, SET_CLIST_EXTRAICON_PHONE, DEFVAL_CLIST_EXTRAICON_PHONE);
+ CheckDlgButton(hDlg, CHECK_OPT_FLAGSUNKNOWN, gFlagsOpts.bUseUnknownFlag);
+ CheckDlgButton(hDlg, CHECK_OPT_FLAGSMSGSTATUS, gFlagsOpts.bShowStatusIconFlag);
+
+ // misc
+ DBGetCheckBtn(hDlg, CHECK_OPT_ZODIACAVATAR, SET_ZODIAC_AVATARS, FALSE);
+
+ bInitialized = 1;
+ break;
-#ifdef _DEBUG // new feature, not in release yet
- ShowWindow(GetDlgItem(hDlg, CHECK_OPT_ZODIACAVATAR),SW_SHOW);
-#else
- ShowWindow(GetDlgItem(hDlg, CHECK_OPT_ZODIACAVATAR),SW_HIDE);
-#endif
- SendNotify_InfoChanged(hDlg);
+ case PSN_APPLY:
+ // menu item settings
+ for (int i = 0; i < SIZEOF(ctrl_Menu); i++) {
+ int flag = IsDlgButtonChecked(hDlg, ctrl_Menu[i].idCheckbox);
+ flag |= IsDlgButtonChecked(hDlg, ctrl_Menu[i].idNONE) ? 2 : 0;
+ flag |= IsDlgButtonChecked(hDlg, ctrl_Menu[i].idALL) ? 4 : 0;
+ flag |= IsDlgButtonChecked(hDlg, ctrl_Menu[i].idEXIMPORT) ? 8 : 0;
+ db_set_b(NULL, MODNAME, ctrl_Menu[i].pszKey, (BYTE)flag);
}
- return TRUE;
- case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_INFOCHANGED:
- {
- bInitialized = 0;
-
- // menu item settings
- for (int i = 0; i < SIZEOF(ctrl_Menu); i++) {
- int flag = db_get_b(NULL, MODNAME, ctrl_Menu[i].pszKey, 2);
- // check button and enable / disable control
- int idEnable[] = { ctrl_Menu[i].idCheckbox + 1, ctrl_Menu[i].idNONE, ctrl_Menu[i].idALL, ctrl_Menu[i].idEXIMPORT };
- EnableControls(hDlg, idEnable, SIZEOF(idEnable), DBGetCheckBtn(hDlg, ctrl_Menu[i].idCheckbox, ctrl_Menu[i].pszKey,0));
- // set radio button state
- int id = ctrl_Menu[i].idNONE; //default
- if ((flag & 4) == 4) id = ctrl_Menu[i].idALL;
- else if ((flag & 8) == 8) id = ctrl_Menu[i].idEXIMPORT;
- CheckRadioButton(hDlg, ctrl_Menu[i].idNONE, ctrl_Menu[i].idEXIMPORT, id);
- }
-
- // extra icon settings
- DBGetCheckBtn(hDlg, CHECK_OPT_GENDER, SET_CLIST_EXTRAICON_GENDER2, 0);
- DBGetCheckBtn(hDlg, CHECK_OPT_HOMEPAGEICON, SET_CLIST_EXTRAICON_HOMEPAGE, DEFVAL_CLIST_EXTRAICON_HOMEPAGE);
- DBGetCheckBtn(hDlg, CHECK_OPT_EMAILICON, SET_CLIST_EXTRAICON_EMAIL, DEFVAL_CLIST_EXTRAICON_EMAIL);
- DBGetCheckBtn(hDlg, CHECK_OPT_PHONEICON, SET_CLIST_EXTRAICON_PHONE, DEFVAL_CLIST_EXTRAICON_PHONE);
- CheckDlgButton(hDlg, CHECK_OPT_FLAGSUNKNOWN, gFlagsOpts.bUseUnknownFlag);
- CheckDlgButton(hDlg, CHECK_OPT_FLAGSMSGSTATUS, gFlagsOpts.bShowStatusIconFlag);
-
- // misc
- DBGetCheckBtn(hDlg, CHECK_OPT_ZODIACAVATAR, SET_ZODIAC_AVATARS, FALSE);
-
- bInitialized = 1;
- }
- break;
+ RebuildMenu();
- case PSN_APPLY:
- // menu item settings
- {
- for (int i = 0; i < SIZEOF(ctrl_Menu); i++) {
- int flag = IsDlgButtonChecked(hDlg, ctrl_Menu[i].idCheckbox);
- flag |= IsDlgButtonChecked(hDlg, ctrl_Menu[i].idNONE)? 2:0;
- flag |= IsDlgButtonChecked(hDlg, ctrl_Menu[i].idALL)? 4:0;
- flag |= IsDlgButtonChecked(hDlg, ctrl_Menu[i].idEXIMPORT)? 8:0;
- db_set_b(NULL, MODNAME, ctrl_Menu[i].pszKey, (BYTE) flag);
- }
-
- RebuildMenu();
- }
+ // extra icon settings
+ BOOL FlagsClistChange = 0;
+ BOOL FlagsMsgWndChange = 0;
- // extra icon settings
- BOOL FlagsClistChange = 0;
- BOOL FlagsMsgWndChange = 0;
- {
- BYTE valNew;
- valNew = IsDlgButtonChecked(hDlg, CHECK_OPT_FLAGSUNKNOWN);
- if (gFlagsOpts.bUseUnknownFlag != valNew) {
- gFlagsOpts.bUseUnknownFlag = valNew;
- db_set_b(NULL, MODNAMEFLAGS, "UseUnknownFlag",valNew);
- FlagsClistChange++;
- FlagsMsgWndChange++;
- }
- valNew = IsDlgButtonChecked(hDlg, CHECK_OPT_FLAGSMSGSTATUS);
- if (gFlagsOpts.bShowStatusIconFlag != valNew) {
- gFlagsOpts.bShowStatusIconFlag = valNew;
- db_set_b(NULL, MODNAMEFLAGS, "ShowStatusIconFlag",valNew);
- FlagsMsgWndChange++;
- }
-
- SvcGenderEnableExtraIcons(IsDlgButtonChecked(hDlg, CHECK_OPT_GENDER)? 1:-1, TRUE);
-
- if (FlagsClistChange) EnsureExtraImages();
- if (FlagsMsgWndChange) UpdateStatusIcons(NULL);
-
- SvcHomepageEnableExtraIcons(IsDlgButtonChecked(hDlg, CHECK_OPT_HOMEPAGEICON), TRUE);
- SvcEMailEnableExtraIcons(IsDlgButtonChecked(hDlg, CHECK_OPT_EMAILICON), TRUE);
- SvcPhoneEnableExtraIcons(IsDlgButtonChecked(hDlg, CHECK_OPT_PHONEICON), TRUE);
+ BYTE valNew = IsDlgButtonChecked(hDlg, CHECK_OPT_FLAGSUNKNOWN);
+ if (gFlagsOpts.bUseUnknownFlag != valNew) {
+ gFlagsOpts.bUseUnknownFlag = valNew;
+ db_set_b(NULL, MODNAMEFLAGS, "UseUnknownFlag", valNew);
+ FlagsClistChange++;
+ FlagsMsgWndChange++;
+ }
+ valNew = IsDlgButtonChecked(hDlg, CHECK_OPT_FLAGSMSGSTATUS);
+ if (gFlagsOpts.bShowStatusIconFlag != valNew) {
+ gFlagsOpts.bShowStatusIconFlag = valNew;
+ db_set_b(NULL, MODNAMEFLAGS, "ShowStatusIconFlag", valNew);
+ FlagsMsgWndChange++;
+ }
- }
+ SvcGenderEnableExtraIcons(IsDlgButtonChecked(hDlg, CHECK_OPT_GENDER) ? 1 : -1, TRUE);
- // misc
- BYTE bEnabled = IsDlgButtonChecked(hDlg, CHECK_OPT_ZODIACAVATAR);
- db_set_b(NULL, MODNAME, SET_ZODIAC_AVATARS, bEnabled);
- NServices::NAvatar::Enable(bEnabled);
- }
- break;
+ if (FlagsClistChange) pcli->pfnSetAllExtraIcons(NULL);
+ if (FlagsMsgWndChange) UpdateStatusIcons(NULL);
+
+ SvcHomepageEnableExtraIcons(IsDlgButtonChecked(hDlg, CHECK_OPT_HOMEPAGEICON), TRUE);
+ SvcEMailEnableExtraIcons(IsDlgButtonChecked(hDlg, CHECK_OPT_EMAILICON), TRUE);
+ SvcPhoneEnableExtraIcons(IsDlgButtonChecked(hDlg, CHECK_OPT_PHONEICON), TRUE);
+
+ // misc
+ BYTE bEnabled = IsDlgButtonChecked(hDlg, CHECK_OPT_ZODIACAVATAR);
+ db_set_b(NULL, MODNAME, SET_ZODIAC_AVATARS, bEnabled);
+ NServices::NAvatar::Enable(bEnabled);
+ }
+ break;
- case WM_COMMAND:
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case CHECK_OPT_MI_MAIN:
+ case CHECK_OPT_MI_CONTACT:
+ case CHECK_OPT_MI_GROUP:
+ case CHECK_OPT_MI_SUBGROUP:
+ case CHECK_OPT_MI_ACCOUNT:
{
- switch (LOWORD(wParam))
- {
- case CHECK_OPT_MI_MAIN:
- case CHECK_OPT_MI_CONTACT:
- case CHECK_OPT_MI_GROUP:
- case CHECK_OPT_MI_SUBGROUP:
-// case CHECK_OPT_MI_STATUS:
- case CHECK_OPT_MI_ACCOUNT:
- {
- for (int i = 0; i < SIZEOF(ctrl_Menu); i++) {
- if (ctrl_Menu[i].idCheckbox == LOWORD(wParam))
- {
- const int idMenuItems[] = { ctrl_Menu[i].idCheckbox + 1, ctrl_Menu[i].idNONE, ctrl_Menu[i].idALL, ctrl_Menu[i].idEXIMPORT };
- EnableControls(hDlg, idMenuItems, SIZEOF(idMenuItems),
- Button_GetCheck((HWND)lParam) && ServiceExists(MS_CLIST_REMOVEMAINMENUITEM));
- break;
- }
- }
- if (bInitialized) NotifyParentOfChange(hDlg);
- }
+ for (int i = 0; i < SIZEOF(ctrl_Menu); i++) {
+ if (ctrl_Menu[i].idCheckbox == LOWORD(wParam)) {
+ const int idMenuItems[] = { ctrl_Menu[i].idCheckbox + 1, ctrl_Menu[i].idNONE, ctrl_Menu[i].idALL, ctrl_Menu[i].idEXIMPORT };
+ EnableControls(hDlg, idMenuItems, SIZEOF(idMenuItems),
+ Button_GetCheck((HWND)lParam) && ServiceExists(MS_CLIST_REMOVEMAINMENUITEM));
break;
- case RADIO_OPT_MI_MAIN_ALL:
- case RADIO_OPT_MI_MAIN_NONE:
- case RADIO_OPT_MI_MAIN_EXIMPORT:
- case RADIO_OPT_MI_CONTACT_ALL:
- case RADIO_OPT_MI_CONTACT_NONE:
- case RADIO_OPT_MI_CONTACT_EXIMPORT:
- case RADIO_OPT_MI_GROUP_ALL:
- case RADIO_OPT_MI_GROUP_NONE:
- case RADIO_OPT_MI_GROUP_EXIMPORT:
- case RADIO_OPT_MI_SUBGROUP_ALL:
- case RADIO_OPT_MI_SUBGROUP_NONE:
- case RADIO_OPT_MI_SUBGROUP_EXIMPORT:
-// case RADIO_OPT_MI_STATUS_ALL:
-// case RADIO_OPT_MI_STATUS_NONE:
-// case RADIO_OPT_MI_STATUS_EXIMPORT:
- case RADIO_OPT_MI_ACCOUNT_ALL:
- case RADIO_OPT_MI_ACCOUNT_NONE:
- case RADIO_OPT_MI_ACCOUNT_EXIMPORT:
- case CHECK_OPT_HOMEPAGEICON:
- case CHECK_OPT_EMAILICON:
- case CHECK_OPT_PHONEICON:
- case CHECK_OPT_GENDER:
- case CHECK_OPT_FLAGSUNKNOWN:
- case CHECK_OPT_FLAGSMSGSTATUS:
- case CHECK_OPT_ZODIACAVATAR:
- {
- if (bInitialized)
- {
- NotifyParentOfChange(hDlg);
- }
- }
+ }
}
+ if (bInitialized)
+ NotifyParentOfChange(hDlg);
}
+ break;
+ case RADIO_OPT_MI_MAIN_ALL:
+ case RADIO_OPT_MI_MAIN_NONE:
+ case RADIO_OPT_MI_MAIN_EXIMPORT:
+ case RADIO_OPT_MI_CONTACT_ALL:
+ case RADIO_OPT_MI_CONTACT_NONE:
+ case RADIO_OPT_MI_CONTACT_EXIMPORT:
+ case RADIO_OPT_MI_GROUP_ALL:
+ case RADIO_OPT_MI_GROUP_NONE:
+ case RADIO_OPT_MI_GROUP_EXIMPORT:
+ case RADIO_OPT_MI_SUBGROUP_ALL:
+ case RADIO_OPT_MI_SUBGROUP_NONE:
+ case RADIO_OPT_MI_SUBGROUP_EXIMPORT:
+ case RADIO_OPT_MI_ACCOUNT_ALL:
+ case RADIO_OPT_MI_ACCOUNT_NONE:
+ case RADIO_OPT_MI_ACCOUNT_EXIMPORT:
+ case CHECK_OPT_HOMEPAGEICON:
+ case CHECK_OPT_EMAILICON:
+ case CHECK_OPT_PHONEICON:
+ case CHECK_OPT_GENDER:
+ case CHECK_OPT_FLAGSUNKNOWN:
+ case CHECK_OPT_FLAGSMSGSTATUS:
+ case CHECK_OPT_ZODIACAVATAR:
+ if (bInitialized)
+ NotifyParentOfChange(hDlg);
+ }
}
return FALSE;
}
@@ -469,123 +431,103 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam static BYTE bInitialized = 0;
switch (uMsg) {
- case WM_INITDIALOG:
- {
- TranslateDialogDefault(hDlg);
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hDlg);
+ EnableDlgItem(hDlg, CHECK_OPT_METASCAN, myGlobals.szMetaProto != NULL);
+ SendNotify_InfoChanged(hDlg);
+ return TRUE;
- EnableDlgItem(hDlg, CHECK_OPT_METASCAN, myGlobals.szMetaProto != NULL);
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_INFOCHANGED:
+ bInitialized = 0;
+
+ DBGetCheckBtn(hDlg, CHECK_OPT_ICOVERSION, SET_ICONS_CHECKFILEVERSION, TRUE);
+ DBGetCheckBtn(hDlg, CHECK_OPT_BUTTONICONS, SET_ICONS_BUTTONS, TRUE);
+ DBGetCheckBtn(hDlg, CHECK_OPT_METASCAN, SET_META_SCAN, TRUE);
+ DBGetCheckBtn(hDlg, CHECK_OPT_SREMAIL_ENABLED, SET_EXTENDED_EMAILSERVICE, TRUE);
+ if (tmi.getTimeZoneTime) {
+ CheckDlgButton(hDlg, CHECK_OPT_AUTOTIMEZONE, TRUE);
+ EnableWindow(GetDlgItem(hDlg, CHECK_OPT_AUTOTIMEZONE), FALSE);
+ }
+ else {
+ DBGetCheckBtn(hDlg, CHECK_OPT_AUTOTIMEZONE, SET_OPT_AUTOTIMEZONE, TRUE);
+ }
- SendNotify_InfoChanged(hDlg);
- } return TRUE;
+ bInitialized = 1;
+ break;
- case WM_NOTIFY:
- {
- switch (((LPNMHDR)lParam)->code) {
- case PSN_INFOCHANGED:
- {
- bInitialized = 0;
-
- DBGetCheckBtn(hDlg, CHECK_OPT_ICOVERSION, SET_ICONS_CHECKFILEVERSION, TRUE);
- DBGetCheckBtn(hDlg, CHECK_OPT_BUTTONICONS, SET_ICONS_BUTTONS, TRUE);
- DBGetCheckBtn(hDlg, CHECK_OPT_METASCAN, SET_META_SCAN, TRUE);
- DBGetCheckBtn(hDlg, CHECK_OPT_SREMAIL_ENABLED, SET_EXTENDED_EMAILSERVICE, TRUE);
- if (tmi.getTimeZoneTime) {
- CheckDlgButton(hDlg, CHECK_OPT_AUTOTIMEZONE, TRUE);
- EnableWindow(GetDlgItem(hDlg, CHECK_OPT_AUTOTIMEZONE), FALSE);
- }
- else {
- DBGetCheckBtn(hDlg, CHECK_OPT_AUTOTIMEZONE, SET_OPT_AUTOTIMEZONE, TRUE);
- }
-
- bInitialized = 1;
- } break;
-
- case PSN_APPLY:
- {
- DBWriteCheckBtn(hDlg, CHECK_OPT_ICOVERSION, SET_ICONS_CHECKFILEVERSION);
- DBWriteCheckBtn(hDlg, CHECK_OPT_BUTTONICONS, SET_ICONS_BUTTONS);
- DBWriteCheckBtn(hDlg, CHECK_OPT_METASCAN, SET_META_SCAN);
-
- DBWriteCheckBtn(hDlg, CHECK_OPT_SREMAIL_ENABLED, SET_EXTENDED_EMAILSERVICE);
- if (!tmi.getTimeZoneTime) {
- DBWriteCheckBtn(hDlg, CHECK_OPT_AUTOTIMEZONE, SET_OPT_AUTOTIMEZONE);
- if (IsDlgButtonChecked(hDlg, CHECK_OPT_AUTOTIMEZONE)) {
- SvcTimezoneSyncWithWindows();
- }
- }
- }
- }
- } break;
+ case PSN_APPLY:
+ DBWriteCheckBtn(hDlg, CHECK_OPT_ICOVERSION, SET_ICONS_CHECKFILEVERSION);
+ DBWriteCheckBtn(hDlg, CHECK_OPT_BUTTONICONS, SET_ICONS_BUTTONS);
+ DBWriteCheckBtn(hDlg, CHECK_OPT_METASCAN, SET_META_SCAN);
- case WM_COMMAND:
- {
- switch (LOWORD(wParam)) {
- case CHECK_OPT_ICOVERSION:
- case CHECK_OPT_BUTTONICONS:
- case CHECK_OPT_METASCAN:
- case CHECK_OPT_SREMAIL_ENABLED:
- case CHECK_OPT_AUTOTIMEZONE:
- {
- if (bInitialized) {
- NotifyParentOfChange(hDlg);
- }
- } break;
-
- case BTN_OPT_RESET:
- {
- BYTE WantReset;
-
- WantReset = MsgBox(hDlg,
- MB_ICON_WARNING|MB_YESNO,
- LPGENT("Question"),
- LPGENT("Reset factory defaults"),
- LPGENT("This will delete all settings, you've made!\nAll TreeView settings, window positions and any other settings!\n\nAre you sure to procceed?"));
-
- if (WantReset) {
- HANDLE hContact;
- DB::CEnumList Settings;
-
- // delete all skin icons
- if (!Settings.EnumSettings(NULL, "SkinIcons")) {
- int i;
- LPSTR s;
-
- for (i = 0; i < Settings.getCount(); i++) {
- s = Settings[i];
- if (!mir_strnicmp(s, "UserInfoEx", 10)) {
- db_unset(NULL, "SkinIcons", s);
- }
- }
- }
- // delete global settings
- DB::Module::Delete(NULL, USERINFO"Ex");
- DB::Module::Delete(NULL, USERINFO"ExW");
-
- // delete old contactsettings
- for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
- db_unset(hContact, USERINFO, "PListColWidth0");
- db_unset(hContact, USERINFO, "PListColWidth1");
- db_unset(hContact, USERINFO, "PListColWidth2");
- db_unset(hContact, USERINFO, "EMListColWidth0");
- db_unset(hContact, USERINFO, "EMListColWidth1");
- db_unset(hContact, USERINFO, "BirthRemind");
- db_unset(hContact, USERINFO, "RemindBirthday");
- db_unset(hContact, USERINFO, "RemindDaysErlier");
- db_unset(hContact, USERINFO, "vCardPath");
-
- DB::Module::Delete(hContact, USERINFO"Ex");
- DB::Module::Delete(hContact, USERINFO"ExW");
- }
-
- SendMessage(GetParent(hDlg), PSM_FORCECHANGED, NULL, NULL);
- MsgBox(hDlg, MB_ICON_INFO,
- LPGENT("Ready"),
- LPGENT("Everything is done!"),
- LPGENT("All settings are reset to default values now!"));
- }
- }
+ DBWriteCheckBtn(hDlg, CHECK_OPT_SREMAIL_ENABLED, SET_EXTENDED_EMAILSERVICE);
+ if (!tmi.getTimeZoneTime) {
+ DBWriteCheckBtn(hDlg, CHECK_OPT_AUTOTIMEZONE, SET_OPT_AUTOTIMEZONE);
+ if (IsDlgButtonChecked(hDlg, CHECK_OPT_AUTOTIMEZONE))
+ SvcTimezoneSyncWithWindows();
+ }
+ }
+ break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case CHECK_OPT_ICOVERSION:
+ case CHECK_OPT_BUTTONICONS:
+ case CHECK_OPT_METASCAN:
+ case CHECK_OPT_SREMAIL_ENABLED:
+ case CHECK_OPT_AUTOTIMEZONE:
+ if (bInitialized)
+ NotifyParentOfChange(hDlg);
+ break;
+
+ case BTN_OPT_RESET:
+ BYTE WantReset = MsgBox(hDlg,
+ MB_ICON_WARNING | MB_YESNO,
+ LPGENT("Question"),
+ LPGENT("Reset factory defaults"),
+ LPGENT("This will delete all settings, you've made!\nAll TreeView settings, window positions and any other settings!\n\nAre you sure to procceed?"));
+
+ if (WantReset) {
+ HANDLE hContact;
+ DB::CEnumList Settings;
+
+ // delete all skin icons
+ if (!Settings.EnumSettings(NULL, "SkinIcons"))
+ for (int i = 0; i < Settings.getCount(); i++) {
+ LPSTR s = Settings[i];
+ if (!mir_strnicmp(s, "UserInfoEx", 10))
+ db_unset(NULL, "SkinIcons", s);
+ }
+
+ // delete global settings
+ DB::Module::Delete(NULL, USERINFO"Ex");
+ DB::Module::Delete(NULL, USERINFO"ExW");
+
+ // delete old contactsettings
+ for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
+ db_unset(hContact, USERINFO, "PListColWidth0");
+ db_unset(hContact, USERINFO, "PListColWidth1");
+ db_unset(hContact, USERINFO, "PListColWidth2");
+ db_unset(hContact, USERINFO, "EMListColWidth0");
+ db_unset(hContact, USERINFO, "EMListColWidth1");
+ db_unset(hContact, USERINFO, "BirthRemind");
+ db_unset(hContact, USERINFO, "RemindBirthday");
+ db_unset(hContact, USERINFO, "RemindDaysErlier");
+ db_unset(hContact, USERINFO, "vCardPath");
+
+ DB::Module::Delete(hContact, USERINFO"Ex");
+ DB::Module::Delete(hContact, USERINFO"ExW");
}
+
+ SendMessage(GetParent(hDlg), PSM_FORCECHANGED, NULL, NULL);
+ MsgBox(hDlg, MB_ICON_INFO,
+ LPGENT("Ready"),
+ LPGENT("Everything is done!"),
+ LPGENT("All settings are reset to default values now!"));
}
+ }
}
return FALSE;
}
@@ -594,101 +536,80 @@ static INT_PTR CALLBACK DlgProc_DetailsDlgOpts(HWND hDlg, UINT uMsg, WPARAM wPar {
static BYTE bInitialized = 0;
- switch (uMsg)
- {
- case WM_INITDIALOG:
- {
- TranslateDialogDefault(hDlg);
- SendNotify_InfoChanged(hDlg);
- }
- return TRUE;
-
- case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_INFOCHANGED:
- {
- bInitialized = 0;
-
- // init colors
- DBGetCheckBtn(hDlg, CHECK_OPT_CLR, SET_PROPSHEET_SHOWCOLOURS, TRUE);
- SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_OPT_CLR, BN_CLICKED), (LPARAM)GetDlgItem(hDlg, CHECK_OPT_CLR));
- DBGetColor(hDlg, CLR_NORMAL, SET_PROPSHEET_CLRNORMAL, RGB(90, 90, 90));
- DBGetColor(hDlg, CLR_USER, SET_PROPSHEET_CLRCUSTOM, RGB(0, 10, 130));
- DBGetColor(hDlg, CLR_BOTH, SET_PROPSHEET_CLRBOTH, RGB(0, 160, 10));
- DBGetColor(hDlg, CLR_CHANGED, SET_PROPSHEET_CLRCHANGED, RGB(190, 0, 0));
- DBGetColor(hDlg, CLR_META, SET_PROPSHEET_CLRMETA, RGB(120, 40, 130));
-
- // treeview options
- DBGetCheckBtn(hDlg, CHECK_OPT_GROUPS, SET_PROPSHEET_GROUPS, TRUE);
- DBGetCheckBtn(hDlg, CHECK_OPT_SORTTREE, SET_PROPSHEET_SORTITEMS, FALSE);
- DBGetCheckBtn(hDlg, CHECK_OPT_AEROADAPTION, SET_PROPSHEET_AEROADAPTION, TRUE);
-
- // common options
- DBGetCheckBtn(hDlg, CHECK_OPT_READONLY, SET_PROPSHEET_PCBIREADONLY, FALSE);
- DBGetCheckBtn(hDlg, CHECK_OPT_CHANGEMYDETAILS, SET_PROPSHEET_CHANGEMYDETAILS, FALSE);
- Button_Enable(GetDlgItem(hDlg, CHECK_OPT_CHANGEMYDETAILS), myGlobals.CanChangeDetails);
-
- bInitialized = 1;
- break;
- }
+ switch (uMsg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hDlg);
+ SendNotify_InfoChanged(hDlg);
+ return TRUE;
- case PSN_APPLY:
- {
- DBWriteCheckBtn(hDlg, CHECK_OPT_CLR, SET_PROPSHEET_SHOWCOLOURS);
- DBWriteCheckBtn(hDlg, CHECK_OPT_GROUPS, SET_PROPSHEET_GROUPS);
- DBWriteCheckBtn(hDlg, CHECK_OPT_SORTTREE, SET_PROPSHEET_SORTITEMS);
- DBWriteCheckBtn(hDlg, CHECK_OPT_READONLY, SET_PROPSHEET_PCBIREADONLY);
- DBWriteCheckBtn(hDlg, CHECK_OPT_AEROADAPTION, SET_PROPSHEET_AEROADAPTION);
- DBWriteCheckBtn(hDlg, CHECK_OPT_CHANGEMYDETAILS, SET_PROPSHEET_CHANGEMYDETAILS);
-
- DBWriteColor(hDlg, CLR_NORMAL, SET_PROPSHEET_CLRNORMAL);
- DBWriteColor(hDlg, CLR_USER, SET_PROPSHEET_CLRCUSTOM);
- DBWriteColor(hDlg, CLR_BOTH, SET_PROPSHEET_CLRBOTH);
- DBWriteColor(hDlg, CLR_CHANGED, SET_PROPSHEET_CLRCHANGED);
- DBWriteColor(hDlg, CLR_META, SET_PROPSHEET_CLRMETA);
- }
- }
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_INFOCHANGED:
+ bInitialized = 0;
+
+ // init colors
+ DBGetCheckBtn(hDlg, CHECK_OPT_CLR, SET_PROPSHEET_SHOWCOLOURS, TRUE);
+ SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_OPT_CLR, BN_CLICKED), (LPARAM)GetDlgItem(hDlg, CHECK_OPT_CLR));
+ DBGetColor(hDlg, CLR_NORMAL, SET_PROPSHEET_CLRNORMAL, RGB(90, 90, 90));
+ DBGetColor(hDlg, CLR_USER, SET_PROPSHEET_CLRCUSTOM, RGB(0, 10, 130));
+ DBGetColor(hDlg, CLR_BOTH, SET_PROPSHEET_CLRBOTH, RGB(0, 160, 10));
+ DBGetColor(hDlg, CLR_CHANGED, SET_PROPSHEET_CLRCHANGED, RGB(190, 0, 0));
+ DBGetColor(hDlg, CLR_META, SET_PROPSHEET_CLRMETA, RGB(120, 40, 130));
+
+ // treeview options
+ DBGetCheckBtn(hDlg, CHECK_OPT_GROUPS, SET_PROPSHEET_GROUPS, TRUE);
+ DBGetCheckBtn(hDlg, CHECK_OPT_SORTTREE, SET_PROPSHEET_SORTITEMS, FALSE);
+ DBGetCheckBtn(hDlg, CHECK_OPT_AEROADAPTION, SET_PROPSHEET_AEROADAPTION, TRUE);
+
+ // common options
+ DBGetCheckBtn(hDlg, CHECK_OPT_READONLY, SET_PROPSHEET_PCBIREADONLY, FALSE);
+ DBGetCheckBtn(hDlg, CHECK_OPT_CHANGEMYDETAILS, SET_PROPSHEET_CHANGEMYDETAILS, FALSE);
+ Button_Enable(GetDlgItem(hDlg, CHECK_OPT_CHANGEMYDETAILS), myGlobals.CanChangeDetails);
+
+ bInitialized = 1;
break;
- case WM_COMMAND:
- {
- switch (LOWORD(wParam))
- {
- case CHECK_OPT_CLR:
- {
- if (HIWORD(wParam) == BN_CLICKED)
- {
- BOOL bChecked = SendMessage((HWND)lParam, BM_GETCHECK, NULL, NULL);
- const int idCtrl[] = { CLR_NORMAL, CLR_USER, CLR_BOTH, CLR_CHANGED, CLR_META, TXT_OPT_CLR_NORMAL,
- TXT_OPT_CLR_USER, TXT_OPT_CLR_BOTH, TXT_OPT_CLR_CHANGED, TXT_OPT_CLR_META };
-
- EnableControls(hDlg, idCtrl, SIZEOF(idCtrl), bChecked);
- }
- }
- case CHECK_OPT_GROUPS:
- case CHECK_OPT_SORTTREE:
- case CHECK_OPT_AEROADAPTION:
- case CHECK_OPT_READONLY:
- case CHECK_OPT_CHANGEMYDETAILS:
- case CHECK_OPT_MI_CONTACT:
- {
- if (bInitialized && HIWORD(wParam) == BN_CLICKED)
- {
- NotifyParentOfChange(hDlg);
- }
- }
- break;
+ case PSN_APPLY:
+ DBWriteCheckBtn(hDlg, CHECK_OPT_CLR, SET_PROPSHEET_SHOWCOLOURS);
+ DBWriteCheckBtn(hDlg, CHECK_OPT_GROUPS, SET_PROPSHEET_GROUPS);
+ DBWriteCheckBtn(hDlg, CHECK_OPT_SORTTREE, SET_PROPSHEET_SORTITEMS);
+ DBWriteCheckBtn(hDlg, CHECK_OPT_READONLY, SET_PROPSHEET_PCBIREADONLY);
+ DBWriteCheckBtn(hDlg, CHECK_OPT_AEROADAPTION, SET_PROPSHEET_AEROADAPTION);
+ DBWriteCheckBtn(hDlg, CHECK_OPT_CHANGEMYDETAILS, SET_PROPSHEET_CHANGEMYDETAILS);
+
+ DBWriteColor(hDlg, CLR_NORMAL, SET_PROPSHEET_CLRNORMAL);
+ DBWriteColor(hDlg, CLR_USER, SET_PROPSHEET_CLRCUSTOM);
+ DBWriteColor(hDlg, CLR_BOTH, SET_PROPSHEET_CLRBOTH);
+ DBWriteColor(hDlg, CLR_CHANGED, SET_PROPSHEET_CLRCHANGED);
+ DBWriteColor(hDlg, CLR_META, SET_PROPSHEET_CLRMETA);
+ }
+ break;
- default:
- {
- if (bInitialized && HIWORD(wParam) == CPN_COLOURCHANGED)
- {
- NotifyParentOfChange(hDlg);
- }
- }
- }
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case CHECK_OPT_CLR:
+ if (HIWORD(wParam) == BN_CLICKED) {
+ BOOL bChecked = SendMessage((HWND)lParam, BM_GETCHECK, NULL, NULL);
+ const int idCtrl[] = { CLR_NORMAL, CLR_USER, CLR_BOTH, CLR_CHANGED, CLR_META, TXT_OPT_CLR_NORMAL,
+ TXT_OPT_CLR_USER, TXT_OPT_CLR_BOTH, TXT_OPT_CLR_CHANGED, TXT_OPT_CLR_META };
+
+ EnableControls(hDlg, idCtrl, SIZEOF(idCtrl), bChecked);
}
+
+ case CHECK_OPT_GROUPS:
+ case CHECK_OPT_SORTTREE:
+ case CHECK_OPT_AEROADAPTION:
+ case CHECK_OPT_READONLY:
+ case CHECK_OPT_CHANGEMYDETAILS:
+ case CHECK_OPT_MI_CONTACT:
+ if (bInitialized && HIWORD(wParam) == BN_CLICKED)
+ NotifyParentOfChange(hDlg);
+ break;
+
+ default:
+ if (bInitialized && HIWORD(wParam) == CPN_COLOURCHANGED)
+ NotifyParentOfChange(hDlg);
+ }
}
return FALSE;
}
@@ -699,222 +620,186 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam static BYTE bInitialized = 0;
switch (uMsg) {
-
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hDlg);
+ {
+ ShowWindow(GetDlgItem(hDlg, CHECK_REMIND_SECURED), myGlobals.UseDbxTree ? SW_HIDE : SW_SHOW);
+
+ SendDlgItemMessage(hDlg, ICO_BIRTHDAY, STM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_DLG_ANNIVERSARY));
+
+ // set colours
+ SendDlgItemMessage(hDlg, EDIT_REMIND, EM_LIMITTEXT, 2, 0);
+ SendDlgItemMessage(hDlg, SPIN_REMIND, UDM_SETRANGE32, 0, 50);
+ SendDlgItemMessage(hDlg, EDIT_REMIND2, EM_LIMITTEXT, 4, 0);
+ SendDlgItemMessage(hDlg, SPIN_REMIND2, UDM_SETRANGE32, 1, 8760);
+ SendDlgItemMessage(hDlg, EDIT_REMIND_SOUNDOFFSET, EM_LIMITTEXT, 2, 0);
+ SendDlgItemMessage(hDlg, SPIN_REMIND_SOUNDOFFSET, UDM_SETRANGE32, 0, 50);
+
+ HWND hCtrl;
+ if (hCtrl = GetDlgItem(hDlg, EDIT_REMIND_ENABLED)) {
+ ComboBox_AddString(hCtrl, TranslateT("Reminder disabled"));
+ ComboBox_AddString(hCtrl, TranslateT("Anniversaries only"));
+ ComboBox_AddString(hCtrl, TranslateT("Bithdays only"));
+ ComboBox_AddString(hCtrl, TranslateT("everything"));
+ }
+ if (hCtrl = GetDlgItem(hDlg, EDIT_BIRTHMODULE)) {
+ ComboBox_AddString(hCtrl, TranslateT("mBirthday"));
+ ComboBox_AddString(hCtrl, TranslateT("UserInfo (default)"));
+ }
+ SendNotify_InfoChanged(hDlg);
+ }
+ return TRUE;
+
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_INFOCHANGED:
{
- HWND hCtrl;
+ bInitialized = 0;
- TranslateDialogDefault(hDlg);
+ // set reminder options
+ BYTE bEnabled = db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED);
+ SendDlgItemMessage(hDlg, EDIT_REMIND_ENABLED, CB_SETCURSEL, bEnabled, NULL);
+ DlgProc_ReminderOpts(hDlg, WM_COMMAND, MAKEWPARAM(EDIT_REMIND_ENABLED, CBN_SELCHANGE),
+ (LPARAM)GetDlgItem(hDlg, EDIT_REMIND_ENABLED));
- ShowWindow(GetDlgItem(hDlg, CHECK_REMIND_SECURED), myGlobals.UseDbxTree?SW_HIDE:SW_SHOW);
+ DBGetCheckBtn(hDlg, CHECK_REMIND_MI, SET_REMIND_MENUENABLED, DEFVAL_REMIND_MENUENABLED);
+ DBGetCheckBtn(hDlg, CHECK_REMIND_FLASHICON, SET_REMIND_FLASHICON, FALSE);
+ DBGetCheckBtn(hDlg, CHECK_REMIND_VISIBLEONLY, SET_REMIND_CHECKVISIBLE, DEFVAL_REMIND_CHECKVISIBLE);
+ DBGetCheckBtn(hDlg, CHECK_REMIND_STARTUP, SET_REMIND_CHECKON_STARTUP, FALSE);
+ DBGetCheckBtn(hDlg, CHECK_REMIND_SECURED, SET_REMIND_SECUREBIRTHDAY, FALSE);
- SendDlgItemMessage(hDlg, ICO_BIRTHDAY, STM_SETIMAGE, IMAGE_ICON, (LPARAM)IcoLib_GetIcon(ICO_DLG_ANNIVERSARY));
+ SetDlgItemInt(hDlg, EDIT_REMIND, db_get_w(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), FALSE);
+ SetDlgItemInt(hDlg, EDIT_REMIND_SOUNDOFFSET, db_get_b(NULL, MODNAME, SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET), FALSE);
+ SetDlgItemInt(hDlg, EDIT_REMIND2, db_get_w(NULL, MODNAME, SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL), FALSE);
- // set colours
- SendDlgItemMessage(hDlg, EDIT_REMIND, EM_LIMITTEXT, 2, 0);
- SendDlgItemMessage(hDlg, SPIN_REMIND, UDM_SETRANGE32, 0, 50);
- SendDlgItemMessage(hDlg, EDIT_REMIND2, EM_LIMITTEXT, 4, 0);
- SendDlgItemMessage(hDlg, SPIN_REMIND2, UDM_SETRANGE32, 1, 8760);
- SendDlgItemMessage(hDlg, EDIT_REMIND_SOUNDOFFSET, EM_LIMITTEXT, 2, 0);
- SendDlgItemMessage(hDlg, SPIN_REMIND_SOUNDOFFSET, UDM_SETRANGE32, 0, 50);
+ SendDlgItemMessage(hDlg, EDIT_BIRTHMODULE, CB_SETCURSEL, db_get_b(NULL, MODNAME, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE), NULL);
- if (hCtrl = GetDlgItem(hDlg, EDIT_REMIND_ENABLED))
- {
- ComboBox_AddString(hCtrl, TranslateT("Reminder disabled"));
- ComboBox_AddString(hCtrl, TranslateT("Anniversaries only"));
- ComboBox_AddString(hCtrl, TranslateT("Bithdays only"));
- ComboBox_AddString(hCtrl, TranslateT("everything"));
- }
- if (hCtrl = GetDlgItem(hDlg, EDIT_BIRTHMODULE))
- {
- ComboBox_AddString(hCtrl, TranslateT("mBirthday"));
- ComboBox_AddString(hCtrl, TranslateT("UserInfo (default)"));
- }
- SendNotify_InfoChanged(hDlg);
+ MTime mtLast;
+ TCHAR szTime[MAX_PATH];
+
+ mtLast.DBGetStamp(NULL, MODNAME, SET_REMIND_LASTCHECK);
+ mtLast.UTCToLocal();
+ mtLast.TimeFormat(szTime, SIZEOF(szTime));
+
+ SetDlgItemText(hDlg, TXT_REMIND_LASTCHECK, szTime);
+
+ bInitialized = 1;
}
- return TRUE;
+ break;
- case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->code)
+ case PSN_APPLY:
{
- case PSN_INFOCHANGED:
- {
- bInitialized = 0;
- BYTE bEnabled;
-
- // set reminder options
- bEnabled = db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED);
- SendDlgItemMessage(hDlg, EDIT_REMIND_ENABLED, CB_SETCURSEL, bEnabled, NULL);
- DlgProc_ReminderOpts(hDlg, WM_COMMAND, MAKEWPARAM(EDIT_REMIND_ENABLED, CBN_SELCHANGE),
- (LPARAM)GetDlgItem(hDlg, EDIT_REMIND_ENABLED));
-
- DBGetCheckBtn(hDlg, CHECK_REMIND_MI, SET_REMIND_MENUENABLED, DEFVAL_REMIND_MENUENABLED);
- DBGetCheckBtn(hDlg, CHECK_REMIND_FLASHICON, SET_REMIND_FLASHICON, FALSE);
- DBGetCheckBtn(hDlg, CHECK_REMIND_VISIBLEONLY, SET_REMIND_CHECKVISIBLE, DEFVAL_REMIND_CHECKVISIBLE);
- DBGetCheckBtn(hDlg, CHECK_REMIND_STARTUP, SET_REMIND_CHECKON_STARTUP, FALSE);
- DBGetCheckBtn(hDlg, CHECK_REMIND_SECURED, SET_REMIND_SECUREBIRTHDAY, FALSE);
-
- SetDlgItemInt(hDlg, EDIT_REMIND, db_get_w(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET), FALSE);
- SetDlgItemInt(hDlg, EDIT_REMIND_SOUNDOFFSET, db_get_b(NULL, MODNAME, SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET), FALSE);
- SetDlgItemInt(hDlg, EDIT_REMIND2, db_get_w(NULL, MODNAME, SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL), FALSE);
-
- SendDlgItemMessage(hDlg, EDIT_BIRTHMODULE, CB_SETCURSEL, db_get_b(NULL, MODNAME, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE), NULL);
- {
- MTime mtLast;
- TCHAR szTime[MAX_PATH];
-
- mtLast.DBGetStamp(NULL, MODNAME, SET_REMIND_LASTCHECK);
- mtLast.UTCToLocal();
- mtLast.TimeFormat(szTime, SIZEOF(szTime));
-
- SetDlgItemText(hDlg, TXT_REMIND_LASTCHECK, szTime);
- }
-
- bInitialized = 1;
- }
- break;
+ BYTE bReminderCheck = FALSE;
+
+ // save checkbox options
+ DBWriteCheckBtn(hDlg, CHECK_REMIND_MI, SET_REMIND_MENUENABLED);
+ DBWriteCheckBtn(hDlg, CHECK_REMIND_FLASHICON, SET_REMIND_FLASHICON);
+ DBWriteCheckBtn(hDlg, CHECK_REMIND_VISIBLEONLY, SET_REMIND_CHECKVISIBLE);
+ DBWriteCheckBtn(hDlg, CHECK_REMIND_STARTUP, SET_REMIND_CHECKON_STARTUP);
+ DBWriteCheckBtn(hDlg, CHECK_REMIND_SECURED, SET_REMIND_SECUREBIRTHDAY);
+
+ DBWriteEditByte(hDlg, EDIT_REMIND_SOUNDOFFSET, SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET);
+ DBWriteEditWord(hDlg, EDIT_REMIND2, SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL);
+ bReminderCheck = DBWriteEditWord(hDlg, EDIT_REMIND, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET);
+
+ // save primary birthday module
+ BYTE bOld = db_get_b(NULL, MODNAME, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE); // = 1
+ BYTE bNew = (BYTE)ComboBox_GetCurSel(GetDlgItem(hDlg, EDIT_BIRTHMODULE));
+ if (bOld != bNew) {
+ //keep the database clean
+ MAnnivDate mdb;
+ HANDLE hContact = NULL;
+ DBWriteComboByte(hDlg, EDIT_BIRTHMODULE, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE);
+ //walk through all the contacts stored in the DB
+ for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
+ mdb.DBMoveBirthDate(hContact, bOld, bNew);
+ }
- case PSN_APPLY:
- {
- BYTE bNewVal;
- BYTE bReminderCheck = FALSE;
-
- // save checkbox options
- DBWriteCheckBtn(hDlg, CHECK_REMIND_MI, SET_REMIND_MENUENABLED);
- DBWriteCheckBtn(hDlg, CHECK_REMIND_FLASHICON, SET_REMIND_FLASHICON);
- DBWriteCheckBtn(hDlg, CHECK_REMIND_VISIBLEONLY, SET_REMIND_CHECKVISIBLE);
- DBWriteCheckBtn(hDlg, CHECK_REMIND_STARTUP, SET_REMIND_CHECKON_STARTUP);
- DBWriteCheckBtn(hDlg, CHECK_REMIND_SECURED, SET_REMIND_SECUREBIRTHDAY);
-
- DBWriteEditByte(hDlg, EDIT_REMIND_SOUNDOFFSET, SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET);
- DBWriteEditWord(hDlg, EDIT_REMIND2, SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL);
- bReminderCheck = DBWriteEditWord(hDlg, EDIT_REMIND, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET);
-
- // save primary birthday module
- BYTE bOld = db_get_b(NULL, MODNAME, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE); // = 1
- BYTE bNew = (BYTE)ComboBox_GetCurSel(GetDlgItem(hDlg,EDIT_BIRTHMODULE));
- if (bOld != bNew) {
- //keep the database clean
- MAnnivDate mdb;
- HANDLE hContact = NULL;
- DBWriteComboByte(hDlg, EDIT_BIRTHMODULE, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE);
- //walk through all the contacts stored in the DB
- for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
- mdb.DBMoveBirthDate(hContact,bOld,bNew);
- }
-
- // update current reminder state
- bNewVal = (BYTE)SendDlgItemMessage(hDlg, EDIT_REMIND_ENABLED, CB_GETCURSEL, NULL, NULL);
- if (db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, 1) != bNewVal)
- {
- db_set_b(NULL, MODNAME, SET_REMIND_ENABLED, bNewVal);
- if (bNewVal == REMIND_OFF)
- {
- SvcReminderEnable(FALSE);
- bReminderCheck = FALSE;
- }
- else {
- bReminderCheck = TRUE;
- }
- }
- // update all contact list extra icons
- if (bReminderCheck)
- {
- SvcReminderEnable(TRUE); // reinit reminder options from db
- SvcReminderCheckAll(NOTIFY_CLIST); // notify
- }
- RebuildMain();
+ // update current reminder state
+ BYTE bNewVal = (BYTE)SendDlgItemMessage(hDlg, EDIT_REMIND_ENABLED, CB_GETCURSEL, NULL, NULL);
+ if (db_get_b(NULL, MODNAME, SET_REMIND_ENABLED, 1) != bNewVal) {
+ db_set_b(NULL, MODNAME, SET_REMIND_ENABLED, bNewVal);
+ if (bNewVal == REMIND_OFF) {
+ SvcReminderEnable(FALSE);
+ bReminderCheck = FALSE;
}
+ else bReminderCheck = TRUE;
+ }
+
+ // update all contact list extra icons
+ if (bReminderCheck) {
+ SvcReminderEnable(TRUE); // reinit reminder options from db
+ SvcReminderCheckAll(NOTIFY_CLIST); // notify
+ }
+ RebuildMain();
}
- break;
+ }
+ break;
- case WM_COMMAND:
- {
- switch (LOWORD(wParam))
- {
- case EDIT_REMIND_ENABLED:
- {
- if (HIWORD(wParam) == CBN_SELCHANGE)
- {
- int bEnabled = ComboBox_GetCurSel((HWND)lParam) > 0;
- const int idCtrl[] = {
- CHECK_REMIND_MI, EDIT_REMIND, EDIT_REMIND2, SPIN_REMIND, SPIN_REMIND2, TXT_REMIND,
- TXT_REMIND2, TXT_REMIND3, TXT_REMIND4, TXT_REMIND6, TXT_REMIND7, TXT_REMIND8, TXT_REMIND9,
- TXT_REMIND_LASTCHECK, CHECK_REMIND_FLASHICON, EDIT_BIRTHMODULE, CHECK_REMIND_VISIBLEONLY,
- CHECK_REMIND_SECURED, CHECK_REMIND_STARTUP, EDIT_REMIND_SOUNDOFFSET, SPIN_REMIND_SOUNDOFFSET
- };
-
- EnableControls(hDlg, idCtrl, SIZEOF(idCtrl), bEnabled);
- }
- }
-
- case EDIT_BIRTHMODULE:
- if (bInitialized && HIWORD(wParam) == CBN_SELCHANGE)
- NotifyParentOfChange(hDlg);
- break;
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case EDIT_REMIND_ENABLED:
+ if (HIWORD(wParam) == CBN_SELCHANGE) {
+ int bEnabled = ComboBox_GetCurSel((HWND)lParam) > 0;
+ const int idCtrl[] = {
+ CHECK_REMIND_MI, EDIT_REMIND, EDIT_REMIND2, SPIN_REMIND, SPIN_REMIND2, TXT_REMIND,
+ TXT_REMIND2, TXT_REMIND3, TXT_REMIND4, TXT_REMIND6, TXT_REMIND7, TXT_REMIND8, TXT_REMIND9,
+ TXT_REMIND_LASTCHECK, CHECK_REMIND_FLASHICON, EDIT_BIRTHMODULE, CHECK_REMIND_VISIBLEONLY,
+ CHECK_REMIND_SECURED, CHECK_REMIND_STARTUP, EDIT_REMIND_SOUNDOFFSET, SPIN_REMIND_SOUNDOFFSET
+ };
- case CHECK_REMIND_MI:
- case CHECK_REMIND_FLASHICON:
- case CHECK_REMIND_VISIBLEONLY:
- case CHECK_REMIND_STARTUP:
- case CHECK_REMIND_SECURED:
- if (bInitialized && HIWORD(wParam) == BN_CLICKED)
- NotifyParentOfChange(hDlg);
- break;
+ EnableControls(hDlg, idCtrl, SIZEOF(idCtrl), bEnabled);
+ }
- /*
- * The user changes the number of days in advance of an anniversary to be notified by popups and clist extra icon.
- */
- case EDIT_REMIND:
- {
- if (bInitialized && HIWORD(wParam) == EN_UPDATE)
- {
- BOOL t;
- WORD v;
-
- v = (WORD)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE);
- if (t && (v != db_get_w(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET)))
- {
- NotifyParentOfChange(hDlg);
- }
- }
- }
- break;
+ case EDIT_BIRTHMODULE:
+ if (bInitialized && HIWORD(wParam) == CBN_SELCHANGE)
+ NotifyParentOfChange(hDlg);
+ break;
- /*
- * The user changes the number of days in advance of an anniversary to be notified by sound.
- */
- case EDIT_REMIND_SOUNDOFFSET:
- {
- if (bInitialized && HIWORD(wParam) == EN_UPDATE)
- {
- BOOL t;
- BYTE v;
-
- v = (BYTE)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE);
- if (t && (v != db_get_b(NULL, MODNAME, SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET)))
- {
- NotifyParentOfChange(hDlg);
- }
- }
- }
- break;
+ case CHECK_REMIND_MI:
+ case CHECK_REMIND_FLASHICON:
+ case CHECK_REMIND_VISIBLEONLY:
+ case CHECK_REMIND_STARTUP:
+ case CHECK_REMIND_SECURED:
+ if (bInitialized && HIWORD(wParam) == BN_CLICKED)
+ NotifyParentOfChange(hDlg);
+ break;
- /*
- * The user changes the notification interval
- */
- case EDIT_REMIND2:
- {
- if (bInitialized && HIWORD(wParam) == EN_UPDATE)
- {
- BOOL t;
- WORD v = (WORD)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE);
- if (t && (v != db_get_w(NULL, MODNAME, SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL)))
- NotifyParentOfChange(hDlg);
- }
- }
- }
+ /*
+ * The user changes the number of days in advance of an anniversary to be notified by popups and clist extra icon.
+ */
+ case EDIT_REMIND:
+ if (bInitialized && HIWORD(wParam) == EN_UPDATE) {
+ BOOL t;
+ WORD v = (WORD)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE);
+ if (t && (v != db_get_w(NULL, MODNAME, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET)))
+ NotifyParentOfChange(hDlg);
+ }
+ break;
+
+ /*
+ * The user changes the number of days in advance of an anniversary to be notified by sound.
+ */
+ case EDIT_REMIND_SOUNDOFFSET:
+ if (bInitialized && HIWORD(wParam) == EN_UPDATE) {
+ BOOL t;
+ BYTE v = (BYTE)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE);
+ if (t && (v != db_get_b(NULL, MODNAME, SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET)))
+ NotifyParentOfChange(hDlg);
+ }
+ break;
+
+ /*
+ * The user changes the notification interval
+ */
+ case EDIT_REMIND2:
+ if (bInitialized && HIWORD(wParam) == EN_UPDATE) {
+ BOOL t;
+ WORD v = (WORD)GetDlgItemInt(hDlg, LOWORD(wParam), &t, FALSE);
+ if (t && (v != db_get_w(NULL, MODNAME, SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL)))
+ NotifyParentOfChange(hDlg);
}
+ }
}
return FALSE;
}
@@ -923,154 +808,117 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR {
static BYTE bInitialized = 0;
- switch (uMsg)
- {
+ switch (uMsg) {
case WM_INITDIALOG:
- {
- TranslateDialogDefault(hDlg);
- SendNotify_InfoChanged(hDlg);
- }
+ TranslateDialogDefault(hDlg);
+ SendNotify_InfoChanged(hDlg);
return TRUE;
case WM_NOTIFY:
- {
- switch (((LPNMHDR)lParam)->code)
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_INFOCHANGED:
{
- case PSN_INFOCHANGED:
- {
- BYTE bDelay, isEnabled;
-
- bInitialized = 0;
-
- DBGetCheckBtn(hDlg, CHECK_OPT_POPUP_MSGBOX, SET_POPUPMSGBOX, DEFVAL_POPUPMSGBOX);
- DBGetCheckBtn(hDlg, CHECK_OPT_POPUP_PROGRESS, "PopupProgress", FALSE);
- // disable if popup plugin dos not sopport buttons inside popop
- if (!myGlobals.PopupActionsExist) {
- EnableDlgItem(hDlg, CHECK_OPT_POPUP_MSGBOX, FALSE);
- EnableDlgItem(hDlg, CHECK_OPT_POPUP_PROGRESS, FALSE);
- }
- else if (!(db_get_dw(0, "Popup","Actions", 0) & 1)) {
- EnableDlgItem(hDlg, CHECK_OPT_POPUP_MSGBOX, FALSE);
- }
+ BYTE bDelay, isEnabled;
- // enable/disable popups
- isEnabled = DBGetCheckBtn(hDlg, CHECK_OPT_POPUP_ENABLED, SET_POPUP_ENABLED, DEFVAL_POPUP_ENABLED);
- SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_OPT_POPUP_ENABLED, BN_CLICKED), (LPARAM)GetDlgItem(hDlg, CHECK_OPT_POPUP_ENABLED));
-
- // set colortype checkboxes and color controls
- DBGetColor(hDlg, CLR_BBACK, SET_POPUP_BIRTHDAY_COLOR_BACK, RGB(192, 180, 30));
- DBGetColor(hDlg, CLR_BTEXT, SET_POPUP_BIRTHDAY_COLOR_TEXT, RGB(0, 0, 0));
- switch (db_get_b(NULL, MODNAME, SET_POPUP_BIRTHDAY_COLORTYPE, POPUP_COLOR_CUSTOM))
- {
- case POPUP_COLOR_DEFAULT:
- {
- CheckDlgButton(hDlg, CHECK_OPT_POPUP_DEFCLR, TRUE);
- }
- break;
+ bInitialized = 0;
- case POPUP_COLOR_WINDOWS:
- {
- CheckDlgButton(hDlg, CHECK_OPT_POPUP_WINCLR, TRUE);
- }
- }
+ DBGetCheckBtn(hDlg, CHECK_OPT_POPUP_MSGBOX, SET_POPUPMSGBOX, DEFVAL_POPUPMSGBOX);
+ DBGetCheckBtn(hDlg, CHECK_OPT_POPUP_PROGRESS, "PopupProgress", FALSE);
+ // disable if popup plugin dos not sopport buttons inside popop
+ if (!myGlobals.PopupActionsExist) {
+ EnableDlgItem(hDlg, CHECK_OPT_POPUP_MSGBOX, FALSE);
+ EnableDlgItem(hDlg, CHECK_OPT_POPUP_PROGRESS, FALSE);
+ }
+ else if (!(db_get_dw(0, "Popup","Actions", 0) & 1))
+ EnableDlgItem(hDlg, CHECK_OPT_POPUP_MSGBOX, FALSE);
+
+ // enable/disable popups
+ isEnabled = DBGetCheckBtn(hDlg, CHECK_OPT_POPUP_ENABLED, SET_POPUP_ENABLED, DEFVAL_POPUP_ENABLED);
+ SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_OPT_POPUP_ENABLED, BN_CLICKED), (LPARAM)GetDlgItem(hDlg, CHECK_OPT_POPUP_ENABLED));
+
+ // set colortype checkboxes and color controls
+ DBGetColor(hDlg, CLR_BBACK, SET_POPUP_BIRTHDAY_COLOR_BACK, RGB(192, 180, 30));
+ DBGetColor(hDlg, CLR_BTEXT, SET_POPUP_BIRTHDAY_COLOR_TEXT, RGB(0, 0, 0));
+ switch (db_get_b(NULL, MODNAME, SET_POPUP_BIRTHDAY_COLORTYPE, POPUP_COLOR_CUSTOM)) {
+ case POPUP_COLOR_DEFAULT:
+ CheckDlgButton(hDlg, CHECK_OPT_POPUP_DEFCLR, TRUE);
+ break;
- DBGetColor(hDlg, CLR_ABACK, SET_POPUP_ANNIVERSARY_COLOR_BACK, RGB(90, 190, 130));
- DBGetColor(hDlg, CLR_ATEXT, SET_POPUP_ANNIVERSARY_COLOR_TEXT, RGB(0, 0, 0));
- switch (db_get_b(NULL, MODNAME, SET_POPUP_ANNIVERSARY_COLORTYPE, POPUP_COLOR_CUSTOM))
- {
- case POPUP_COLOR_DEFAULT:
- {
- CheckDlgButton(hDlg, CHECK_OPT_POPUP_ADEFCLR, TRUE);
- }
- break;
- case POPUP_COLOR_WINDOWS:
- {
- CheckDlgButton(hDlg, CHECK_OPT_POPUP_AWINCLR, TRUE);
- }
- }
-
- if (isEnabled)
- {
- SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_OPT_POPUP_DEFCLR, BN_CLICKED), NULL);
- SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_OPT_POPUP_ADEFCLR, BN_CLICKED), NULL);
- }
- // set delay values
- bDelay = db_get_b(NULL, MODNAME, SET_POPUP_DELAY, 0);
- switch (bDelay)
- {
- case 0:
- {
- CheckDlgButton(hDlg, RADIO_OPT_POPUP_DEFAULT, TRUE);
- if (isEnabled)
- {
- EnableDlgItem(hDlg, EDIT_DELAY, FALSE);
- }
- }
- break;
+ case POPUP_COLOR_WINDOWS:
+ CheckDlgButton(hDlg, CHECK_OPT_POPUP_WINCLR, TRUE);
+ }
- case 255:
- {
- CheckDlgButton(hDlg, RADIO_OPT_POPUP_PERMANENT, TRUE);
- if (isEnabled)
- {
- EnableDlgItem(hDlg, EDIT_DELAY, FALSE);
- }
- }
- break;
+ DBGetColor(hDlg, CLR_ABACK, SET_POPUP_ANNIVERSARY_COLOR_BACK, RGB(90, 190, 130));
+ DBGetColor(hDlg, CLR_ATEXT, SET_POPUP_ANNIVERSARY_COLOR_TEXT, RGB(0, 0, 0));
+ switch (db_get_b(NULL, MODNAME, SET_POPUP_ANNIVERSARY_COLORTYPE, POPUP_COLOR_CUSTOM)) {
+ case POPUP_COLOR_DEFAULT:
+ CheckDlgButton(hDlg, CHECK_OPT_POPUP_ADEFCLR, TRUE);
+ break;
+ case POPUP_COLOR_WINDOWS:
+ CheckDlgButton(hDlg, CHECK_OPT_POPUP_AWINCLR, TRUE);
+ }
- default:
- {
- CheckDlgButton(hDlg, RADIO_OPT_POPUP_CUSTOM, TRUE);
- SetDlgItemInt(hDlg, EDIT_DELAY, bDelay, FALSE);
- }
- }
- bInitialized = TRUE;
+ if (isEnabled) {
+ SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_OPT_POPUP_DEFCLR, BN_CLICKED), NULL);
+ SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(CHECK_OPT_POPUP_ADEFCLR, BN_CLICKED), NULL);
}
- break;
-
- case PSN_APPLY:
- {
- DBWriteCheckBtn(hDlg, CHECK_OPT_POPUP_MSGBOX, SET_POPUPMSGBOX);
- DBWriteCheckBtn(hDlg, CHECK_OPT_POPUP_PROGRESS, "PopupProgress");
- DBWriteCheckBtn(hDlg, CHECK_OPT_POPUP_ENABLED, SET_POPUP_ENABLED);
-
- // save popup style for birthdays
- DBWriteColor(hDlg, CLR_BBACK, SET_POPUP_BIRTHDAY_COLOR_BACK);
- DBWriteColor(hDlg, CLR_BTEXT, SET_POPUP_BIRTHDAY_COLOR_TEXT);
- db_set_b(NULL, MODNAME, SET_POPUP_BIRTHDAY_COLORTYPE,
- SendDlgItemMessage(hDlg, CHECK_OPT_POPUP_DEFCLR, BM_GETCHECK, NULL, NULL)
- ? POPUP_COLOR_DEFAULT
- : SendDlgItemMessage(hDlg, CHECK_OPT_POPUP_WINCLR, BM_GETCHECK, NULL, NULL)
- ? POPUP_COLOR_WINDOWS
- : POPUP_COLOR_CUSTOM);
-
- // save popup style for anniversaries
- DBWriteColor(hDlg, CLR_ABACK, SET_POPUP_ANNIVERSARY_COLOR_BACK);
- DBWriteColor(hDlg, CLR_ATEXT, SET_POPUP_ANNIVERSARY_COLOR_TEXT);
- db_set_b(NULL, MODNAME, SET_POPUP_ANNIVERSARY_COLORTYPE,
- SendDlgItemMessage(hDlg, CHECK_OPT_POPUP_ADEFCLR, BM_GETCHECK, NULL, NULL)
- ? POPUP_COLOR_DEFAULT
- : SendDlgItemMessage(hDlg, CHECK_OPT_POPUP_AWINCLR, BM_GETCHECK, NULL, NULL)
- ? POPUP_COLOR_WINDOWS
- : POPUP_COLOR_CUSTOM);
-
- // save delay
- if (SendDlgItemMessage(hDlg, RADIO_OPT_POPUP_PERMANENT, BM_GETCHECK, NULL, NULL))
- {
- db_set_b(NULL, MODNAME, SET_POPUP_DELAY, 255);
- }
- else if (SendDlgItemMessage(hDlg, RADIO_OPT_POPUP_CUSTOM, BM_GETCHECK, NULL, NULL))
- {
- TCHAR szDelay[4];
- GetDlgItemText(hDlg, EDIT_DELAY, szDelay, SIZEOF(szDelay));
- db_set_b(NULL, MODNAME, SET_POPUP_DELAY, (BYTE)_tcstol(szDelay, NULL, 10));
- }
- else
- {
- db_unset(NULL, MODNAME, SET_POPUP_DELAY);
- }
+ // set delay values
+ bDelay = db_get_b(NULL, MODNAME, SET_POPUP_DELAY, 0);
+ switch (bDelay) {
+ case 0:
+ CheckDlgButton(hDlg, RADIO_OPT_POPUP_DEFAULT, TRUE);
+ if (isEnabled)
+ EnableDlgItem(hDlg, EDIT_DELAY, FALSE);
+ break;
+
+ case 255:
+ CheckDlgButton(hDlg, RADIO_OPT_POPUP_PERMANENT, TRUE);
+ if (isEnabled)
+ EnableDlgItem(hDlg, EDIT_DELAY, FALSE);
+ break;
+
+ default:
+ CheckDlgButton(hDlg, RADIO_OPT_POPUP_CUSTOM, TRUE);
+ SetDlgItemInt(hDlg, EDIT_DELAY, bDelay, FALSE);
}
+ bInitialized = TRUE;
}
+ break;
+
+ case PSN_APPLY:
+ DBWriteCheckBtn(hDlg, CHECK_OPT_POPUP_MSGBOX, SET_POPUPMSGBOX);
+ DBWriteCheckBtn(hDlg, CHECK_OPT_POPUP_PROGRESS, "PopupProgress");
+ DBWriteCheckBtn(hDlg, CHECK_OPT_POPUP_ENABLED, SET_POPUP_ENABLED);
+
+ // save popup style for birthdays
+ DBWriteColor(hDlg, CLR_BBACK, SET_POPUP_BIRTHDAY_COLOR_BACK);
+ DBWriteColor(hDlg, CLR_BTEXT, SET_POPUP_BIRTHDAY_COLOR_TEXT);
+ db_set_b(NULL, MODNAME, SET_POPUP_BIRTHDAY_COLORTYPE,
+ SendDlgItemMessage(hDlg, CHECK_OPT_POPUP_DEFCLR, BM_GETCHECK, NULL, NULL)
+ ? POPUP_COLOR_DEFAULT
+ : SendDlgItemMessage(hDlg, CHECK_OPT_POPUP_WINCLR, BM_GETCHECK, NULL, NULL)
+ ? POPUP_COLOR_WINDOWS
+ : POPUP_COLOR_CUSTOM);
+
+ // save popup style for anniversaries
+ DBWriteColor(hDlg, CLR_ABACK, SET_POPUP_ANNIVERSARY_COLOR_BACK);
+ DBWriteColor(hDlg, CLR_ATEXT, SET_POPUP_ANNIVERSARY_COLOR_TEXT);
+ db_set_b(NULL, MODNAME, SET_POPUP_ANNIVERSARY_COLORTYPE,
+ SendDlgItemMessage(hDlg, CHECK_OPT_POPUP_ADEFCLR, BM_GETCHECK, NULL, NULL)
+ ? POPUP_COLOR_DEFAULT
+ : SendDlgItemMessage(hDlg, CHECK_OPT_POPUP_AWINCLR, BM_GETCHECK, NULL, NULL)
+ ? POPUP_COLOR_WINDOWS
+ : POPUP_COLOR_CUSTOM);
+
+ // save delay
+ if (SendDlgItemMessage(hDlg, RADIO_OPT_POPUP_PERMANENT, BM_GETCHECK, NULL, NULL))
+ db_set_b(NULL, MODNAME, SET_POPUP_DELAY, 255);
+ else if (SendDlgItemMessage(hDlg, RADIO_OPT_POPUP_CUSTOM, BM_GETCHECK, NULL, NULL)) {
+ TCHAR szDelay[4];
+ GetDlgItemText(hDlg, EDIT_DELAY, szDelay, SIZEOF(szDelay));
+ db_set_b(NULL, MODNAME, SET_POPUP_DELAY, (BYTE)_tcstol(szDelay, NULL, 10));
+ }
+ else db_unset(NULL, MODNAME, SET_POPUP_DELAY);
}
break;
@@ -1133,7 +981,7 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR RADIO_OPT_POPUP_DEFAULT, RADIO_OPT_POPUP_CUSTOM,
RADIO_OPT_POPUP_PERMANENT, EDIT_DELAY
};
-
+
EnableControls(hDlg, idCtrl, SIZEOF(idCtrl), bEnabled);
if (bInitialized)
@@ -1213,14 +1061,15 @@ static INT_PTR CALLBACK DlgProc_Popups(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR }
/**
- * This hook handler function is called on opening the options dialog
- * to tell miranda, which pages userinfoex wants to add.
- *
- * @param wParam - options dialog's internal datastructure,
- * @param lParam - not used
- *
- * @retval MIR_OK
- **/
+* This hook handler function is called on opening the options dialog
+* to tell miranda, which pages userinfoex wants to add.
+*
+* @param wParam - options dialog's internal datastructure,
+* @param lParam - not used
+*
+* @retval MIR_OK
+**/
+
static int OnInitOptions(WPARAM wParam, LPARAM lParam)
{
DlgContactInfoInitTreeIcons();
@@ -1273,12 +1122,13 @@ static int OnInitOptions(WPARAM wParam, LPARAM lParam) }
/**
- * This function loads the options module.
- *
- * @param none
- *
- * @retval nothing
- **/
+* This function loads the options module.
+*
+* @param none
+*
+* @retval nothing
+**/
+
void OptionsLoadModule()
{
HookEvent(ME_OPT_INITIALISE, OnInitOptions);
diff --git a/plugins/UserInfoEx/src/resource.h b/plugins/UserInfoEx/src/resource.h index 854031ebf5..fcc0666960 100644 --- a/plugins/UserInfoEx/src/resource.h +++ b/plugins/UserInfoEx/src/resource.h @@ -199,7 +199,6 @@ #define CHECK_POPUP 1572
#define GROUP_FILTER 1573
#define GROUP_REMINDER 1574
-#define TXT_OPT_GENDER 1577
#define GROUP_OPT_EXTRAICONS 1578
#define TXT_OPT_DEFAULTICONS 1579
#define TXT_OPT_DEFAULTICONS2 1580
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp index bcc452c628..55aacd17b5 100644 --- a/plugins/UserInfoEx/src/svc_email.cpp +++ b/plugins/UserInfoEx/src/svc_email.cpp @@ -189,15 +189,11 @@ void SvcEMailRebuildMenu() {
static HANDLE hPrebuildMenuHook = NULL;
- if (db_get_b(NULL, MODNAME, SET_EXTENDED_EMAILSERVICE, TRUE))
- {
+ if (db_get_b(NULL, MODNAME, SET_EXTENDED_EMAILSERVICE, TRUE)) {
if (!hPrebuildMenuHook)
- {
hPrebuildMenuHook = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnPreBuildMenu);
- }
- if (!ghMenuItem)
- {
+ if (!ghMenuItem) {
// insert contact menuitem
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000010000;
@@ -207,15 +203,11 @@ void SvcEMailRebuildMenu() ghMenuItem = Menu_AddContactMenuItem(&mi);
}
}
- else
- {
- if (hPrebuildMenuHook)
- {
- UnhookEvent(ME_CLIST_PREBUILDCONTACTMENU);
- hPrebuildMenuHook = NULL;
- }
- if (ghMenuItem)
- {
+ else {
+ if (hPrebuildMenuHook)
+ UnhookEvent(ME_CLIST_PREBUILDCONTACTMENU), hPrebuildMenuHook = NULL;
+
+ if (ghMenuItem) {
CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)ghMenuItem, NULL);
ghMenuItem = NULL;
}
@@ -230,7 +222,7 @@ void SvcEMailRebuildMenu() **/
void SvcEMailApplyCListIcons()
{
- //walk through all the contacts stored in the DB
+ // walk through all the contacts stored in the DB
for (HANDLE hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
OnCListApplyIcons((WPARAM)hContact, 0);
}
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 7bdd777281..269af4ada0 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -925,8 +925,7 @@ static void UpdateTimer(BYTE bStartup) void SvcReminderEnable(BYTE bEnable)
{
- if (bEnable) // Reminder is on
- {
+ if (bEnable) { // Reminder is on
if (ExtraIcon == INVALID_HANDLE_VALUE)
ExtraIcon = ExtraIcon_Register("Reminder", LPGEN("Reminder (uinfoex)"), ICO_COMMON_ANNIVERSARY);
@@ -948,8 +947,7 @@ void SvcReminderEnable(BYTE bEnable) // init the timer
UpdateTimer(TRUE);
}
- else // Reminder is off
- {
+ else { // Reminder is off
for (HANDLE hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
NotifyWithExtraIcon(hContact, CEvent());
|