This finally gets me something that I like. The way the different boxes
get resized seems pleasant and intuitive. And it appears to do the right
thing on all platforms (I learned that having different levels of layout
nested creates no vertical offset on Linux/KDE, but a very ugly offset on
Mac, for example).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This raises the maximum number of gas mixes listed to 20 and also changes
the layout / design of the stats tab to make it much more attractive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The planner has its own view of the gradient factors. So replacing those
with the ones set up for viewing dives in the preferences is wrong.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While planning we might change the gradient factors. Make sure they are
back to what's in the preferences when we're done planning.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We already did a list of gases and volume consumed for the selected dive
on the Dive Info tab, but did not provide that same data on the Stats tab
for all the selected dives.
I arbitrary limited this to eight gases (as the list can get quite long
when you select a lot of dives). The gases are sorted by volume consumed.
Fixes#535
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Being shown between the deepest and shallowest dive's max depth it
confuses a lot of people - the average depth is frequently less than the
shallowest of the dives, so at first glance it looks like the "average" is
less than the "minimum". So having three numbers grouped like this that
use different algorithms is just distracting.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
"warning: 'bottom_time' may be used uninitialized in this
function"
we set it to zero for now.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
warning: 'ProfileWidget2::someVariableName' will be
initialized after [-Wreorder]
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
"warning: suggest parentheses around assignment used
as truth value [-Wparentheses]"
I think 4.8.2 is confused about this one, but we suppress
it regardless by separating into two assignments.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
encodeUtf8() and decodeUtf8() are only used for Q_OS_WIN in init_ui(),
but also that branch is wrapped in a "#if QT_VERSION < 0x050000"
we do the same for the actual function declarations.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We should either use mplicit struct initializers (empty braces { }
or double braced zero {{ 0 }}) or memset the struct.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This worked before without the "file:///" prefix, but something else that
I did broke that. Oh well, now it works again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Strangely, *prinf() on Linux appears to do the right thing in either
order (my guess is based on the type of the two values?), but on Windows
things go badly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Previously the code could get confused by edits (including trivial things
like deleting the coordinates). It seems much more reliable to simply
compare the coordinates of the edited dive with the ones in the current
dive before the edits.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also change the on file XML to be even easier to read by making it a
duration as well (which gets us '32:34 min' instead of un-typed seconds).
This is backwards compatible, it will happily read what was written with
the previous commit).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And fix the bug that in the info overlay SAC was always given in metric
values. And try to reduce the number of places in which we calculate the
unit conversions...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In commit 125ddd955c ("Display liters with script el") Robert only fixed
the C routine we use to show units. Strangely, we had a separately
implemented C++ function as well. Instead of implementing this in two
spots I now simply have the C++ function use the C function to do the
actual work and then wrap this into an easier to use (from UI code)
QString output.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Triple time step in deco ascents to improve responsiveness of interactive
deco calculation.
[Dirk Hohndel: split commit into two]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use script ell instead of 'l' for liters to avoid confusion with digit 1.
Let's hope that this glyph is available in the common fonts, otherwise
we'll have to revert it.
[Dirk Hohndel: split commit into two]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
And make sure it gets called whenever it needs to get called - it was
missing from the openRecentFile case.
Fixes#530
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Subtle change in function name from Qt4 to Qt5
setAcceptsHoverEvents -> setAcceptHoverEvents
Now Subsurface builds with Qt5 again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Using XML data files we can now save picture data and load it back in
again. The corresponding code for save-git and load-git is still missing.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It makes no sense to store a 64bit time stamp with every picture. Even the
32bit offset (in seconds) from the dive start is WAY overkill. But
switching to that makes the code much more simple in a number of spots.
And makes what is saved to the XML file easier to read, too.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the pictures are too close to each other, spread them out a bit more.
This seems to give a reasonably pleasant layout.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It confuses us elsewhere (the model suddenly doesn't match the list of
pictures as the model doesn't reflect the duplicate pictures).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch rotates the picture a bit, so it looks like it was
splattered around the profile.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds a drop shadow on the picture. a real blurry shadow
could be much better, but without OpenGL it's too costly to calculate
the shadow for each picture.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes the picture looks a bit more like a real paper picture
shadow's missing, though.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds a subtle animation when the picture gets hovered
with the mouse, and restored to it's original size when mouse exits
the image area.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
ScaleTo animation will scale or shrinks an graphical element in an
animated way. This is going primarelly to be used on the pictures on the
profile, but can be used on anything else later.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Save the timestamp of the dive if it exists in the data provided
by the exif library.
[Dirk Hohndel: fixed whitespace and format specifier]
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also add reminder comments for creating debug builds on Windows
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
After the switch to a central event decoder and just return gasmix from
that we printed things in permille, eg. EAN1000 and 180/550 which looks
kinda strange.
This fixes that by using gasname instead to give the gas a name.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We tried to copy the .html.git file from the out of tree build dir, not
from the source dir.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I was confused by the function name getSubsurfaceDataPath() - it does not
find paths relative to the "data" folder, if finds the path where we might
install folders like "data", "translations", or "theme".
"data" is for some reason where we install the "marbledata" files.
Therefore on both Mac and Windows we need to put the "theme" directory
next to the "data" directory, not below it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
.. and fix the type breakage brought in by commit eaf6d56487 ("CCR code:
Change to sample structure")
The XML parsing callbacks pass a "void *" around, because the helper
function that matches the XML node names ("match()") does so for all the
different dive/sample/dc member nodes that all have different types.
But that also hid the fact that it very much depended on the various types
being regular "int" etc, rather than the denser types that were introduced
so that the CCR data wouldn't expand memory use excessively. As a result,
XML loading would overwrite other members, and possibly even the
allocation, when it wrote an "int" value to something that only was a
8-bit allocation.
I left the "utf8_string()" without type checking - so it still uses
"void *_res" for the result type, with the cast happening inside the
function.
That's because the result destination ends up being a bit mixed-up wrt
"const char **" and just plain "char **". Note that the thing we modify
itself isn't const (it's not "char *const *"), but the pointer, but we
basically sometimes assign a "const char *", and sometimes a "char *".
I considered making two different versions of the callback, but it just
wasn't worth it. So "utf8_string()" users still aren't type-checked, and
you'd better give it a pointer to something that is some kind of "char *"
This patch doesn't really change the calling convention of the matching
function itself, but it makes the wrapper macro ("MATCH()") take a
properly type-checked function pointer instead (with a dummy call to do
type checking), and then casts the pointer to the "void *" type for the
actual real call.
The function pointer call is not really portable (although it works on
all sane architectures, particularly since the cast only changes one
argument from one type of pointer to another), and to make matters worse
uses the gcc statement-expression extension. But all the compilers we use
seem to support that gcc'ism, so in practice this gives us type-safety
with no downsides.
(If we ever want to use MSVC to compile subsurface, I suspect we'll have
to ifdef out the statement expression use and not type-check things. Or
perhaps re-write the thing as a ternary expression instead, or something).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>