diff options
-rw-r--r-- | desktop-widgets/diveplanner.cpp | 10 | ||||
-rw-r--r-- | desktop-widgets/diveplanner.h | 2 | ||||
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 2 |
3 files changed, 14 insertions, 0 deletions
diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp index b12feab95..ee85d12bc 100644 --- a/desktop-widgets/diveplanner.cpp +++ b/desktop-widgets/diveplanner.cpp @@ -181,6 +181,16 @@ void DivePlannerWidget::setupStartTime(QDateTime startTime) ui.dateEdit->setDate(startTime.date()); } +void DivePlannerWidget::setSurfacePressure(int surface_pressure) +{ + ui.ATMPressure->setValue(surface_pressure); +} + +void DivePlannerWidget::setSalinity(int salinity) +{ + ui.salinity->setValue(salinity / 10000.0); +} + void DivePlannerWidget::settingsChanged() { // Adopt units diff --git a/desktop-widgets/diveplanner.h b/desktop-widgets/diveplanner.h index cf3a172c9..91501ceb7 100644 --- a/desktop-widgets/diveplanner.h +++ b/desktop-widgets/diveplanner.h @@ -52,6 +52,8 @@ slots: void heightChanged(const int height); void salinityChanged(const double salinity); void printDecoPlan(); + void setSurfacePressure(int surface_pressure); + void setSalinity(int salinity); private: Ui::DivePlanner ui; diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 2143663e8..5231961c7 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -914,6 +914,8 @@ void MainWindow::on_actionReplanDive_triggered() setApplicationState("PlanDive"); divePlannerWidget()->setReplanButton(true); divePlannerWidget()->setupStartTime(QDateTime::fromMSecsSinceEpoch(1000 * current_dive->when, Qt::UTC)); + divePlannerWidget()->setSurfacePressure(current_dive->surface_pressure.mbar); + divePlannerWidget()->setSalinity(current_dive->salinity); DivePlannerPointsModel::instance()->loadFromDive(current_dive); reset_cylinders(&displayed_dive, true); } |