summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/globe.cpp20
-rw-r--r--qt-ui/globe.h1
2 files changed, 13 insertions, 8 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
index 3ea01f0d8..846eabb1d 100644
--- a/qt-ui/globe.cpp
+++ b/qt-ui/globe.cpp
@@ -120,19 +120,12 @@ void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit unit)
}
}
-void GlobeGPS::reload()
+void GlobeGPS::repopulateLabels()
{
if (loadedDives) {
model()->treeModel()->removeDocument(loadedDives);
delete loadedDives;
}
-
- if (editingDiveCoords) {
- editingDiveCoords = 0;
- if (messageWidget->isVisible())
- messageWidget->animatedHide();
- }
-
loadedDives = new GeoDataDocument;
QMap<QString, GeoDataPlacemark *> locationMap;
@@ -162,6 +155,16 @@ void GlobeGPS::reload()
model()->treeModel()->addDocument(loadedDives);
}
+void GlobeGPS::reload()
+{
+ if (editingDiveCoords) {
+ editingDiveCoords = 0;
+ if (messageWidget->isVisible())
+ messageWidget->animatedHide();
+ }
+ repopulateLabels();
+}
+
void GlobeGPS::centerOn(dive* dive)
{
// dive has changed, if we had the 'editingDive', hide it.
@@ -255,6 +258,7 @@ void GlobeGPS::mousePressEvent(QMouseEvent* event)
if (mainWindow()->information()->isEditing() &&
geoCoordinates(event->pos().x(), event->pos().y(), lon, lat, GeoDataCoordinates::Degree)) {
mainWindow()->information()->updateCoordinatesText(lat, lon);
+ repopulateLabels();
} else if (editingDiveCoords &&
geoCoordinates(event->pos().x(), event->pos().y(), lon, lat, GeoDataCoordinates::Degree)) {
changeDiveGeoPosition(lon, lat, GeoDataCoordinates::Degree);
diff --git a/qt-ui/globe.h b/qt-ui/globe.h
index b04ff9266..c44e9b591 100644
--- a/qt-ui/globe.h
+++ b/qt-ui/globe.h
@@ -17,6 +17,7 @@ public:
using MarbleWidget::centerOn;
GlobeGPS(QWidget *parent);
void reload();
+ void repopulateLabels();
void centerOn(struct dive* dive);
void diveEditMode();