summaryrefslogtreecommitdiff
path: root/plugins/Alarms
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-14 21:05:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-14 21:05:30 +0000
commit45358c3507af7d4bb32c031eaa25708905effa91 (patch)
tree202fd149b18a39cfe6314f037421cf8d4fe2e842 /plugins/Alarms
parentae5bb5cc96d0f0add1d1189c2a3293daaea83d6f (diff)
old ansi popups removed, noone used them anyway
git-svn-id: http://svn.miranda-ng.org/main/trunk@4034 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Alarms')
-rw-r--r--plugins/Alarms/src/alarmlist.cpp88
-rw-r--r--plugins/Alarms/src/options.cpp4
2 files changed, 44 insertions, 48 deletions
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp
index 569f17d2f7..1e550be85d 100644
--- a/plugins/Alarms/src/alarmlist.cpp
+++ b/plugins/Alarms/src/alarmlist.cpp
@@ -473,80 +473,76 @@ void suspend(unsigned short alarm_id) {
static LRESULT CALLBACK PopupAlarmDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
- case WM_COMMAND: // snooze
- if (HIWORD(wParam) == STN_CLICKED) { //It was a click on the Popup.
- ALARM *mpd = NULL;
- mpd = (ALARM *)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd,(LPARAM)mpd);
+ case WM_COMMAND: // snooze
+ if (HIWORD(wParam) == STN_CLICKED) { //It was a click on the Popup.
+ ALARM *mpd = NULL;
+ mpd = (ALARM *)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd,(LPARAM)mpd);
- if (mpd->flags & ALF_NOSNOOZE)
- return TRUE;
+ if (mpd->flags & ALF_NOSNOOZE)
+ return TRUE;
- // add snooze minutes to current time
- FILETIME ft;
- GetLocalTime(&mpd->time);
- SystemTimeToFileTime(&mpd->time, &ft);
- ULARGE_INTEGER uli;
- uli.LowPart = ft.dwLowDateTime;
- uli.HighPart = ft.dwHighDateTime;
+ // add snooze minutes to current time
+ FILETIME ft;
+ GetLocalTime(&mpd->time);
+ SystemTimeToFileTime(&mpd->time, &ft);
+ ULARGE_INTEGER uli;
+ uli.LowPart = ft.dwLowDateTime;
+ uli.HighPart = ft.dwHighDateTime;
- uli.QuadPart += mult.QuadPart * options.snooze_minutes;
+ uli.QuadPart += mult.QuadPart * options.snooze_minutes;
- ft.dwHighDateTime = uli.HighPart;
- ft.dwLowDateTime = uli.LowPart;
+ ft.dwHighDateTime = uli.HighPart;
+ ft.dwLowDateTime = uli.LowPart;
- FileTimeToSystemTime(&ft, &mpd->time);
+ FileTimeToSystemTime(&ft, &mpd->time);
- mpd->occurrence = OC_ONCE;
- mpd->snoozer = true;
- mpd->flags = mpd->flags & ~(ALF_NOSTARTUP);
+ mpd->occurrence = OC_ONCE;
+ mpd->snoozer = true;
+ mpd->flags = mpd->flags & ~(ALF_NOSTARTUP);
- mpd->id = next_alarm_id++;
+ mpd->id = next_alarm_id++;
- append_to_list(mpd);
- }
+ append_to_list(mpd);
+ }
- PUDeletePopUp(hWnd);
- return TRUE;
- case WM_CONTEXTMENU:
- PUDeletePopUp(hWnd);
- return TRUE;
- case UM_FREEPLUGINDATA:
- {
- ALARM *mpd = NULL;
- mpd = (ALARM *)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd,(LPARAM)mpd);
- if (mpd > 0) {
- free_alarm_data(mpd);
- delete mpd;
- }
- return TRUE;
- }
- default:
- break;
+ PUDeletePopUp(hWnd);
+ return TRUE;
+
+ case WM_CONTEXTMENU:
+ PUDeletePopUp(hWnd);
+ return TRUE;
+
+ case UM_FREEPLUGINDATA:
+ ALARM *mpd = (ALARM *)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd,(LPARAM)mpd);
+ if (mpd > 0) {
+ free_alarm_data(mpd);
+ delete mpd;
+ }
+ return TRUE;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
-void ShowPopup(ALARM *alarm) {
- if (ServiceExists(MS_POPUP_ADDPOPUP)) {
+void ShowPopup(ALARM *alarm)
+{
+ if ( ServiceExists(MS_POPUP_ADDPOPUP)) {
ALARM *data = new ALARM;
memset(data, 0, sizeof(ALARM));
copy_alarm_data(data, alarm);
POPUPDATAT ppd = { 0 };
ppd.lchIcon = hIconMenuSet;
-
lstrcpyn(ppd.lptzContactName, data->szTitle, MAX_CONTACTNAME);
lstrcpyn(ppd.lptzText, data->szDesc, MAX_SECONDLINE);
ppd.PluginWindowProc = PopupAlarmDlgProc;
ppd.PluginData = data;
ppd.iSeconds = -1;
-
- //Now that every field has been filled, we want to see the popup.
PUAddPopUpT(&ppd);
}
}
-void DoAlarm(ALARM *alarm) {
+void DoAlarm(ALARM *alarm)
+{
ALARMINFO alarminfo;
alarminfo.szTitle = alarm->szTitle;
alarminfo.szDesc = alarm->szDesc;
diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp
index ff3ed3d855..3a263d4188 100644
--- a/plugins/Alarms/src/options.cpp
+++ b/plugins/Alarms/src/options.cpp
@@ -828,7 +828,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
EnableWindow(hw, FALSE);
}
- if (ServiceExists(MS_POPUP_ADDPOPUP)) {
+ if ( ServiceExists(MS_POPUP_ADDPOPUP)) {
CheckDlgButton(hwndDlg, IDC_CHK_POPUPS, temp_options.use_popup_module ? TRUE : FALSE);
if (options.use_popup_module) {
HWND hw = GetDlgItem(hwndDlg, IDC_CHK_LOOPSOUND);
@@ -1110,7 +1110,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
int reminder_period = GetDlgItemInt(hwndDlg, IDC_ED_PERIOD, &translated, FALSE);
if (translated) temp_options.reminder_period = reminder_period;
- if (!ServiceExists(MS_POPUP_ADDPOPUP) || !options.use_popup_module)
+ if ( !ServiceExists(MS_POPUP_ADDPOPUP) || !options.use_popup_module)
temp_options.loop_sound = IsDlgButtonChecked(hwndDlg, IDC_CHK_LOOPSOUND) ? true : false;
options = temp_options;