mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Disable info widget when canceling 'add dive' for a first dive
One more corner case that we cover correctly. Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
446ab45858
commit
72f0516f6d
2 changed files with 9 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue