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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Kirigami prevents us from altering the color of the gps icon in the action menu. So let's display an gps fix icon in the lower left corner of the drawer when the location services is running, colored to match the themes primary accent color.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Not the lsit is much more compact and shows a lot more dives even on
smaller screens. And it's similar in style to the dive list.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Replace the theme checkboxes on the settings page
so that we get a unified UI.
These switches are linked and as such can only be activated
deactivation occurs when the user selects another theme.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Move the location services switch to the GPS menu, indicate both with icon and text if the service is active or not.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Strangely, a click/tap anywhere else worked as expected, but if you hit
exactly on the checkbox, the status change wasn't propagated.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In stead of using the fixed 4 column code introduced in f2fcad89b0db9b164d8fd3f89218ad27ca362bd3 use percentages of page width to allow for a more flexible layout since no block really has 4 columns.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Automatically save changes made on the settings page on completion of text fields or theme checkboxes.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Put all GPS settings in one block and revert to a 2 column layout while maintaing the 4 column widh.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Addresses: #492
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Had a bit of rebase issue with this one.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
New icons for the dive management sub-menu
ttps://material.io/icons/
The icons are under Apache License Version 2.0
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Add a couple of icons from the material repository.
https://material.io/icons/
The icons are under Apache License Version 2.0
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Add a checkbox to the preferences page to facilitate selective visibility of the developer menu. With the coresponding function in qmlmanager.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Fixes: #490 items 1) and 2).
1) Reference to isBluetooth.leftPadding is removed as the isBooltooth
checkbox is gone.
2) Do not set background color of downloaded dives. The checkbox is used
to denote "selected or not".
In addition, incorrect references to subsurfaceTheme.PrimaryColor (which
does not exist) are replaced by the correct subsurfaceTheme.primaryColor.
Finally, an obvious copy/paste error width: childrenRect.height. that
is supposed to be width: childrenRect.width.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit adds the capability to cancel a running download from DC.
The actual cancel is fully handled in the underlying libdivecomputer
code. As the user may be interested in the dives downloaded up to
the moment of cancel, do not just close the download screen (as
it was before this commit). Now, the <quit> button changes to
<cancel> when the download is started, and pressing cancel, only
cancels the download and does not close the download screen, but
presents the so far downloaded data. When no download is running,
the <quit> button just quits the screen as before.
Fixes: #485
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
The connection already clearly defines whether this is Bluetooth or not.
No reason for the separate checkbox.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I wonder if we even need this anymore at all as the connection
clearly determines whether this is a BT download or not.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we can't find a match, just leave it unchanged. This way, if we
mis-recognize a device, the user can correct the product (or even
vendor) without losing the correct connection.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add styling to the GPS fixes page.
The background color of the swipe list objects is wrong and also the icon overlay. This is a Kirigami issue.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
The built in theme in Kirigami has special variables for sertain objects, this sets the correct color for each object to match our themes.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
THe editable textboxes rely on the material theme to set the correct colors. This sets the appropriate colors for each theme.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This hides the text for the map it button if ther are no coordinates for a dive. Needed as for the dark theme the map it text was still visible.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This adds the right handle icon that is needed for the swipe list items not to report an error when activated.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Right now we need to restart Subsurface-mobile in order to detect
Bluetooth devices - so simply turning on BT after Subsurface-mobile was
started is not sufficient.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit only has the actual changes, the next commit will clean up
the white space in order to make it more obvious what was done.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These buttons only work when we successfully downloaded a dive. Also, don't
show a list of dives when there are no dives.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>