2013-05-17 11:14:10 +00:00
|
|
|
#ifndef GLOBE_H
|
|
|
|
#define GLOBE_H
|
2014-03-26 22:08:56 +00:00
|
|
|
#ifndef NO_MARBLE
|
2013-05-17 11:14:10 +00:00
|
|
|
|
|
|
|
#include <marble/MarbleWidget.h>
|
2013-05-17 19:12:55 +00:00
|
|
|
#include <marble/GeoDataCoordinates.h>
|
2013-05-30 00:52:31 +00:00
|
|
|
#include <marble/GeoDataDocument.h>
|
2013-05-17 19:12:55 +00:00
|
|
|
|
2013-05-17 17:09:10 +00:00
|
|
|
#include <QHash>
|
2013-05-17 11:14:10 +00:00
|
|
|
|
2013-05-18 00:58:49 +00:00
|
|
|
class KMessageWidget;
|
2013-05-17 19:12:55 +00:00
|
|
|
using namespace Marble;
|
|
|
|
struct dive;
|
|
|
|
|
2014-02-28 04:09:57 +00:00
|
|
|
class GlobeGPS : public MarbleWidget {
|
2013-05-17 11:14:10 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2013-05-17 19:12:55 +00:00
|
|
|
using MarbleWidget::centerOn;
|
2013-05-17 11:14:10 +00:00
|
|
|
GlobeGPS(QWidget *parent);
|
2013-05-17 16:28:02 +00:00
|
|
|
void reload();
|
2013-11-19 12:23:59 +00:00
|
|
|
void repopulateLabels();
|
2014-02-28 04:09:57 +00:00
|
|
|
void centerOn(struct dive *dive);
|
|
|
|
bool eventFilter(QObject *, QEvent *);
|
|
|
|
|
2013-05-17 19:12:55 +00:00
|
|
|
protected:
|
2013-10-17 21:53:12 +00:00
|
|
|
/* reimp */ void resizeEvent(QResizeEvent *event);
|
2014-02-28 04:09:57 +00:00
|
|
|
/* reimp */ void mousePressEvent(QMouseEvent *event);
|
|
|
|
/* reimp */ void contextMenuEvent(QContextMenuEvent *);
|
|
|
|
|
2013-05-17 16:28:02 +00:00
|
|
|
private:
|
2013-05-17 19:12:55 +00:00
|
|
|
GeoDataDocument *loadedDives;
|
2014-02-28 04:09:57 +00:00
|
|
|
KMessageWidget *messageWidget;
|
2013-10-17 21:53:12 +00:00
|
|
|
QTimer *fixZoomTimer;
|
|
|
|
int currentZoomLevel;
|
2013-12-02 17:06:19 +00:00
|
|
|
bool editingDiveLocation;
|
2013-05-17 19:12:55 +00:00
|
|
|
|
2014-02-28 04:09:57 +00:00
|
|
|
public
|
|
|
|
slots:
|
|
|
|
void changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::Unit);
|
2013-06-05 05:44:12 +00:00
|
|
|
void mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit);
|
2013-10-17 21:53:12 +00:00
|
|
|
void fixZoom();
|
2013-12-02 17:06:19 +00:00
|
|
|
void prepareForGetDiveCoordinates();
|
2013-05-17 11:14:10 +00:00
|
|
|
};
|
|
|
|
|
2014-03-26 22:08:56 +00:00
|
|
|
#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 centerOn(struct dive* dive);
|
|
|
|
bool eventFilter(QObject*, QEvent*);
|
|
|
|
public slots:
|
|
|
|
void prepareForGetDiveCoordinates();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // NO_MARBLE
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // GLOBE_H
|