summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-09-11 13:37:06 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-09-11 13:37:06 -0700
commit41d3a11ee3d793e7a20a85baf66c18b3dca431a4 (patch)
tree3ed1fd27093cd1aaf63a044d1908c37e9cbd2e4b /dive.h
parent0fceb1c9070eb2b1c65f26e665d49ee54cc4e17e (diff)
downloadsubsurface-41d3a11ee3d793e7a20a85baf66c18b3dca431a4.tar.gz
Fix a long standing bug when editing dives
Calling edit from the context menu creates a combined editing widget that contains both dive info and equipment. When editing cylinders or weightsystems from that widget and confirming those edits with OK those changes were already committed to the current_dive - regardless on which dive the user clicked. Worse, even when the user clicked Cancel in the edit widget, any changes to the equipment stayed in effect. This had especially confusing consequences when editing multiple dives. As a workaround this commit adds a global edit_dive variable. This fake dive is edited by the secondary editing widgets and if the user accepts changes with OK then they are copied over to the current dive (or all selected dives in multi dive editing mode). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index e45d962ff..1fb0870aa 100644
--- a/dive.h
+++ b/dive.h
@@ -262,6 +262,10 @@ struct dive {
struct sample sample[];
};
+/* this is a global spot for a temporary dive structure that we use to
+ * be able to edit a dive without unintended side effects */
+extern struct dive edit_dive;
+
extern GList *dive_trip_list;
extern gboolean autogroup;
/* random threashold: three days without diving -> new trip