diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-05-17 14:09:10 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-05-17 14:09:10 -0300 |
commit | b89265c7f0de93c663435541167518188bcd4b2d (patch) | |
tree | dd3c39395763c6e29bec6bb6ccac8885e4093c1d /qt-ui | |
parent | 3a1a4c1874c36480cc46d5ab241fb99bd25e5358 (diff) | |
download | subsurface-b89265c7f0de93c663435541167518188bcd4b2d.tar.gz |
Adds rotation while selecting a dive.
This adds rotation, a very, very shinny feature.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/globe.cpp | 12 | ||||
-rw-r--r-- | qt-ui/globe.h | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index 77fd8b3b6..a8fb886d8 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -16,14 +16,12 @@ GlobeGPS::GlobeGPS(QWidget* parent) : MarbleWidget(parent), loadedDives(0) setMapThemeId("earth/bluemarble/bluemarble.dgml"); setProjection( Marble::Spherical ); - // Enable the cloud cover and enable the country borders + setAnimationsEnabled(true); setShowClouds( false ); setShowBorders( false ); setShowPlaces( false ); setShowCrosshairs( false ); setShowGrid( false ); - - // Hide the FloatItems: Compass and StatusBar setShowOverviewMap(false); setShowScaleBar(false); @@ -33,6 +31,7 @@ GlobeGPS::GlobeGPS(QWidget* parent) : MarbleWidget(parent), loadedDives(0) floatItem->setContentSize( QSize( 50, 50 ) ); } } + } void GlobeGPS::reload() @@ -49,8 +48,11 @@ void GlobeGPS::reload() struct dive *dive; for_each_dive(idx, dive) { if (dive_has_gps_location(dive)) { + // don't add dive locations twice. + if( diveLocations.contains( QString(dive->location))) + continue; + GeoDataPlacemark *place = new GeoDataPlacemark( dive->location ); - place->setDescription(dive->notes); place->setCoordinate(dive->longitude.udeg / 1000000.0,dive->latitude.udeg / 1000000.0 , 0, GeoDataCoordinates::Degree ); loadedDives->append( place ); } @@ -60,5 +62,5 @@ void GlobeGPS::reload() void GlobeGPS::centerOn(dive* dive) { - centerOn(dive->longitude.udeg / 1000000.0,dive->latitude.udeg / 1000000.0); + centerOn(dive->longitude.udeg / 1000000.0,dive->latitude.udeg / 1000000.0, true); } diff --git a/qt-ui/globe.h b/qt-ui/globe.h index 86dc3bec0..e89c9b777 100644 --- a/qt-ui/globe.h +++ b/qt-ui/globe.h @@ -2,6 +2,7 @@ #define GLOBE_H #include <marble/MarbleWidget.h> +#include <QHash> namespace Marble{ class GeoDataDocument; @@ -16,6 +17,8 @@ public: private: Marble::GeoDataDocument *loadedDives; + QStringList diveLocations; + }; #endif |