summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
AgeCommit message (Collapse)Author
2017-07-28qrc: add a couple of images for the map type toggles (satellite/street)Gravatar Lubomir I. Ivanov
The QML based map will have a toggle in the top left corner to toggle between the satellite and steet tiles. The images are created specifically for use in this Qt Location widget and are free for use in Subsurface. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28qrc: yet another slight rename for the map markers resourcesGravatar Lubomir I. Ivanov
Use a "mapwidget-" prefix for both the QRC and the file names. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: use a seprate animation for zooming outGravatar Lubomir I. Ivanov
The animation sequence when deselecting a zoomed in map location, should be: - zoom out completely - pan to center To achieve that a new animation object is created - "mapAnimationZoomOut" The previous zoom in animation is renamed to "mapAnimationZoomIn". The map functions centerOnMapLocation() and deselectMapLocation() now call the helper functions animateMapZoomIn() and animateMapZoomOut(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: reduce the properies in mapAnimation to single linesGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgethelper.cpp: call deselectMapLocation() in QMLGravatar Lubomir I. Ivanov
If a divesite doesn't have a GPS location we want to deselect the currently selected markers and zoom out the map. In the Map QML object the function deselectMapLocation will handle that. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: don't use the onSourceChanged() slot for flag animationGravatar Lubomir I. Ivanov
It's best to only animate the flags when clicked, thus play the animation in the onClicked() slot from the MouseArea. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: add deselectMapLocation()Gravatar Lubomir I. Ivanov
When called this function will zoom-out the map and set it's center to (0, 0) Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: remove some redundant "map." referencesGravatar Lubomir I. Ivanov
Inside the Map object, properties can be referenced directly. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: add the animateMapTo() helper functionGravatar Lubomir I. Ivanov
To be used to center the map on a dive location or reset the map if a dive from the dive list doesn't have GPS coordinates. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: use map.newZoom and map.defaultZoomInGravatar Lubomir I. Ivanov
When centering on a map location, use the predefined zoom map.defaultZoomIn. Later the map should be able to center on (0, 0) and zoom-out if a dive doesn't have GPS data. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: whitespace and ';' cleanupGravatar Lubomir I. Ivanov
The rest of the QML code in subsurface doesn't use the ';' to end a line of code or a declaration. Remove all the redundant ';'. Also clean extra blank lines. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: play little animation on marker clicksGravatar Lubomir I. Ivanov
If a marker is clicked it's source image changes, which will call the onSourceChanged() slot. If a marker is selected play the newly added sourceItemAnimation which is a short scale animation for the image. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: update the Z order of selected markersGravatar Lubomir I. Ivanov
If a marker is selected bring it up front (high Z value) else set it behind everything else. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: add some properties for zoom and centerGravatar Lubomir I. Ivanov
These properties will be used when zooming-in on a map location or when zooming out if no map location is selected. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgethelper: pass a MapLocation object to QML in centerOnDiveSite()Gravatar Lubomir I. Ivanov
The function in QML centerOnCoordinate() is now renamed centerOnMapLocation() and accepts a MapLocation object, so that a marker is selected (based on UUID). In MapWidgetHelper::centerOnDiveSite(), the pointer to a MapLocation is retrieved via MapLocationModel::getMapLocationForUuid(). Added in the previous commit. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgethelper: add a slot to handle marker selection from the modelGravatar Lubomir I. Ivanov
When MapLocationModel updates the selected marker, MapWidgetHelper now receives a signal. The slot is named selectedLocationChanged(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: track the marker selectionGravatar Lubomir I. Ivanov
Add a MouseArea to the MapItemView delagate and onClick set the "mapHelper.model.selectedUuid" to the uuid of the clicked marker. This updates the "selectedUuid" property inside MapLocationModel. Based on "mapHelper.model.selectedUuid" it is now possible to show two seprate images for selected / deselected markers. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28maplocationmodel: add a "uuid" property to MapLocationGravatar Lubomir I. Ivanov
The "uuid" property will be the one from the dive_site. At first it will also be used to track the active marker/flag selection. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28qrc: use a separate image for the selected and unselected markersGravatar Lubomir I. Ivanov
The image for the unselected marker is now a slightly darker flag. Same behaviour as the current Marble implementation. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgethelper: pass a QGeoCoordinate to the QML mapGravatar Lubomir I. Ivanov
Rename the QML function "centerOnCoordinates" to "centerOnCoordinate" and pass a QGeoCoordinate to it in ::centerOnDiveSite(). This will prevent the creation of a QGeoCoordinate object on the QML side and instead it will be created in C++. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28maplocationmodel: use QVector for the MapLocation storageGravatar Lubomir I. Ivanov
QVector is faster, use it for "m_mapLocations" instead of QList. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28maplocationmodel: add the addList() methodGravatar Lubomir I. Ivanov
This method should be used if many markers are added at once. It's main purpose is to reduces the number of beingInsertRows() calls. Make MapWidgetHelper::reloadMapLocations() use it. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidgethelper: add the reloadMapLocations() methodGravatar Lubomir I. Ivanov
reloadMapLocations() is the method which is called when the list of markers (model) should be cleared and re-populated with new MapLocation objects. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28maplocationmodel: store the coordinate as QGeoCoordinateGravatar Lubomir I. Ivanov
Instead of maintaining a seperate latitude/longitude values in C++ and passing them to QML separatelly, pass them as a QGeoCoordinate. This reduces the number of model "roles" and also prevents the creations of extra objects in QML (e.g. via QtPositioning.coordinate(..)). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: implement the MapItemView with delegateGravatar Lubomir I. Ivanov
MapItemView is the QML class that handles the "create map markers based on a model". In this case the model is created as part of the MapWidgetHelper, so here passing "mapHelper.model" to the "model" property is enough. The delegate receives coordinates from the model as "model.latitude", "model.logitude" and converts them to QGeoCoordinate. The "sourceItem" image for the delagete is just an image ATM and is fetched from QRC. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28qmlmapwidgethelper: maintain an instance of MapLocationModelGravatar Lubomir I. Ivanov
The idea here is that the QML code should be able to fetch a model from the MapWidgetHelper instance which is instantiated inside the QML code; fetch it in the lines of "mapHelper.model". This way, updates at the backend would be reflected on the Map QML widget. 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-28mapwidget.qml: implement some map animationGravatar Lubomir I. Ivanov
When calling centerOnCoordinates() the map will now animate over a period of 3 seconds the zoom level and over 2 seconds the center of the map. Can be tweaked and improved later on. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: add the function centerOnCoordinates()Gravatar Lubomir I. Ivanov
This function can be called to center the map on a specific coordinates. For the C++ version call it via QMetaObject::invokeMethod() in centerOnDiveSite(). TODO: add QML property animations. 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-28qmlmapwidgethelper: remove stray test() methodGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28MapWidget.qml: reference the Map object in the MapWidgetHelper objectGravatar Lubomir I. Ivanov
The idea here is that the Map object can be controlled from C++ via the "m_map" private member. Also, for the mobile version, QML code can call the same C++ methods (if marked as Q_INVOCABLE). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28qmlmapwidgethelper.h: add a "map" property with m_map MEMBERGravatar Lubomir I. Ivanov
This is about to be used to reference the QML Map in the MapWidgetHelper C++ class. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28MapWidget.qml: create an instance of MapWidgetHelperGravatar Lubomir I. Ivanov
This instance in the QML code itself will be accessed by both the mobile and desktop version. That way, the map code between the two Subsurface versions will be shared. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mobile-widgets: add the helper class MapWidgetHelperGravatar Lubomir I. Ivanov
The idea with this class is that it should be used by both the mobile and desktop version. TODO STEPS: 1) the class should be registered in both the mobile and desktop version with qmlRegisterType<MapWidgetHelper>... 2) the MapWidget.qml should create an instance of this class. 3) this way the helper will be part of the QML and both the desktop and mobile version can have access to it. 4) the desktop version as a first implementation can just use findChild() in desktop-widgets/mapwidget.cpp. 5) desktop-widgets/mapwidget.cpp on the desktop should just translate calls from the rest of the desktop-widgets to this helper class. 6) the mobile version access to this object would be easy but is off the scope for now. 7) the idea, when implementing the desktop support is to make it so that when implementing the mobile version later, no or only minimal changes would be required to the MapWidgetHelper class. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28mapwidget.qml: enumerate the ESRI map types of interestGravatar Lubomir I. Ivanov
Add a local "enumeration" (object) for the two possibly map types of interest: SATELLITE and STREET. Use SATELLITE by default. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28map: use Item instead of Rectangle in MapWidget.qmlGravatar Lubomir I. Ivanov
The root element is now an Item and also doesn't have explicit anchors and dimensions as these will be handled by the parent: - on desktop: a QQuickWidget - on mobile: any QML based QQuickItem Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28map: add new marker resource imageGravatar Lubomir I. Ivanov
This new marker image is free for use in Subsurface. Custom made in CorelDraw and Photoshop. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28map: add placeholder MapWidget.qml in mobile-widgets/qmlGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28Revert "QML UI: color the status bar correctly"Gravatar Jan Mulder
This reverts commit d22f67925ef4893832c26deb44fef50589c6fff8.
2017-07-26QML UI: remove obsolete debugging codeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-26QML UI: remove "show password" switch and only show pw on first entryGravatar Jan Mulder
Like the subject says. We do not want the password to be made visible, so a switch to show it, is useless and is therefore removed. Futher, the entry mode is set to PasswordEchoOnEdit, which causes the passwd to be visible (for easy entry), but can't be made visible again after save/end edit. Fixes: #512 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-26QML UI: remove some dead codeGravatar Jan Mulder
Removed some unused alias defines. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-26QML UI: color the status bar correctlyGravatar Jan Mulder
In commit e9503cfa3d1740 re-coloring of the status bar was forgotten. Added here. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-26QML UI: add missing id line in our buttonGravatar Joakim Bygdell
The missing id line in our own button generates an error in log and makes the buttons to fat. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: use a lighter text color for the selected diveGravatar Joakim Bygdell
Use the ligther text color on the secondary row of text when a dive is selcted in the divelist Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: use primaryColor instead of darkerPrimaryColorGravatar Joakim Bygdell
In most places we wrongly used the darker primary color instead of the primary color. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: replcae the "map it" buttonGravatar Joakim Bygdell
Replace the "map it" button implementation with our own button. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: replace button on DC download pageGravatar Joakim Bygdell
Replace the generic buttons on the DC download page with our own. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26QML UI: add our own styled buttonGravatar Joakim Bygdell
Add out own styled button as resource. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>