mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add special download modes to force updates from the divecomputer
This will hopefully not be something we need often, but if we improve support for a divecomputer (either in libdivecomputer or in our native Uemis code or even in the way we handle (and potentially discard) events), then it is extremely useful to be able to say "re-download things from the divecomputer and for things that were not edited in Subsurface, don't try to merge the data (which gives BAD results if for example you fixed a bug in the depth calculation in libdivecomputer) but instead simply take the samples, the events and some of the other unedited data straight from the download". This commit implements just that - a "force download" checkbox in the download dialog that makes us reimport all dives from the dive computer, even the ones we already have, and an "always prefer downloaded dive" checkbox that then tells Subsurface not to merge but simply to take the data from the downloaded dive - without overwriting the things we have already edited in Subsurface (like location, buddy, equipment, etc). This, as a precaution, refuses to merge dives that don't have identical start times. So if you have edited the date / time of a dive or if you have previously merged your dive with a different dive computer (and therefore modified samples and events) you are out of luck. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
78ad07c72e
commit
fe4f13f184
9 changed files with 90 additions and 35 deletions
7
dive.h
7
dive.h
|
@ -261,6 +261,7 @@ struct dive {
|
|||
tripflag_t tripflag;
|
||||
dive_trip_t *divetrip;
|
||||
int selected;
|
||||
gboolean downloaded;
|
||||
int start, end;
|
||||
timestamp_t when;
|
||||
char *location;
|
||||
|
@ -414,10 +415,10 @@ extern void delete_dive(struct dive *dive);
|
|||
extern struct sample *prepare_sample(struct dive **divep);
|
||||
extern void finish_sample(struct dive *dive);
|
||||
|
||||
extern void report_dives(gboolean imported);
|
||||
extern void report_dives(gboolean imported, gboolean prefer_imported);
|
||||
extern struct dive *fixup_dive(struct dive *dive);
|
||||
extern struct dive *merge_dives(struct dive *a, struct dive *b, int offset);
|
||||
extern struct dive *try_to_merge(struct dive *a, struct dive *b);
|
||||
extern struct dive *merge_dives(struct dive *a, struct dive *b, int offset, gboolean prefer_downloaded);
|
||||
extern struct dive *try_to_merge(struct dive *a, struct dive *b, gboolean prefer_downloaded);
|
||||
|
||||
extern void renumber_dives(int nr);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue