mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
0fceb1c907
commit
41d3a11ee3
3 changed files with 46 additions and 21 deletions
4
dive.h
4
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue