diff options
author | mikeller <github@ike.ch> | 2021-05-16 15:39:47 +1200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-05-19 15:15:34 -0700 |
commit | 2d734c529b5eb389ca9526575c9520b444d21a30 (patch) | |
tree | ca34e7dd7eacdbb107079441ae1d13be49db117e /core | |
parent | 2264a5e16659f847187271e852473fb454f990d1 (diff) | |
download | subsurface-2d734c529b5eb389ca9526575c9520b444d21a30.tar.gz |
desktop: Add the capability to copy / paste dive number and date / time.
This is adding the capability to select 'Dive number' and 'Date / Time'
in the 'Copy dive components' dialog, and then copy them into the
clipboard.
When using 'Paste dive components, these values will then be pasted into
the selected dive(s).
This is intended to help with workflows that import dive information
from two different sources, like general information from another
logging program, and CCR ppO2 sensor readings from a unit log, and then
stitch them together into one cohesive entry with all data per dive.
Copied data is also output into formatted text when pasting the
clipboard outside of the application:
```
Dive number: 401
Date / time: Sun 2 May 2021 12:00 AM
```
No translations have been added as of now - I could not find any
information on how strings are translated for this project.
Signed-off-by: Michael Keller <github@ike.ch>
Diffstat (limited to 'core')
-rw-r--r-- | core/dive.c | 4 | ||||
-rw-r--r-- | core/dive.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/core/dive.c b/core/dive.c index 8bc66a655..351476bb8 100644 --- a/core/dive.c +++ b/core/dive.c @@ -336,6 +336,10 @@ void selective_copy_dive(const struct dive *s, struct dive *d, struct dive_compo copy_cylinder_types(s, d); if (what.weights) copy_weights(&s->weightsystems, &d->weightsystems); + if (what.number) + d->number = s->number; + if (what.when) + d->when = s->when; } #undef CONDITIONAL_COPY_STRING diff --git a/core/dive.h b/core/dive.h index 9c847ee90..3e5ec1324 100644 --- a/core/dive.h +++ b/core/dive.h @@ -90,6 +90,8 @@ struct dive_components { unsigned int tags : 1; unsigned int cylinders : 1; unsigned int weights : 1; + unsigned int number : 1; + unsigned int when : 1; }; extern bool has_gaschange_event(const struct dive *dive, const struct divecomputer *dc, int idx); |