summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmapwidgethelper.h
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-07-27 23:55:35 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-28 07:31:11 -0700
commit4d698310ff830462b7d5fad7d449bedc45aa50cb (patch)
tree7fedc6ed7bf3df4647abce09b87382451f4c40ba /mobile-widgets/qmlmapwidgethelper.h
parent5e57e428748d8c9876dc607ba32bafafb33e797d (diff)
downloadsubsurface-4d698310ff830462b7d5fad7d449bedc45aa50cb.tar.gz
mapwidgethelper: add methods for editing MapLocations
updateCurrentDiveSiteCoordinates() should be called from QML when a marker changed it's location. it emits the coordinatesChanged() signal, which should be tracked in the MapWidget class. The MapWidget class should emit the same signal to the MainWindow (Marble does that). editMode is now a boolean property, which should put the QML map into editing mode. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'mobile-widgets/qmlmapwidgethelper.h')
-rw-r--r--mobile-widgets/qmlmapwidgethelper.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmapwidgethelper.h b/mobile-widgets/qmlmapwidgethelper.h
index 91e95f4f9..3c6f6a1c8 100644
--- a/mobile-widgets/qmlmapwidgethelper.h
+++ b/mobile-widgets/qmlmapwidgethelper.h
@@ -14,6 +14,7 @@ class MapWidgetHelper : public QObject {
Q_OBJECT
Q_PROPERTY(QObject *map MEMBER m_map)
Q_PROPERTY(MapLocationModel *model MEMBER m_mapLocationModel NOTIFY modelChanged)
+ Q_PROPERTY(bool editMode READ editMode WRITE setEditMode NOTIFY editModeChanged)
public:
explicit MapWidgetHelper(QObject *parent = NULL);
@@ -22,19 +23,25 @@ public:
void reloadMapLocations();
Q_INVOKABLE void copyToClipboardCoordinates(QGeoCoordinate coord, bool formatTraditional);
Q_INVOKABLE void calculateSmallCircleRadius(QGeoCoordinate coord);
+ Q_INVOKABLE void updateCurrentDiveSiteCoordinates(quint32 uuid, QGeoCoordinate coord);
+ bool editMode();
+ void setEditMode(bool editMode);
private:
QObject *m_map;
MapLocationModel *m_mapLocationModel;
qreal m_smallCircleRadius;
QList<int> m_selectedDiveIds;
+ bool m_editMode;
private slots:
void selectedLocationChanged(MapLocation *);
signals:
void modelChanged();
+ void editModeChanged();
void selectedDivesChanged(QList<int> list);
+ void coordinatesChanged();
};
extern "C" const char *printGPSCoords(int lat, int lon);