Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ T-Clock*.7z
_*
Static/
*.[0-9].*
/src/~ide/.vs/msvc-vs/v15
/.vs
12 changes: 12 additions & 0 deletions src/Clock/alarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,14 @@ time_t AlarmNextTimestamp() {
tm.tm_min = minute;
tm.tm_sec = 0;


if (api.GetInt(g_alarmkey, L"Once", 0) && api.GetInt(g_alarmkey, L"Day", 0) && api.GetInt(g_alarmkey, L"Month", 0)) {
int month = api.GetInt(g_alarmkey, L"Month", 0) - 1;
if (tm.tm_mon > month) ++tm.tm_year;
tm.tm_mday = api.GetInt(g_alarmkey, L"Day", 0);
tm.tm_mon = month;
}

return mktime(&tm);
}
void ReadAlarmFromReg(alarm_t* pAS, int idx)
Expand All @@ -298,6 +306,8 @@ void ReadAlarmFromReg(alarm_t* pAS, int idx)

pAS->hour = api.GetInt(g_alarmkey, L"Hour", 12) % 24;
pAS->minute = api.GetInt(g_alarmkey, L"Minute", 0);
pAS->day = api.GetInt(g_alarmkey, L"Day", 0);
pAS->month = api.GetInt(g_alarmkey, L"Month", 0);
pAS->days = api.GetInt(g_alarmkey, L"Days", 0);
pAS->iTimes = api.GetInt(g_alarmkey, L"Times", 1);

Expand All @@ -323,6 +333,8 @@ void SaveAlarmToReg(alarm_t* pAS, int idx)
api.SetStr(g_alarmkey, L"Name", pAS->dlgmsg.name);
api.SetInt(g_alarmkey, L"Hour", pAS->hour);
api.SetInt(g_alarmkey, L"Minute", pAS->minute);
api.SetInt(g_alarmkey, L"Day", pAS->day);
api.SetInt(g_alarmkey, L"Month", pAS->month);
if(pAS->fname[0] == '<')
pAS->fname[0] = '\0';
api.SetStr(g_alarmkey, L"File", pAS->fname);
Expand Down
22 changes: 20 additions & 2 deletions src/Clock/pagealarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,13 @@ INT_PTR CALLBACK Page_Alarm(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPara
EnableDlgItem(hDlg, IDC_SPINTIMES, checked);
}
/* fall through */
case IDC_ALRM_ONCE: {
int i;
for (i = IDC_LABDATEALARM; i <= IDC_SPINMONTH; ++i)
EnableDlgItem(hDlg, i, IsDlgButtonChecked(hDlg, IDC_ALRM_ONCE));
}
/* fall through */
// checked other checkboxes
case IDC_ALRM_ONCE:
case IDC_REPEATJIHOU:
case IDC_BLINKALARM:
case IDC_BLINKJIHOU:
Expand Down Expand Up @@ -361,6 +366,8 @@ void GetAlarmFromDlg(HWND hDlg, alarm_t* pAS) //------------------------------
pAS->hour = _12hTo24h(pAS->hour, IsDlgButtonChecked(hDlg,IDC_AMPM_CHECK));
pAS->minute = (int)SendDlgItemMessage(hDlg,IDC_SPINMINUTE,UDM_GETPOS32,0,0);
pAS->days = m_days;
pAS->day = (int)SendDlgItemMessage(hDlg,IDC_SPINDATE,UDM_GETPOS32,0,0);
pAS->month = (int)SendDlgItemMessage(hDlg,IDC_SPINMONTH,UDM_GETPOS32,0,0);

GetDlgItemText(hDlg, IDC_FILEALARM, pAS->fname, MAX_PATH);

Expand All @@ -375,6 +382,10 @@ void SetAlarmToDlg(HWND hDlg, alarm_t* pAS) //--------------------------------

SetDlgItemText(hDlg, IDC_COMBOALARM, pAS->dlgmsg.name);

SendDlgItemMessage(hDlg, IDC_SPINMONTH, UDM_SETRANGE32, 1, 12);
SendDlgItemMessage(hDlg, IDC_SPINMONTH, UDM_SETPOS32, 0, pAS->month);
SendDlgItemMessage(hDlg, IDC_SPINDATE, UDM_SETRANGE32, 1, 31);
SendDlgItemMessage(hDlg, IDC_SPINDATE, UDM_SETPOS32, 0, pAS->day);
SendDlgItemMessage(hDlg, IDC_SPINMINUTE, UDM_SETRANGE32, 0,59);
SendDlgItemMessage(hDlg, IDC_SPINMINUTE, UDM_SETPOS32, 0, pAS->minute);
SendDlgItemMessage(hDlg, IDC_SPINTIMES, UDM_SETRANGE32, (WPARAM)-1,42);
Expand Down Expand Up @@ -524,7 +535,7 @@ void OnAlarmJihou(HWND hDlg, WORD id)
enabled = IsDlgButtonChecked(hDlg, id);

if(id == IDC_ALARM) {
cstart = IDC_LABTIMEALARM; cend = IDC_MSG_ALARM;
cstart = IDC_LABTIMEALARM; cend = IDC_SPINMONTH;
if(enabled) {
int repeat=IsDlgButtonChecked(hDlg,IDC_REPEATALARM);
OnMsgAlarm(hDlg,IDC_MSG_ALARM);
Expand All @@ -540,6 +551,13 @@ void OnAlarmJihou(HWND hDlg, WORD id)

for(i=cstart; i<=cend; ++i)
EnableDlgItem(hDlg, i, enabled);


if (id == IDC_ALARM && enabled && !IsDlgButtonChecked(hDlg, IDC_ALRM_ONCE)) {
cstart = IDC_LABDATEALARM;
for (i = cstart; i <= cend; ++i)
EnableDlgItem(hDlg, i, !enabled);
}

if(id == IDC_ALARM){
OnFileChange(hDlg, IDC_FILEALARM);
Expand Down
30 changes: 18 additions & 12 deletions src/Clock/tClock.rc
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,24 @@ BEGIN
RTEXT "Name", IDC_STATIC, 9, 19, 35, 11, SS_RIGHT
COMBOBOX IDC_COMBOALARM, 48, 17, 114, 120, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWN
PUSHBUTTON "", IDC_DELALARM, 163, 17, 13, 13, BS_ICON
AUTOCHECKBOX "enabled", IDC_ALARM, 182, 19, 42, 11
RTEXT "Time", IDC_LABTIMEALARM, 9, 43, 35, 11, SS_RIGHT
EDITTEXT IDC_HOURALARM, 48, 41, 26, 13, ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "", IDC_SPINHOUR, UPDOWN_CLASS, UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_WRAP | UDS_AUTOBUDDY | UDS_SETBUDDYINT, 62, 41, 11, 12
CTEXT ":", IDC_LABCOLON, 75, 43, 8, 10, SS_CENTER
EDITTEXT IDC_MINUTEALARM, 84, 41, 26, 13, ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "", IDC_SPINMINUTE, UPDOWN_CLASS, UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_WRAP | UDS_AUTOBUDDY | UDS_SETBUDDYINT, 105, 68, 11, 12
CTEXT "AM", IDC_AMPM_DISPLAY, 114, 43, 29, 8, SS_CENTER
AUTOCHECKBOX "PM", IDC_AMPM_CHECK, 147, 43, 23, 8
AUTOCHECKBOX "12H", IDC_12HOURALARM, 174, 43, 27, 8
AUTOCHECKBOX "one-shot", IDC_ALRM_ONCE, 238, 20, 45, 8
PUSHBUTTON "Days...", IDC_ALARMDAY, 242, 32, 33, 14
AUTOCHECKBOX "enabled", IDC_ALARM, 182, 19, 38, 11
RTEXT "Date", IDC_LABDATEALARM, 29, 43, 15, 11, SS_RIGHT
EDITTEXT IDC_DATEALARM, 48, 41, 26, 13, ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "", IDC_SPINDATE, UPDOWN_CLASS, UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_WRAP | UDS_AUTOBUDDY | UDS_SETBUDDYINT, 54, 68, 11, 12
RTEXT "Month", IDC_LABMONTHALARM, 78, 43, 20, 11, SS_RIGHT
EDITTEXT IDC_MONTHALARM, 102, 41, 26, 13, ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "", IDC_SPINMONTH, UPDOWN_CLASS, UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_WRAP | UDS_AUTOBUDDY | UDS_SETBUDDYINT, 108, 68, 11, 12
RTEXT "Time", IDC_LABTIMEALARM, 140, 43, 17, 11, SS_RIGHT
EDITTEXT IDC_HOURALARM, 161, 41, 26, 13, ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "", IDC_SPINHOUR, UPDOWN_CLASS, UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_WRAP | UDS_AUTOBUDDY | UDS_SETBUDDYINT, 165, 41, 11, 12
CTEXT ":", IDC_LABCOLON, 188, 43, 6, 10, SS_CENTER
EDITTEXT IDC_MINUTEALARM, 194, 41, 25, 13, ES_CENTER | ES_AUTOHSCROLL | ES_NUMBER
CONTROL "", IDC_SPINMINUTE, UPDOWN_CLASS, UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_WRAP | UDS_AUTOBUDDY | UDS_SETBUDDYINT, 225, 68, 11, 12
LTEXT "AM", IDC_AMPM_DISPLAY, 222, 44, 27, 8, SS_LEFT
AUTOCHECKBOX "PM", IDC_AMPM_CHECK, 250, 44, 21, 8
AUTOCHECKBOX "12H", IDC_12HOURALARM, 272, 44, 24, 8
AUTOCHECKBOX "one-shot", IDC_ALRM_ONCE, 222, 20, 41, 8
PUSHBUTTON "Days...", IDC_ALARMDAY, 263, 17, 32, 14
RTEXT "Action", IDC_LABTIMEALARM_X, 9, 67, 35, 11, SS_RIGHT
COMBOBOX IDC_FILEALARM, 48, 65, 229, 120, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_HASSTRINGS
PUSHBUTTON "...", IDC_BROWSEALARM, 278, 65, 12, 12
Expand Down
2 changes: 2 additions & 0 deletions src/Clock/tclock.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ typedef struct alarm_t {
int days;
int hour;
int minute;
int day;
int month;
int iTimes;
dlgmsg_t dlgmsg;
unsigned char uFlags;
Expand Down
12 changes: 9 additions & 3 deletions src/common/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
#define IDC_COMBOALARM 1290
#define IDC_DELALARM 1291
#define IDC_ALARM 1300
#define IDC_LABTIMEALARM 1301 /* group */
#define IDC_LABTIMEALARM 1301/* group */
#define IDC_LABTIMEALARM_X 1302
#define IDC_HOURALARM 1303
#define IDC_SPINHOUR 1304
Expand All @@ -338,8 +338,14 @@
#define IDC_REPEATIMES 1320 /* group_2 */
#define IDC_SPINTIMES 1321 /* end group_2 */
#define IDC_ALRM_ONCE 1322
#define IDC_MSG_ALARM 1323 /* end group */
#define IDC_BMPJACK 1326
#define IDC_MSG_ALARM 1323
#define IDC_LABDATEALARM 1324 /* group_3 */
#define IDC_DATEALARM 1325
#define IDC_SPINDATE 1326
#define IDC_LABMONTHALARM 1327
#define IDC_MONTHALARM 1328
#define IDC_SPINMONTH 1329 /* end group *//* end group_3*/
#define IDC_BMPJACK 1360
#define IDC_JIHOU 1330
#define IDC_LABSOUNDJIHOU 1331 /* group */
#define IDC_FILEJIHOU 1332 /* group_1 */
Expand Down
46 changes: 23 additions & 23 deletions src/common/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,37 @@
# define VER_STATUS_FULL "RC"
# define VER_STATUS_SHORT "rc"
# define VER_STATUS_GREEK "\u0433c"
# define VER_REVISION 492
# define VER_REVISION 531
# define VER_FULL "2.4.4 RC"
# define VER_SHORT "2.4rc4"
# define VER_SHORT_DOTS "2.4.4"
# define VER_SHORT_GREEK "2.4\u0433c4"
# define VER_RC_REVISION 2, 4, 4, 492
# define VER_RC_REVISION 2, 4, 4, 531
# define VER_RC_STATUS 2, 4, 4, 2
/**** Subversion Information ****/
# define VER_REVISION_URL "git@github.com:White-Tiger/T-Clock.git"
# define VER_REVISION_DATE "2018-01-28 19:22:27 +0000 (Sun, Jan 28 2018)"
# define VER_REVISION_HASH "e89dfdb"
# define VER_REVISION_TAG "v2.4.4#492-rc"
# define VER_REVISION_URL "https://github.com/dfrunet/T-Clock"
# define VER_REVISION_DATE "2018-06-08 08:42:06 +0000 (Fri, Jun 08 2018)"
# define VER_REVISION_HASH "2eb7e2a"
# define VER_REVISION_TAG "v2.4.4#531-rc"
/**** Date/Time ****/
# define VER_TIMESTAMP 1517167741
# define VER_TIME_SEC 1
# define VER_TIME_MIN 29
# define VER_TIME_HOUR 19
# define VER_TIME_DAY 28
# define VER_TIME_MONTH 1
# define VER_TIMESTAMP 1538657278
# define VER_TIME_SEC 58
# define VER_TIME_MIN 47
# define VER_TIME_HOUR 12
# define VER_TIME_DAY 4
# define VER_TIME_MONTH 10
# define VER_TIME_YEAR 2018
# define VER_TIME_WDAY 0
# define VER_TIME_YDAY 27
# define VER_TIME_WDAY_SHORT "Sun"
# define VER_TIME_WDAY_FULL "Sunday"
# define VER_TIME_MONTH_SHORT "Jan"
# define VER_TIME_MONTH_FULL "January"
# define VER_TIME "19:29:01"
# define VER_DATE "2018-01-28"
# define VER_DATE_LONG "Sun, Jan 28, 2018 19:29:01 UTC"
# define VER_DATE_SHORT "2018-01-28 19:29:01 UTC"
# define VER_DATE_ISO "2018-01-28T19:29:01Z"
# define VER_TIME_WDAY 4
# define VER_TIME_YDAY 276
# define VER_TIME_WDAY_SHORT "Thu"
# define VER_TIME_WDAY_FULL "Thursday"
# define VER_TIME_MONTH_SHORT "Oct"
# define VER_TIME_MONTH_FULL "October"
# define VER_TIME "12:47:58"
# define VER_DATE "2018-10-04"
# define VER_DATE_LONG "Thu, Oct 04, 2018 12:47:58 UTC"
# define VER_DATE_SHORT "2018-10-04 12:47:58 UTC"
# define VER_DATE_ISO "2018-10-04T12:47:58Z"
/**** Helper 'functions' ****/
# define VER_IsReleaseOrHigher() ( VER_STATUS >= 3 )
# define VER_IsAlpha() ( VER_STATUS == 0 )
Expand Down