Planner: show the GF used for planning on top of the profile

Showing the GF in the preferences is just confusing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-06-10 09:24:10 -07:00
parent 6daeb276ad
commit 445e937a5b

View file

@ -8,6 +8,7 @@
#include "dive.h"
#include "preferences.h"
#include "helpers.h"
#include "diveplanner.h"
#include <QPen>
#include <QPainter>
@ -551,7 +552,13 @@ void DiveCalculatedCeiling::modelDataChanged(const QModelIndex &topLeft, const Q
setBrush(pat);
gradientFactor->setX(poly.boundingRect().width() / 2 + poly.boundingRect().x());
gradientFactor->setText(QString("GF %1/%2").arg(prefs.gflow).arg(prefs.gfhigh));
DivePlannerPointsModel *plannerModel = DivePlannerPointsModel::instance();
if (plannerModel->isPlanner()) {
struct diveplan &diveplan = plannerModel->getDiveplan();
gradientFactor->setText(QString("GF %1/%2").arg(diveplan.gflow).arg(diveplan.gfhigh));
} else {
gradientFactor->setText(QString("GF %1/%2").arg(prefs.gflow).arg(prefs.gfhigh));
}
}
void DiveCalculatedCeiling::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)