mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive site rewrite: copy the changed dive site to the original
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
78293f5078
commit
1fd4e55240
2 changed files with 5 additions and 0 deletions
|
@ -168,6 +168,7 @@ void copy_dive_site(struct dive_site *orig, struct dive_site *copy)
|
||||||
copy->name = copy_string(orig->name);
|
copy->name = copy_string(orig->name);
|
||||||
copy->notes = copy_string(orig->notes);
|
copy->notes = copy_string(orig->notes);
|
||||||
copy->description = copy_string(orig->description);
|
copy->description = copy_string(orig->description);
|
||||||
|
copy->uuid = orig->uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_dive_site(struct dive_site *ds)
|
void clear_dive_site(struct dive_site *ds)
|
||||||
|
|
|
@ -800,6 +800,8 @@ void MainTab::acceptChanges()
|
||||||
struct dive *added_dive = clone_dive(&displayed_dive);
|
struct dive *added_dive = clone_dive(&displayed_dive);
|
||||||
record_dive(added_dive);
|
record_dive(added_dive);
|
||||||
addedId = added_dive->id;
|
addedId = added_dive->id;
|
||||||
|
copy_dive_site(&displayed_dive_site, get_dive_site_by_uuid(displayed_dive_site.uuid));
|
||||||
|
|
||||||
// unselect everything as far as the UI is concerned and select the new
|
// unselect everything as far as the UI is concerned and select the new
|
||||||
// dive - we'll have to undo/redo this later after we resort the dive_table
|
// dive - we'll have to undo/redo this later after we resort the dive_table
|
||||||
// but we need the dive selected for the middle part of this function - this
|
// but we need the dive selected for the middle part of this function - this
|
||||||
|
@ -858,6 +860,8 @@ void MainTab::acceptChanges()
|
||||||
saveTaggedStrings();
|
saveTaggedStrings();
|
||||||
saveTags();
|
saveTags();
|
||||||
|
|
||||||
|
copy_dive_site(&displayed_dive_site, get_dive_site_by_uuid(displayed_dive_site.uuid));
|
||||||
|
|
||||||
if (editMode != ADD && cylindersModel->changed) {
|
if (editMode != ADD && cylindersModel->changed) {
|
||||||
mark_divelist_changed(true);
|
mark_divelist_changed(true);
|
||||||
MODIFY_SELECTED_DIVES(
|
MODIFY_SELECTED_DIVES(
|
||||||
|
|
Loading…
Add table
Reference in a new issue