diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp index c378b9fb3..d5a926f59 100644 --- a/desktop-widgets/mapwidget.cpp +++ b/desktop-widgets/mapwidget.cpp @@ -9,6 +9,8 @@ #include "core/divesite.h" #include "mobile-widgets/qmlmapwidgethelper.h" #include "qt-models/maplocationmodel.h" +#include "mainwindow.h" +#include "divelistview.h" MapWidget *MapWidget::m_instance = NULL; @@ -23,6 +25,8 @@ MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent) m_rootItem = qobject_cast(rootObject()); m_mapHelper = rootObject()->findChild(); + connect(m_mapHelper, SIGNAL(selectedDivesChanged(QList)), + this, SLOT(selectedDivesChanged(QList))); } void MapWidget::centerOnDiveSite(struct dive_site *ds) @@ -59,6 +63,16 @@ void MapWidget::prepareForGetDiveCoordinates() // TODO; } +void MapWidget::selectedDivesChanged(QList list) +{ + qDebug() << "onSelectedDivesChanged:" << list.size(); + /* + MainWindow::instance()->dive_list()->unselectDives(); + if (!list.empty()) + MainWindow::instance()->dive_list()->selectDives(list); + */ +} + MapWidget::~MapWidget() { m_instance = NULL; diff --git a/desktop-widgets/mapwidget.h b/desktop-widgets/mapwidget.h index b7f4aac76..5a79cd68d 100644 --- a/desktop-widgets/mapwidget.h +++ b/desktop-widgets/mapwidget.h @@ -3,6 +3,7 @@ #define MAPWIDGET_H #include +#include #undef IGNORE @@ -31,6 +32,7 @@ public slots: void endGetDiveCoordinates(); void repopulateLabels(); void prepareForGetDiveCoordinates(); + void selectedDivesChanged(QList); private: static MapWidget *m_instance;