aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/locationinformation.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2015-06-04 00:21:16 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-03 21:43:07 -0700
commitdb333226d9662337216b52fc4abccee9d3d664f9 (patch)
tree963846304a39e7733db149ef1e2b7afcfc88a2bb /qt-ui/locationinformation.cpp
parent3561d347457fa99fbe6a1f46e7e14a39d313f6be (diff)
downloadsubsurface-db333226d9662337216b52fc4abccee9d3d664f9.tar.gz
Reset state: have a correct dive site being displayed
I'm not sure if this is the right approach, but it seems to work: when we reset the state of the widget, we try to get the current dive site from the current dive, and set it. This way it will work for the globe later. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/locationinformation.cpp')
-rw-r--r--qt-ui/locationinformation.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index 3655d4dc3..3dc46a603 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -144,6 +144,12 @@ void LocationInformationWidget::markChangedWidget(QWidget *w)
void LocationInformationWidget::resetState()
{
+ if (displayed_dive.id) {
+ struct dive_site *ds = get_dive_site_by_uuid(displayed_dive.dive_site_uuid);
+ if(ds) {
+ displayed_dive_site = *ds;
+ }
+ }
modified = false;
resetPallete();
MainWindow::instance()->dive_list()->setEnabled(true);