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 <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-07-29 16:34:57 -03:00 committed by Dirk Hohndel
parent 936f057ddc
commit 078332bae1
3 changed files with 11 additions and 22 deletions

View file

@ -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)

View file

@ -83,9 +83,6 @@ protected:
private
slots:
void settingsChanged();
private:
bool showWithPPGraph;
};
class TimeAxis : public DiveCartesianAxis {

View file

@ -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);