mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 21:20:19 +00:00
When editing a manually entered dive, make sure divelist is updated
Editing a manually entered dive allows the user to edit duration, max depth and mean depth. These values are stored in the first (and only) divecomputer and the duration, maxdepth and meandepth fields of the dive are populated in fixup_dive() after the dive was initially parsed. In order for this to work we need to clear out the existing fields (so that values can get smaller) and rerun fixup_dive(). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
41a97bc1ae
commit
6dfd16a1f5
1 changed files with 8 additions and 1 deletions
|
@ -777,8 +777,15 @@ int edit_multi_dive_info(struct dive *single_dive)
|
|||
update_cylinder_related_info(master);
|
||||
/* if there was only one dive we might also have changed dive->when
|
||||
* or even the duration and depth information (in a dive without samples) */
|
||||
if (! multi)
|
||||
if (! multi) {
|
||||
update_time_depth(master, &edit_dive);
|
||||
/* these values could have changed because of the edit - so let's
|
||||
* recreate them */
|
||||
master->duration.seconds = 0;
|
||||
master->maxdepth.mm = 0;
|
||||
master->meandepth.mm = 0;
|
||||
(void)fixup_dive(master);
|
||||
}
|
||||
dive_list_update_dives();
|
||||
}
|
||||
gtk_widget_destroy(dialog);
|
||||
|
|
Loading…
Reference in a new issue