Commit graph

1968 commits

Author SHA1 Message Date
Dirk Hohndel
b42df1dab6 Globe: do a better job detecting double clicks and setting GPS coordinates
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>
2014-06-11 09:31:01 -07:00
Dirk Hohndel
f54849987e Remove unused variable
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-10 13:18:16 -07:00
Dirk Hohndel
52c7b6d934 Planner: fix the tab order
I know this is being redone, but the messed up tab order was driving me
insane when testing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-10 13:12:42 -07:00
Dirk Hohndel
486ff0990f 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>
2014-06-10 12:59:54 -07:00
Dirk Hohndel
e6fe4760a0 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>
2014-06-10 11:45:20 -07:00
Dirk Hohndel
6998dcdf6a 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>
2014-06-10 10:56:03 -07:00
Dirk Hohndel
e4a9fa74e8 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>
2014-06-10 09:28:17 -07:00
Dirk Hohndel
445e937a5b 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>
2014-06-10 09:24:10 -07:00
Dirk Hohndel
6daeb276ad 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>
2014-06-10 09:11:34 -07:00
Dirk Hohndel
8a0d852a7c 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>
2014-06-09 22:48:21 -07:00
Dirk Hohndel
0102604645 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>
2014-06-09 20:32:44 -07:00
Lubomir I. Ivanov
8b3ebaa8a3 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>
2014-06-09 16:55:44 -07:00
Lubomir I. Ivanov
90982a84fa 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>
2014-06-09 16:55:24 -07:00
Dirk Hohndel
863f885012 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>
2014-06-09 13:42:16 -07:00
Dirk Hohndel
95cb4e85ee 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>
2014-06-09 10:55:56 -07:00
Dirk Hohndel
a26719c541 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>
2014-06-09 09:38:50 -07:00
Dirk Hohndel
bbe62f756a Change character for liter in SAC values as well
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>
2014-06-08 21:00:56 -07:00
Dirk Hohndel
11380a5deb Really display liters with script el
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>
2014-06-08 20:39:46 -07:00
Dirk Hohndel
6f568fbecd Simplify the code that checks if it's OK to close the current file
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>
2014-06-08 19:49:25 -07:00
Dirk Hohndel
a70a0662f5 Pick the correct API function name for Qt5
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>
2014-06-08 17:54:51 -07:00
Dirk Hohndel
1604299a5b Picture handling: change data structure to store offset instead timestamp
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>
2014-06-08 17:17:49 -07:00
Dirk Hohndel
3a14076b1d Picture handling: stagger the pictures
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>
2014-06-08 12:42:51 -07:00
Dirk Hohndel
f037f03268 Picture handling: put the picture near its correct time during the dive
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-08 12:42:51 -07:00
Tomaz Canabrava
380385d86f Rotate the picture around -4 and 4 degrees.
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>
2014-06-08 12:42:51 -07:00
Tomaz Canabrava
c21122af40 Add a drop shadow on the picture
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>
2014-06-08 12:42:51 -07:00
Tomaz Canabrava
8e682c41e8 Add a nice white rectangle around the picture
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>
2014-06-08 12:42:51 -07:00
Tomaz Canabrava
e14a15e61c Subtle animation when the picture gets hovered with the mouse.
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>
2014-06-08 12:42:51 -07:00
Tomaz Canabrava
38ac6ed35f Add a scaleTo animation
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>
2014-06-08 12:42:51 -07:00
Anton Lundin
efd8da9b08 Gas was printed in permille, use gasname instead
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>
2014-06-08 09:25:27 -07:00
Dirk Hohndel
439c2e0473 Correctly test QString for being empty
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-08 07:53:22 -07:00
Dirk Hohndel
a0a6759d93 User manual: show a localized version of the manual if it exists
So far we only have Spanish, but it always pays to plan ahead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-06 12:10:34 -07:00
Gehad elrobey
7c9e6cac2e HTML: export to system dependant path separator
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>
2014-06-06 10:08:09 -07:00
Robert C. Helling
40dd6f4c39 Disclaimer included in the printed diveplan
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-04 14:45:54 -07:00
Dirk Hohndel
714fdc7ced Force TTS/NDL calculation off if things take too long
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>
2014-06-04 13:44:34 -07:00
Dirk Hohndel
c92bb9e021 Planner: don't redo the plan after partial edits of GFlow/high
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>
2014-06-04 09:34:08 -07:00
Dirk Hohndel
5bc5cae6dc Planner: only copy cylinders that were used in the template dive
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>
2014-06-03 23:09:12 -07:00
Miika Turkia
a89533bf37 Fix HTML export white space issues
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03 21:16:11 -07:00
Gehad elrobey
197bd76f16 Remember selection of export HTML settings
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>
2014-06-03 21:09:44 -07:00
Gehad elrobey
4ec4c84ea9 Minor Fixes to the export dialog UI
- 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>
2014-06-03 21:09:16 -07:00
Gehad elrobey
e21032c99b Add HTML tab in export dialog
- 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>
2014-06-03 21:07:45 -07:00
Dirk Hohndel
b6fce3f556 Closing the window should behave like triggering Quit
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>
2014-06-03 18:32:00 -07:00
Dirk Hohndel
a82411b67c Dive edit: when asked ti quit while editing, offer to discard current edit
This is equivalent behavior to what we do when planning a dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03 18:17:32 -07:00
Dirk Hohndel
37910751a0 Dive edit: avoid memory leaks
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>
2014-06-03 18:12:24 -07:00
Dirk Hohndel
c5437c7499 Dive edit: don't free the taglist of the master dive
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>
2014-06-03 18:04:39 -07:00
Dirk Hohndel
a12b10c008 Ask before discarding edits
This is equivalent to what we do for the planner.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03 18:01:00 -07:00
Dirk Hohndel
1fec6453a2 Another futile attempt to keep whitespace consistent
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03 16:49:56 -07:00
Tomaz Canabrava
3e46b4862a Do not plot pictures that don't have a timestamp.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-03 16:47:43 -07:00
Tomaz Canabrava
b1847f9ebb Also hold a pointer to the struct picture on the model.
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>
2014-06-03 16:46:03 -07:00
Tomaz Canabrava
43cf9fdb7a Add a method to plot the pictures on the profile.
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>
2014-06-03 16:43:06 -07:00
Tomaz Canabrava
ebe799e0a0 Connect & disconnect the PictureModel on the profile
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>
2014-06-03 16:41:51 -07:00