Desktop: Fix Gas Editing for Manually Added Dives.

- show the correct gasmix in the profile;
- make gases available for gas switches in the profile after they have
  been added;
- persist gas changes;
- add air as a default gas when adding a dive.

This still has problems when undoing a gas switch - instead of
completely removing the gas switch it is just moved to the next point in the
profile.

Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
Michael Keller 2024-05-25 19:03:39 +12:00
parent 9243921cbb
commit f65afaf5d2
13 changed files with 121 additions and 54 deletions

View file

@ -711,6 +711,7 @@ void MainWindow::on_actionAddDive_triggered()
d.dc.meandepth.mm = M_OR_FT(13, 39); // this creates a resonable looking safety stop
make_manually_added_dive_dc(&d.dc);
fake_dc(&d.dc);
add_default_cylinder(&d);
fixup_dive(&d);
Command::addDive(&d, divelog.autogroup, true);