summaryrefslogtreecommitdiffstats
path: root/core/divelist.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-09-23 21:22:48 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-11 16:22:27 -0700
commitf427226b3b605523bc8285dbdaaa7f6993af6e6a (patch)
treee025722f92883fbac72b3584d6b4fb301bb8a40d /core/divelist.h
parent4fbb8ef399a356e0b1a7393311c22ca68c50a14d (diff)
downloadsubsurface-f427226b3b605523bc8285dbdaaa7f6993af6e6a.tar.gz
Undo: make diverse trip-related operations undo-able
AddDivesToTrip, CreateTrip, AutogroupDives, RemoveAutogenTrips and MergeTrips basically all did the same thing as RemoveDivesFromTrip, which was already implemented. Thus, factor our the common functionality and hook it up to make all these functions undo-able. Don't do the autogroup-call everytime the dive-list is rebuilt (that would create innumberable undo-actions), but only on dive-load / import or if expressly asked by the user [by switching the autogroup flag]. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/divelist.h')
-rw-r--r--core/divelist.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/divelist.h b/core/divelist.h
index 2b2ee07a5..8bcf9f55c 100644
--- a/core/divelist.h
+++ b/core/divelist.h
@@ -28,7 +28,10 @@ extern int get_divenr(const struct dive *dive);
extern int get_divesite_idx(const struct dive_site *ds);
extern struct dive_trip *unregister_dive_from_trip(struct dive *dive, short was_autogen);
extern void remove_dive_from_trip(struct dive *dive, short was_autogen);
+extern dive_trip_t *alloc_trip(void);
+extern dive_trip_t *create_trip_from_dive(struct dive *dive);
extern dive_trip_t *create_and_hookup_trip_from_dive(struct dive *dive);
+extern dive_trip_t *get_dives_to_autogroup(int start, int *from, int *to, bool *allocated);
extern void autogroup_dives(void);
extern struct dive *merge_two_dives(struct dive *a, struct dive *b);
extern bool consecutive_selected();
@@ -38,6 +41,7 @@ extern void select_dives_in_trip(struct dive_trip *trip);
extern void deselect_dives_in_trip(struct dive_trip *trip);
extern void filter_dive(struct dive *d, bool shown);
extern void combine_trips(struct dive_trip *trip_a, struct dive_trip *trip_b);
+extern dive_trip_t *combine_trips_create(struct dive_trip *trip_a, struct dive_trip *trip_b);
extern void find_new_trip_start_time(dive_trip_t *trip);
extern struct dive *first_selected_dive();
extern struct dive *last_selected_dive();