Commit graph

688 commits

Author SHA1 Message Date
Lubomir I. Ivanov
b0cf820bef mapwidget.qml: move the new map type toggle on top of the map
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
09a0f74bd8 mapwidget.qml: animate the map type toggle image on click
Add a SequentialAnimation that performs a slight animation of the
toggle image scale.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
8487873029 mapwidget.qml: add an small icon (top-left) to toggle the map type
Clicking the image toggles the map.activeMapType value from type
STREET to type SATELLITE.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
468f3b57c0 mapwidget.qml: simplify the map type enumeration into "mapType"
Make the "enumeration" local to the Map object for now.
This will possibly break if another plugin is used in place of the
ESRI plugin, but it will simplify the map toggle button which is about
to be implemented next.

If support for multiple plugins is added on runtime a simple
helper function will be needed that will check the current plugin "name".
And return the appropriate supportedMapTypes[X] for e.g. STREET of that
plugin.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
8b22435809 qrc: add a couple of images for the map type toggles (satellite/street)
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-28 07:31:11 -07:00
Lubomir I. Ivanov
88c6d98265 qrc: yet another slight rename for the map markers resources
Use a "mapwidget-" prefix for both the QRC and the file names.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
ce309c15a7 mapwidget.qml: use a seprate animation for zooming out
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-28 07:31:11 -07:00
Lubomir I. Ivanov
6aa57ce7f7 mapwidget.qml: reduce the properies in mapAnimation to single lines
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
11eaea01dd mapwidgethelper.cpp: call deselectMapLocation() in QML
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-28 07:31:11 -07:00
Lubomir I. Ivanov
250fc1e03f mapwidget.qml: don't use the onSourceChanged() slot for flag animation
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-28 07:31:11 -07:00
Lubomir I. Ivanov
23c56b3c31 mapwidget.qml: add deselectMapLocation()
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-28 07:31:11 -07:00
Lubomir I. Ivanov
3e3b4baee2 mapwidget.qml: remove some redundant "map." references
Inside the Map object, properties can be referenced directly.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
a8f6c99fc0 mapwidget.qml: add the animateMapTo() helper function
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-28 07:31:11 -07:00
Lubomir I. Ivanov
033eec9500 mapwidget.qml: use map.newZoom and map.defaultZoomIn
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-28 07:31:11 -07:00
Lubomir I. Ivanov
6299a3c93b mapwidget.qml: whitespace and ';' cleanup
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-28 07:31:11 -07:00
Lubomir I. Ivanov
2d101b7252 mapwidget.qml: play little animation on marker clicks
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-28 07:31:11 -07:00
Lubomir I. Ivanov
24d5485a88 mapwidget.qml: update the Z order of selected markers
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-28 07:31:11 -07:00
Lubomir I. Ivanov
6c640158e8 mapwidget.qml: add some properties for zoom and center
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-28 07:31:11 -07:00
Lubomir I. Ivanov
b4740803a1 mapwidgethelper: pass a MapLocation object to QML in centerOnDiveSite()
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-28 07:31:11 -07:00
Lubomir I. Ivanov
a920d683a1 mapwidgethelper: add a slot to handle marker selection from the model
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-28 07:31:11 -07:00
Lubomir I. Ivanov
f2608edc56 mapwidget.qml: track the marker selection
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-28 07:31:11 -07:00
Lubomir I. Ivanov
a9c0abd71a maplocationmodel: add a "uuid" property to MapLocation
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-28 07:31:11 -07:00
Lubomir I. Ivanov
ea5221bcf0 qrc: use a separate image for the selected and unselected markers
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-28 07:31:11 -07:00
Lubomir I. Ivanov
476670cb8d mapwidgethelper: pass a QGeoCoordinate to the QML map
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-28 07:31:11 -07:00
Lubomir I. Ivanov
de90480b46 maplocationmodel: use QVector for the MapLocation storage
QVector is faster, use it for "m_mapLocations" instead of QList.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
6ed807f52d maplocationmodel: add the addList() method
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-28 07:31:11 -07:00
Lubomir I. Ivanov
ffb92111e5 mapwidgethelper: add the reloadMapLocations() method
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-28 07:31:11 -07:00
Lubomir I. Ivanov
f44645b6fe maplocationmodel: store the coordinate as QGeoCoordinate
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-28 07:31:11 -07:00
Lubomir I. Ivanov
d783984443 mapwidget.qml: implement the MapItemView with delegate
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-28 07:31:11 -07:00
Lubomir I. Ivanov
a50e9866d5 qmlmapwidgethelper: maintain an instance of MapLocationModel
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-28 07:31:11 -07:00
Lubomir I. Ivanov
2cb8fee827 add the SPDX-License-Identifier to new source files
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
0678e5936c mapwidget.qml: implement some map animation
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-28 07:31:11 -07:00
Lubomir I. Ivanov
5f2e60142a mapwidget.qml: add the function centerOnCoordinates()
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-28 07:31:11 -07:00
Lubomir I. Ivanov
5cc2c02dfb qmlmapwidgethelper: add the centerOnDiveSite() method
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-28 07:31:11 -07:00
Lubomir I. Ivanov
c68536ec56 qmlmapwidgethelper: remove stray test() method
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Lubomir I. Ivanov
5266a5e84b MapWidget.qml: reference the Map object in the MapWidgetHelper object
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-28 07:31:11 -07:00
Lubomir I. Ivanov
118a3b9804 qmlmapwidgethelper.h: add a "map" property with m_map MEMBER
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-28 07:31:11 -07:00
Lubomir I. Ivanov
0d75dec0fa MapWidget.qml: create an instance of MapWidgetHelper
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-28 07:31:11 -07:00
Lubomir I. Ivanov
f5882362d3 mobile-widgets: add the helper class MapWidgetHelper
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-28 07:31:11 -07:00
Lubomir I. Ivanov
ccaaff42a3 mapwidget.qml: enumerate the ESRI map types of interest
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-28 07:31:11 -07:00
Lubomir I. Ivanov
e9d4bdcf4e map: use Item instead of Rectangle in MapWidget.qml
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-28 07:31:11 -07:00
Lubomir I. Ivanov
42980e51d3 map: add new marker resource image
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-28 07:31:11 -07:00
Lubomir I. Ivanov
a73a56284c map: add placeholder MapWidget.qml in mobile-widgets/qml
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00
Jan Mulder
e6ee87efec Revert "QML UI: color the status bar correctly"
This reverts commit d22f67925e.
2017-07-28 07:30:44 -07:00
Dirk Hohndel
f3271c973f QML UI: remove obsolete debugging code
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-26 06:31:14 -07:00
Jan Mulder
bb7dcc25c7 QML UI: remove "show password" switch and only show pw on first entry
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-26 22:30:43 +09:00
Jan Mulder
e1e1c4b650 QML UI: remove some dead code
Removed some unused alias defines.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-26 21:57:11 +09:00
Jan Mulder
d22f67925e QML UI: color the status bar correctly
In commit e9503cfa3d re-coloring of the status bar was
forgotten. Added here.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-26 21:57:11 +09:00
Joakim Bygdell
1ebd7dd430 QML UI: add missing id line in our button
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-26 14:13:22 +09:00
Joakim Bygdell
25fd8c1727 QML UI: use a lighter text color for the selected dive
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-26 14:13:22 +09:00
Joakim Bygdell
e9503cfa3d QML UI: use primaryColor instead of darkerPrimaryColor
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-26 14:13:22 +09:00
Joakim Bygdell
0e0b5cee22 QML UI: replcae the "map it" button
Replace the "map it" button implementation with our own button.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
9d2c4dcd3c QML UI: replace button on DC download page
Replace the generic buttons on the DC download page with our own.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
4bcbe8e3a0 QML UI: add our own styled button
Add out own styled button as resource.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
ae33422ede QML UI: replace all checkboxes with our own
As per title, helps simplify theme modifications.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
fe425924e4 QML UI: add our own styled checkbox
Add out own styled checkbox as resource.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
071db08b14 QML UI: replace all switches with our own
As per title, helps simplify theme modifications.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
93ec03105e QML UI: add our own styled switch
This adds a switch styled for us, size is about the same as the material default.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
d803d3e63c QML UI: display gps fix icon in the global drawer
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>
2017-07-26 01:39:26 +09:00
Joakim Bygdell
a981c3d7c1 QML UI: add colored version of the gps location icon
This adds colred versions of the Material ic_gps_fixed icon, in our primary blue and pink colors.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-26 01:39:26 +09:00
Jan Mulder
fd03621a4b Mobile: honour location service time threshold
Independ of the settings, the threshold to reset the GPS data was
hard coded to 5 minutes. Now, honour the entered (and updated during
a session) time to refresh the GPS data in the location service.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-25 22:12:19 +09:00
Miika Turkia
97b770b837 Error message on mobile cloud credentials
Display proper error message when cloud credentials are incorrect.

See #481

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-07-25 10:04:20 +09:00
Dirk Hohndel
04213e1f03 QML UI: Download from DC: tell user if BT is disabled
This makes much more sense than displaying "No dives"

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23 17:51:48 -07:00
Dirk Hohndel
be8eedb773 QML UI: Download from DC: move label next to buttons
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23 17:45:55 -07:00
Dirk Hohndel
442ba66822 QML UI: remove obsolete comment
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-23 17:32:21 -07:00
Dirk Hohndel
8c0a1c2e6d QML UI: better list of downloaded dives
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>
2017-07-23 17:30:05 -07:00
Joakim Bygdell
b9e90441ca QML UI: replace theme checkboxes with switches
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>
2017-07-23 23:47:22 +09:00
Joakim Bygdell
d51fe03bd9 QML UI: move location services to GPS menu
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>
2017-07-23 23:47:22 +09:00
Joakim Bygdell
3b3f6b67f5 QML UI: fix copy paste error
The credential status has nothing to do with GPS functionality.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 23:47:22 +09:00
Joakim Bygdell
2187ef6c90 QML UI: fix typo
Simple typo on the overlay drawer.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 23:47:22 +09:00
Dirk Hohndel
686b87e903 QML UI: Download from DC: respond to click on checkbox
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>
2017-07-22 16:15:00 -07:00
Dirk Hohndel
05a3bbe65c QML UI: Download from DC: remove unused property
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22 16:15:00 -07:00
Dirk Hohndel
e49a3b01ab QML UI: save credentials as they are bein entered
We removed the action button for saving on the Settings page, so credentials
never got saved.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22 16:15:00 -07:00
Dirk Hohndel
680022aea5 QML UI: don't disclose the current password
This isn't perfect, but at least it doesn't disclose a password that
isn't currently being edited.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22 16:15:00 -07:00
Dirk Hohndel
a03aa44821 QML UI: fix typo
And remove line that's commented out.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22 16:15:00 -07:00
Dirk Hohndel
a24e49361d Add README explaining icon licenses
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-22 11:26:06 -07:00
Joakim Bygdell
1659390a54 QML UI: simplify settings page code
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>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
a80394d5b6 QML UI: make the theme settings not overflow page width
As per title.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
f96dacc94d QML UI: remove the save button from settings page
As per title.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
ee210c3bcd QML UI: enable auto-save on settings page
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>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
bc0f473908 QML UI: merge all GPS settings in one block
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>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
a56e98ffc6 QML UI: Replace checkboxes on settingspage with switches
Replace the checkboxes for location services and developer with switches.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
a5d43bc5f8 QML UI: fix typo
Simple typo fix.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Rick Walsh
213f68d922 Mobile settings: stylize switches
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-07-23 03:20:58 +09:00
Rick Walsh
8d2b59ff31 Mobile Settings formatting
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
6655b37add Mobile: consolidate settings to one page and menu entry
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>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
e80132cdef QML UI: move location service to preferences page
Move the locations service switch to the GPS section of  the preferences page.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
98268a0c7e QML UI: add icons to the GPS menu
As per title.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
5739294c07 QML UI: add icons to the dive management sub-menu
The title says it all.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
72c5125b2e Add more icons
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>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
8419a19810 QML UI: add icons to global drawer
Add an icon to each item in the global drawer

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
71b6b8e043 Add material icons
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>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
a66d876ed0 QML UI: add checkbox to show/hide developer menu
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>
2017-07-23 03:20:58 +09:00
Joakim Bygdell
0eef27376a QML UI: reorder the items of the global drawer
Change the order of the items in the global drawer and change the name of some of them.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-23 03:20:58 +09:00
Jan Mulder
6f8e50f860 QML UI: fix some obvious UI errors
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>
2017-07-19 21:52:22 +09:00
Jan Mulder
619fbaf1e2 QML UI: Allow cancel of ongoing download
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>
2017-07-19 21:49:37 +09:00
Jan Mulder
915b760d54 Android: truncate logfile and add date
Trucate the logfile on open to remove any data from previous sessions.
This confused me very much, as the new logfile started from the
top, leaving old data on the bottom.

Also added system date for easy reference.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-19 11:13:03 +09:00
Joakim Bygdell
c1e0324d95 QML UI: set the color of the action side-buttons
This sets the color of the action side-buttons to the same color as the overlay drawer.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-18 00:49:31 -07:00
Dirk Hohndel
bb3387f234 QML UI: Download from DC: remove Bluetooth checkbox
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>
2017-07-18 00:49:31 -07:00
Dirk Hohndel
0104d7444e QML UI: Download from DC: smaller font for connection
Also style all three drop downs the same (otherwise the left edge of the
text doesn't align).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-18 00:49:31 -07:00
Dirk Hohndel
025efc12d4 QML UI: remove the Paired Bluetooth Devices virtual vendor
We now actually handle connections in a sane manner and don't need
that workaround anymore.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-18 00:49:31 -07:00
Dirk Hohndel
c7e284369a Merge branch 'MobileUI' of git://github.com/jbygdell/subsurface 2017-07-17 07:39:48 -07:00
Dirk Hohndel
695be281c0 QML UI: automatically set the Bluetooth checkbox
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>
2017-07-17 07:36:44 -07:00
Dirk Hohndel
ec1b22b487 QML UI: only change connection when finding a match
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>
2017-07-17 07:35:22 -07:00
Dirk Hohndel
40223c8a5f QML UI: show the connection choices in Download UI
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-16 21:53:44 -07:00
Joakim Bygdell
a4e3a4cb25 QML UI: style the GPS fixes page
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>
2017-07-15 18:21:03 +02:00
Joakim Bygdell
03a52b37bc QML UI: add material theme controls
In order for the theme styilng to work we need the materials definitions.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15 18:11:34 +02:00
Dirk Hohndel
7f49ba745c Fix compile errors
This was fixed in my local tree but I forgot to amend the commit
before pushing it out. Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-15 08:17:05 -07:00
Joakim Bygdell
4a1b675b86 Fix typo
Simple typo.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15 16:36:37 +02:00
Joakim Bygdell
c0a9426ad3 QML UI: add Kirkigami theme variables
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>
2017-07-15 16:35:40 +02:00
Joakim Bygdell
745e29958a QML UI: define the material accent colors for each theme
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>
2017-07-15 16:33:52 +02:00
Joakim Bygdell
1f20350849 QML UI: style the overlay drawer
This adds separate colors for the overlay drawer background for light and dark themes.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15 16:31:55 +02:00
Joakim Bygdell
0c31167e72 QML UI: style the GPS services checkbox
This adds style to the GPS services checkbox so that it matches the theme.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15 16:28:58 +02:00
Joakim Bygdell
b889bf117d QML UI: style the DC download dialog
This sets the checkboxes in the dive computer download dialog to match the rest of the theme.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-15 16:27:34 +02:00
Dirk Hohndel
a0c6ceeb3d QML UI: enforce rules for cloud credentials
Email addresses are checked for a someone useful pattern, passwords are
letters, numbers, and +-_. only. Reject anything else.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-14 22:41:25 -07:00
Joakim Bygdell
60b64ceca4 QML UI: Hide map it text if no coordinates exists
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>
2017-07-14 16:28:50 +02:00
Joakim Bygdell
2ecd7e58d4 QML UI: Change the pink color
This changes the pink primary color to match the tone of the blue primary color.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-14 15:44:45 +02:00
Joakim Bygdell
9f3a565601 QML UI: Add right handle icon
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>
2017-07-14 15:41:04 +02:00
Joakim Bygdell
2f0873a7c1 QML UI: Don't use black for dark theme
This sets the background color to the recommended hue for dark themes.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-14 15:37:59 +02:00
Dirk Hohndel
b7b2e813ad QML UI: only offer BT checkbox if BT is available
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>
2017-07-12 04:16:39 -07:00
Dirk Hohndel
2c111bb4cc QML UI: make BT state available to QML
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-12 04:14:24 -07:00
Dirk Hohndel
d233725519 Whitespace change
No code change at all.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 21:11:37 -07:00
Dirk Hohndel
3a7ecc1a7f QML UI: make Preferences page scrollable
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>
2017-07-09 21:11:37 -07:00
Dirk Hohndel
6422932c61 QML UI: correctly wrap devinfo message
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 21:11:37 -07:00
Dirk Hohndel
7b922a1f72 QML UI: actually write libdc logfile
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 18:23:16 -07:00
Dirk Hohndel
dbb5826f2a QML UI: add preference for libdivecomputer log
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 18:08:36 -07:00
Dirk Hohndel
0a0c93e3b7 QML UI: add variable for libdc logfile
It seemed cleanest and easiest to have this in the QMLManager and
not in the DCDownload object.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 18:08:06 -07:00
Dirk Hohndel
ff659396c3 QML UI: fix typo in color values
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 18:06:12 -07:00
Dirk Hohndel
c59a74029b Android: write appLog to file
The trick is to pick a path that is accessible from other applications.
In theory QStandardPaths::GenericDataLocation should provide that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 17:40:29 -07:00
Dirk Hohndel
9111ce01e7 QML UI: show progress messages on the download page
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 16:07:48 -07:00
Dirk Hohndel
8e0895e429 QML UI: Download from DC: disable misleading UI elements
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>
2017-07-09 16:07:03 -07:00
Dirk Hohndel
fd96daca6a QML UI: add progress message variable
To be shared between C/C++ and QML code in order to show the updates
and potential error messages from libdivecomputer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 15:07:44 -07:00
Dirk Hohndel
d2a5bf87c4 QML UI: add dev_info data to AppLog
This should make it easier to tell how far we get downloading data
from dive computers.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-09 12:50:22 -07:00
Joakim Bygdell
22a0ebe45d QML UI: Style the gps checkbox
Style the gps checkbos on the dive edit page so it follows
theme coloring.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-09 03:06:04 +09:00
Joakim Bygdell
4698b86b13 QML UI: Style the radio buttons
This styles the radio  buttons in the preferences pane
so they follows the theme colors.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-09 03:06:04 +09:00
Joakim Bygdell
4c4b72853c QML UI: Style the BT download checkbox
Style the checkbox to the themes primary color

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-09 03:06:04 +09:00
Joakim Bygdell
aa5060669c QML UI: Style Dive Details View
Change the accent colors in the dive details view
to match the theme colors.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-09 03:06:04 +09:00
Joakim Bygdell
b9a05e501b QML UI: Style DC download buttons
Style the button in the DC download dialog so they follow
the theme colors.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-09 03:06:04 +09:00
Joakim Bygdell
12ac75c7dd QML UI: Proper button color
Make the "map it" button follow the theme color.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-07-09 03:06:04 +09:00
Dirk Hohndel
b1f4a2975f QML UI: better icon for download from dive computer
Thanks to Davide for paying for professional icon design.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-08 10:29:10 -07:00
Dirk Hohndel
c9c9a8390a QML UI: start BT discovery a tiny bit later
This way the AppLog starts with the name and version of Subsurface-mobile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-06 09:34:37 -07:00
Dirk Hohndel
ce21c2a696 QML UI: drop AppLog title and add margin instead
The title was hidden under the title bar, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-06 09:34:37 -07:00
Dirk Hohndel
282698e5d2 QML UI: disable reachability mode
Latest Kirigami master allows us to turn off reachability mode. In
general this had been rather confusing to our users and it seems to
somewhat conflict with the pull down to refresh of the dive list.

Latest Kirigami also changes the behavior of refresh slightly, you now
need to pull "down" for at least 500ms before it triggers. So, with this
change and the latest Kirigami, hopefully the user experience for
refresh is good enough that we can consider keeping it enabled and use
it as an equivalent to manual sync (even in offline mode).

See #454
See #456

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-29 15:10:42 -07:00
Jan Mulder
d6446569af QML UI: only drag a pull down sync, and not flick it
Fast flicking to the top of the divelist triggers almost certainly a
pull down sync, as the default boundBehavior is DragAndOvershootBounds.
Despite being the default QML action, this leads to unwanted pull
down syncs (even in offline mode).

Setting the boundBehavior to DragOverBounds solves this issue. Now,
the user has to explicitly drag the top down to force a pull down
sync, and a accidental fast flick is stopped at the upper bound.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-29 23:21:55 +09:00
Dirk Hohndel
b459ccbff7 QML UI: DiveList: make download from DC main action
Now that we support this for many dive computers, that seem reasonable.
I'm not happy with the icon, but couldn't figure out a better one in the
breeze icon set.

See #426

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-27 22:18:26 -07:00
Dirk Hohndel
77f545b38e QML UI: Download from DC: move accept button to the right
So it doesn't conflict with the hamburger menu button / opening the
global drawer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-25 16:12:45 -07:00
Dirk Hohndel
4963b27f52 QML UI: Download from DC: avoid assignments of undefined values
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-25 16:12:07 -07:00
Dirk Hohndel
fc2ca3a804 QML UI: DC Download progress indicator
For now just do an indeterminate busy indicator - we can get more fancy
and use the libdivecomputer progress event, later.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-25 15:52:07 -07:00
Jan Mulder
03badea06f QML UI: make toast message translatable
Restyle construction of toast message and enable translation for it.
Further, removed newline characters as they break the lines at
non-logical positions.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-25 13:56:04 +09:00
Dirk Hohndel
d93280f1dc QML UI: DiveList: add date box to trip header
This way you can tell when a trip happened.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-24 13:13:04 -07:00
Dirk Hohndel
49a368539a QML UI: set opacity of 1 for dive list
Hopefully with this we get exactly the right colors.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-24 11:19:56 -07:00
Dirk Hohndel
e3cd6719c1 QML UI: Davide's colors for the blue theme
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-24 11:18:18 -07:00
Dirk Hohndel
94bc756391 QML UI: Theme colors: fix bad typo
Here I confused myself with "dark" theme and the "darkerPrimary"
colorls...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 21:36:59 -07:00
Dirk Hohndel
206df227f8 QML UI: remember the theme
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 19:49:57 -07:00
Dirk Hohndel
26b206af1f QML UI: show a small color palette preview
When picking which color theme to use, show the user how things will look.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 19:49:57 -07:00
Dirk Hohndel
8ba581a088 QML UI: use textColor instead of diveListTextColor
This color is used for more than just the dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 19:49:57 -07:00
Dirk Hohndel
694e833f90 QML UI: move theme setting into preferences
And reorganize settings and preferences a bit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 18:48:41 -07:00
Dirk Hohndel
dac9ce578b QML UI: clean up the setting of theme colors
Let's have names for the colors in each theme and assign those
named values to the theme colors when switching themes. This
way other pages can access the colors that are not in the current
theme (for example for a theme switcher).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 18:48:41 -07:00
Dirk Hohndel
3f055ac9cb QML UI: set color of the action button
This requires Kirigami master past 2.2.0 (which explains commit 001ff1b9
"QML UI: switch to Kirigami master").

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 08:44:55 -07:00
Dirk Hohndel
57e365222b QML UI: color the status bar on Android
This code is based on code from Marco Martin from the Kirigami Android
sample app. In order to simplify the QML code the QMLManager function is
there for all OSs, but it's a no-op on anything but Android.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-23 08:42:45 -07:00
Dirk Hohndel
b1f7e3eae2 QML UI: add missing go-up icon
Now the 'Reachability' feature should be more obvious.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-22 09:05:43 -07:00
Dirk Hohndel
ea218b9d24 QML UI: DiveList: allow trip header to wrap
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-22 04:19:23 -07:00
Rick Walsh
d9cb65cbed QML UI: turn off spinner if pull-down-to-refresh fails
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-22 04:19:23 -07:00
Dirk Hohndel
28490d5dd0 QML UI: DiveDetails: add more space at bottom
This way the user can scroll up the page to see all of the notes without
having them covered by the action button.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 18:33:27 -07:00
Dirk Hohndel
a7fca80a3e QML UI: don't access dive without modelData
Occasionally I see errors in the log where we would access modelData.dive
with modelData = null. This patch addresses a couple of the spaces where
this happens, but also simplifies the code by using the existing alias.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 17:20:07 -07:00
Dirk Hohndel
7b7294d127 QML UI: DiveList: implement pull down to refresh
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 17:20:07 -07:00
Dirk Hohndel
e0f46b033d QML UI: attempt to add dark theme
This isn't great, yet, but a first step to show that this is possible
(and in doing so I found quite a few spots where the colors weren't
correctly propagating, yet).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 17:20:07 -07:00
Dirk Hohndel
8f2fc84ae7 QML UI: simple attempt to allow color scheme switching
By making the assignments to the Kirigami Theme colors Qt bindings
things get correctly updated when switching.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 14:01:30 -07:00
Dirk Hohndel
71d9aafcd6 QML UI: Linus requested Hot Pink as color scheme
He started the project, he gets to have his color preference.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 13:34:15 -07:00
Dirk Hohndel
4651454557 QML UI: don't reduce opacity for background of selected dive
Now that we have distinct colors for trip header and selected dive, this
is actually counter productive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 11:53:19 -07:00
Dirk Hohndel
02d8c98c93 QML UI: DiveList: always show current trip at the top
This is especially nice for very long dive trips.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 11:48:29 -07:00
Dirk Hohndel
9ddd26ff37 QML UI: redo all the colors
Naming them the same way Davide named them in his emails and assigning the
color values he proposed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 11:05:36 -07:00
Dirk Hohndel
16f16f6818 QML UI: DiveList: fix position of delete button
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 11:01:37 -07:00
Dirk Hohndel
c775fcebec QML UI: DiveList: turn the color blob into a thin line
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 09:55:03 -07:00
Dirk Hohndel
fc4153f8ac QML UI: make title bar taller again on Android
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 09:29:24 -07:00
Dirk Hohndel
d7be3b21d6 QML UI: DiveList distinguish trip and selected dive
Making the selected dive's background less opaque prevents confusion.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-21 09:28:40 -07:00
Dirk Hohndel
1d32ebd657 QML UI: use Android palette colors
These were picked from
https://material.io/guidelines/style/color.html#color-color-system

One could argue that we should use different colors for iOS.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 22:51:25 -07:00
Dirk Hohndel
d1ed9c310f QML UI: remove files we no longer use
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 22:49:41 -07:00
Dirk Hohndel
fd5cd5ebf0 QML UI: DiveList: playing with different colors
Make the accent color much lighter, don't have a solid bar on the left
for dives that are part of a trip.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 16:21:47 -07:00
Dirk Hohndel
7a6f87405a QML UI: disable the MouseArea
Visible doesn't even make sense...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 13:28:46 -07:00
Dirk Hohndel
20dae442ad QML UI: DiveDetailsView add button for map
Implementing another suggestion from Davide. A button to get the map
(as well as just tapping on the location name).

Fixes #431

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 13:28:46 -07:00
Dirk Hohndel
7ccda01e7e QML UI: DiveDetailsView: make key dive info consistent with dive list
Remove the grid layout and replace it with code that is derived from the delegate
that we use in the dive list. In order to look proportional I ended up using a
larger font for the location and therefore decided to allow that text to wrap
instead of forcing single line.

This implements a good chunk of another one of Davide's great
suggestions.

See #431

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 13:06:29 -07:00
Dirk Hohndel
cbcb43247e QML UI: DiveDetailsView: make the lower section less busy
This removes fairly redundant text (yes, we know those are the Dive Details) and
makes the label for the Notes consistent with all the other labels.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 11:59:51 -07:00
Dirk Hohndel
4f34513277 QML UI: DiveDetailsView: move profile into bottom layout
Then we can remove the main layout and create a similar look as we now have
in the dive list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 11:57:14 -07:00
Dirk Hohndel
d941384fb6 QML UI: DiveDetailsView: don't underline location
Davide points out that this is not a commonly understood way in an app
to indicate that a text is also a link. So let's just remove that (but
tapping on the location will still work to get you to the map if there
is GPS information available).

See #431

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 11:07:09 -07:00
Dirk Hohndel
4a2e21cf7b QML UI: log the font in use
This shows that we are, indeed, using Roboto on Android. Which means I
can close the first of Davide's design issues:

Fixes #427

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 11:00:01 -07:00
Dirk Hohndel
157e14e11d QML UI: DiveList: some fine tuning of sizes and spacing
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 10:05:45 -07:00
Dirk Hohndel
712d1e97f3 QML UI: DiveList: remove space below trip heading
That made sense before we had the shaded background, now it just looks terrible.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 09:25:07 -07:00
Dirk Hohndel
edd0d2f2bb QML UI: DiveList: don't show empty trip heading for dives without trip
We need to hide the left bar and background rectangle as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 09:14:05 -07:00
Dirk Hohndel
a93e3b26d6 QML UI: DiveList: show left bar on dives that are part of a trip
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 09:13:12 -07:00
Dirk Hohndel
a6a9eaa998 QML UI: DiveList: add blue bar on the left to trip heading
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 08:29:06 -07:00
Dirk Hohndel
684354ab6e QML UI: re-indent DiveList code
No actual changes besides whitespace.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 07:49:11 -07:00
Dirk Hohndel
e49301ea21 QML UI: DiveList: add background color to trip heading
In order to make it easier to see the changes, the code hasn't been re-indented.
This will be in the next commit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 07:49:11 -07:00
Dirk Hohndel
3d8f61fe6c QML UI: turn DiveList heading into label
This way it will render in the same font as the location of a dive.
This will look like crap until the next commit adds a rectangle with
color around it, but this way it's much easier to see the individual
changes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-20 07:45:16 -07:00
Dirk Hohndel
3d707dca9a QML UI: make the dive list heading slightly smaller
Again, the goal is to make this list look better and be more space
efficient.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-18 18:05:18 -07:00
Dirk Hohndel
d74ef97228 QML UI: less whitespace around dive list entries
This way we get to show a few more dives per screen.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-18 17:38:03 -07:00
Dirk Hohndel
47a01b1dcd QML UI: improve the dive list layout
Based on Davide's ideas, but with a few tweaks:
I really like the dive number on the far right; that gives a clean
consistent look. I tried it with date on the left and depth/duration in
the middle and liked the result.

This doesn't change the font, just addresses the layout and bold heading
vs smaller sub-heading.

See #427

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-18 17:06:53 -07:00
Dirk Hohndel
2b01ab7d50 Clean up git storage update messages
Translate all of them, but also remove some redundant or possibly
misleading messages. These are now seen by users, not just developers
trying to debug the code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-18 01:00:30 -07:00
Dirk Hohndel
4866dd6f45 QML UI: show debug output in the App Log
We have unified the debug output to the console and to the App Log, let's
use it consistently everywhere.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-17 23:23:41 -07:00
Dirk Hohndel
b2b51c833a QML UI: redesign the user notification
The old system of cloud access updates with fake percentages just wasn't
helpful. Even worse, it hid a lot important information from the user.
This should be more useful (but it will require that we localize the
messages sent from the git progress notifications and make them more
'user ready').

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-17 23:22:37 -07:00
Dirk Hohndel
9db886b8c8 QML UI: explicitly reference parent id
Otherwise we get an odd 'TypeError: Cannot read property of null'
error message.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-17 22:56:08 -07:00
Dirk Hohndel
b45340389b QML UI: better App Log
This should actually scroll and be much simple.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-16 02:02:00 -07:00
Dirk Hohndel
77a3e6ac70 QML UI: clear the previous list when downloading
When you start a new session with Download from DC, clear out the table
from the last attempt before adding the page.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-16 01:22:44 -07:00
Jan Mulder
5c1d67e0c1 code cleanup: one more unused include
See c7a3509800. A forgotten include is now removed as well.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-16 05:31:41 +09:00
Dirk Hohndel
fb2638b3fb QML UI: small fix and whitespace cleanup
In the JS code we should use assignment with '='.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-13 00:54:21 -07:00
Jan Mulder
23df593817 Mobile: wrap up fixes for BT download on Android
Major functional change in this commit is the addition of found static BT devices
to the internal administration (on Android), in a way that is equivalent to
mobile-on-desktop. So, in both cases, the list of devices in the app are
as in the list of devices on the host OS (Linux or Android). To minimize code
duplication, the btDeviceDiscovered slot is split in two parts, the part to
act as slot for the Qt BT discovery agent (Linux, so mobile-on-desktop), and
the part only needed for Android.

Remaining to be fixed: the correct handling of the QML UI selection of
vendor/product. The first default dive computer is correctly detected,
all paired devices from the virtual vendow can be selected, but clicking
through vendors results in non logical selections. It is obvious why
this is, but a fix is not straigforward at this point.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12 11:05:08 -07:00
Jan Mulder
5142d7409f Mobile: add BT name to vendor/product capability
This adds a central function to convert a BT name to a vendor/product pair
known to Subsurface. This allows interfacing from a paired BT dive
computer, without actively selecting its type, but by selecting it
from the list of paired BT devices. So, after this, downloading from
multiple (paired) DCs is also possible.

And not the niced piece of code ...

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12 10:59:05 -07:00
Jan Mulder
790c0dcfc8 QML UI: add internal admin for virtual vendor
Added a list of paired BT devices for the "Paired BT Devices" vendor. The
devices under this vendor represent all BT devces that can be found
from the local BT interface. Some special processing is required, as
the BT provided data is (obviously) missing the specific data needed
to open a BT device using libdc code. This processing is not in
this commit, but will follow. This commit is preparation for that.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12 09:55:27 -07:00
Jan Mulder
c7a3509800 Android BT: fix compile bug
One Andorid JNI include was missing. And removed the unused ones
from QMLManager.

[Dirk Hohndel: I had added the missing include elsewhere, so this commit
               now only has the removal of the unused includes]

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12 09:51:13 -07:00
Jan Mulder
f6e94e691f QML UI: call correct function for BT address
After the recent refactoring of QMLManager to btdiscovery, the
manager.getBtAddress() got superseeded by
downloadThread.data().getDetectedDeviceAddress(). Corrected this
here.

Futher some debug output is modified, so that it report the proper
function names.

This corrects the download from an automatically detected OSTC 3.
Manul selection of the same device from the fake vendor "Paired
BT Devices" does not work, however. Still work to be done in
that area.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12 09:49:11 -07:00
Jan Mulder
a7288cc912 QML UI: do not crash on selecting dive computers
For reasons unknown to me, the DCDeviceData instance was freed way too early,
and used afterwards, obviously resulting in a SIGSEGV. This commit creates
the DCDeviceData as a direct child of the QMLManager instance, ensuring
it does not get freed prematurely.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-12 09:49:05 -07:00
Dirk Hohndel
b14a522f4f QML UI: move BT handling into core code
This shouldn't be part of the UI (qmlmanager), but part of our
overall handling of dive computers and BT devices.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11 13:55:41 -07:00
Dirk Hohndel
3b993fbaad QML UI: adjust to modified logging API
appendTextToLog prepends the elapsed time which can be useful, so let's
not remove that but instead have it log to qDebug() instead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11 13:55:41 -07:00
Tomaz Canabrava
0ea6f13891 Add a messageHandler to take care of qDebug & friends on QML
all qDebug / qCDebug and friends now will be properly
logged into developer -> log, on QML.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11 13:55:41 -07:00
Dirk Hohndel
8faf33eac6 QML UI: correctly set up the divecomputer for download
If we find a paired BT divecomputer, this will populate vendor and product
correctly for that device.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-11 13:55:41 -07:00
Tomaz Canabrava
03e771066b QML UI: show selection box on the Download from DC list
QML and C++ model don't interact too much, a new Rule
should be created and used on the QML

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-06-04 07:11:01 -07:00
Jan Mulder
78ee3f40a5 Silence compiler warnings
Silence some compiler warnings about implicit double to int conversions.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-02 11:31:00 -07:00
Jan Mulder
dbd1d1f41a Android BT: generalize pairing data
This adds a list of paired BT devices to the QMLManager class. In addition,
a very simple implementation is made of getting the paired BT devices on
Linux, so that we can test further processing of selecting the proper
devices, in a mobile-on-desktop situation.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-02 11:31:00 -07:00
Jan Mulder
3b4091a0b9 Android BT: do not force BT on
It is very impolite to force BT on at start of the mobile app. We cannot
know if the user is going to import dives over BT.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-01 16:53:29 -07:00
Jan Mulder
ed392694db Android BT: pull the pairing data from a device
As Qt is not able to pull the pairing data from a device, a lengthy
discovery process is needed to see what devices are paired. On
https://forum.qt.io/topic/46075/solved-bluetooth-list-paired-devices
user s.frings74 does, however, present a solution to this using JNI.
Currently, this code is taken "as is".

Currently, only for Android (so not mobile-on-desktop, or even desktop).
And only generating logging data in the logcat.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-01 16:53:29 -07:00
Jan Mulder
f5adbe5662 Use #if defined() instead of #if
qtcreator (4.3.0) got confused whether BT_SUPPORT was defined. Using
work as expected.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-06-01 07:28:18 -07:00
Dirk Hohndel
b9760f1db0 QML UI: try to also detect OSTC BT dive computers
The naming scheme of OSTC dive computers doesn't match their product names,
but they all behave the same from a download perspective, so we assume that
any BT device that has a name starting with OSTC is an OSTC 3.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31 10:16:29 -07:00
Dirk Hohndel
286bac6d30 Android: connect to BT via uuid instead of port
We remember the offered service uuids as we detect the device and then
try the first one - likely this needs to be fixed / tuned to pick the
right one if multiple uuids are offered.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31 10:15:40 -07:00
Dirk Hohndel
782caf5fa6 QML UI: use the BT address of the first dive computer found
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31 10:14:24 -07:00
Dirk Hohndel
be271e7d48 QML UI: add getBtAddress function
This allows us to get the BT address of the first dive computer that we found.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-31 10:14:24 -07:00
Dirk Hohndel
c8c56b3737 QML UI: populate dive computer vendor and product
If we detected a BT dive computer, we can already set up the vendor and
product for it (as well as the new BT checkbox).

Oddly, in my tests this doesn't set up the product correctly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-29 15:11:11 -07:00
Dirk Hohndel
18eff8f2b3 QML UI: detect BT dive computers
If we find something that looks like a known BT dive computer, set
things up so that we can use it later. If multiple dive computers are
found, simply use the first.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-29 15:08:28 -07:00
Dirk Hohndel
a568562503 QML UI: try to match BT names to known dive computers
So far this just adds data to the log.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-29 12:25:21 -07:00
Tomaz Canabrava
b9ac6334c7 QML UI: remove unused layout
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-29 12:01:15 -07:00
Tomaz Canabrava
52e07a6306 QML UI: select / unselect dive by clicking on it
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-29 12:01:02 -07:00
Tomaz Canabrava
1de1a85e32 QML UI: add DownloadDiveDelegate
A delegate to display the dives in a better way,
based on the code from DiveList.qml

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-29 12:00:51 -07:00
Tomaz Canabrava
81277c259b QML UI: remove unused item on the interface
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-29 12:00:35 -07:00
Dirk Hohndel
1ab6b50a34 QML UI: start BT discovery
So far all this does is list all the BT devices that it finds
(and I worry if this will have negative battery implications
on a mobile device), but this should allow us to connect to
a standard BT dive computer (but that will of course require
more code to pick the right device).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-29 12:00:27 -07:00
Dirk Hohndel
3f0d21046e QML UI: add downloaded dives to dive list
This already takes into account which of those dives were selected.
Right now all we have is select all or none - this needs actual support
in the UI, but once that's there, it will just work (famous last words).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-28 11:54:33 -07:00
Dirk Hohndel
057f46f854 QML UI: stub out saving downloaded dives
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-28 03:22:46 -07:00
Dirk Hohndel
4ad02634e9 QML UI: add some DC Download info to AppLog
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-28 02:50:55 -07:00
Dirk Hohndel
a492b8bbd0 QML UI: fix typo in component id
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-28 02:23:03 -07:00
Dirk Hohndel
e255a698cb QML UI: remove code that's commented out
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-28 02:21:05 -07:00
Dirk Hohndel
9d1ebffe1f QML UI: use QtQuick.Controls 2.0 everywhere
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27 14:36:32 -07:00
Tomaz Canabrava
38e24512b7 QML UI: add the Downloaded Dive Model
Still to do:
 - select the dives to save
 - record the downloaded dives

but download is already working. :)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27 11:07:20 -07:00
Tomaz Canabrava
7858376727 QML UI: add the DownloadThread
For this I had to also make the DCDeviceData accessible,
and for that it needed to be a pointer.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27 11:07:20 -07:00
Tomaz Canabrava
0e4c996f51 QML UI: Fill the product list
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27 11:07:19 -07:00
Tomaz Canabrava
f78fdf3d0f QML UI: show the VendorList on the Download from DC
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27 11:07:19 -07:00
Tomaz Canabrava
9951592216 QML UI: fix the layout for the Download from DC
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27 11:07:19 -07:00
Tomaz Canabrava
8056e16589 QML UI: initial code for Download from Dive Computer
Add a new action on the drawer to display the
Download from Dive Computer options. Nothing works yet.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27 11:07:01 -07:00
Dirk Hohndel
8525805f04 Add SPDX header to mobile widgets and QML files
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29 13:32:55 -07:00
Dirk Hohndel
972819d77a QML UI: more fine tuning of the magic shift factor
Now it should also work on devices with device pixel ratios of
1.3, 1.33, or 1.4.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-16 08:26:40 -07:00
Dirk Hohndel
20f525cedd QML UI: correctly update dive list after editing timestamp
Once we re-inserted the dive in the list we aren't done, quite the
contrary - we now need to make sure that we handle any other changes
and mark the dive list as updated.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-16 07:43:48 -07:00
Dirk Hohndel
03b2b854bf QML UI: correctly parse manually edited date
We need to set the timeSpec after the QDateTime was parsed,
otherwise it gets converted to localtime again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-16 07:43:48 -07:00
Dirk Hohndel
74a5511b39 QML UI: fix broken delete from dive details page
Trying to close the non-existing context drawer caused the function
to abort (and consequently not to delete the dive).

Fixes #309

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-15 13:50:18 -07:00
Dirk Hohndel
cc6c41c846 QML UI: fix GPS list rendering
There was an extra BasicListItem inside the SwipeListItem.
This commit just removes 5 lines, the rest is indentation change.

Fixes #312

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-15 13:33:48 -07:00
Dirk Hohndel
052be692bb QML UI: reset completion fields when adding dive
Otherwise the last value in those fields might still be shown.

Also, set up the cylinder completion.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 17:33:11 -07:00
Dirk Hohndel
6a50efd80a QML UI: create completion list for cylinders as well
We already have that for the other three fields where we offer auto
completion (buddy, divemaster, suit).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 17:32:45 -07:00
Dirk Hohndel
e42bf2cfa5 QML UI: fix profile for device pixel ratio of 1.5
I think this is actually a typo - either way, seems to work correctly
now.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 16:57:09 -07:00
Dirk Hohndel
c00b14af9a QML UI: better simulation of onPressed in TextField
Prior to Qt Quick Components 2.1 there was no onPressed signal for a
TextField; in order to be able to build against Qt 5.7 (which comes with
Qt Quick Components 2.0) we need to work around the lack of this signal.
This code seems to do a pretty good job at simulating it.

My attempt in commit 73c66e1d7d ("QML UI: make run with Qt 5.7 again")
didn't work so well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 14:04:34 -07:00
Dirk Hohndel
ee4ae49d37 QML UI: don't populate hints texts when adding dive
If we don't have values for the HintsTextEdit fields, don't show any
values.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 13:43:48 -07:00
Dirk Hohndel
525cd4c9e3 QML UI: correctly render dive list when showing delete button
This fixes the visual artifact that Willem reported.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 13:13:06 -07:00
Dirk Hohndel
ee75812b5a QML UI: keep the fontMetric
We reference it elsewhere.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 13:05:01 -07:00
Dirk Hohndel
1246324897 QML UI: don't shrink fonts on narrow displays
Now that wrapping should work correctly, this isn't necessary any more.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 11:17:00 -07:00
Dirk Hohndel
73c66e1d7d QML UI: make run with Qt 5.7 again
onPressed needs to be relative to Keys in Qt 5.7.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 09:50:57 -07:00
Dirk Hohndel
c8bf412720 QML-UI: remove references to download from divecomputer
This needs to be reimplemented.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-14 09:50:57 -07:00
Dirk Hohndel
540b3548b9 QML UI: add 2cm x 2cm square to theme test page
This should make it easier to spot displays that are completely out of
whack in their scaling.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-13 18:21:50 -07:00
Marco Martin
71191f1294 QML UI: only assign actions in a declarative way
Assigning actions in an imperative way on component complete,
seems to cause a crash on some devices, assign declaratively
the whole list instead, hiding the gps related actions on
iOS as they are not supported on that platform.

Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-13 11:05:26 -07:00
Dirk Hohndel
4ea4e8fa81 QML UI: re-layout the details view
This is a different take that seems to deal much better with different
width and font size combinations.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-11 17:24:44 -07:00
Dirk Hohndel
f99aedc626 QML UI: correctly set grid column widths
Spending more time reading the documentation, we need to set the
Layout.maximumWidth, not the width.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-10 10:22:02 -07:00
Marco Martin
8a71196e4e QML UI: fix saving fields using HintsTextEdit
The editText property is not there anymore, we need text

Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-04 19:10:22 -07:00
Marco Martin
89d7dd4348 QML UI: dialog of HintsTextEdit on top
Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-04 19:10:22 -07:00
Dirk Hohndel
01d091fbd5 QML UI: better handling of device pixel ratio
In order to make sure we don't render the initial profiles with the
wrong scale on devices, we need to seed the device pixel ratio with the
device default and then update it once the window has been created.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-04 11:00:18 -07:00
Dirk Hohndel
e700ea9638 QML UI: more hacks for the magicShiftFactor hack
Since the device pixel ratio can be a fraction we should interpolate the
values. I still don't really understand why this is necessary, so this is
a hack on top of a hack - but for most values I tried this does seem to
give us a reasonably well placed (and well scaled) profile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-04 11:00:18 -07:00
Dirk Hohndel
8c94fa2676 QML UI: ensure actions are set up for Credentials page
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-03 10:49:07 -07:00
Marco Martin
e4460be8a6 QML UI: use a scrollable page for StartPage
Fixes scrolling of the cloud credentials and simplifies code

Signed-off-by: Marco Martin <notmart@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-03 07:22:56 -07:00
Marco Martin
4113bab17b QML UI: replace combobox with custom text field with hints
Signed-off-by: Marco Martin <notmart@gmail.com>
2017-04-01 09:36:47 +02:00
Marco Martin
751626eec5 QML UI: Fully port dive edit to Kirigami2
Completely adapt to the api changes of OverlaySheet in Kirigami2
in order to achieve the same look and behavior for the dive
edits that had with kirigami1

Port most components to QtQuickContrls2, except comboboxes
in the dive edit sheet that will need a new control type

Signed-off-by: Marco Martin <notmart@gmail.com>
2017-04-01 09:35:51 +02:00
Joakim Bygdell
bd0c99dfb7 MOBILE: Display pO2 and Setpoint for CCR dives
For CCR dives we want to display the setpoint and pO2 information,
due to the limited screensize we have to remove the temperature graph or
the view will be to cluttered.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-03-26 21:57:57 -07:00
Jan Mulder
d6003209d6 Subsurface-mobile: do send decimal GPS to Google
Sending nicely readable formatted coordinates to Google Maps does not
result in a correctly positioned map. Google likes unreadable
decimal format.

Little hacky solution. Added a gps_decimal attribute, populate that
with the standard function for format a coordinate to string, but
reset the preferences value temporarly so that it always converts it
to decimal style.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:35:00 -07:00
Jan Mulder
59417342c7 mobile: the infamous enumerate problem
This fix seems to fix the enumerate problem: the problem that on a
seemingly non-determinstic way, all the profiles get enumerated
and rendered, causing freeze of the app, or even crash due
to out of memory.

Only 3 lines of code change, but this fix did not come easy. The
enumerate problem seems some kind of race condition between QML,
Kiragami and most definitely, the Subsurface QML code itself.
The breakthrough in my debugging was the setting of
highlightRangeMode: ListView.StrictlyEnforceRange based on
the QML documentation on snapMode: enumeration.

This fix deserves proper testing in multiple environments. As
could be seen on the developpers mailing list, I was (easily)
able to reproduce the enumerate problem, but Rick was not. So
I definitely do not claim to understand why this fix solves
the issue for me.

And as a sidenote: fixes #263 for me as well.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:27:23 -07:00
Dirk Hohndel
220d25588f QML UI: enable caching of the details view
This way the dive on either side should be cached.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
783f9ee565 QML UI: don't explicitly position view
Instead have the view follow the currentItem.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
7ffc619f4c QML UI: make profile drawing less verbose
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
10842b3eb3 QML UI: don't unset the currentIndex in the dive list
It's unclear why this code was added in the first place - removing it
makes the highlight of the selected dive in the dive list work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
dd1d90b529 QML UI: don't clip
At least that's what the QML documentation recommends.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
a2bc3e02f8 QML UI: small cleanups
Remove unused signal handler.
Small whitespace cleanup.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
9389fd0049 QML UI: don't access members of undefined objects
If we don't have a currentItem, don't try to access its members.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
33df10cbaa QML UI: small clarification
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-18 17:05:45 -07:00
Dirk Hohndel
d87d97a794 Sync unit system to Subsurface-mobile (part 2)
Missed a spot.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-11 16:09:06 -08:00
Dirk Hohndel
ae9ab68096 Correctly sync unit system to Subsurface-mobile
We were doing the right thing switching from metric to imperial, but in
order to swtich back you had to restart. Now it works both ways.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-11 15:23:42 -08:00
Jeremie Guichard
406e4287eb Change calls to rint into lrint avoiding conversion warnings
Using gcc option "-Wfloat-conversion" is useful to catch
potential conversion errors (where lrint should be used).
rint returns double and still raises the same warning,
this is why this change updates all rint calls to lrint.
In few places, where input type is a float, corresponding
lrinf is used.

Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-08 14:04:17 +07:00
Martin Měřinský
869a7fcfcc dive master > divemaster 2017-03-04 12:08:17 -08:00
Martin Měřinský
f007f0329b Remove space before colon. 2017-02-21 07:03:10 -08:00
Joakim Bygdell
0277d5aacc Merge informational_prefs into git_prefs
There is no need to have two variables for the same purpose.

[Dirk Hohndel: changed to keep the two separate functions as otherwise
               we no longer parse existing repos successfully]

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-05 12:29:51 -08:00
Joakim Bygdell
11dcae436e MOBILE: Read profile settings from git
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-02-05 11:59:47 -08:00
jbygdell
0e57033042 QML UI: Parse multiple buddies when editing a dive
This allows the user to enter multiple buddies as a comma separated list,
the "Multiple Buddies" entry is still a special case as we can only populate
the combobox with a single name for each entry.

fixes #168

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-01-29 14:55:33 -08:00
Dirk Hohndel
b15b3c195c QML UI: allow magic phrase for multiple buddies to be localized
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-22 18:20:03 -08:00
Dirk Hohndel
0196d9a220 QML UI: correctly test if there are multiple buddies
The JS string function search returns the position of the string you
search for and -1 if that string isn't found. Also, search allows
regular expression, indexOf does just a string match. So let's use
that as it is much faster.

See issue #168

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-22 18:18:57 -08:00
Dirk Hohndel
bfaeb22cc5 QML UI: prevent modification of Multible Buddies text
"Multiple Buddies" is magic in that it means "do not change the buddies
set for this dive". Allowing the user to edit that magic phrase defeats
the purpose.

This deals with part of issue #168 - but of course that magic phrase
shouldn't be fixed as English text.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-22 18:18:07 -08:00
Dirk Hohndel
fc60f210c4 QML UI: move 'No dives in dive list' down
Otherwise it overlaps with the page title.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-21 17:06:07 -08:00
Dirk Hohndel
14b4c94ded Revert "QML UI: build against latest Kirigami"
This reverts commit a842e44b68.
2017-01-21 14:42:10 -08:00
Dirk Hohndel
6459e455bc Revert "QML UI: steps towards working with Kirigami 2"
This reverts commit 53ce3ce3e3.
2017-01-21 14:42:00 -08:00
Henrik Brautaset Aronsen
ba23989e6b Update from 2016 to 2017. Happy new year!
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-01-01 10:28:25 -08:00
Tomaz Canabrava
4db80aa1a4 Remove opacity calls
ApplicationWindow has no Opacity calls no more.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-27 09:46:58 -08:00