summaryrefslogtreecommitdiffstats
path: root/map-widget
diff options
context:
space:
mode:
Diffstat (limited to 'map-widget')
-rw-r--r--map-widget/qml/MapWidget.qml4
-rw-r--r--map-widget/qmlmapwidgethelper.cpp6
-rw-r--r--map-widget/qmlmapwidgethelper.h1
3 files changed, 8 insertions, 3 deletions
diff --git a/map-widget/qml/MapWidget.qml b/map-widget/qml/MapWidget.qml
index 5b85aaa24..fb5545e88 100644
--- a/map-widget/qml/MapWidget.qml
+++ b/map-widget/qml/MapWidget.qml
@@ -69,10 +69,8 @@ Item {
drag.target: (mapHelper.editMode && mapHelper.model.isSelected(model.divesite)) ? mapItem : undefined
anchors.fill: parent
onClicked: {
- if (!mapHelper.editMode && model.divesite) {
- mapHelper.model.setSelected(model.divesite)
+ if (!mapHelper.editMode && model.divesite)
mapHelper.selectedLocationChanged(model.divesite)
- }
}
onDoubleClicked: map.doubleClickHandler(mapItem.coordinate)
onReleased: {
diff --git a/map-widget/qmlmapwidgethelper.cpp b/map-widget/qmlmapwidgethelper.cpp
index 02bfa78a2..fe43c6fce 100644
--- a/map-widget/qmlmapwidgethelper.cpp
+++ b/map-widget/qmlmapwidgethelper.cpp
@@ -46,6 +46,11 @@ void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds)
}
}
+void MapWidgetHelper::setSelected(const QVector<dive_site *> &divesites)
+{
+ m_mapLocationModel->setSelected(divesites);
+}
+
void MapWidgetHelper::centerOnSelectedDiveSite()
{
QVector<struct dive_site *> selDS = m_mapLocationModel->selectedDs();
@@ -115,6 +120,7 @@ void MapWidgetHelper::reloadMapLocations()
void MapWidgetHelper::selectionChanged()
{
+ updateEditMode();
m_mapLocationModel->selectionChanged();
}
diff --git a/map-widget/qmlmapwidgethelper.h b/map-widget/qmlmapwidgethelper.h
index 046cb4ce1..f2c5eb6bb 100644
--- a/map-widget/qmlmapwidgethelper.h
+++ b/map-widget/qmlmapwidgethelper.h
@@ -37,6 +37,7 @@ public:
Q_INVOKABLE void selectVisibleLocations();
Q_INVOKABLE void selectedLocationChanged(struct dive_site *ds);
void selectionChanged();
+ void setSelected(const QVector<dive_site *> &divesites);
QString pluginObject();
bool editMode() const;