Commit graph

12833 commits

Author SHA1 Message Date
Robert C. Helling
0f458023d9 Correct time bookkeeping when doing O2 breaks
These got mangled with previous changes to stop length determination.

Fixes #662

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-31 16:33:32 -07:00
Berthold Stoeger
3acc28cebf Postpone error message display if not in GUI thread
Calls to report_error() crashed if not called from GUI thread.
Fix this by postponing error message display if not in GUI thread.
Code that creates a thread which possibly calls report_error()
is responsible for calling MainWindow::showErrors() to flush
the accumulated messages.

Note that there is a race condition in report_error() and
get_error_string(). Nevertheless, hitting it should be rather
unlikely (two threads producing error messages at the same time)
and hopefully it can be fixed rather easily.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-10-31 16:32:08 -07:00
Lubomir I. Ivanov
945a0a8748 desktop-main.cpp: don't validate for custom backends
Without this patch the user can pass a custom backend
like 'software' and the validation will still be performed.
In a case where the validation fails Subsurface will still exit.

With this patch the validation is performed *only* for the
standard backend which is OpenGL (or an empty QT_QUICK_BACKEND)
env. variable.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-10-30 22:09:52 +01:00
Rick Walsh
68c2b10161 VPM-B ceiling: calculate deco_time similar to planned VPM-B dives
When planning a VPM-B dive, the "deco time" ends at surfacing, which is after
ascending after a full-minute deco stop is complete, after ceiling clears. We
should take this into account when calculating the ceiling outside of the
planner.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-10-30 21:48:15 +01:00
Rick Walsh
f2535995f0 VPM-B ceiling outside of planner: over-estimate deco_time on first iteration
This means the iterations converge from an over-estimate, consistent with
planning VPM-B dives

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-10-30 21:48:15 +01:00
Rick Walsh
eb62ced8a1 whitespace (planner.c)
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-10-30 21:48:15 +01:00
Rick Walsh
04383e27e5 VPMB profile: use bottom_time to calculate deco_time in planner
This corrects the issue where the displayed ceiling in the profile was
"broken" by the planner, especially for shorter and shallower dives.

Also fixes issue outside of planner where the deepest VPM-B ceiling was shown
too early, messing up the deco_time calculation.

VPM-B plans respond to change in O2% in gas as expected (in my testing)

Fixes: #630

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-10-30 21:48:15 +01:00
Stefan Fuchs
d470ef05e0 New dive plan set salinity to current dive salinity if dive selected
This helps people who always use a std. salinity of e.g. 1020g/l.
If they have a log with their dives open and plan a new dive they will
have also for new planned dives the salinity set to their prefered value.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-30 21:45:56 +01:00
Stefan Fuchs
16f330e6c9 Planner remove unnecessary gas consumption info from notes
If we consumed 0l/0bar in total from a cylinder there is no need to also
state that we consumed 0l/0bar during ascend.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-30 21:45:56 +01:00
Stefan Fuchs
2bfcc5554f Tidy up code for cylinder remove decision in cylindermodel.cpp
Replace currentMode() != ...:NOTHING with equivalent in_planner()

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-30 21:45:56 +01:00
Dirk Hohndel
582ce3b0f1 Update ReleaseNotes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-30 12:52:19 -07:00
Dirk Hohndel
38c4dfd45c Add a useful error message if we fail to connect to cloud server
Because now we are trying to open a URL as if it was a local file.
Again, the goal is to accelerated debugging if things go wrong.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-30 12:27:29 -07:00
Dirk Hohndel
2878f32a22 Improve parsing of git error message
This is rather fragile code, and the capitalization of the error message
in libgit2 changed at some point. But commit 794739b4c0 ("strstr is a
case sensitive compare") didn't really fix the problem - as it broke
that same check for older libgit2 versions.

Instead use our new helper function to make it work with libgit2 old and
new.

Also, add some more error output so the next time we run into this it's
more obvious what broke and where.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-30 12:27:29 -07:00
Dirk Hohndel
1c42750cdf Add new helfer for strcasestr
That's not a standard functions, so let's just build it. This is not
the most efficient way to write it, but it will do.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-30 12:27:29 -07:00
Jan Mulder
15cdcdbc69 QML UI: show divelist from the top
In commit bdf6dc7828, we pulled in some changes from Kirigami.
I checked all the new commits and they seemed just fine, and a
test (on desktop) on both Qt 5.9.1. and 5.9.2 showed no obvious
problems.

However, some time later, working on something else, I compiled
from Android to test, and saw some strange behavior in the dive
list. The topmost dive is partially hidden behind the application
header on startup of the app, but can be pulled down. Not a big
deal, but is does not look right.

After tedious testing, bisecting, etc, I found commit
d0f3941a4d7f4d4c6 in Kirigami (obviosuly, it was not clear from
the start that it was in Kirigami, as I could well have been
some error in Subsurface, or even Qt). Mentioned commit is
trivial, and handles with the wideScreen property of the
application window. With wideScreen = false, the bug is
visible, when true the bug is gone.

This all said. Just set the wideScreen to true, which can
definitely be considered a workaround. I exspect that this
commit can be reverted later on when Kirigami is fixed.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-30 18:42:58 +01:00
Lubomir I. Ivanov
182992fad5 desktop-main.cpp: add verbose output to validateGL()
Amend validateGL() with verbose output.
Also use QDebug instead of fprintf().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-10-29 16:56:35 -07:00
Dirk Hohndel
c88b59392b Latest translations
This includes several fixed translations where arguments didn't
match the source strings, several of which could likely have
resulted in crashes.

Credit goes to Robert's update to checktranslation.pl.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-29 20:14:15 +01:00
Dirk Hohndel
090e86e34d Update translation source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-29 20:01:31 +01:00
Dirk Hohndel
2d604ab2ff Mark missing translations
Reported-by: Pedro Neves <nevesdiver@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-29 20:00:53 +01:00
Jan Mulder
cf75e6451d QML UI: Scrolling in dive details
While testing the mobile app on Qt 5.9.2, I encounted a show stopping
issue. Select a dive in the dive list, go back to the dive list (as
selecting a dive opens the details), now scroll down to a different
dive, and select one. The app starts enumerating (moved smoothly
according to the specs) all the dives between the old and the new
selected dive. So, depending on the distance, this could take forever.
Explicitly: on 5.9.2. only.

From the Qt docs:

highlightFollowsCurrentItem : bool

If this property is true (the default value), the highlight is moved
smoothly to follow the current item. Otherwise, the highlight is not
moved by the view, and any movement must be implemented by the highlight.

End Qt docs.

Setting this property to false solves the issue. Tested on both Qt 5.9.1
and 5.9.2.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-29 11:08:10 -07:00
Stefan Fuchs
4e320cca5b Remove three obsolete preferences options for geocoding
These options are not used any longer/were never used and can be
removed to not confuse the users.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-29 11:07:52 -07:00
Lubomir I. Ivanov
c78a864e15 desktop-main.cpp: add validateGL()
Add a new static function to validate the availability of OpenGL
on this particular desktop system. It makes some calls to create
a platform agnostic GL context that renders to a offscreen surface.
Then it makes a couple of glGetIntegerv((GL_xxx_VERSION, ...) calls
to see if the GL profile version is at least 2.1.

In case any of the steps fail, a stderr message is shown and all
QtQuick based widgets would be rendered using a software renderer.

Testing was done in the case of the Google maps plugin and the
fallback seems to work on Windows, but further testing will be
required on all OS.

For the time being, the automatic fallback is only supported
on Qt 5.8.0 or later.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-10-29 11:06:40 -07:00
Lubomir I. Ivanov
fd2e4803a0 README: add notes about the OpenGL requirements
This commit creates a "System Requirements" section
in the README. Thus far this wasn't required but the
Google maps plugin introduced a complication.

The next patch will attempt to add the automatic
"fall back to a software renderer".

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-10-29 11:06:40 -07:00
Robert C. Helling
43b1a73022 Check arguments of translation strings
Make sure the arguments of placeholders agree

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-10-29 11:01:56 -07:00
Salvador Cuñat
15028fd299 smtk2ssrf-build.sh: add building command line mode
Add a flag to build with -DCOMMANDLINE=ON
2017-10-29 17:08:36 +01:00
Salvador Cuñat
d7d8434f4e sntk2ssrf-build.sh: minor fixes
- Reverse warning question logic.
- Remove marble related cmake flag.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2017-10-29 17:08:36 +01:00
Salvador Cuñat
1a0ea6cc97 smtk2ssrf-build.sh: Add warning and some style fixes
Add a warning about overriding subsurface binary and make some scripting
style changes.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2017-10-29 17:08:36 +01:00
Salvador Cuñat
c6d85838b5 smtk2ssrf-build.sh: Build a stripped version of subsurface
Till now we have been building against a previous built of subsurface.
This was handy and fast, but there is a huge drawback in this approach
because we were including a lot of unneeded dependencies (e.g. marble
or serial-ftdi), some of which are, indeed, optional.

With this patch, a stripped down version of susbsurface is built and
used to link in smtk2ssrf.

The bad news are that this - almost unusable - version of subsurface
overrides any preexisting binary, so the user has to rebuild.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2017-10-29 17:08:36 +01:00
Lubomir I. Ivanov
9367610220 mapwidget: add the 'isReady' flag to the Map component
The 'isReady' boolean flag is now set to 'true' only
once the Component.onCompleted slot is reached.

The flag is then used as a safe-guard in the
onZoomLevelChanged slot. Calculate the small circle radius
(mapHelper.calculateSmallCircleRadius()) only if 'isReady'
is set to true.

Prevents a crash if the Map widget is not ready, yet a zoom
level is set via the 'zoomLevel' property. The crash happens
because mapHelper.calculateSmallCircleRadius() has a callback
to the Map component to estimate some points and distances of the
small circle.

Reported-by: Stefan Fuchs <sfuchs@gmx.de>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-10-29 08:26:11 +01:00
Jan Mulder
6d81e19eae map widget: start with normal zoomlevel
Commit 344d976593 resulted in the start of Subsurface with a map of
the whole world. The user has to zoom in (assuming the case that the
first selected dive has a position), in evenry session. This is solved
by setting the zoomlevel at startup at the default value. Ok, this
results in a map of central London, UK, when starting Subsurface with
a dive without location, but is this as good as any map.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-29 08:26:11 +01:00
Lubomir I. Ivanov
4357e06ba0 mainwindow.cpp: fix whitespace
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-10-28 17:39:19 +02:00
Dirk Hohndel
98ddc1977c Start ReleaseNotes for 4.7.2
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-28 17:11:16 +02:00
Dirk Hohndel
6efb357249 Pull latest translations
Fixes #740

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-28 17:02:30 +02:00
Dirk Hohndel
9fabb50040 Small changes to the issue template
This way hopefully more people will tell us right away which
localization they are running in.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-28 16:59:20 +02:00
Stefan Fuchs
81492b8cba Set checked status of menu entry for dive list filter correctly
When enabling the dive list filter via the menu entry
"Log->Filter dives" and then switch off the filter via the small "close"
button of the filter:
Set the checked status of the menu entry correctly.
Also set it correctly when switching on/off via the menu entry to avoid
any situation where it is not synced.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-28 14:16:38 +02:00
Salvador Cuñat
215f61175d mobile-manual_es: Update translation to daac80b7 2017-10-28 13:10:13 +02:00
Jan Mulder
bdf6dc7828 Kirigami: newer SHA
Switch to a newer SHA, so that at least my commit is in. Checked
the newer version, and no other artefacts seen. I think we
should try to follow master where we can (but controlled).

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-28 09:05:16 +02:00
Salvador Cuñat
1095b78071 Planner: Do not translate VARIATIONS
This string is substituted with the runtime increments derived of slight
variations in depth or bottom time in:

diveplannermodel.cpp:1058:
displayed_dive.notes = strdup(notes.replace("VARIATIONS", QString(buf)).toUtf8().data());

Translating it avoids substitution and we just get the translated
string.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2017-10-28 08:19:18 +02:00
Jan Mulder
6bd5312dfa QML UI: prevent full overflow of bottom buttons
A not perfect improvement, but way better IMHO. Prevent the list of
downloaded dives to grow over the buttons at the bottom. Just a simple
change by adding a bottomMargin to the list.

Notice that there is still some overlap, but for now I consider this a
trade-off between the scarce screen real-estate and the wish to present
and much as possible dowloaded dives.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-27 19:28:42 +02:00
Jan Mulder
f25cc3a67f QML UI: repair long trip headers
Trip headers spanning more than one line where broken at incorrect
locations in the string. Not exactly sure, but I think this came with
the newest Kirigami SHA, and especially the Label change.

Carefully reading the code for the trip heading shows a "strange"
negative margin. So the margin is on the outside. This margin was
used to split the string, allowing for a small invisible part of
the string to present as trip header.

This is solved by this commit.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-10-27 19:27:47 +02:00
Berthold Stoeger
43a5cb3962 Clear error string when starting dive computer dowload.
Fixes minor interface inconsistency: After a failed download, the
error message was also shown on subsequent successful downloads.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-10-26 20:45:25 +02:00
Dirk Hohndel
6852c3b039 git save: create a better commit message for initial commit
When we create an empty repo we should simply state that in the commit message.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26 20:44:02 +02:00
Dirk Hohndel
1be4435175 git save: don't save the git_id if just creating empty repo
Otherwise the following call to do_git_save will potentially have incorrect information
about the cache validity of the dives in the divelist.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26 20:44:02 +02:00
Dirk Hohndel
bd54e94606 git save: remove redundant 'subsurface' from commit message
The user agent string already contains the (correctly capitalized) program name.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26 20:44:02 +02:00
Dirk Hohndel
a0c40833a4 Report which files were opened / imported at start
We only do this in verbose mode to make sure a report contains the information
about the existing files used.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26 20:44:02 +02:00
Dirk Hohndel
5269f8ce40 git storage: print the actual error
It seems silly to not show what git told us went wrong.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26 20:44:02 +02:00
Dirk Hohndel
6f20d1a208 cloudstorage: handle invalid PIN correctly
If the server tells us that the PIN is invalid, we need to continue
to ask for a PIN.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26 20:44:02 +02:00
Dirk Hohndel
9c4782fa5c cloudstorage: better member name when updating authentication state
This isn't just about showing the PIN or not.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26 20:44:02 +02:00
Dirk Hohndel
95a8f951ba Remove bogus member that hides global variable
Inexplicably, commit 8b7427c56d ("Move CloudStorage out of the widgets")
didn't just move the code but added a local member 'verbose' that hides
our global variable...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-10-26 20:44:02 +02:00
Miika Turkia
5f88b62cb1 Support for trimix on jdivelog import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-10-26 13:13:24 -04:00