summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-08-31 16:26:04 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-09-01 21:29:05 -0700
commitc3debc10fdcb0f7e939872ea24d525f41039f5bd (patch)
treeb3f744f54e8ffde489a20930ed0608fddd706dfb /dive.h
parenta5f894d1d3b53a3a99580d2da467a46d04c65266 (diff)
downloadsubsurface-c3debc10fdcb0f7e939872ea24d525f41039f5bd.tar.gz
Allow modification and edits of trips
Now that we can load and store trips we needed to add the capability to manipulate those trips as well. This commit allows us remove a dive from a trip via a right click operation on the dive list. The commit also adds code to split a trip into two, to merge two trips and to create a new trip out of a top level dive. To make all that useful this commit changes the right-click on the dive list to identify and act on the record we are actually on (instead of acting on the selection). The right-click menu ("context menu") changes depending which divelist entry the mouse pointer is on - so different operations are offered, depending on where you are. We also add simplistic editing of location and notes for a trip (but the notes are never displayed so far). To make our lives easier this commit adds a link from the dive to the dive trip it is part of. This allowed to hugely simplify the auto trip generation algorithm (among other things). The downside of this change is that there are now three different ways in which we express the relationship of dives and trips: in the dive_trip_list, in the tree_model, and with these pointers. Somehow this screams that I should rethink my data structures... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index e15fd7763..384c7e4ca 100644
--- a/dive.h
+++ b/dive.h
@@ -241,6 +241,7 @@ extern const char *tripflag_names[NUM_TRIPFLAGS];
struct dive {
int number;
tripflag_t tripflag;
+ struct dive *divetrip;
int selected;
time_t when;
char *location;
@@ -433,6 +434,7 @@ extern void remember_event(const char *eventname);
extern void evn_foreach(void (*callback)(const char *, int *, void *), void *data);
extern int add_new_dive(struct dive *dive);
+extern gboolean edit_trip(struct dive *trip);
extern int edit_dive_info(struct dive *dive);
extern int edit_multi_dive_info(struct dive *single_dive);
extern void dive_list_update_dives(void);