mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
Only set surface pressure when it has a value
When replanning a dive, do not set the surface pressure when it is 0. Same for salinity. This closes #161 . Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
22267762ce
commit
dbf1390094
1 changed files with 4 additions and 2 deletions
|
@ -927,8 +927,10 @@ 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);
|
||||
if (current_dive->surface_pressure.mbar)
|
||||
divePlannerWidget()->setSurfacePressure(current_dive->surface_pressure.mbar);
|
||||
if (current_dive->salinity)
|
||||
divePlannerWidget()->setSalinity(current_dive->salinity);
|
||||
DivePlannerPointsModel::instance()->loadFromDive(current_dive);
|
||||
reset_cylinders(&displayed_dive, true);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue