aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mapwidget.cpp
AgeCommit message (Collapse)Author
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>