aboutsummaryrefslogtreecommitdiffstats
path: root/map-widget/qmlmapwidgethelper.cpp
AgeCommit message (Collapse)Author
2017-12-28cleanup: Uninitialized pointer fieldGravatar Jan Mulder
CID: 208335 Mainly to silence Coverity, as I do not believe this caused any problem. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-27map-widget: use 'getter' function coordinate() for MapLocationGravatar Lubomir I. Ivanov
Avoid using qvariant_cast() with getRole() in favor of MapLocation::coordinate() in MapWidgetHelper::reloadMapLocations(). This makes the code more readble. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-27map-widget: start dive site editing with coords pre-enteredGravatar Lubomir I. Ivanov
Once the user starts editing a dive site, make sure to pass coordinates of either the current map center (if a new MapLocation is being added) or the coordinates of the existing MapLocation. The "Dive site management" coordinates text field would receive these new coordinates after the displayed_dive_site struct is updated and the coordinatesChanged() signal is emitted. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-27map-widget: move the map with the edited dive siteGravatar Lubomir I. Ivanov
Once the user starts editing the coordinates by hand (from the "Dive site management" UI) make sure to update the map to center on those user entered coordinates. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-09map-widget: allow real-time updates of edited markersGravatar Lubomir I. Ivanov
This patch allows updating the location of map markers while editing a dive site and updating the text in the LocationInformationWidget in real-time. Currently it is only possible to see the marker changes by clicking 'Apply'. The modification required the following changes: - add the MapWidget::updateCurrentDiveSiteCoordinatesToMap() slot and call it each time the GPS text updates - separate the updateCurrentDiveSiteCoordinates(FromMap/ToMap) logic by having the FromMap/ToMap suffix to method names - make MapWidgetHelper::updateCurrentDiveSiteCoordinatesToMap() call a new MapLocationModel::updateMapLocationCoordinates() method, which updates selected location coordinates and the model - add MapLocation::setCoordinateNoEmit() that does not emit a signal when updating a coordinate Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-09map-widget: use current center when editing new markersGravatar Lubomir I. Ivanov
When starting to edit a new dive location, create a marker at the current map center instead of zooming out and centering on the 0,0 coordinate. This will help (and speed up) a lot the edition, if the user needs to add numerous dive markers at a specific location close to each other. refs #754 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-05map-widget: move the widget and its resources to 'map-widget'Gravatar Lubomir I. Ivanov
Move all the map widget platform agnostic files to the <subsurface-root>/map-widget folder. This avoids the confusion about the desktop version of subsurface using mobile components. The map widget is planned as a shared component between the mobile and desktop versions. desktop-widgets/mapwidget[.h/.cpp] still remain as those are specific to the desktop version. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>