Rework the method to pick a dive site via the globe

The globe used to allow the user to pick a dive site if the dive didn't
have coordinates, but this is now wrong since when in dive site editing
mode we can select multiple times new coordinates for it, and it should
only be marked as finished when the user actually finishes it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-06-03 22:53:38 -03:00 committed by Dirk Hohndel
parent 7507c96dcd
commit fa373fd544
2 changed files with 16 additions and 10 deletions

View file

@ -298,18 +298,22 @@ void GlobeGPS::zoomOutForNoGPS()
} }
} }
void GlobeGPS::endGetDiveCoordinates()
{
messageWidget->animatedHide();
editingDiveLocation = false;
}
void GlobeGPS::prepareForGetDiveCoordinates() void GlobeGPS::prepareForGetDiveCoordinates()
{ {
if (!messageWidget->isVisible()) { messageWidget->setMessageType(KMessageWidget::Warning);
messageWidget->setMessageType(KMessageWidget::Warning); messageWidget->setText(QObject::tr("Move the map and double-click to set the dive location"));
messageWidget->setText(QObject::tr("Move the map and double-click to set the dive location")); messageWidget->setWordWrap(true);
messageWidget->setWordWrap(true); messageWidget->setCloseButtonVisible(false);
messageWidget->setCloseButtonVisible(false); messageWidget->animatedShow();
messageWidget->animatedShow(); editingDiveLocation = true;
editingDiveLocation = true; if (!dive_has_gps_location(current_dive))
if (!dive_has_gps_location(current_dive)) zoomOutForNoGPS();
zoomOutForNoGPS();
}
} }
// This needs to update the dive site, not just this dive // This needs to update the dive site, not just this dive

View file

@ -49,6 +49,8 @@ slots:
void fixZoom(); void fixZoom();
void zoomOutForNoGPS(); void zoomOutForNoGPS();
void prepareForGetDiveCoordinates(); void prepareForGetDiveCoordinates();
void endGetDiveCoordinates();
}; };
#else // NO_MARBLE #else // NO_MARBLE