summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-04 09:34:08 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-04 09:34:08 -0700
commitc92bb9e02171d884c50dd3f8b4e57d963c2e7935 (patch)
tree2cf4ea8e8cd7f0d424a34b9ff315ef1bf5708948
parentcbdf3ee0420eca86c3df3f9e6460ae10017f4487 (diff)
downloadsubsurface-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>
-rw-r--r--qt-ui/diveplanner.cpp9
-rw-r--r--qt-ui/diveplanner.h1
2 files changed, 8 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)
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h
index fabf2e683..e513eff6e 100644
--- a/qt-ui/diveplanner.h
+++ b/qt-ui/diveplanner.h
@@ -84,6 +84,7 @@ slots:
void deleteTemporaryPlan();
void loadFromDive(dive *d);
void restoreBackupDive();
+ void emitDataChanged();
signals:
void planCreated();