diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-02 14:11:01 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-02 14:11:01 +0000 |
commit | 75b1ff75c42644eb36552762652e4b0c9ff071bc (patch) | |
tree | 238f026ef373d30a395846f38c302a81961b14ac /plugins/BuddyExpectator/src | |
parent | 2caba72d51b09368801f23dd8951d589ab4dc809 (diff) |
final switch to the typed icolib api
git-svn-id: http://svn.miranda-ng.org/main/trunk@2152 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BuddyExpectator/src')
-rw-r--r-- | plugins/BuddyExpectator/src/BuddyExpectator.cpp | 86 | ||||
-rw-r--r-- | plugins/BuddyExpectator/src/options.cpp | 106 |
2 files changed, 96 insertions, 96 deletions
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 1c0646c628..be864b115f 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -251,20 +251,20 @@ bool isContactGoneFor(HANDLE hContact, int days) int daysSinceMessage = -1;
if (lastInputMsg != -1) daysSinceMessage = (int)((currentTime - lastInputMsg)/(60*60*24));
-
+
if (options.hideInactive)
{
if (daysSinceMessage >= options.iSilencePeriod)
if (!DBGetContactSettingByte(hContact, "CList", "Hidden", 0) && !DBGetContactSettingByte(hContact, MODULE_NAME, "NeverHide", 0))
{
TCHAR szInfo[200];
-
+
POPUPDATAT_V2 ppd = {0};
ppd.cbSize = sizeof(POPUPDATAT_V2);
-
+
ppd.lchContact = hContact;
- ppd.lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon");
-
+ ppd.lchIcon = Skin_GetIcon("enabled_icon");
+
mir_sntprintf(szInfo, 200, TranslateT("Hiding %s (%S)"), (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR), (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0));
_tcsncpy(ppd.lptzContactName, szInfo, MAX_CONTACTNAME);
mir_sntprintf(szInfo, 200, TranslateT("%d days since last message"), daysSinceMessage);
@@ -277,11 +277,11 @@ bool isContactGoneFor(HANDLE hContact, int days) ppd.PluginWindowProc = HidePopupDlgProc;
ppd.PluginData = NULL;
ppd.iSeconds = -1;
-
+
hideactions[0].flags = hideactions[1].flags = PAF_ENABLED;
ppd.lpActions = hideactions;
ppd.actionCount = 2;
-
+
CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NEWDATA);
SkinPlaySound("buddyExpectatorHide");
@@ -295,7 +295,7 @@ void ReturnNotify(HANDLE hContact, TCHAR *message) {
if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 1 || DBGetContactSettingByte(hContact, "CList", "Hidden", 0) == 1)
return;
-
+
SkinPlaySound("buddyExpectatorReturn");
if (options.iShowPopUp > 0)
@@ -362,7 +362,7 @@ void GoneNotify(HANDLE hContact, TCHAR *message) ppd.PluginWindowProc = PopupDlgProcNoSet;
ppd.PluginData = NULL;
ppd.iSeconds = options.iPopUpDelay;
-
+
PUAddPopUpT(&ppd);
}
@@ -473,7 +473,7 @@ INT_PTR ContactStillAbsentAction(WPARAM wParam, LPARAM lParam) */
int onIconsChanged(WPARAM wParam, LPARAM lParam)
{
- hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"main_icon");
+ hIcon = Skin_GetIcon("main_icon");
return 0;
}
@@ -506,7 +506,7 @@ int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam) CLISTMENUITEM mi = {0};
mi.cbSize = sizeof(CLISTMENUITEM);
-
+
if (DBGetContactSettingByte((HANDLE)wParam, proto, "ChatRoom", 0) || !(CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND))
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
else
@@ -524,7 +524,7 @@ int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam) mi.ptszName = LPGENT("Enable Miss You");
mi.icolibItem = hDisabledIcon;
}
-
+
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenu, (LPARAM)&mi);
return 0;
@@ -534,17 +534,17 @@ int onExtraImageApplying(WPARAM wParam, LPARAM lParam) {
if (DBGetContactSettingByte((HANDLE)wParam,MODULE_NAME,"MissYou",0))
CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) wParam, (LPARAM) &g_IECMissYou);
-
+
return 0;
}
-int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam)
+int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam)
{
g_IECMissYou.cbSize = sizeof(IconExtraColumn);
g_IECMissYou.ColumnType = options.MissYouIcon;
if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON))
- g_IECMissYou.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon"), (LPARAM)0);
+ g_IECMissYou.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)Skin_GetIcon("enabled_icon"), 0);
return 0;
}
@@ -557,7 +557,7 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) HANDLE hContact = (HANDLE) wParam;
DBCONTACTWRITESETTING *inf = (DBCONTACTWRITESETTING *) lParam;
- if (hContact == NULL || inf->value.type == DBVT_DELETED || strcmp(inf->szSetting, "Status") != 0)
+ if (hContact == NULL || inf->value.type == DBVT_DELETED || strcmp(inf->szSetting, "Status") != 0)
return 0;
if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 1)
@@ -570,15 +570,15 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) int currentStatus = inf->value.wVal;
int prevStatus = DBGetContactSettingWord(hContact, "UserOnline", "OldStatus", ID_STATUS_OFFLINE);
-
+
if (currentStatus == prevStatus)
{
return 0;
}
-
+
// Last status
DBWriteContactSettingDword(hContact, MODULE_NAME, "LastStatus", prevStatus);
-
+
if (prevStatus == ID_STATUS_OFFLINE)
{
if (DBGetContactSettingByte(hContact, MODULE_NAME, "MissYou", 0))
@@ -586,9 +586,9 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) // Display PopUp
POPUPDATAT_V2 ppd = {0};
ppd.cbSize = sizeof(POPUPDATAT_V2);
-
+
ppd.lchContact = hContact;
- ppd.lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon");
+ ppd.lchIcon = Skin_GetIcon("enabled_icon");
_tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR), MAX_CONTACTNAME);
_tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
if (!options.iUsePopupColors)
@@ -599,14 +599,14 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) ppd.PluginWindowProc = MissYouPopupDlgProc;
ppd.PluginData = NULL;
ppd.iSeconds = -1;
-
+
missyouactions[0].flags = PAF_ENABLED;
ppd.lpActions = missyouactions;
ppd.actionCount = 1;
CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NEWDATA);
-
- SkinPlaySound("buddyExpectatorMissYou");
+
+ SkinPlaySound("buddyExpectatorMissYou");
}
}
@@ -615,7 +615,7 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) setLastSeen(hContact);
return 0;
}
-
+
/*
if (CallService(MS_IGNORE_ISIGNORED, (WPARAM) hContact, (LPARAM) IGNOREEVENT_USERONLINE))
{
@@ -630,7 +630,7 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) setLastSeen(hContact);
}
-
+
unsigned int AbsencePeriod = DBGetContactSettingDword(hContact, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
if (isContactGoneFor(hContact, AbsencePeriod))
{
@@ -652,7 +652,7 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) message = tmpBuf;
}
}
-
+
ReturnNotify(hContact, message);
if ((options.iShowMessageWindow == 0 && options.iShowUDetails == 0) || (options.iShowEvent == 0 && options.iShowPopUp == 0))
@@ -666,7 +666,7 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) }
void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
-{
+{
HANDLE hContact = db_find_first();
char *proto;
while (hContact != 0)
@@ -719,15 +719,15 @@ int ModulesLoaded2(WPARAM wParam, LPARAM lParam) int ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
hEventUserInfoInit = HookEvent(ME_USERINFO_INITIALISE, UserinfoInit);
-
+
// add sounds support
SkinAddNewSoundExT("buddyExpectatorReturn", LPGENT("BuddyExpectator"), LPGENT("Contact returned"));
SkinAddNewSoundExT("buddyExpectatorStillAbsent", LPGENT("BuddyExpectator"), LPGENT("Contact still absent"));
SkinAddNewSoundExT("buddyExpectatorMissYou", LPGENT("BuddyExpectator"), LPGENT("Miss you event"));
SkinAddNewSoundExT("buddyExpectatorHide", LPGENT("BuddyExpectator"), LPGENT("Hide contact event"));
-
+
timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours
-
+
hModulesLoaded2 = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded2);
if (options.MissYouIcon)
{
@@ -737,7 +737,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) g_IECClear.ColumnType = options.MissYouIcon;
g_IECClear.hImage = (HANDLE) -1;
}
-
+
TCHAR szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, MAX_PATH);
@@ -747,32 +747,32 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) sid.cbSize = sizeof(sid);
sid.flags = SIDF_ALL_TCHAR;
sid.ptszSection = LPGENT("BuddyExpectator");
-
+
sid.ptszDescription = LPGENT("Tray/popup icon");
sid.pszName = "main_icon";
sid.iDefaultIndex = -IDI_MAINICON;
Skin_AddIcon(&sid);
-
+
sid.ptszDescription = LPGENT("Enabled");
sid.pszName = "enabled_icon";
sid.iDefaultIndex = -IDI_ENABLED;
hEnabledIcon = Skin_AddIcon(&sid);
-
+
sid.ptszDescription = LPGENT("Disabled");
sid.pszName = "disabled_icon";
sid.iDefaultIndex = -IDI_DISABLED;
hDisabledIcon = Skin_AddIcon(&sid);
-
+
sid.ptszDescription = LPGENT("Hide");
sid.pszName = "hide_icon";
sid.iDefaultIndex = -IDI_HIDE;
Skin_AddIcon(&sid);
-
+
sid.ptszDescription = LPGENT("NeverHide");
sid.pszName = "neverhide_icon";
sid.iDefaultIndex = -IDI_NEVERHIDE;
Skin_AddIcon(&sid);
-
+
hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged);
onIconsChanged(0,0);
@@ -791,17 +791,17 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) }
missyouactions[0].cbSize = sizeof(POPUPACTION);
- missyouactions[0].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"disabled_icon");
+ missyouactions[0].lchIcon = Skin_GetIcon("disabled_icon");
lstrcpyA(missyouactions[0].lpzTitle, LPGEN("Disable Miss You"));
missyouactions[0].wParam = missyouactions[0].lParam = 1;
hideactions[0].cbSize = sizeof(POPUPACTION);
- hideactions[0].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"hide_icon");
+ hideactions[0].lchIcon = Skin_GetIcon("hide_icon");
lstrcpyA(hideactions[0].lpzTitle, LPGEN("Hide contact"));
hideactions[0].wParam = hideactions[0].lParam = 2;
hideactions[1].cbSize = sizeof(POPUPACTION);
- hideactions[1].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"neverhide_icon");
+ hideactions[1].lchIcon = Skin_GetIcon("neverhide_icon");
lstrcpyA(hideactions[1].lpzTitle, LPGEN("Never hide this contact"));
hideactions[1].wParam = hideactions[1].lParam = 3;
@@ -840,11 +840,11 @@ int onSystemOKToExit(WPARAM wParam,LPARAM lParam) DeinitOptions();
if (hIcoLibIconsChanged)
- CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
+ Skin_ReleaseIcon(hIcon);
else
DestroyIcon(hIcon);
- return 0;
+ return 0;
}
extern "C" int __declspec(dllexport) Load(void)
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index f0a8e8cf7e..7ca92deeca 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -95,7 +95,7 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, {
switch (uMsg)
{
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
if (!ServiceExists(MS_POPUP_ADDPOPUP))
@@ -104,84 +104,84 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, }
//iAbsencePeriod
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_RESETCONTENT, 0, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_RESETCONTENT, 0, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
if (options.iAbsencePeriod % 365 == 0)
{
SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/365, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 3, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 3, 0);
}
else if (options.iAbsencePeriod % 30 == 0)
{
SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/30, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 2, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 2, 0);
}
else if (options.iAbsencePeriod % 7 == 0)
{
SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/7, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 1, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 1, 0);
}
else
{
SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 0, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 0, 0);
}
//iAbsencePeriod2
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_RESETCONTENT, 0, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_RESETCONTENT, 0, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
if (options.iAbsencePeriod2 % 365 == 0)
{
SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/365, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 3, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 3, 0);
}
else if (options.iAbsencePeriod2 % 30 == 0)
{
SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/30, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 2, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 2, 0);
}
else if (options.iAbsencePeriod2 % 7 == 0)
{
SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/7, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 1, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 1, 0);
}
else
{
SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2,options.iAbsencePeriod2, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 0, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 0, 0);
}
//iSilencePeriod
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_RESETCONTENT, 0, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_RESETCONTENT, 0, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
if (options.iSilencePeriod % 365 == 0)
{
SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/365, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 3, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 3, 0);
}
else if (options.iSilencePeriod % 30 == 0)
{
SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/30, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 2, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 2, 0);
}
else if (options.iSilencePeriod % 7 == 0)
{
SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/7, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 1, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 1, 0);
}
else
{
SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR,options.iSilencePeriod, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 0, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 0, 0);
}
SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), BM_SETCHECK, options.iShowPopUp > 0 ? BST_CHECKED : BST_UNCHECKED, 0);
@@ -194,18 +194,18 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP2), BM_SETCHECK, options.iShowPopUp2 > 0 ? BST_CHECKED : BST_UNCHECKED, 0);
SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON2), BM_SETCHECK, options.iShowEvent2 > 0 ? BST_CHECKED : BST_UNCHECKED, 0);
-
-
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_RESETCONTENT, 0, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Do nothing"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Delete the contact"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Open User Details"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Open message window"));
+
+
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_RESETCONTENT, 0, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Do nothing"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Delete the contact"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Open User Details"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Open message window"));
SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_SETCURSEL, options.action2, 0);
return TRUE;
case WM_COMMAND:
- if ((HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == CBN_SELCHANGE)
+ if ((HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == CBN_SELCHANGE)
|| ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_ABSENCE), EM_GETMODIFY, 0, 0)))
|| ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_ABSENCE2), EM_GETMODIFY, 0, 0)))
|| ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_SILENTFOR), EM_GETMODIFY, 0, 0))))
@@ -260,7 +260,7 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, options.iShowPopUp2 = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP2), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0;
options.iShowEvent2 = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON2), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0;
-
+
options.action2 = (GoneContactAction)SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_GETCURSEL, 0, 0);
// save values to the DB
@@ -281,7 +281,7 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours
TimerProc(0, 0, 0, 0);
return TRUE;
- }
+ }
break;
}
}
@@ -296,8 +296,8 @@ static INT_PTR CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP static int ChangeLock = 0;
switch (uMsg)
{
- case WM_INITDIALOG:
-
+ case WM_INITDIALOG:
+
ChangeLock++;
TranslateDialogDefault(hwndDlg);
@@ -340,7 +340,7 @@ static INT_PTR CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_CUST), BM_SETCHECK, BST_CHECKED, 0);
SetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, options.iPopUpDelay, FALSE);
}
-
+
ChangeLock--;
return TRUE;
case WM_COMMAND:
@@ -348,7 +348,7 @@ static INT_PTR CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP {
POPUPDATAT ppd;
ZeroMemory(&ppd, sizeof(ppd));
-
+
//iPopUpDelay
options.iPopUpDelay = GetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 0, FALSE);
if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_GETCHECK, 0, 0) == BST_CHECKED)
@@ -365,7 +365,7 @@ static INT_PTR CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP TCHAR szPreviewText[50];
mir_sntprintf(szPreviewText,50,TranslateT("has returned after being absent since %d days"),rand() % 30);
_tcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
-
+
// Get current popups colors options
if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP))
{
@@ -385,10 +385,10 @@ static INT_PTR CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP ppd.iSeconds = options.iPopUpDelay;
CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NO_HISTORY);
-
+
_tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
- ppd.lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon");;
-
+ ppd.lchIcon = Skin_GetIcon("enabled_icon");;
+
CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NO_HISTORY);
}
else
@@ -435,21 +435,21 @@ static INT_PTR CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), true);
}
}
-
+
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);
@@ -461,7 +461,7 @@ static INT_PTR CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP 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 (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_GETCHECK, 0, 0) == BST_CHECKED)
@@ -477,7 +477,7 @@ static INT_PTR CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP SavePopupOptions();
return TRUE;
- }
+ }
break;
}
}
@@ -525,7 +525,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar {
/*
int status = DBGetContactSettingWord((HANDLE)lparam, MODULE_NAME, "LastStatus", ID_STATUS_OFFLINE);
- char *strptr = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)status, (LPARAM)0);
+ char *strptr = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)status, 0);
*/
_tcsftime(tmpBuf, 50, _T("%#x"), gmtime(&tmpTime));
SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, tmpBuf);
|