diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-06-04 09:34:08 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-04 09:34:08 -0700 |
commit | c92bb9e02171d884c50dd3f8b4e57d963c2e7935 (patch) | |
tree | 2cf4ea8e8cd7f0d424a34b9ff315ef1bf5708948 /qt-ui/diveplanner.cpp | |
parent | cbdf3ee0420eca86c3df3f9e6460ae10017f4487 (diff) | |
download | subsurface-c92bb9e02171d884c50dd3f8b4e57d963c2e7935.tar.gz |
Planner: don't redo the plan after partial edits of GFlow/high
In most cases this wouldn't really matter, but when planning very deep or
very long dive with corresponding very long deco times, calculating the
deco takes long enough to make this notable.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r-- | qt-ui/diveplanner.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index b682aa131..c03ec63ad 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -272,7 +272,9 @@ DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidg connect(ui.bottomSAC, SIGNAL(textChanged(QString)), this, SLOT(bottomSacChanged(QString))); connect(ui.decoStopSAC, SIGNAL(textChanged(QString)), this, SLOT(decoSacChanged(QString))); connect(ui.gfhigh, SIGNAL(valueChanged(int)), plannerModel, SLOT(setGFHigh(int))); + connect(ui.gfhigh, SIGNAL(editingFinished()), plannerModel, SLOT(emitDataChanged())); connect(ui.gflow, SIGNAL(valueChanged(int)), plannerModel, SLOT(setGFLow(int))); + connect(ui.gflow, SIGNAL(editingFinished()), plannerModel, SLOT(emitDataChanged())); connect(ui.lastStop, SIGNAL(toggled(bool)), plannerModel, SLOT(setLastStop6m(bool))); connect(ui.verbatim_plan, SIGNAL(toggled(bool)), plannerModel, SLOT(setVerbatim(bool))); connect(ui.display_duration, SIGNAL(toggled(bool)), plannerModel, SLOT(setDisplayDuration(bool))); @@ -482,6 +484,11 @@ DivePlannerPointsModel *DivePlannerPointsModel::instance() return self.data(); } +void DivePlannerPointsModel::emitDataChanged() +{ + emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1)); +} + void DivePlannerPointsModel::setBottomSac(int sac) { diveplan.bottomsac = sac * 1000; @@ -497,13 +504,11 @@ void DivePlannerPointsModel::setDecoSac(int sac) void DivePlannerPointsModel::setGFHigh(const int gfhigh) { diveplan.gfhigh = gfhigh; - emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1)); } void DivePlannerPointsModel::setGFLow(const int ghflow) { diveplan.gflow = ghflow; - emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1)); } void DivePlannerPointsModel::setSurfacePressure(int pressure) |