For some reasons Marble appears to sometimes not detect double clicks and
call the correct callback. With this commit we manually intercept the
double clocks and route them to the right function.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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: '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>
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>
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>
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>
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>
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>
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>
This will make the exporting path separators platform dependant
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is kind of a random cut off, but if plotting the dive takes more than
a second and TTS/NDL is on, we force it off. Because the algorithm for
that is fundamentally quadratic in nature it can take a VERY long time -
getting users to think something is broken.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In most cases this wouldn't really matter, but when planning very deep or
very long dive with corresponding very long deco times, calculating the
deco takes long enough to make this notable.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This was only semi-implemented the first time around. Now we really only
copy the ones that are indeed used.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a new QSettings group "HTML" to save the HTML exporting settings and
restore them later.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- use heading "Style options" instead of advanced
- choice of selected dives is the same as other tabs
- changing the default font to 14
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- Separate the export dialog into two tabs general exports for other
exports and HTML export.
- Save HTML settings to JSON file
- Copy HTML templates to the exporting directory
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It seems odd to have different behavior depending on whether the window
manager tells us that the user wants to close the window or whether the
user hits quit or ctrl-q.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we edit any of these fields, we create new strings via strdup (or a
fresh tag_list). So if the edits are rejected, free all that memory.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We do all of our edits on a copy of the dive - but the tag_list points to
the tag_list of the master dive (based on how we create that copy of the
master dive). So only free the tag_list if it is already different from
the master dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Changes to hold a pointer to the struct picture on the model, so we can
use it to determine the correct positioning of the image on the profile.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It plots in the wrong place for now, because I need to change the model a
bit. But it shares the same pixmap with the other widget which is nice. :)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Ignore the warnings for now, this patch connects and disconnects the (not
done yet) plotPictures() method.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>