Start on last CPAP/Oximetery day, instead of journal day

This commit is contained in:
Mark Watkins 2014-09-30 01:43:00 +10:00
parent 429fcb64a1
commit be6e66bdd7

View File

@ -565,7 +565,11 @@ void Daily::ReloadGraphs()
d=previous_date; d=previous_date;
//Unload(d); //Unload(d);
} }
d=p_profile->LastDay(); QDate lastcpap = p_profile->LastDay(MT_CPAP);
QDate lastoxi = p_profile->LastDay(MT_OXIMETER);
d = qMax(lastcpap, lastoxi);
if (!d.isValid()) { if (!d.isValid()) {
d=ui->calendar->selectedDate(); d=ui->calendar->selectedDate();
} }
@ -722,7 +726,7 @@ void Daily::UpdateCalendarDay(QDate date)
oxicpap.setFontWeight(QFont::Bold); oxicpap.setFontWeight(QFont::Bold);
stageday.setForeground(QBrush(COLOR_Magenta, Qt::SolidPattern)); stageday.setForeground(QBrush(COLOR_Magenta, Qt::SolidPattern));
stageday.setFontWeight(QFont::Bold); stageday.setFontWeight(QFont::Bold);
jourday.setForeground(QBrush(COLOR_Black, Qt::SolidPattern)); jourday.setForeground(QBrush(COLOR_DarkYellow, Qt::SolidPattern));
jourday.setFontWeight(QFont::Bold); jourday.setFontWeight(QFont::Bold);
nodata.setForeground(QBrush(COLOR_Black, Qt::SolidPattern)); nodata.setForeground(QBrush(COLOR_Black, Qt::SolidPattern));
nodata.setFontWeight(QFont::Normal); nodata.setFontWeight(QFont::Normal);
@ -2127,8 +2131,13 @@ void Daily::on_calButton_toggled(bool checked)
void Daily::on_todayButton_clicked() void Daily::on_todayButton_clicked()
{ {
QDate d=QDate::currentDate(); // QDate d=QDate::currentDate();
if (d > p_profile->LastDay()) d=p_profile->LastDay(); // if (d > p_profile->LastDay()) {
QDate lastcpap = p_profile->LastDay(MT_CPAP);
QDate lastoxi = p_profile->LastDay(MT_OXIMETER);
QDate d = qMax(lastcpap, lastoxi);
// }
LoadDate(d); LoadDate(d);
} }