summaryrefslogtreecommitdiffstats
path: root/qt-ui/globe.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-12-03 21:25:20 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-03 18:48:17 -0800
commit9190c97a3c2c9c73f0a351e7478077b057993955 (patch)
tree44af7c497c39e09f6402ebdc4926b1698a07fd22 /qt-ui/globe.cpp
parentd128b74a8a05fda4cd43583ecc2323fd2d38f032 (diff)
downloadsubsurface-9190c97a3c2c9c73f0a351e7478077b057993955.tar.gz
Attempt to fix the 'click goes to 0,0' thing on the globe.
This patch attempts to fix the 'click goes to 0,0' bug on the globe. it moves a bit of code around and I particulary don't like the way that we are dealing with 'EditMode', I think I'll refactor that for 4.1. We are alredy dealing with a bunch of states, maybe a State Machine will help on removing code-complexity. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/globe.cpp')
-rw-r--r--qt-ui/globe.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
index 10ce7058b..e0f94bbd5 100644
--- a/qt-ui/globe.cpp
+++ b/qt-ui/globe.cpp
@@ -197,23 +197,21 @@ void GlobeGPS::reload()
{
editingDiveLocation = false;
if (messageWidget->isVisible())
- messageWidget->animatedHide();
+ messageWidget->hide();
repopulateLabels();
}
void GlobeGPS::centerOn(dive* dive)
{
// dive has changed, if we had the 'editingDive', hide it.
- if (messageWidget->isVisible() && (!dive || dive_has_gps_location(dive))) {
- messageWidget->animatedHide();
- }
+ if (messageWidget->isVisible() && (!dive || dive_has_gps_location(dive)))
+ messageWidget->hide();
if (!dive)
return;
-
qreal longitude = dive->longitude.udeg / 1000000.0;
qreal latitude = dive->latitude.udeg / 1000000.0;
- if (!longitude || !latitude) {
+ if (!longitude || !latitude || mainWindow()->information()->isEditing()) {
prepareForGetDiveCoordinates();
return;
}
@@ -241,7 +239,7 @@ void GlobeGPS::prepareForGetDiveCoordinates()
{
if (!messageWidget->isVisible()) {
messageWidget->setMessageType(KMessageWidget::Warning);
- messageWidget->setText(QObject::tr("No location data - 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->animatedShow();
editingDiveLocation = true;
@@ -250,6 +248,8 @@ void GlobeGPS::prepareForGetDiveCoordinates()
void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::Unit unit)
{
+ messageWidget->hide();
+
if (mainWindow()->dive_list()->selectionModel()->selection().isEmpty())
return;
@@ -271,7 +271,6 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U
centerOn(lon, lat, true);
editingDiveLocation = false;
mark_divelist_changed(TRUE);
- messageWidget->animatedHide();
mainWindow()->refreshDisplay();
}