Move all the map widget platform agnostic files to the
<subsurface-root>/map-widget folder.
This avoids the confusion about the desktop version of subsurface
using mobile components. The map widget is planned as a shared
component between the mobile and desktop versions.
desktop-widgets/mapwidget[.h/.cpp] still remain as those are specific
to the desktop version.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
We had not done this on Linux as it was just as easy to run from the build
environment, but we need to install in order to be able to create an AppImage
on Travis.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This fixes two problems:
1) Using the keybord or clicking below the list and moving the mouse
up while holding the mouse button did not properly update the status
message and the save button. For example, one could save with a non-
paired device selected.
2) The code assumed that a device is selected if the save button is
active, but the save button was not disabled on scan. Thus, one could
provoke a crash by selecting an item, scanning and then pressing save.
This problem is fixed indirectly, because the save button is now always
disabled if the selection is cleared.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Remove unused variables o2time and breaktime or convert into boolean.
Never consider minimum gas switch time when switching to o2.
Reflect this behavior also in the UI.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Disable option "safety stop" for all deco modes other than
"recreational".
Disable also labels "reserve gas", "GF ..." and "VPM conservatism"
correctly.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Correct spelling and typos in file filters.
Unify and translate file filter names.
Don't pass a file filter to a directory open dialog - not needed.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
QMap::operator[] creates a new default constructed entry in the map
if no entry with the given key exists. While not problematic (since
typically nullptrs are inserted) this is usually not what you want
for read access.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Currently one has to explicitly use --win32console and/or
--win32log to enable a dedicated console (a console window
that opens next to the Subsurface window) or to enable file
logging on Win32.
This patch makes the following changes:
- removes the --win32* command line arguments
- removes the dedicated console window support
- if the app starts from a shortcut and not from a console, always
redirect stderr and stdout to _err & _out log files
- if the app starts from a console redirect stderr and stdout to that
console
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
When verMinor is extracted with the glGetString() method,
use roundf() to round the GL MINOR version to an integer.
2.1 is split in 2 and 1.
Without this patch rounding issues are present as for 32bit IEEE
the default rounding makes (0.1f * 10.f) into 0.999999f.
Given the MINOR is a single digit for GL, calling roundf() on
0.999999 gives the expected result 1 for the MINOR.
Reported-by: Murillo Fernandes Bernardes <notifications@github.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
1) Destroy QLowEnergyService objects in destructor of BLEObject.
2) Let BLE object take ownership of the controller so that the
latter can be destroyed in the destructor of the former. This
introduces a certain ownership subtlety, which could be solved by
allocating the controller object in the BLE object. But let's
first do the less intrusive thing.
3) Destroy the BLE object for two error conditions.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Fixes minor interface inconsistency: The device field in the
download-from-dive-computer widget is disabled when selecting
a non-serial-transport dive computer. In contrast, post-download
the field was reset to enabled for all dive computers.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
First, attempt to use glGetString(GL_VERSION), which works
on legacy profiles but has to be parsed (unsafe and vendor specific?).
If the above fails attempt to use the newer version API from
glGetIntegerv().
If both fail, fall back to a software renderer or exit.
If GLES is detected from glGetString() (for some odd reason -
e.g. emulated driver) show a warning and return early as we don't
handle it's versioning.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>