From db333226d9662337216b52fc4abccee9d3d664f9 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 4 Jun 2015 00:21:16 -0300 Subject: [PATCH] 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 Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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);