Picture handling: parse and convert old style picture events

Speacial case handling for event type '123' to instead add a picture to
the picture_list of the dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Picture handling: switch to stronger typed offset

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>
Dive edit: do a better job noticing when the coordinates were changed

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>
Fix incorrect argument order for %.*f

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>
Make sure Windows can find the user manual

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>
windows.c: prevent a warning due to #define _WIN32_WINNT...

mingw 4.8.2 complains:
warning: "_WIN32_WINNT" redefined

0x500 suits our needs windows.c wise.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
planner.c: use implicit struct initializer

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>
qt-gui.cpp: add another QT_VERSION check

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>
mainwindow.cpp: fix a warning about parentheses

"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>
profilewidget2: fix -Wreorder warnings

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>
planner.c: prevent an uninitialized warning

"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>
Don't show the average depth for the selected dives

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>
Add gas consumption statistic for selected dives

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>
Planner: use the actual setting for GF low at max depth

Using the default_prefs value makes no sense.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Planner: reset GFlow and GFhigh when we're done

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>
Planner: show the GF used for planning on top of the profile

Showing the GF in the preferences is just confusing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Planner: don't reset GF when preferences change

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>
Picture handling: when zooming thumbnail, put it in the foreground

This just seems to look much better.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Improve statistic on used gas

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>
More layout work for stats tab

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>