mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
28e3413ff6
Instead of having people treat latitude and longitude as separate things, just add a 'location_t' data structure that contains both. Almost all cases want to always act on them together. This is really just prep-work for adding a few more locations that we track: I want to add a entry/exit location to each dive (independent of the dive site) because of how the Garmin Descent gives us the information (and hopefully, some day, other dive computers too). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
48 lines
1 KiB
C++
48 lines
1 KiB
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef MAPWIDGET_H
|
|
#define MAPWIDGET_H
|
|
|
|
#include "core/units.h"
|
|
#include <QQuickWidget>
|
|
#include <QList>
|
|
|
|
#undef IGNORE
|
|
|
|
class QResizeEvent;
|
|
class QQuickItem;
|
|
class MapWidgetHelper;
|
|
struct dive_site;
|
|
|
|
class MapWidget : public QQuickWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MapWidget(QWidget *parent = NULL);
|
|
~MapWidget();
|
|
|
|
static MapWidget *instance();
|
|
void reload();
|
|
|
|
signals:
|
|
void coordinatesChanged(const location_t &);
|
|
|
|
public slots:
|
|
void centerOnSelectedDiveSite();
|
|
void centerOnDiveSite(struct dive_site *);
|
|
void centerOnIndex(const QModelIndex& idx);
|
|
void endGetDiveCoordinates();
|
|
void repopulateLabels();
|
|
void prepareForGetDiveCoordinates(uint32_t uuid);
|
|
void selectedDivesChanged(QList<int>);
|
|
void coordinatesChangedLocal(const location_t &);
|
|
void doneLoading(QQuickWidget::Status status);
|
|
void updateDiveSiteCoordinates(uint32_t uuid, const location_t &);
|
|
|
|
private:
|
|
static MapWidget *m_instance;
|
|
QQuickItem *m_rootItem;
|
|
MapWidgetHelper *m_mapHelper;
|
|
};
|
|
|
|
#endif // MAPWIDGET_H
|