From 758762fbc91f2002a9e41957ca34a5d772d575f4 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 19 Dec 2016 06:04:51 +0300 Subject: plugins: alarms: added days of week. closes #318 --- plugins/Alarms/res/resource.rc | 73 ++++++++---- plugins/Alarms/src/alarmlist.cpp | 68 ++++++++++- plugins/Alarms/src/alarmlist.h | 6 +- plugins/Alarms/src/frame.cpp | 2 +- plugins/Alarms/src/options.cpp | 242 ++++++++++++++++++++++++++++++++++++++- plugins/Alarms/src/resource.h | 15 ++- plugins/Alarms/src/stdafx.h | 2 +- plugins/ExternalAPI/m_alarms.h | 10 ++ 8 files changed, 377 insertions(+), 41 deletions(-) mode change 100644 => 100755 plugins/Alarms/res/resource.rc mode change 100644 => 100755 plugins/Alarms/src/alarmlist.cpp mode change 100644 => 100755 plugins/Alarms/src/alarmlist.h mode change 100644 => 100755 plugins/Alarms/src/frame.cpp mode change 100644 => 100755 plugins/Alarms/src/options.cpp mode change 100644 => 100755 plugins/Alarms/src/resource.h mode change 100644 => 100755 plugins/Alarms/src/stdafx.h mode change 100644 => 100755 plugins/ExternalAPI/m_alarms.h diff --git a/plugins/Alarms/res/resource.rc b/plugins/Alarms/res/resource.rc old mode 100644 new mode 100755 index 13104dbf7e..32a34ebd7f --- a/plugins/Alarms/res/resource.rc +++ b/plugins/Alarms/res/resource.rc @@ -63,45 +63,53 @@ BEGIN PUSHBUTTON "Preview",IDC_BTN_PREVIEW,250,181,42,25 END -IDD_DIALOG2 DIALOGEX 0, 0, 381, 234 +IDD_DIALOG2 DIALOGEX 0, 0, 381, 249 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Alarm" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - DEFPUSHBUTTON "OK",IDOK,138,213,50,14 - PUSHBUTTON "Cancel",IDCANCEL,194,213,50,14 + DEFPUSHBUTTON "OK",IDOK,138,228,50,14 + PUSHBUTTON "Cancel",IDCANCEL,194,228,50,14 EDITTEXT IDC_TITLE,8,13,151,14,ES_AUTOHSCROLL LTEXT "Title:",IDC_STATIC,8,3,104,8 - EDITTEXT IDC_DESC,7,40,152,57,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN + EDITTEXT IDC_DESC,7,40,152,71,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN LTEXT "Description:",IDC_STATIC,8,30,96,8 - GROUPBOX "Actions",IDC_STATIC,7,100,367,88 - CONTROL "Popup window",IDC_CHK_APOPUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,110,119,10 - CONTROL "Sound:",IDC_CHK_ASOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,120,84,10 - CONTROL "Run command:",IDC_CHK_ACOMMAND,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,16,131,119,10 - LTEXT "Parameters:",IDC_STATIC,16,159,119,8 - EDITTEXT IDC_ED_COMMAND,16,143,351,14,ES_AUTOHSCROLL - EDITTEXT IDC_ED_PARAMS,16,169,351,14,ES_AUTOHSCROLL - CONTROL "Alert 1",IDC_RAD_SND1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,105,120,61,10 - CONTROL "Alert 2",IDC_RAD_SND2,"Button",BS_AUTORADIOBUTTON,171,120,61,10 - CONTROL "Alert 3",IDC_RAD_SND3,"Button",BS_AUTORADIOBUTTON,237,120,61,10 - CONTROL "Speak",IDC_RAD_SPK,"Button",BS_AUTORADIOBUTTON,303,120,61,10 + GROUPBOX "Actions",IDC_STATIC,7,116,367,88 + CONTROL "Popup window",IDC_CHK_APOPUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,126,119,10 + CONTROL "Sound:",IDC_CHK_ASOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,136,84,10 + CONTROL "Run command:",IDC_CHK_ACOMMAND,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,16,147,119,10 + LTEXT "Parameters:",IDC_STATIC,16,175,119,8 + EDITTEXT IDC_ED_COMMAND,16,159,351,14,ES_AUTOHSCROLL + EDITTEXT IDC_ED_PARAMS,16,185,351,14,ES_AUTOHSCROLL + CONTROL "Alert 1",IDC_RAD_SND1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,105,136,61,10 + CONTROL "Alert 2",IDC_RAD_SND2,"Button",BS_AUTORADIOBUTTON,171,136,61,10 + CONTROL "Alert 3",IDC_RAD_SND3,"Button",BS_AUTORADIOBUTTON,237,136,61,10 + CONTROL "Speak",IDC_RAD_SPK,"Button",BS_AUTORADIOBUTTON,303,136,61,10 CONTROL "DateTimePicker1",IDC_TIME,"SysDateTimePick32",DTS_RIGHTALIGN | DTS_UPDOWN | WS_TABSTOP | 0x8,174,19,55,13 - GROUPBOX "Occurrence",IDC_STATIC,305,9,69,88 + GROUPBOX "Occurrence",IDC_STATIC,305,9,69,100 CONTROL "Once",IDC_RAD_ONCE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,311,19,58,10 - CONTROL "Weekly",IDC_RAD_WEEKLY,"Button",BS_AUTORADIOBUTTON,311,45,58,10 + CONTROL "Weekly",IDC_RAD_WEEKLY,"Button",BS_AUTORADIOBUTTON,311,69,58,10 CONTROL "Daily",IDC_RAD_DAILY,"Button",BS_AUTORADIOBUTTON,311,32,58,10 CONTROL "Weekdays",IDC_RAD_WEEKDAYS,"Button",BS_AUTORADIOBUTTON,311,58,58,10 - CONTROL "Monthly",IDC_RAD_MONTHLY,"Button",BS_AUTORADIOBUTTON,311,71,58,10 - CONTROL "Yearly",IDC_RAD_YEARLY,"Button",BS_AUTORADIOBUTTON,311,84,58,10 + CONTROL "Monthly",IDC_RAD_MONTHLY,"Button",BS_AUTORADIOBUTTON,311,80,58,10 + CONTROL "Yearly",IDC_RAD_YEARLY,"Button",BS_AUTORADIOBUTTON,311,92,58,10 COMBOBOX IDC_DAY,231,36,64,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "i'm hiding",IDC_CHK_INVIS,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,113,28,45,10 COMBOBOX IDC_DAYNUM,174,36,48,61,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Date and time",IDC_STATIC,167,9,134,88 + GROUPBOX "Date and time",IDC_STATIC,167,9,134,100 EDITTEXT IDC_RELMIN,238,19,57,13,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER - CONTROL "Disable next occurrence",IDC_CHK_SUSPEND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,192,128,10 - CONTROL "Don't trigger on startup",IDC_CHK_NOSTARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,147,192,113,10 - CONTROL "No reminder",IDC_CHK_NOREMINDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,263,192,110,10 + CONTROL "Disable next occurrence",IDC_CHK_SUSPEND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,209,128,10 + CONTROL "Don't trigger on startup",IDC_CHK_NOSTARTUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,141,209,113,10 + CONTROL "No reminder",IDC_CHK_NOREMINDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,264,209,110,10 CONTROL "",IDC_DATE,"SysDateTimePick32",DTS_RIGHTALIGN | WS_TABSTOP,185,65,100,15 + CONTROL "Selected Days",IDC_RAD_DAYS,"Button",BS_AUTORADIOBUTTON,311,46,61,10 + CONTROL "1",IDC_CHK_DAY1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,87,20,10 + CONTROL "2",IDC_CHK_DAY2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,189,87,20,10 + CONTROL "3",IDC_CHK_DAY3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,208,87,20,10 + CONTROL "4",IDC_CHK_DAY4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,227,87,20,10 + CONTROL "5",IDC_CHK_DAY5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,97,20,10 + CONTROL "6",IDC_CHK_DAY6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,190,98,20,10 + CONTROL "7",IDC_CHK_DAY7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,98,20,10 END IDD_ALARM DIALOGEX 0, 0, 185, 82 @@ -138,7 +146,8 @@ BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 374 TOPMARGIN, 7 - BOTTOMMARGIN, 227 + BOTTOMMARGIN, 242 + HORZGUIDE, 219 END IDD_ALARM, DIALOG @@ -184,11 +193,16 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_MAINMENU ICON "clock.ico" + IDI_LIST1 ICON "green.ico" + IDI_LIST2 ICON "yellow.ico" + IDI_TBUP ICON "iconttbup.ico" + IDI_TBDN ICON "iconttbdown.ico" + ///////////////////////////////////////////////////////////////////////////// // // Menu @@ -208,6 +222,17 @@ BEGIN END END + +///////////////////////////////////////////////////////////////////////////// +// +// AFX_DIALOG_LAYOUT +// + +IDD_DIALOG2 AFX_DIALOG_LAYOUT +BEGIN + 0 +END + #endif // English (Australia) resources ///////////////////////////////////////////////////////////////////////////// diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp old mode 100644 new mode 100755 index cc41317231..05154d5d46 --- a/plugins/Alarms/src/alarmlist.cpp +++ b/plugins/Alarms/src/alarmlist.cpp @@ -27,6 +27,7 @@ void free_alarm_data(ALARM *alarm) { void copy_alarm_data(ALARM *dest, ALARM *src) { dest->action = src->action; dest->flags = src->flags; + dest->day_mask = src->day_mask; dest->id = src->id; dest->occurrence = src->occurrence; dest->snoozer = src->snoozer; @@ -45,8 +46,8 @@ void GetPluginTime(SYSTEMTIME *t) { *t = last_check; } -int MinutesInFuture(SYSTEMTIME time, Occurrence occ) { - if (!UpdateAlarm(time, occ)) return 0; +int MinutesInFuture(SYSTEMTIME time, Occurrence occ, int selected_days) { + if (!UpdateAlarm(time, occ, selected_days)) return 0; SYSTEMTIME now; GetPluginTime(&now); @@ -87,7 +88,40 @@ void TimeForMinutesInFuture(int mins, SYSTEMTIME *time) { // update an alarm so that the systemtime reflects the next time the alarm will go off, based on the last_check time -bool UpdateAlarm(SYSTEMTIME &time, Occurrence occ) { + +bool is_day_selected(int day, int selected_days) +{ + switch (day) + { + case 0: + return selected_days & ALDF_7; + break; + case 1: + return selected_days & ALDF_1; + break; + case 2: + return selected_days & ALDF_2; + break; + case 3: + return selected_days & ALDF_3; + break; + case 4: + return selected_days & ALDF_4; + break; + case 5: + return selected_days & ALDF_5; + break; + case 6: + return selected_days & ALDF_6; + break; + default: + return false; + } + +// return false; +} + +bool UpdateAlarm(SYSTEMTIME &time, Occurrence occ, int selected_days) { FILETIME ft_now, ft_then; ULARGE_INTEGER uli_then; @@ -96,6 +130,7 @@ bool UpdateAlarm(SYSTEMTIME &time, Occurrence occ) { case OC_DAILY: case OC_WEEKDAYS: case OC_WEEKLY: + case OC_SELECTED_DAYS: time.wDay = last_check.wDay; case OC_MONTHLY: time.wMonth = last_check.wMonth; @@ -160,6 +195,24 @@ bool UpdateAlarm(SYSTEMTIME &time, Occurrence occ) { } while(temp.wDayOfWeek == 0 || temp.wDayOfWeek == 6 || CompareFileTime(&ft_then, &ft_now) < 0); } break; + case OC_SELECTED_DAYS: //////TODO::::: + { + SYSTEMTIME temp; + uli_then.HighPart = ft_then.dwHighDateTime; + uli_then.LowPart = ft_then.dwLowDateTime; + FileTimeToSystemTime(&ft_now, &temp); + int day = temp.wDayOfWeek; + while (CompareFileTime(&ft_then, &ft_now) < 0 || (selected_days && !is_day_selected(day, selected_days))) { + uli_then.QuadPart += mult.QuadPart * (ULONGLONG)24 * (ULONGLONG)60; + ft_then.dwHighDateTime = uli_then.HighPart; + ft_then.dwLowDateTime = uli_then.LowPart; + if (day < 7) + day++; + else + day = 0; + } + } + break; case OC_DAILY: uli_then.HighPart = ft_then.dwHighDateTime; uli_then.LowPart = ft_then.dwLowDateTime; @@ -239,7 +292,7 @@ void LoadAlarms() { break; } - if (UpdateAlarm(alarm.time, alarm.occurrence)) { + if (UpdateAlarm(alarm.time, alarm.occurrence, alarm.day_mask)) { mir_snprintf(buff, "ActionFlags%d", i); alarm.action = (unsigned short)db_get_dw(0, MODULE, buff, AAF_POPUP | AAF_SOUND); if (alarm.action & AAF_COMMAND) { @@ -273,6 +326,9 @@ void LoadAlarms() { mir_snprintf(buff, "Flags%d", i); alarm.flags = db_get_dw(0, MODULE, buff, alarm.flags); + mir_snprintf(buff, "SelectedDays%d", i); + alarm.flags = db_get_dw(0, MODULE, buff, alarm.day_mask); + alarm.id = next_alarm_id++; alarms.push_back(&alarm); } @@ -344,6 +400,8 @@ void SaveAlarms() { mir_snprintf(buff, "Flags%d", index); db_set_dw(0, MODULE, buff, i->flags); + mir_snprintf(buff, "SelectedDays%d", index); + db_set_dw(0, MODULE, buff, i->day_mask); } db_set_w(0, MODULE, "Count", index); } @@ -580,7 +638,7 @@ void CheckAlarms() { mir_cslock lck(alarm_cs); ALARM *i; for(alarms.reset(); i = alarms.current(); alarms.next()) { - if (!UpdateAlarm(i->time, i->occurrence)) { + if (!UpdateAlarm(i->time, i->occurrence, i->day_mask)) { // somehow an expired one-off alarm is in our list remove_list.push_back(i); continue; diff --git a/plugins/Alarms/src/alarmlist.h b/plugins/Alarms/src/alarmlist.h old mode 100644 new mode 100755 index af8e90b666..a18b8a4aa1 --- a/plugins/Alarms/src/alarmlist.h +++ b/plugins/Alarms/src/alarmlist.h @@ -11,11 +11,11 @@ void free_alarm_data(ALARM *alarm); void copy_alarm_data(ALARM *dest, ALARM *src); -int MinutesInFuture(SYSTEMTIME time, Occurrence occ); +int MinutesInFuture(SYSTEMTIME time, Occurrence occ, int selected_days = 0); void TimeForMinutesInFuture(int mins, SYSTEMTIME *time); static bool operator<(const ALARM &a1, const ALARM &a2) { - return MinutesInFuture(a1.time, a1.occurrence) < MinutesInFuture(a2.time, a2.occurrence); // less-than inverted 'cause we want ascending order + return MinutesInFuture(a1.time, a1.occurrence, a1.day_mask) < MinutesInFuture(a2.time, a2.occurrence, a2.day_mask); // less-than inverted 'cause we want ascending order } class AlarmList { @@ -138,7 +138,7 @@ void suspend(unsigned short alarm_id); void GetPluginTime(SYSTEMTIME *t); // increase 'time' to next occurrence -bool UpdateAlarm(SYSTEMTIME &time, Occurrence occ); +bool UpdateAlarm(SYSTEMTIME &time, Occurrence occ, int selected_days = 0); const ULARGE_INTEGER mult = { 600000000, 0}; // number of 100 microsecond blocks in a minute diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp old mode 100644 new mode 100755 index 6df1829178..96d464ff8d --- a/plugins/Alarms/src/frame.cpp +++ b/plugins/Alarms/src/frame.cpp @@ -124,7 +124,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar RECT r; GetClientRect(hwnd, &r); - int min = MinutesInFuture(alarm.time, alarm.occurrence); + int min = MinutesInFuture(alarm.time, alarm.occurrence, alarm.day_mask); FillRect(dis->hDC, &dis->rcItem, bk_brush); diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp old mode 100644 new mode 100755 index f7cdda24b8..fd51a07bc6 --- a/plugins/Alarms/src/options.cpp +++ b/plugins/Alarms/src/options.cpp @@ -45,6 +45,14 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP for (int i = 1; i <= 31; i++) SendDlgItemMessage(hwndDlg, IDC_DAYNUM, CB_INSERTSTRING, (WPARAM)-1, (LPARAM)_itow(i, buff, 10)); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), FALSE); + SendDlgItemMessage(hwndDlg, IDC_DAYNUM, CB_SETCURSEL, 0, 0); EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE); @@ -86,6 +94,34 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_DAY), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_DAYNUM), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SUSPEND), TRUE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), FALSE); + + break; + + case OC_SELECTED_DAYS: + CheckDlgButton(hwndDlg, IDC_RAD_DAYS, BST_CHECKED); + EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_CAL), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_DATE), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_DAY), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_DAYNUM), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_RELMIN), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SUSPEND), TRUE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), TRUE); + break; case OC_WEEKDAYS: @@ -96,6 +132,15 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_DAYNUM), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_RELMIN), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SUSPEND), TRUE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), FALSE); + break; case OC_ONCE: @@ -103,6 +148,15 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_DAY), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_DAYNUM), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SUSPEND), FALSE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), FALSE); + break; case OC_WEEKLY: @@ -112,6 +166,15 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_DAYNUM), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_RELMIN), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SUSPEND), TRUE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), FALSE); + break; case OC_MONTHLY: @@ -121,6 +184,15 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_DAY), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_RELMIN), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SUSPEND), TRUE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), FALSE); + break; case OC_YEARLY: @@ -128,8 +200,32 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_DAY), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_DAYNUM), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SUSPEND), TRUE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), FALSE); + break; } + if (add_edit_alarm->day_mask & ALDF_1) + CheckDlgButton(hwndDlg, IDC_CHK_DAY1, TRUE); + if (add_edit_alarm->day_mask & ALDF_2) + CheckDlgButton(hwndDlg, IDC_CHK_DAY2, TRUE); + if (add_edit_alarm->day_mask & ALDF_3) + CheckDlgButton(hwndDlg, IDC_CHK_DAY3, TRUE); + if (add_edit_alarm->day_mask & ALDF_4) + CheckDlgButton(hwndDlg, IDC_CHK_DAY4, TRUE); + if (add_edit_alarm->day_mask & ALDF_5) + CheckDlgButton(hwndDlg, IDC_CHK_DAY5, TRUE); + if (add_edit_alarm->day_mask & ALDF_6) + CheckDlgButton(hwndDlg, IDC_CHK_DAY6, TRUE); + if (add_edit_alarm->day_mask & ALDF_7) + CheckDlgButton(hwndDlg, IDC_CHK_DAY7, TRUE); + CheckDlgButton(hwndDlg, IDC_CHK_SUSPEND, (add_edit_alarm->flags & ALF_SUSPENDED) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_CHK_NOSTARTUP, (add_edit_alarm->flags & ALF_NOSTARTUP) ? BST_CHECKED : BST_UNCHECKED); @@ -139,7 +235,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_TIME, DTM_SETSYSTEMTIME, (WPARAM)GDT_VALID, (LPARAM)&add_edit_alarm->time); SendDlgItemMessage(hwndDlg, IDC_DATE, DTM_SETSYSTEMTIME, (WPARAM)GDT_VALID, (LPARAM)&add_edit_alarm->time); SendDlgItemMessage(hwndDlg, IDC_DAYNUM, CB_SETCURSEL, add_edit_alarm->time.wDay - 1, 0); - SetDlgItemInt(hwndDlg, IDC_RELMIN, MinutesInFuture(add_edit_alarm->time, add_edit_alarm->occurrence), FALSE); + SetDlgItemInt(hwndDlg, IDC_RELMIN, MinutesInFuture(add_edit_alarm->time, add_edit_alarm->occurrence, add_edit_alarm->day_mask), FALSE); if (add_edit_alarm->action & AAF_SOUND) { CheckDlgButton(hwndDlg, IDC_CHK_ASOUND, BST_CHECKED); @@ -211,6 +307,8 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP add_edit_alarm->occurrence = OC_ONCE; else if (IsDlgButtonChecked(hwndDlg, IDC_RAD_DAILY)) add_edit_alarm->occurrence = OC_DAILY; + else if(IsDlgButtonChecked(hwndDlg, IDC_RAD_DAYS)) + add_edit_alarm->occurrence = OC_SELECTED_DAYS; else if (IsDlgButtonChecked(hwndDlg, IDC_RAD_WEEKDAYS)) add_edit_alarm->occurrence = OC_WEEKDAYS; else if (IsDlgButtonChecked(hwndDlg, IDC_RAD_WEEKLY)) @@ -227,6 +325,35 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_DATE, DTM_SETRANGE, (WPARAM)(GDTR_MIN | GDTR_MAX), (LPARAM)r); } + if (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAY1)) + add_edit_alarm->day_mask |= ALDF_1; + else + add_edit_alarm->day_mask &= ~ALDF_1; + if (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAY2)) + add_edit_alarm->day_mask |= ALDF_2; + else + add_edit_alarm->day_mask &= ~ALDF_2; + if (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAY3)) + add_edit_alarm->day_mask |= ALDF_3; + else + add_edit_alarm->day_mask &= ~ALDF_3; + if (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAY4)) + add_edit_alarm->day_mask |= ALDF_4; + else + add_edit_alarm->day_mask &= ~ALDF_4; + if (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAY5)) + add_edit_alarm->day_mask |= ALDF_5; + else + add_edit_alarm->day_mask &= ~ALDF_5; + if (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAY6)) + add_edit_alarm->day_mask |= ALDF_6; + else + add_edit_alarm->day_mask &= ~ALDF_6; + if (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAY7)) + add_edit_alarm->day_mask |= ALDF_7; + else + add_edit_alarm->day_mask &= ~ALDF_7; + if (add_edit_alarm->occurrence == OC_ONCE || add_edit_alarm->occurrence == OC_YEARLY) SendDlgItemMessage(hwndDlg, IDC_DATE, DTM_GETSYSTEMTIME, 0, (LPARAM)&add_edit_alarm->time); @@ -241,7 +368,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP add_edit_alarm->time.wMinute = temp_time.wMinute; add_edit_alarm->time.wSecond = temp_time.wSecond; - UpdateAlarm(add_edit_alarm->time, add_edit_alarm->occurrence); + UpdateAlarm(add_edit_alarm->time, add_edit_alarm->occurrence, add_edit_alarm->day_mask); return TRUE; case WMU_SETTIME: @@ -252,7 +379,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_DAY, CB_SETCURSEL, add_edit_alarm->time.wDayOfWeek, 0); SendDlgItemMessage(hwndDlg, IDC_TIME, DTM_SETSYSTEMTIME, (WPARAM)GDT_VALID, (LPARAM)&add_edit_alarm->time); SendDlgItemMessage(hwndDlg, IDC_DAYNUM, CB_SETCURSEL, add_edit_alarm->time.wDay - 1, 0); - SetDlgItemInt(hwndDlg, IDC_RELMIN, MinutesInFuture(add_edit_alarm->time, add_edit_alarm->occurrence), FALSE); + SetDlgItemInt(hwndDlg, IDC_RELMIN, MinutesInFuture(add_edit_alarm->time, add_edit_alarm->occurrence, add_edit_alarm->day_mask), FALSE); return TRUE; case WM_NOTIFY: @@ -325,6 +452,15 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_DAYNUM), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_RELMIN), TRUE); EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SUSPEND), FALSE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), FALSE); + SendMessage(hwndDlg, WMU_UPDATETIME, 0, 0); SendMessage(hwndDlg, WMU_SETTIME, 0, 0); break; @@ -337,6 +473,15 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_DAYNUM), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_RELMIN), TRUE); EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SUSPEND), TRUE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), FALSE); + SendMessage(hwndDlg, WMU_UPDATETIME, 0, 0); SendMessage(hwndDlg, WMU_SETTIME, 0, 0); break; @@ -349,6 +494,15 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_DAYNUM), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_RELMIN), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SUSPEND), TRUE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), FALSE); + SendMessage(hwndDlg, WMU_UPDATETIME, 0, 0); SendMessage(hwndDlg, WMU_SETTIME, 0, 0); break; @@ -361,6 +515,15 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_DAYNUM), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_RELMIN), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SUSPEND), TRUE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), FALSE); + SendMessage(hwndDlg, WMU_UPDATETIME, 0, 0); SendMessage(hwndDlg, WMU_SETTIME, 0, 0); break; @@ -373,6 +536,15 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_DAYNUM), TRUE); EnableWindow(GetDlgItem(hwndDlg, IDC_RELMIN), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SUSPEND), TRUE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), FALSE); + SendMessage(hwndDlg, WMU_UPDATETIME, 0, 0); SendMessage(hwndDlg, WMU_SETTIME, 0, 0); break; @@ -385,6 +557,36 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP EnableWindow(GetDlgItem(hwndDlg, IDC_DAYNUM), FALSE); EnableWindow(GetDlgItem(hwndDlg, IDC_RELMIN), TRUE); EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SUSPEND), TRUE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), FALSE); + + SendMessage(hwndDlg, WMU_UPDATETIME, 0, 0); + SendMessage(hwndDlg, WMU_SETTIME, 0, 0); + break; + + case IDC_RAD_DAYS: + EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_CAL), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_DATE), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_DAY), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_DAYNUM), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_RELMIN), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_SUSPEND), TRUE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY1), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY2), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY3), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY4), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY5), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY6), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHK_DAY7), TRUE); + SendMessage(hwndDlg, WMU_UPDATETIME, 0, 0); SendMessage(hwndDlg, WMU_SETTIME, 0, 0); break; @@ -429,7 +631,38 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendMessage(hwndDlg, WMU_UPDATETIME, 0, 0); - if (!UpdateAlarm(add_edit_alarm->time, add_edit_alarm->occurrence)) { + if (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAY1)) + add_edit_alarm->day_mask |= ALDF_1; + else + add_edit_alarm->day_mask &= ~ALDF_1; + if (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAY2)) + add_edit_alarm->day_mask |= ALDF_2; + else + add_edit_alarm->day_mask &= ~ALDF_2; + if (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAY3)) + add_edit_alarm->day_mask |= ALDF_3; + else + add_edit_alarm->day_mask &= ~ALDF_3; + if (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAY4)) + add_edit_alarm->day_mask |= ALDF_4; + else + add_edit_alarm->day_mask &= ~ALDF_4; + if (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAY5)) + add_edit_alarm->day_mask |= ALDF_5; + else + add_edit_alarm->day_mask &= ~ALDF_5; + if (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAY6)) + add_edit_alarm->day_mask |= ALDF_6; + else + add_edit_alarm->day_mask &= ~ALDF_6; + if (IsDlgButtonChecked(hwndDlg, IDC_CHK_DAY7)) + add_edit_alarm->day_mask |= ALDF_7; + else + add_edit_alarm->day_mask &= ~ALDF_7; + + + + if (!UpdateAlarm(add_edit_alarm->time, add_edit_alarm->occurrence, add_edit_alarm->day_mask)) { MessageBox(hwndDlg, TranslateT("The alarm time you have selected is in the past."), TranslateT("Error"), MB_OK | MB_ICONERROR); return TRUE; } @@ -445,6 +678,7 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP add_edit_alarm->flags |= IsDlgButtonChecked(hwndDlg, IDC_CHK_NOSTARTUP) ? ALF_NOSTARTUP : 0; add_edit_alarm->flags |= IsDlgButtonChecked(hwndDlg, IDC_CHK_NOREMINDER) ? ALF_NOREMINDER : 0; + if (add_edit_alarm->action & AAF_COMMAND) { GetDlgItemText(hwndDlg, IDC_ED_COMMAND, buff, _countof(buff)); replaceStrW(add_edit_alarm->szCommand, buff); diff --git a/plugins/Alarms/src/resource.h b/plugins/Alarms/src/resource.h old mode 100644 new mode 100755 index 924503bbd9..790f66e72b --- a/plugins/Alarms/src/resource.h +++ b/plugins/Alarms/src/resource.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. -// Used by ..\res\resource.rc +// Used by X:\install\git\miranda\miranda-ng\plugins\Alarms\res\resource.rc // #define IDD_DIALOG1 101 #define IDD_OPT1 102 @@ -70,6 +70,15 @@ #define IDC_CHK_LOOPSOUND 1065 #define IDC_ED_DESC 1066 #define IDC_DATE 1071 +#define IDC_RAD_DAYS 1072 +#define IDC_CHK_DAY1 1073 +#define IDC_CHK_DAY2 1074 +#define IDC_CHK_DAY3 1075 +#define IDC_CHK_DAY4 1076 +#define IDC_CHK_DAY5 1077 +#define IDC_CHK_DAY6 1078 +#define IDC_CHECK7 1079 +#define IDC_CHK_DAY7 1079 #define ID_REMINDERFRAMECONTEXT_SUSPEND 40003 #define ID_REMINDERFRAMECONTEXT_EDIT 40004 #define ID_REMINDERFRAMECONTEXT_DELETE 40005 @@ -80,9 +89,9 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 127 +#define _APS_NEXT_RESOURCE_VALUE 128 #define _APS_NEXT_COMMAND_VALUE 40008 -#define _APS_NEXT_CONTROL_VALUE 1072 +#define _APS_NEXT_CONTROL_VALUE 1080 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/plugins/Alarms/src/stdafx.h b/plugins/Alarms/src/stdafx.h old mode 100644 new mode 100755 index c9d5be5729..fcbd50182a --- a/plugins/Alarms/src/stdafx.h +++ b/plugins/Alarms/src/stdafx.h @@ -44,7 +44,7 @@ typedef struct ALARM_tag { wchar_t *szCommand; wchar_t *szCommandParams; BYTE sound_num; - int flags; + int flags, day_mask; } ALARM; #endif diff --git a/plugins/ExternalAPI/m_alarms.h b/plugins/ExternalAPI/m_alarms.h old mode 100644 new mode 100755 index 82b376af86..83360901a2 --- a/plugins/ExternalAPI/m_alarms.h +++ b/plugins/ExternalAPI/m_alarms.h @@ -10,6 +10,7 @@ typedef enum { OC_ONCE, // all fields in time (see below) are valid OC_DAILY, // only wHour, wMinute, and wSecond are valid + OC_SELECTED_DAYS, // only wHour, wMinute, and wSecond are valid OC_WEEKLY, // wHour, wMinute, wSecond, and wDayOfWeek are valid OC_WEEKDAYS, // only wHour, wMinute, and wSecond are valid OC_MONTHLY, // wHour, wMinute, wSecond, and wDay are valid @@ -23,6 +24,15 @@ typedef enum { #define ALF_NOSTARTUP 0x08 // do not trigger on startup if it was due when miranda was not running #define ALF_NOSNOOZE 0x10 // do not allow snoozing of this alarm +//day flags +#define ALDF_1 0x01 +#define ALDF_2 0x02 +#define ALDF_3 0x04 +#define ALDF_4 0x08 +#define ALDF_5 0x10 +#define ALDF_6 0x20 +#define ALDF_7 0x40 + typedef struct { TCHAR *szTitle; TCHAR *szDesc; -- cgit v1.2.3