diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-07-15 23:52:59 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-28 07:31:11 -0700 |
commit | 6e916b6764c7779776240db6f48f8d4435c2745c (patch) | |
tree | d5d092948a0fe2317c4fe0230961aabaaa59bc7c | |
parent | df519be01e5d39736b98a2c51df905d7ba30d568 (diff) | |
download | subsurface-6e916b6764c7779776240db6f48f8d4435c2745c.tar.gz |
locationinformationwidget: abstract between GlobeGPS and MapWidget
Connect the same signals for the two classes based on the NO_MARBLE
macro.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
-rw-r--r-- | desktop-widgets/locationinformation.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp index 74f659593..80676b36f 100644 --- a/desktop-widgets/locationinformation.cpp +++ b/desktop-widgets/locationinformation.cpp @@ -5,6 +5,7 @@ #include "desktop-widgets/divelistview.h" #include "core/qthelper.h" #include "desktop-widgets/globe.h" +#include "desktop-widgets/mapwidget.h" #include "qt-models/filtermodels.h" #include "qt-models/divelocationmodel.h" #include "core/divesitehelpers.h" @@ -43,8 +44,8 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo ui.diveSiteListView->setModel(filter_model); ui.diveSiteListView->setModelColumn(LocationInformationModel::NAME); ui.diveSiteListView->installEventFilter(this); + // Map Management Code. #ifndef NO_MARBLE - // Globe Management Code. connect(this, &LocationInformationWidget::requestCoordinates, GlobeGPS::instance(), &GlobeGPS::prepareForGetDiveCoordinates); connect(this, &LocationInformationWidget::endRequestCoordinates, @@ -53,6 +54,15 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo this, &LocationInformationWidget::updateGpsCoordinates); connect(this, &LocationInformationWidget::endEditDiveSite, GlobeGPS::instance(), &GlobeGPS::repopulateLabels); +#else + connect(this, &LocationInformationWidget::requestCoordinates, + MapWidget::instance(), &MapWidget::prepareForGetDiveCoordinates); + connect(this, &LocationInformationWidget::endRequestCoordinates, + MapWidget::instance(), &MapWidget::endGetDiveCoordinates); + connect(MapWidget::instance(), &MapWidget::coordinatesChanged, + this, &LocationInformationWidget::updateGpsCoordinates); + connect(this, &LocationInformationWidget::endEditDiveSite, + MapWidget::instance(), &MapWidget::repopulateLabels); #endif } |