Commit graph

12229 commits

Author SHA1 Message Date
Miika Turkia
4ced7c3f73 Fix size conversion on imperial CSV import
We really need the decimal separator to get correct results

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-04-01 08:06:09 -07:00
Miika Turkia
841d1b4fac CSV export: convert cylinder size to imperial
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-04-01 08:06:09 -07:00
Miika Turkia
acd791b7c1 Export-import test for manual CSV
Note that the actual validation of the result is currently disabled, so
the tests will pass even though there are some bugs and rounding errors
present.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-04-01 08:06:09 -07:00
Miika Turkia
a0ed0ff823 Change parseCSV to support unit and file selection
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-04-01 08:06:09 -07:00
Miika Turkia
1c03cb259e CSV export: export only existing temperatures
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-04-01 08:06:09 -07:00
Dirk Hohndel
3a003f4c10 QML UI: we now depend on QuckControls2
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-01 09:37:15 +02: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
Dirk Hohndel
34a42d7f04 Shift fake tank pressures up by 30bar
This is a rather arbitrary value, intended to create actually valid
pressure values for Uwatec Memomouse users - since we treat 0bar as
invalid pressure value, this simply creates an arbitrary '30bar + delta'
to '30bar' consumption graph (since all the Memomouse devices give us is
the pressure delta that was used during the dive).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-30 11:44:45 +02:00
Dirk Hohndel
09b5f9b99c Accept 0 as valid endpressure for Uwatec devices
Instead of delivering the actual start and end pressure, memomouse
gives you a start pressure that matches the delta between actual
start and end pressure, and an end pressure of zero. Who the heck
knows why it does that, but the information is better than nothing,
so we should accept it.

Fixes #286

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-29 14:00:16 +02:00
Jan Mulder
3b9c32a050 UI: preferences-profile screen beautify
Stefan suggested "Maybe it would be nicer to move the 3 fields for the
maximum pressure for N2, He, O2 for MOD to the right in the UI window
exactly below the maximum field for the O2 (where we now have
minimum + maximum)."

And I agree, so this is the change.

At the same time, reset the tab-order to a logical one.

Reported-by: Stefan Fuchs <sfuchs@gmx.de>
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-29 13:21:50 +02:00
Dirk Hohndel
6bcc36f27b Update translation source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-28 22:32:53 +02:00
Robert C. Helling
1b744c7639 Always show notes when replanning
... as per popular request. Plus adding const keyword to constant
strings.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-28 13:31:45 -07:00
Robert C. Helling
d344779c47 Fix missing slash in markup
Reported-by: Stefan Fuchs
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-28 13:31:45 -07:00
Robert C. Helling
eefa390e5f Handle notes in replan
Upon replanning a dive, we want to delete the old
dive plan in the notes and replace it with the actual.

This fixes a problem when we failed to detect the old plan due
to the deco model name appearing in the disclaimer that was used
as a marker for the notes.

This patch also adds translation markers for the deco model name strings..

Fixes #285

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-28 13:31:45 -07:00
Jan Mulder
622ab2286a minimal pO2 threshold: corrected testpreferences
Adapt the testpreferences procedure for the new min/max pO2 preference.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-28 11:17:03 -07:00
Jan Mulder
5a235aea12 minimal pO2 threshold: color the p02 graph also for minumum
Color the p02 graph also in red for going under the minumum p02 value as
set in the Preferences.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-28 11:17:03 -07:00
Jan Mulder
bb31c77597 minimal pO2 threshold: split max threshold into min and max
Nothing really special here. Just a split of the only p02 max threshold into
a min threshold and max threshold, and the adaptation of the UI. Change of
translatable strings included.

ref: https://github.com/Subsurface-divelog/subsurface/issues/259

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-28 11:17:03 -07:00
Miika Turkia
1d0281c923 Fix a crash when git init fails
This can occur e.g. if directory permissions prevent one from writing to
the local cloud storage directory. (Such a crash was discussed on
mailing list.) The error message on GUI is misleading, claiming that
cloud connection failed...

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
---
We probably should check the return value of other git operations as
well, but going for bare minimum for now.
2017-03-28 11:12:36 -07:00
Jan Mulder
ec7206a475 compile fix
commit 597539ce39 breaks my compile. Fixed here.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-26 22:01:30 -07:00
Jan Mulder
cbe6e8e62b UI: typo fix
Trivial typo fix, suggested in issue #274. Apnea is more common than
Apnoea, and Apnea is also used in the code already, so, more common
and more consistent. Hmm. A lot of text for a one letter fix.

Close of issue suggested #274.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-26 22:01:04 -07:00
Jan Mulder
588a83e339 Fix issue 280: Facebook without a dive selected
Accessing Facebook stuff without a dive selected (as in an empty logbook)
just SIGSEGVs. Just be more carefull.

After this fix, it is still possible to upload an "empty dive" to FB. Ok,
a little pointless, but a nice picture of the Subsurface logo is uploaded
to FB. Consider it an easter egg :-)

Fixes: #280

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-26 21:58:29 -07: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
ae7913599c QStyleOptionViewItemV4 is deprecated as of Qt 5.7
Trivial change to silence compiler waring about QStyleOptionViewItemV4 being deprecated.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-26 21:55:24 -07:00
Stefan Fuchs
0b59954709 Improve mxe-based-build.sh for debug builds
Give a hint how to enable build of debug Qt5 DLLs when building MXE.
Take care about the "d"/"xxxd.dll" suffix for DLLs.
Copy libastro.dll from marble to correct loation as well (nevertheless we don't use it)

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-26 21:55:13 -07:00
Robert C. Helling
99351b7b73 Allow cylinder names to be edited
The same ComboBoxDelegate is used for picking a cylinder model
and picking a gas in the planner waypoint table. In the former
case we want to allow the user to edit the string in the second
we don't.

The difference is not if we are in the planner but which use of
the class. So add a bool allowEdit to the constructor.

Fixes #272

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-03-26 21:53:57 -07:00
Dirk Hohndel
cdcbeea571 Update Subsurface-mobile version to 1.2.1
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-24 12:00:45 -07:00
Dirk Hohndel
3413fcd164 Update ReleaseNotes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-24 09:44:26 -07:00
Jeremie Guichard
597539ce39 Fix double to int truncation in C++ code
Wfloat-conversion enabled for C++ part of the code
Fix warnings raised by the flag using lrint

Original issue reported on the mailing list:
The ascent/descent rates are sometimes not what is expected.
E.g. setting the ascent rate to 10m/min results in an actual
ascent rate of 9m/min.
This is due to truncating the ascent rate preference,
then effectively rounding up the time to reach each stop to 2s intervals.
The result being that setting the ascent rate to 10m/min
results in 20s to ascend 3m (9m/min), when it should be exactly 18s.

Reported-by: John Smith <noseygit@hotmail.com>
Reported-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-24 09:39:25 -07:00
Stefan Fuchs
d83449f3b5 Don't erroneously mark the cylinder pressure red - second try
Second attempt to do the thing with the red background color for cylinder
start and end pressure correctly. This now should cover all scenarios.

This rewrites and partitially reverts commit b8e044d

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-24 09:35:51 -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
6e38619970 user manual: Preferences Defaults renamed to General
See commit 25dcee139e. Preferences Defaults renamed to General.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:32:41 -07:00
Jan Mulder
5006fe1c6b user manaul: Preferences Graph renamed to profile
See commit 6305361d14. Graph is renamed to Profile.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:32:41 -07:00
Jan Mulder
ede5e70c54 user manual: pSCR diving is similar to OC, not CCR
See also commit acb38c9e00. pSCR is with respect to cylinder planning very
similar to OC planning. Obviously, the SAC is much (max. 8x for counterlung
ration 1:10) lower, but multiple gasses are common (in all but recreational
pSCR diving).

Changed the wording to reflect this.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:32:41 -07:00
Jan Mulder
97f7de6165 user manual: weird and incorrect paragraph
from the planner section the follwing paragraph is weird and partially incorrect:

These changes should reflect the cylinders and gas compositions defined in the table
with _Available Gases_. If two or more gases are used, automatic gas switches will be
suggested during the ascent to the surface. These changes can be deleted by
right-clicking the gas change and manually creating a gas change by right-clicking
on the appropriate waypoint.

Yes: during the ascent, gas switches are automatically planned (not suggested). These
can't be deleted by right-clicking (as there are no real waypoints associated with
the gas switches). And futher. To delete a gas change you have to manually create one?

Solution: refrase paragraph.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:32:41 -07:00
Jan Mulder
b1673a190a user manual: waypoints on profile can be moved using arrow keys
Add a sentence in the central section on manual profile entry that waypoints
can also be moved by keyboard (arrows).

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:32:41 -07:00
Jan Mulder
e9f5c8d525 user manual: do not repeat
Just said that we do not need to plan the ascent. Removed the 2nd ocurrence.

Also: trivial typo corrected

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:32:41 -07:00
Jan Mulder
1355687b88 user manual: p02 setting in Available Gases dialog is not possible
The manual suggests that in the  Available Gases dialog of the planner, setting of
pO2 is possible. This is not the case, and changed the text accordingly.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:32:41 -07:00
Jan Mulder
d7ba41fe0f user manual: set of small changes in planner text
Mostly typos and some wording change due to change of UI from
working pressure to starting pressure. And some subscripts changed,
some correction, some style. Now all are in ~2~ format.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:32:41 -07:00
Jan Mulder
58eeb3f825 user manual: section is called Proxy
Section is called Proxy and nor Proxy Type (which is attribute
in the section).

Simple incorrect wording fixed.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:32:41 -07:00
Jan Mulder
94d6b52330 user manual: changed unclear wording (network preferences)
The old wording suggests that your ISP has something to do with
the Subsurface cloud or companion app. This is not right, so did
a little rewrite.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:32:41 -07:00
Jan Mulder
9616d7b1f8 user manual: typo
trivial 1 letter typo.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:32:41 -07:00
Jan Mulder
6c22585dfc user manual: spell O2 correctly
Spell (p)O2 correctly with a subscript.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-24 09:32:41 -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
Jan Mulder
ed3f5a6240 Android build: extend comment for Qt5.8
Just an update of comment. The stange issue with Qt5.7.1 is
still present in Qt5.8. Extend the comment accordingly.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-03-20 21:39:00 -07:00
Stefan Fuchs
258aa70d04 Add 10l 200bar and 232bar cylinder
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-20 21:38:20 -07:00
Stefan Fuchs
6f21d2749e Tests for minimum gas
Add automatic tests in TestPlan for minimum gas:
- Copy minimum gas result (pressure) to diveplan.
- Add cylinder size and working pressure for bottom gas to every dive in TestPlan
  Hint: Unrealistic cylinder sizes (100l, 200l) have to be used for the very long and deep dives in TestPlan
- Add minimum gas check for every dive
- Add two additional test dives in TestPlan which produce sane minimum gas results with 24l tank
  Hint: Deco check for these new dives is commented out at the moment

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-19 17:11:52 -07:00
Stefan Fuchs
ce420d7720 Prevent overflow in minimum gas calculation
For the "crazy" long and deep dives in "TestPlan" an overflow happened here.
Rearranged the calculation to have more margin.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-19 17:11:52 -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