Re-center on current dive if dive edit is canceled

If the user changes the coordinates for a dive but then cancels the dive
edit, the globe would stay at the location that was temporarily set and
not rotate back to the still active coordinates.

This fixes it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-05-01 21:26:18 -07:00
parent 7a85b9fb27
commit 3364e5b490

View file

@ -830,6 +830,9 @@ void MainTab::rejectChanges()
}
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::NOTHING);
MainWindow::instance()->dive_list()->setFocus();
// the user could have edited the location and then canceled the edit
// let's get the correct location back in view
MainWindow::instance()->globe()->centerOn(current_dive);
}
#undef EDIT_TEXT2