Commit graph

12372 commits

Author SHA1 Message Date
Robert C. Helling
0c426c37b2 Use letters instead of digit in TeX macro names
TeX doesn't like digits there, so let's use letters

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-08-10 09:08:02 -07:00
Robert C. Helling
de47c96763 Cleaning up TeX export
Removed some merge artefacts and made sure code compiles and
produces wellformed TeX. Shortend some comments.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-08-10 09:08:02 -07:00
Ben McCandless
72e302a1c2 Add additional data to TeX-export
The purpose of this work is to allow for generation of more complete log
pages using TeX/LaTeX.

Previously, the exporting to TeX generated a document that contained
very limited information about the dive.  For example: the only details
reported about air consumption were delta pressure and SAC.  In addition
no data was reported about what equipment (weights, tanks, suit) was
used.

Per feedback, code was updated to use helper functions, and now exports
data with the units set by the user in the Subsurface preferences.  Some
characters (Degree symbol) do not render correctly by default in LaTeX,
so sample code to address this was included in the top comments.  Volume
units do not export an ideal character string, so another string was
substituted.

This update adds the following information:
   * GPS Location
   * Dive computer used
   * Max, Min, Air, and Water Temperatures
   * Average depth
   * Number of cylinders listed, mix, and start/end pressure for each
   * Total weight used, and the description and quantity of each weight
   * Dive rating (previously, only visibility was reported)
   * Buddy
   * Dive master
   * Suit

This update moved several fields that had no output or had unexpected
names (i.e. "spot", "place") into a "Deprecated section"

Future work:
   * The export currently only includes the first entry in the tag list.
   * Future versions should export all tags.
   * Ideally, this would export a screenshot of the dive location.
   * Create a table of correct size for weights and cylinders.
   * It would be nice to have a bit more control over the generation of
     profile images, but that may be beyond me.

Rebased-and-cleaned-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Ben McCandless <mccand@gmail.com>
2017-08-10 09:08:02 -07:00
Rick Walsh
1409521eb2 DiveList.qml: set detailsWindow index before deleting dive from list
This appears to fix the mystery crashes that can occur when deleting a dive
from the dive list.

Fixes: #497

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-08-10 09:06:44 -07:00
Linus Torvalds
e04ef1df1e Fix the overprinting of gas name and pressure value on the profile
When I massaged the code to do multiple gas pressures in commit e1b880f4
("Profile support for multiple concurrent pressure sensors") some of the
Y offsetting code got cut out as being too specific to the old
o2pressure code.

But I removed a bit too much, leaving the label (gas name) and number
(gas pressure) overlapping.

This should fix it.

If we really care about multiple gas pressure labels overlapping each
other, we'll have to revisit this code, but the old two-gas case didn't
do a very good job either (both that old code - and this new version -
can look very good in particular cases, but there are cases where it
won't work so well).

So we may need to revisit this eventually, but this gets it looking fine
for the normal cases.

Reported-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-07 00:57:58 -07:00
Joakim Bygdell
3f1a20cbaa QML UI: GPS: remove header
Being the only page that still has an on page header
it makes sens to remove it.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-07 00:52:32 -07:00
Joakim Bygdell
e4d4718bae QML UI: GPS: remove margins
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-07 00:52:32 -07:00
Rick Walsh
7e4ba965d1 DiveDetailsEdit: make sure model data exists
This gets rid of TypeError messages, but does not appear to affect behaviour
qrc:///qml/DiveDetailsEdit.qml:254: TypeError: Cannot read property 'dive' of null
qrc:///qml/DiveDetailsEdit.qml:228: TypeError: Cannot read property 'dive' of null
qrc:///qml/DiveDetailsEdit.qml:216: TypeError: Cannot read property 'dive' of null
qrc:///qml/DiveDetailsEdit.qml:204: TypeError: Cannot read property 'dive' of null

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-08-07 00:51:51 -07:00
Lubomir I. Ivanov
00e401b61f mapwidget.qml: add menu action for selecting visible locations
MapWidgetContextMenu now has a new action (SELECT_VISIBLE_LOCATIONS),
that will invoke the MapWidgetHelper method selectVisibleLocations().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-07 00:51:21 -07:00
Lubomir I. Ivanov
93896e54db mapwidgethelper: add the selectVisibleLocations() method
The new method selectVisibleLocations() contains a routine
to find all visible MapLocation objects in the Map viewport and
select the dives associated to said MapLocation objects.

This method is to be invoked from the QML context menu.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-07 00:51:21 -07:00
Lubomir I. Ivanov
5db2460168 mapwidget.qml: implement centerOnRectangle()
First, this function calculates the zoom out effect until both the
current Map center and the target rectangle are visible - see the
"calculate zoom out" part.

Then it calculates a zoom level, so that the target rectangle
fits the viewport, but also so that the zoom is not too much (clamped).
see the "calculate zoom in" part.

NOTE: "centerStored" (the variable used to store the current map center)
is created using QtPositioning.coordinate(), because the code needs a new
object and not a reference of the map.center QGeoCoordinate object.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-07 00:51:21 -07:00
Lubomir I. Ivanov
0fc9a3bf4a mapwidget.qml: add a couple of helpers
Add stopZoomAnimations(), which is really just a precaution
function to make sure we have stopped all animation of the
map before doing calculations! Since the animation *should*
be running in a separate thread, this would make sure the Map "center"
and "zoomLevel" properties do not change.

Add pointIsVisible(), which is a helper to determine
if a point created by map.fromCoordinate() method is inside
the viewport. fromCoordinate() has to be called without the
"false" (clip) flag for this to work.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-07 00:51:21 -07:00
Lubomir I. Ivanov
d421660f91 mapwidgethelper: support tracking of all selected dive sites
MapWidgetHelper::centerOnDiveSite() now checks if more than
one dive sites are selected and finds the most top-left and
bottom-right ones in the coordinate system to form
a rectangle.

It also supports the special cases where a selected dive site
does not have coordinates or the case where only a single dive site
with GPS coordinates are selected.

TODO: implement mapwidget.qml::centerOnRectangle()
This QML function will receive a QGeoCoordinate based rectangle which
has to be centered in the viewport with animation.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-07 00:51:21 -07:00
Lubomir I. Ivanov
6fb841887d mapwidget.qml: add better error reporing on a missing map plugin
For instance, if the 'googlemaps' geoservices plugin is missing
a new message is now shown:
"qml: MapWidget.qml: cannot find a plugin with the name 'googlemaps'"

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-07 00:51:21 -07:00
Lubomir I. Ivanov
aea1cc4b8a mapwidget: use "satallite" maps instead of "hybrid"
Do so until the following issue is resolved:
https://github.com/vladest/googlemaps/issues/9

With the satellite map ([1]), the black tiles at relatively high
zoom levels over the Red Sea cannot be seen. Instead it shows white
tiles at the ultra-maximum zoom level at places.

As a side note, the "satellite" map does not have the country labels
which the "hybrid" map has.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-07 00:51:21 -07:00
Anton Lundin
d77de11a1d configure ostc3: Correct code for right button
Back when I wrote this code I made a typo. This fixes it.

Reported-By: Alexander Gottwald <jugendtrainingtsck@gmail.com>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-04 09:50:44 -07:00
Dirk Hohndel
dd9e5bb96f build.sh: qmake should pick up our INSTALL_ROOT
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03 16:50:53 -07:00
Dirk Hohndel
0476f6dc18 QML UI: Settings: remove more margins
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03 16:00:09 -07:00
Dirk Hohndel
c004e31dc2 QML UI: CloudCredentials: better use of space
No idea why this was restricted to be so narrow. Also, making
the font of the label smaller and lighter seems visually more
pleasing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03 15:31:23 -07:00
Dirk Hohndel
c043366b8f QML UI: remove unnecessary margin
This makes better use of the available space.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03 15:30:32 -07:00
Dirk Hohndel
ada6a0d664 QML UI: remove unused code
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03 15:29:50 -07:00
Linus Torvalds
8fe24055f0 Fix Poseidon MkVI txt file import sensor pressures
When I unified the sample pressures in commit 11a0c0cc70 ("Unify
sample pressure and o2pressure as pressure[2] array") I did all the
obvious conversions, including the conversion of the Poseidon txt file
import:

        case POSEIDON_PRESSURE:
-               sample->cylinderpressure.mbar = lrint(val * 1000);
+               sample->pressure[0].mbar = lrint(val * 1000);
                break;
        case POSEIDON_O2CYLINDER:
-               sample->o2cylinderpressure.mbar = lrint(val * 1000);
+               sample->pressure[1].mbar = lrint(val * 1000);
                break;

which was ObviouslyCorrect(tm).

But as so often is the case, obvious doesn't actually exist.  The old
"o2cylinderpressure[]" model had an implicit sensor associated with it,
and that implicit sensor mapping wasn't obvious, and didn't get fixed.

It turns out that the way the Poseidon sensor mapping works, the O2
cylinder is cylinder 0, and the diluent cylinder is cylinder 1, so just
use the add_sample_pressure() helper to set both sensor index and
pressure value.

And since we now do all the sensor indexing right, we can also get rid
of some manual cylinder sample pressure code, because the generic dive
fixup will just DTRT.  It used to screw up because the diluent sensor
number was wrong before, and the import code tried to work around that
by hand.

Reported-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03 13:29:25 -07:00
Dirk Hohndel
b4063de452 Travis: fix typo in '--platform' option
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03 11:19:49 -07:00
Dirk Hohndel
1e62120534 build.sh: remove unsupported compiler options for googlemaps
Trusty (Travis) doesn't support -std=c++1z and -Wdate-time - and the
module doesn't need them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03 11:19:49 -07:00
Robert C. Helling
c979d9f166 Always show the ascent to the initial deco stop
...even when not showing transitions, this makes the
first stop look more like a stop (since it does not include
several minutes of ascent).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-08-03 11:17:33 -07:00
Dirk Hohndel
4e2cada878 build.sh: clone from https
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-03 06:41:30 -07:00
Dirk Hohndel
37b4522438 Mac build: install googlemaps plugin
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-02 23:07:47 -07:00
Dirk Hohndel
e808c92bb6 MXE build: build the googlemaps plugin
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-02 23:07:47 -07:00
Dirk Hohndel
f57f10eb8c build.sh: follow our build pattern a bit more
Build in a 'build' subdirectory and use the INSTALL_ROOT. Also make sure
you find qmake on custom Qt installations.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-02 19:05:16 -07:00
Dirk Hohndel
2b9523dcff Merge branch 'googlemaps' of git://github.com/neolit123/subsurface into googlemaps 2017-08-02 18:53:52 -07:00
Joakim Bygdell
bc1a388952 QML UI: dive edit autocomplete
This makes sure that the autocompleting comboboxes never displays the scroll list where the user can pick an entry, and as such forces the view of a autocompleting textfield from the users point of view. The reasoning is that when scrolling in the drop down list it it possible to scroll to far and thus abort the ongoing edit by flicking away the edit page.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
a9348607e7 QML UI: add more width to dive edit page
Mobile devices hare rather limited when it comes to screen size,
there is no point in reducing the availabel space more than neccecary.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
29e704a1b2 QML UI: loose focus on endEditMode
This handles a cornercase where a user starts editing and then cances the divedit followed by a return to edit mode. The previously acive textfield would then be active again even though all changes are lost.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
bc7d11860f QML UI: make sure textfields loose focus
For some reason the textfields on dive edit page did not loose focus when editing ended by press on the return key.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
97f1dc0b01 QML UI: autocomplete objects should lose focus on selection
When the user makes a selection using the autocomplete function while editing a dive the keyboard should close and the selection list should disappear.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
9e9e06aed6 QML UI: decrease fontsize on dive edit
Decrease the fontsize of the static text on the dive edits page.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
6a47af2d16 QML UI: enable modification of ratings
This enables editing of visibility and ratings for a dive.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
9d7eb33a33 QML UI: display rating and visibility stars
Display rating and visibility stars on the dive details page. See #495

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-02 18:49:47 -07:00
Joakim Bygdell
ee17d54753 Add star icons
Add star 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-08-02 18:49:47 -07:00
Lubomir I. Ivanov
e05abca7e0 mxe-based-build.sh: copy a googlemaps plugin instead of esri
This would work only if the folder:
$BASEDIR/"$MXEDIR"/usr/i686-w64-mingw32.shared/qt5/plugins/geoservices
contains such a file.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-02 23:39:10 +03:00
Lubomir I. Ivanov
ca37301cb5 build.sh: build the google maps geoservices plugin
The source code is pulled from the forked repository at:
git@github.com:Subsurface-divelog/googlemaps.git

It's rebased if needed, build using 'make -j4' and then
installed.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-02 23:38:52 +03:00
Lubomir I. Ivanov
5cb1d28861 mapwidget.qml: use a custom built googlemaps plugin
This patch makes use of the geolocation plugin "googlemaps"
for Qt Location with source code from here:
https://github.com/vladest/googlemaps

The change from the ESRI plugin is that it requires new indexes
for the Hybrid ([3]) and Street ([0]) map types.

There are more zoom levels in this plugins, but our default zoom-in
settings seem to transition well to it.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-08-02 00:51:12 +03:00
Joakim Bygdell
2e057bc29a QML UI: hide action button when keyboard is visible
Until we get some solution from upstream this patch to Kirigami hides the action button when the keyboard is visible.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2017-08-01 13:40:17 -07:00
Anton Lundin
5e0c2a7693 Configure ostc4: Correct button sensitivity range
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-08-01 13:39:35 -07:00
Anton Lundin
cfd5f8bf95 Configure ostc4: Wire up reset button
I previously forgot to enable the reset button.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-08-01 13:39:35 -07:00
Anton Lundin
a717cb3a41 android: access() is declared in unistd.h
Calling access() makes no sense at all on android, but this atleast
fixes a compilation error on ndk 15+.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-08-01 13:39:35 -07:00
Anton Lundin
7c6fa227ea Null check before writing to pointer
In the serial api for libdivecomputer is ok to send NULL as the int
pointer actual, if you dont't care about how many bytes that where
actually read or written.

This makes sure we don't crash if the ble backend where ever used with
such a backend.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-08-01 13:39:35 -07:00
Dirk Hohndel
15962add7a Print Qt version when started in verbose mode
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-01 02:59:40 -07:00
Dirk Hohndel
ada477eda4 MXE build: don't use host cmake
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-08-01 02:53:17 -07:00
Robert C. Helling
757985bf2a Smaller buttons on map widget
... so they take up less space while still being clickable.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-07-31 16:55:12 -07:00