From 078332bae1263ebc9419ab7a818e1d727406beab Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 29 Jul 2014 16:34:57 -0300 Subject: Change the Ruler text values when metric system changes. "ups", as I did this in Metric system I forgot to update to imperial when the user selected it. Fixes #665 Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/divecartesianaxis.cpp | 29 +++++++++++------------------ qt-ui/profile/divecartesianaxis.h | 3 --- qt-ui/profile/profilewidget2.cpp | 1 - 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/qt-ui/profile/divecartesianaxis.cpp b/qt-ui/profile/divecartesianaxis.cpp index f5123ae9e..be3e313f0 100644 --- a/qt-ui/profile/divecartesianaxis.cpp +++ b/qt-ui/profile/divecartesianaxis.cpp @@ -308,9 +308,9 @@ qreal DiveCartesianAxis::posAtValue(qreal value) double retValue = realSize * percent; double adjusted = orientation == LeftToRight ? retValue + m.x1() + p.x() : - orientation == RightToLeft ? retValue + m.x1() + p.x() : - orientation == TopToBottom ? retValue + m.y1() + p.y() : - /* entation == BottomToTop */ retValue + m.y1() + p.y(); + orientation == RightToLeft ? retValue + m.x1() + p.x() : + orientation == TopToBottom ? retValue + m.y1() + p.y() : + /* entation == BottomToTop */ retValue + m.y1() + p.y(); return adjusted; } @@ -365,28 +365,21 @@ static bool isPPGraphEnabled() return prefs.pp_graphs.po2 || prefs.pp_graphs.pn2 || prefs.pp_graphs.phe; } -DepthAxis::DepthAxis() : showWithPPGraph(false) +DepthAxis::DepthAxis() { connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); - - // force the correct size of the line. - showWithPPGraph = !isPPGraphEnabled(); + changed = true; settingsChanged(); } void DepthAxis::settingsChanged() { - // bool ppGraph = isPPGraphEnabled(); - // if ( ppGraph == showWithPPGraph){ - // return; - // } - // - // if (ppGraph) { - // animateChangeLine(shrinkedLine); - // } else { - // animateChangeLine(expandedLine); - // } - // showWithPPGraph = ppGraph; + static int unitSystem = prefs.units.length; + if ( unitSystem == prefs.units.length ) + return; + changed = true; + updateTicks(); + unitSystem = prefs.units.length; } QColor TimeAxis::colorForValue(double value) diff --git a/qt-ui/profile/divecartesianaxis.h b/qt-ui/profile/divecartesianaxis.h index e7fa68cc3..77e2697cc 100644 --- a/qt-ui/profile/divecartesianaxis.h +++ b/qt-ui/profile/divecartesianaxis.h @@ -83,9 +83,6 @@ protected: private slots: void settingsChanged(); - -private: - bool showWithPPGraph; }; class TimeAxis : public DiveCartesianAxis { diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 6ec51e0e6..c1bdccd79 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -450,7 +450,6 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) temperatureAxis->setMinimum(pInfo.mintemp); temperatureAxis->setMaximum(pInfo.maxtemp); - if (pInfo.maxhr) { heartBeatAxis->setMinimum(pInfo.minhr); heartBeatAxis->setMaximum(pInfo.maxhr); -- cgit v1.2.3-70-g09d2