From 45358c3507af7d4bb32c031eaa25708905effa91 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 14 Mar 2013 21:05:30 +0000 Subject: old ansi popups removed, noone used them anyway git-svn-id: http://svn.miranda-ng.org/main/trunk@4034 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Alarms/src/alarmlist.cpp | 88 +++++++++++++++++++--------------------- plugins/Alarms/src/options.cpp | 4 +- 2 files changed, 44 insertions(+), 48 deletions(-) (limited to 'plugins/Alarms/src') 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; -- cgit v1.2.3