From 70656cddead4eaf3382d16af7be4898a34cbdec1 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 14 Jul 2015 11:50:38 -0700 Subject: Location completer: show candidate sites on the globe As the user scrolls through the possible completions, show them on the globe as well. Signed-off-by: Dirk Hohndel --- qt-ui/modeldelegates.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'qt-ui') diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index 516ada3ce..268312a4d 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -11,6 +11,9 @@ #include "weightmodel.h" #include "divetripmodel.h" #include "qthelper.h" +#ifndef NO_MARBLE +#include "globe.h" +#endif #include #include @@ -520,6 +523,13 @@ void LocationFilterDelegate::paint(QPainter *painter, const QStyleOptionViewItem free( (void*) gpsCoords); } +#ifndef NO_MARBLE + if ((option.state & QStyle::State_HasFocus) && dive_site_has_gps_location(ds)) { + qDebug() << "center on" << ds->name; + MainWindow::instance()->globe()->centerOnDiveSite(ds->uuid); + } +#endif + if (dive_site_has_gps_location(ds) && dive_site_has_gps_location(&displayed_dive_site)) { // so we are showing a completion and both the current dive site and the completion // have a GPS fix... so let's show the distance -- cgit v1.2.3-70-g09d2