aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mapwidget.cpp
AgeCommit message (Collapse)Author
2018-07-12desktop-widget: move qmlRegister from mapwidget to shared helperGravatar jan Iversen
Remove qmlRegister in desktop-widgets/mapwidget in order to have a shared registration in subsurface-helper.cpp Signed-off-by: Jan Iversen <jani@apache.org>
2018-06-21android/desktop: remove mapWidget from subsurface.qrcGravatar jan Iversen
remove mapWidget entries from subsurface.qrc, and add reference to map-widget.qrc in CMakelist.txt Android uses the same CMakelist.txt Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-14Core: remove dive.h from files that don't need itGravatar Dirk Hohndel
Of course, quite a few of them indirectly get it through other header files. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-29cleanup: Uninitialized pointer fieldGravatar Jan Mulder
CID 208311 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
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-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>
2017-10-07map-widget: don't crash if the map QML failed to loadGravatar Lubomir I. Ivanov
If the QML modules for QtLocation and QtPositioning are missing the QML in mapwidget.cpp will fail to load, which can lead to crashes. To solve the issue check if the QML has loaded and set a flag 'isReady' to true. If the loading has failed load another QML which is for showing a red error text in the lines of `MapWidget.qml failed to load!`. If the map QML has failed, use a macro in all relevant MapWidget members to turn them into a NOP. This approach leaves the rest of the codebase intact - e.g. no checks in classes which connect to the MapWidget class. Fixes #596 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28Map: try to wait for Map to loadGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-28Switch new files to unix line endingsGravatar Dirk Hohndel
I thought we had this automated, but Lubomirs commits introduced a few files with dos line endings. This is purely a change of line endings, no other changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-28mapwidget: add a method to set update editMode in MapWidgetHelperGravatar Lubomir I. Ivanov
The local slot coordinatesChangedLocal() tracks the MapWidgetHelper coordinatesChanged() signal and emit a coordinatesChanged() signal to any listeners (e.g. MainWindow). Also add a small change in centerOnDiveSite(), to not be called if we are skipping the reload (skipReload is updated by selectedDivesChanged()). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget: add the "skipReload" guardGravatar Lubomir I. Ivanov
This guard is to prevent a meaningless reload on the map marker list, when the user selects a new dive and nearby dives. The flag is updated in selectedDivesChanged() which on it's now cannot possibly trigger changes in the markers, only the selection. The selection of active flags is already handled by the model and automatically updated in the QML. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget: connect the helper selectedDivesChanged() signalGravatar Lubomir I. Ivanov
The selectedDivesChanged() signal from MapWidgetHelper is connected to a local slot. One problem here is that this crashes with the calls to DiveListView(). The dive list widget triggers events that call reload() on the MapWidget (same happens for Marble's Globe class) and that crashes somewhere in the QML shared library. TODO: investigate. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28qrc: use "MapWidget.qml" as a QRC aliasGravatar Lubomir I. Ivanov
Apparently, if it's required to import a QML component inside any QML file from resource, the compoment QRC alias has to have the same name as the component - e.g. add QRC alias MapWidgetContextMenu.qml allows creating a MapWidgetContextMenu compoment inside MapWidget.qml. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget: call MapWidgetHelper::reloadMapLocations()Gravatar Lubomir I. Ivanov
MapWidgetHelper::reloadMapLocations() is now called from MapWidget::reload() and MapWidget::repopulateLabels(). The mobile version should do similar. NOTE: These MapWidget methods names are from the Marble "port". Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.cpp: register the MapLocation and MapLocationModel typesGravatar Lubomir I. Ivanov
Apparently the "safe way" is to register C++ types is before the QML code has loaded. The idea here is that the QML code should know about these type definitions and be able to operate with them. TODO: do the same for the mobile version. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28add the SPDX-License-Identifier to new source filesGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28qmlmapwidgethelper: add the centerOnDiveSite() methodGravatar Lubomir I. Ivanov
MapWidget sould not handle any of the map backend. Instead it should just pass calls to MapWidgetHelper. Do that for centerOnDiveSite(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.cpp: obtain a reference of the MapWidgetHelper from QMLGravatar Lubomir I. Ivanov
Use findChild() to obtain the only MapWidgetHelper object created in the MapWidget.qml. Store the reference as a member variable - m_mapHelper. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28desktop-widgets/mapwidget: register the MapWidgetHelper QML typeGravatar Lubomir I. Ivanov
This commit registers the class MapWidgetHelper for QML in the desktop version. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget: add the placeholder prepareForGetDiveCoordinates() slotGravatar Lubomir I. Ivanov
Port from GlobeGPS. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget: add the placeholder repopulateLabels() methodGravatar Lubomir I. Ivanov
Another placeholder for the Marble port. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget: add the method centerOnIndex()Gravatar Lubomir I. Ivanov
Again for the port from Marble, later can be removed / renamed. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget: add public slot endGetDiveCoordinates()Gravatar Lubomir I. Ivanov
Later this has to be replaced / renamed if needed. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget: add an empty reload() methodGravatar Lubomir I. Ivanov
Call same method in MainWindow if the NO_MARBLE macro is defined. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget: add placeholder centerOnDiveSite() public slotGravatar Lubomir I. Ivanov
This is WIP and would be developed futher, so that the new map widget can center on a divesite location. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28map: add placeholder .cpp and .h files for the new map widgetGravatar Lubomir I. Ivanov
The files are WIP and located in desktop-widgets, as these would only be used by the desktop version. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>