From 1f1f689001706b52fd57ce8e36680d82cf2c4ca4 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Thu, 29 Dec 2011 00:21:45 +1000 Subject: [PATCH] Stopped bookmarks selecting areas in disabled sessions --- daily.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/daily.cpp b/daily.cpp index 89523211..bb97b48a 100644 --- a/daily.cpp +++ b/daily.cpp @@ -1468,6 +1468,31 @@ void Daily::on_bookmarkTable_itemClicked(QTableWidgetItem *item) bool ok; st=it->data(Qt::UserRole).toLongLong(&ok); et=it->data(Qt::UserRole+1).toLongLong(&ok); + qint64 st2,et2,st3,et3; + Day * day=PROFILE.GetGoodDay(previous_date,MT_CPAP); + if (day) { + st2=day->first(); + et2=day->last(); + } + Day * oxi=PROFILE.GetGoodDay(previous_date,MT_OXIMETER); + if (oxi) { + st3=oxi->first(); + et3=oxi->last(); + } + if (oxi && day) { + st2=qMin(st2,st3); + et2=qMax(et2,et3); + } else if (oxi) { + st2=st3; + et2=et3; + } else if (!day) return; + if ((etet2)) { + mainwin->Notify("This bookmarked is in a currently disabled area.."); + return; + } + + if (stet2) et=et2; GraphView->SetXBounds(st,et); GraphView->redraw(); }