mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
UI restructure: use displayed_dive for add dive and plan dive
This gets rid of the stagingDive and stops the constant adding and removing of dives from the divelist (that was an INSANE design, seriously). When adding or planning a dive all work is now done in the dedicated displayed_dive. Add dive mostly works - when the user clicks save the dive is added to the dive list and selected. Plan dive is mostly untested. It passed trivial "start planner, save" testing so it's not entirely broken, but I'm sure there's more work to be done there. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d8c3113584
commit
611bae3441
6 changed files with 113 additions and 137 deletions
14
planner.c
14
planner.c
|
@ -257,14 +257,14 @@ static void create_dive_from_plan(struct diveplan *diveplan)
|
|||
printf("in create_dive_from_plan\n");
|
||||
dump_plan(diveplan);
|
||||
#endif
|
||||
// clear out the dive, fill in the basics and get started
|
||||
clear_dive(&displayed_dive);
|
||||
displayed_dive.when = diveplan->when;
|
||||
displayed_dive.dc.surface_pressure.mbar = diveplan->surface_pressure;
|
||||
dc = &displayed_dive.dc;
|
||||
dc->model = "planned dive"; /* do not translate here ! */
|
||||
dp = diveplan->dp;
|
||||
// reset the cylinders and clear out the samples of the displayed dive so we can restart
|
||||
reset_cylinders(&displayed_dive);
|
||||
dc = &displayed_dive.dc;
|
||||
free(dc->sample);
|
||||
dc->sample = NULL;
|
||||
dc->samples = 0;
|
||||
dc->alloc_samples = 0;
|
||||
dp = diveplan->dp;
|
||||
cyl = &displayed_dive.cylinder[0];
|
||||
oldgasmix = cyl->gasmix;
|
||||
sample = prepare_sample(dc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue