subsurface/qt-ui/globe.h
Tomaz Canabrava 6b81fb49d0 Always send the UUID of the coordinates to the globe
We were relying in the current_dive to display the
globe coordinates correctly - but this is not always
the case: you can be inserting a new dive site and it
isn't yet inside of the dive until the user presses
accept. So always pass the uuid of the dive site that
we want to display.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07 08:04:32 -07:00

75 lines
1.6 KiB
C++

#ifndef GLOBE_H
#define GLOBE_H
#ifndef NO_MARBLE
#include <stdint.h>
#include <marble/MarbleWidget.h>
#include <marble/GeoDataCoordinates.h>
#include <QHash>
namespace Marble{
class GeoDataDocument;
}
class KMessageWidget;
using namespace Marble;
struct dive;
class GlobeGPS : public MarbleWidget {
Q_OBJECT
public:
using MarbleWidget::centerOn;
GlobeGPS(QWidget *parent = 0);
void reload();
bool eventFilter(QObject *, QEvent *);
protected:
/* reimp */ void resizeEvent(QResizeEvent *event);
/* reimp */ void mousePressEvent(QMouseEvent *event);
/* reimp */ void contextMenuEvent(QContextMenuEvent *);
private:
GeoDataDocument *loadedDives;
KMessageWidget *messageWidget;
QTimer *fixZoomTimer;
int currentZoomLevel;
bool needResetZoom;
bool editingDiveLocation;
bool doubleClick;
signals:
void coordinatesChanged();
public
slots:
void repopulateLabels();
void changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::Unit);
void mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit);
void fixZoom();
void zoomOutForNoGPS();
void prepareForGetDiveCoordinates();
void endGetDiveCoordinates();
void centerOnDiveSite(uint32_t uuid);
};
#else // NO_MARBLE
/* Dummy widget for when we don't have MarbleWidget */
#include <QLabel>
class GlobeGPS : public QLabel {
Q_OBJECT
public:
GlobeGPS(QWidget *parent);
void reload();
void repopulateLabels();
void centerOnDiveSite(uint32_t uuid);
bool eventFilter(QObject *, QEvent *);
public
slots:
void prepareForGetDiveCoordinates();
void endGetDiveCoordinates();
};
#endif // NO_MARBLE
#endif // GLOBE_H