From 4efdd531337b74d819a40c87c454a0fa1f6ca838 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Wed, 28 Dec 2016 10:17:05 +0300 Subject: plugins: alarms: "selected days" mode db write/load fix, ui fix --- plugins/Alarms/src/alarmlist.cpp | 13 ++++++++----- plugins/Alarms/src/options.cpp | 3 +++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp index 6988f436f6..d9bb0ed360 100755 --- a/plugins/Alarms/src/alarmlist.cpp +++ b/plugins/Alarms/src/alarmlist.cpp @@ -279,6 +279,10 @@ void LoadAlarms() break; case OC_WEEKDAYS: break; + case OC_SELECTED_DAYS: + mir_snprintf(buff, "SelectedDays%d", i); + alarm.day_mask = db_get_dw(0, MODULE, buff, alarm.day_mask); + break; case OC_DAILY: break; case OC_MONTHLY: @@ -327,9 +331,6 @@ 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); } @@ -365,6 +366,10 @@ void SaveAlarms() break; case OC_WEEKDAYS: break; + case OC_SELECTED_DAYS: + mir_snprintf(buff, "SelectedDays%d", index); + db_set_dw(0, MODULE, buff, i->day_mask); + break; case OC_WEEKLY: mir_snprintf(buff, "STDayOfWeek%d", index); db_set_w(0, MODULE, buff, i->time.wDayOfWeek); @@ -402,8 +407,6 @@ 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); } diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp index 381e38b674..dbc5cf3dcc 100755 --- a/plugins/Alarms/src/options.cpp +++ b/plugins/Alarms/src/options.cpp @@ -591,6 +591,9 @@ static INT_PTR CALLBACK DlgProcAddEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendMessage(hwndDlg, WMU_UPDATETIME, 0, 0); SendMessage(hwndDlg, WMU_SETTIME, 0, 0); break; + case IDC_CHK_DAY1: case IDC_CHK_DAY2: case IDC_CHK_DAY3: case IDC_CHK_DAY4: case IDC_CHK_DAY5: case IDC_CHK_DAY6: case IDC_CHK_DAY7: + EnableWindow(GetDlgItem(hwndDlg, IDOK), TRUE); + break; case IDC_CHK_ACOMMAND: bChecked = IsDlgButtonChecked(hwndDlg, IDC_CHK_ACOMMAND) != 0; -- cgit v1.2.3