summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-07 14:52:31 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-07 14:52:31 -0800
commitae3886b9875a48a726627a9bec437702ffc8e7c7 (patch)
tree53d3e996d486a091289881713464257fb87226c2 /planner.c
parentab7aecf16e960c14c0f5e565bb75c68ee85e2928 (diff)
downloadsubsurface-ae3886b9875a48a726627a9bec437702ffc8e7c7.tar.gz
Make Cancel work in dive planner dialog
With this a partially planned dive is indeed thrown away when hitting Cancel. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/planner.c b/planner.c
index b02363f06..52066d673 100644
--- a/planner.c
+++ b/planner.c
@@ -732,6 +732,14 @@ void input_plan()
gtk_widget_show_all(planner);
if (gtk_dialog_run(GTK_DIALOG(planner)) == GTK_RESPONSE_ACCEPT) {
plan(&diveplan, &cache_data, &planned_dive);
+ } else {
+ if (planned_dive) {
+ /* we have added a dive during the dynamic construction
+ * in the dialog; get rid of it */
+ delete_single_dive(dive_table.nr - 1);
+ report_dives(FALSE, FALSE);
+ planned_dive = NULL;
+ }
}
gtk_widget_destroy(planner);
}