mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Undo: update map when dive site location is changed by undo command
Simply hook into the appropriate signal. Thus, the "update dive site location" button can be removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
fa4fedbb48
commit
0b851d723e
5 changed files with 6 additions and 36 deletions
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "mapwidget.h"
|
||||
#include "core/divesite.h"
|
||||
#include "core/subsurface-qt/DiveListNotifier.h"
|
||||
#include "map-widget/qmlmapwidgethelper.h"
|
||||
#include "qt-models/maplocationmodel.h"
|
||||
#include "qt-models/divelocationmodel.h"
|
||||
|
|
@ -28,6 +29,7 @@ MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent)
|
|||
m_mapHelper = nullptr;
|
||||
setResizeMode(QQuickWidget::SizeRootObjectToView);
|
||||
connect(this, &QQuickWidget::statusChanged, this, &MapWidget::doneLoading);
|
||||
connect(&diveListNotifier, &DiveListNotifier::diveSiteChanged, this, &MapWidget::diveSiteChanged);
|
||||
setSource(urlMapWidget);
|
||||
}
|
||||
|
||||
|
|
@ -116,10 +118,11 @@ void MapWidget::coordinatesChangedLocal(const location_t &location)
|
|||
emit coordinatesChanged(location);
|
||||
}
|
||||
|
||||
void MapWidget::updateDiveSiteCoordinates(struct dive_site *ds, const location_t &location)
|
||||
void MapWidget::diveSiteChanged(struct dive_site *ds, int field)
|
||||
{
|
||||
CHECK_IS_READY_RETURN_VOID();
|
||||
m_mapHelper->updateDiveSiteCoordinates(ds, location);
|
||||
if (field == LocationInformationModel::LOCATION)
|
||||
m_mapHelper->updateDiveSiteCoordinates(ds, ds->location);
|
||||
}
|
||||
|
||||
MapWidget::~MapWidget()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue