aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/diveplanner.cpp3
-rw-r--r--qt-models/diveplannermodel.cpp7
-rw-r--r--qt-models/diveplannermodel.h1
3 files changed, 5 insertions, 6 deletions
diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp
index f1efa3f27..f4deafa8c 100644
--- a/desktop-widgets/diveplanner.cpp
+++ b/desktop-widgets/diveplanner.cpp
@@ -72,7 +72,6 @@ DivePlannerWidget::DivePlannerWidget(QWidget *parent) : QWidget(parent, QFlag(0)
connect(ui.atmHeight, QOverload<int>::of(&QSpinBox::valueChanged), this, &DivePlannerWidget::heightChanged);
connect(ui.waterType, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DivePlannerWidget::waterTypeChanged);
connect(ui.customSalinity, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &DivePlannerWidget::customSalinityChanged);
- connect(plannerModel, &DivePlannerPointsModel::startTimeChanged, this, &DivePlannerWidget::setupStartTime);
// Creating (and canceling) the plan
replanButton = ui.buttonBox->addButton(tr("Save new"), QDialogButtonBox::ActionRole);
@@ -564,6 +563,8 @@ void PlannerWidgets::planDive()
plannerWidget.setSalinity(SEAWATER_SALINITY);
}
plannerWidget.setReplanButton(false);
+
+ plannerWidget.setupStartTime(timestampToDateTime(displayed_dive.when)); // This will reload the profile!
}
void PlannerWidgets::replanDive()
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index 0fd7962f3..d94b728ae 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -58,13 +58,14 @@ void DivePlannerPointsModel::createSimpleDive()
setupStartTime();
// initialize the start time in the plan
- diveplan.when = displayed_dive.when;
+ diveplan.when = dateTimeToTimestamp(startTime);
+ displayed_dive.when = diveplan.when;
// Use gas from the first cylinder
int cylinderid = 0;
// If we're in drop_stone_mode, don't add a first point.
- // It will be added implicit.
+ // It will be added implicitly.
if (!prefs.drop_stone_mode)
addStop(M_OR_FT(15, 45), 1 * 60, cylinderid, 0, true, UNDEF_COMP_TYPE);
@@ -91,7 +92,6 @@ void DivePlannerPointsModel::setupStartTime()
startTime = startTime.addSecs(diff + 3600);
}
}
- emit startTimeChanged(startTime);
}
void DivePlannerPointsModel::loadFromDive(dive *d)
@@ -737,7 +737,6 @@ void DivePlannerPointsModel::setStartTime(const QTime &t)
emitDataChanged();
}
-
bool divePointsLessThan(const divedatapoint &p1, const divedatapoint &p2)
{
return p1.time < p2.time;
diff --git a/qt-models/diveplannermodel.h b/qt-models/diveplannermodel.h
index 08ed8fd79..0f3a423db 100644
--- a/qt-models/diveplannermodel.h
+++ b/qt-models/diveplannermodel.h
@@ -116,7 +116,6 @@ signals:
void planCreated();
void planCanceled();
void cylinderModelEdited();
- void startTimeChanged(QDateTime);
void recreationChanged(bool);
void calculatedPlanNotes(QString);
void variationsComputed(QString);