aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-01 21:26:18 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-01 21:26:18 -0700
commit3364e5b49078e406c74375e16806db35c579ba3b (patch)
tree75dafb60479615ea720fea2ea4c720ee40699a56 /qt-ui/maintab.cpp
parent7a85b9fb27f96c55e11e904fe3a68eba4ca79eba (diff)
downloadsubsurface-3364e5b49078e406c74375e16806db35c579ba3b.tar.gz
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>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r--qt-ui/maintab.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index b4b711445..28c497815 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -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