From 72f0516f6dc36fb3813563a76dac86d946aba5b8 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 24 Sep 2013 12:32:18 -0700 Subject: Disable info widget when canceling 'add dive' for a first dive One more corner case that we cover correctly. Reported-by: Henrik Brautaset Aronsen Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 6a3d46a99..d9249046f 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -469,6 +469,11 @@ void MainTab::rejectChanges() ui->notes->setText(notesBackup[NULL].notes ); ui->location->setText(notesBackup[NULL].location); }else{ + if (editMode == ADD) { + // clean up + delete_single_dive(selected_dive); + DivePlannerPointsModel::instance()->cancelPlan(); + } struct dive *curr = current_dive; ui->notes->setText(notesBackup[curr].notes ); ui->location->setText(notesBackup[curr].location); @@ -520,10 +525,8 @@ void MainTab::rejectChanges() ui->watertemp->setPalette(p); ui->dateTimeEdit->setPalette(p); if (editMode == ADD) { - // clean up - delete_single_dive(selected_dive); - selected_dive = -1; - DivePlannerPointsModel::instance()->cancelPlan(); + // more clean up + updateDiveInfo(selected_dive); mainWindow()->showProfile(); mainWindow()->refreshDisplay(); } -- cgit v1.2.3-70-g09d2