From b7ec57bdeff11d4639397efffd693eeafe6a0f55 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 26 May 2015 17:10:46 -0300 Subject: Show the correct dive_site on the manage combobox When triggering the dive_site management, we need to get the uuid that was send to us and set it as the current dive_site on the combobox, the dialog can fill all required info for us. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/locationinformation.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index 3ee9dd746..b433805e0 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -87,6 +87,13 @@ void LocationInformationWidget::setLocationId(uint32_t uuid) return; displayed_dive_site = *currentDs; + if (ui.currentLocation->currentText() != displayed_dive_site.name) { + // this will trigger setCurrentDiveSite again, and thus, + // will gethere with the correct uuid. + ui.currentLocation->setCurrentText(displayed_dive_site.name); + return; + } + if (displayed_dive_site.name) ui.diveSiteName->setText(displayed_dive_site.name); else -- cgit v1.2.3-70-g09d2