Commit graph

9334 commits

Author SHA1 Message Date
Tomaz Canabrava
1d6683f3e0 Move Profile widget out of desktop-widgets
The reason for that is, even if profile widget is made with qpainter
and for that reason it should be a desktop widget, it's being used
on the mobile version because of a lack of QML plotting library that
is fast and reliable.

We discovered that it was faster just to encapsulate our Profile in
a QML class and call it directly.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
50ec7200e6 Single CMake to handle the models
This one was pretty easy because of the work I did a few months
ago to separate the models from the UI.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
45c9764073 main.cpp -> {android-main, desktop-main}
This is needed to compile both in a single call to make. Also it will
help removing some of the mistakes in the current android version:
it always created the mainwindow, even without using it for anything,
so tons of memory will be freed now for the android version, making it
snappier and smoother.

This is a necessary move so we don't need to #ifdef all over the place
for the two different versions, and imo the changes needed to keep both
versions will not be that huge if we keep things in subsurface-core
sane.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
e49d6213ad Move qt-ui to desktop-widgets
Since we have now destkop and mobile versions, 'qt-ui' was a very
poor name choice for a folder that contains only destkop-enabled
widgets.

Also, move the graphicsview-common.h/cpp to subsurface-core because
it doesn't depend on qgraphicsview, it merely implements all the
colors that we use throughout Subsurface, and we will use colors on both
desktop and mobile versions

Same thing applies for metrics.h/cpp

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
588abd019f Move the icons to the icons folder
There was no reason at all to keep those icons on the root
folder.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:48 -07:00
Tomaz Canabrava
6cd711a11b Modify code to make it compile after rebase
Did a git rebase and some stuff changed in the meantime;
This is a compatibility commit: Add a few include directories
on the cmake to quiet some ui_headers.h not being found (the
ones that are created automatically by uic) and a few noiseances
like models requiring interface functionality.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:48 -07:00
Tomaz Canabrava
4c0156e3d5 Move all core-functionality to subsurface-core
And adapt a new CMakeLists.txt file for it. On the way I've also
found out that we where double-compilling a few files. I've also
set the subsurface-core as a include_path but that was just to
reduce the noise on this commit, since I plan to remove it from
the include path to make it obligatory to specify something like

 include "subsurface-core/dive.h"

for the header files. Since the app is growing quite a bit we ended
up having a few different files with almost same name that did
similar things, I want to kill that (for instance Dive.h, dive.h,
PrintDive.h and such).

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:48 -07:00
Tomaz Canabrava
a079821423 Start to clean CMake
CMake can be a good system but if we keep everything into one big
cmake file things can go nuts really quick. Since I already took
quite a start on an subsurface layer separation some time ago, I'm
improving it by making each module on Subsurface depend on it's own
CMake module.

This first patch moves the qt-ui part to qt-ui/CMakeLists.txt file,
it cleans tons of the main cmake file ( moving all parts to the in
ternal folder ), and makes things more easily manageable by the
programmer that will change the ui bits, he doesn't need to play
hide and seek with the CMakeLists.txt file anymore, trying to figure
out where should he put his newly generated file.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:02 -07:00
Dirk Hohndel
f38ca97a78 Update strings
Manually fixed the two strings with plurals. The Qt tools create only one
<numerusform></numerusform> line, but for some reason transifex appears to
require two of them back to back.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-29 12:33:43 -07:00
Sergey Starosek
9132390689 Fix plurals translation
This allows separate translation of singular and plural forms

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-29 12:17:29 -07:00
Guillaume GARDET
f451387f8f Add subsurface.debug script to help debugging and install it (for Linux only)
This patch adds subsurface.debug script and install it for Linux.
Instead of running subsurface, you can run subsurface.debug which will launch
subsurface as usual, but will monitor subsurface exit and run gdb automatically
if subsurface crashes and it creates a crashlog in $HOME/.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-29 08:35:01 -07:00
Guillaume GARDET
94207fa8d7 Documentation: update french translation of user-manual
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-29 08:34:48 -07:00
Sergey Starosek
906b2c2288 Documentation: update russian translation of user manual to english eed9a4b0
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-29 08:33:51 -07:00
Robert C. Helling
97e53649fd Notes from planned dives contain html. Convert to text for printing.
Otherwise we would be printing html source with too many tags
for humans to spot the content.

[Dirk Hohndel: changed the string comparison to use our helper]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-28 07:50:38 +09:00
Dirk Hohndel
dfc1e36c0e Adjust asciidoc invocation to build latest manual
We shouldn't need to set the stylesdir - instead doing so makes us not
find the toc.css file.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-28 07:50:38 +09:00
Willem Ferguson
eed9a4b0f2 User manual updates.
1) Put table of contents as a column on the left-hand side of the page
   instead of as part of the user manual text.
2) Correct a some typoss.
3) Add three sentences to the Bluetooth download section to deal with
   Bluetooth Pass Codes.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-27 21:52:33 +09:00
Dirk Hohndel
f6ae4fde51 Getting ready for 4.5.1
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-27 15:27:16 +09:00
Dirk Hohndel
5b08705f39 Pull latest translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-27 15:23:39 +09:00
Dirk Hohndel
3b419b3d07 Make libtool versioning happy
This way we find the versioned libdivecomputer.dll

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-26 15:19:05 -07:00
Dirk Hohndel
5d8f3c1ebd Cmake: fix incorrect modification of a QT_LIBRARIES
It's a list, not a string. Treating it as a string creates all kinds of
exciting weird errors that make no sense.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-26 14:51:07 -07:00
Dirk Hohndel
47c7958ed3 Build Windows installer with shared libdivecomputer
Since we ship it all in one piece there is no reason to use a static
libdivecomputer (like there is on Linux). This allows us to give the user
a different libdivecomputer.dll for testing when tracking down a bug.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-26 14:27:16 -07:00
Dirk Hohndel
c6ec742d11 Build libzip with cmake when cross building for Windows
This seems to fix our issues with being able to create zip files on the
fly (needed for the divelogs.de access).

Fixes #955

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-26 14:24:34 -07:00
Dirk Hohndel
755ecf607a Remove unnecessary Q_INTERFACES declaration
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-27 06:15:14 +09:00
Dirk Hohndel
aa78c5b0ec Allow building with both libzip 0.11.x and 1.0.x
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-26 06:51:47 -07:00
Dirk Hohndel
3b0f38f24a Fix building without BT support
I guess no one had tried this in a while.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-26 06:51:47 -07:00
Miika Turkia
1d10a56bdf Some error reporting on divelogs.de export
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-26 01:19:40 +09:00
Dirk Hohndel
8c706357f4 Report error received from zip_close
We may want to hide the error text in a release build and replace it with
something more user friendly but then again, the next time this fails on
us at least our users can report more than "doesn't work"...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-25 23:39:29 +09:00
Dirk Hohndel
3b033a85ac Divelogs.de upload: report error when unable to open upload file
Silently failing is not cool.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-25 14:48:25 +09:00
Dirk Hohndel
622fb4f800 List latest changes in ReleaseNotes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-25 14:01:43 +09:00
Dirk Hohndel
3c8a9bc057 Move informational output to only be shown in verbose mode
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-25 13:57:11 +09:00
Linus Torvalds
2b1017c986 Interpolate depth for samples that have no depth
When downloading from libdivecomputer, we used to initialize the depth
of a sample to the previous depth.  However, at least for the Suunto EON
Steel, you can get sample times without any actual depth reading - the
time might be associated with some ranbdom event rather than a new depth
sample.

Rather than initialize these samples to have the same depth as the
previous one (and then perhaps getting a very sudden jump when the
*real* depth event comes in a second later), initialize the depth
samples to -1, and if that sample doesn't get a real depth, we'll create
an interpolated depth.

It is possible that we should just carry the sample around as not
actually having a depth, and instead just interpolate in the plot_info
generation, but at least right now we have a ton of code that "knows"
that every sample has a depth.  Not the least of which is our own save
format.

So generating an interpolated depth seems the path of least resistance,
and at least makes the graph look correct - no odd staircase effect from
other events that happen in between depth samples.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-25 13:22:59 +09:00
Dirk Hohndel
cd1884b29c Use neutral color for "no SAC information"
In commit 31d1d1f421 ("Don't change pen color when for zero SAC") Robert
continues to use the last SAC color (which certainly was better than
switching to dark green for "extremely low SAC rate"). But I think it
makes even more sense to mark it as neutral - so I picked a gray.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-25 13:00:58 +09:00
Dirk Hohndel
1ff309c9a1 Fix location edit UI issue on Mac
For some reason the Mac doesn't create an "activated" signal when hitting
enter/return on the drop down. So we simply manually send this and now you can
select the site with enter/return just like on Linux or Windows.

Fixes #953

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-25 12:19:18 +09:00
Miika Turkia
bf2df951e6 Divelogs.de export: split location on slash
As we join LOCATION with SITE on divelogs.de import using slash (/) as a
separator, we might as well split on last slash on export.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-24 20:17:21 +09:00
Dirk Hohndel
997123c0a4 Merge branch 'for_dirk' of https://github.com/atdotde/subsurface 2015-10-24 06:55:51 +09:00
Robert C. Helling
31d1d1f421 Don't change pen color when for zero SAC
When for individual plot entries the SAC is zero this comes
from gas changes and the SAC calculation needing a bit more
pressure data and not from the diver switching to freediving
mode. So we shold not change the pen color on the pressure
line for that but pretend we are still breathing at the
previous SAC.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2015-10-23 23:50:21 +02:00
Linus Torvalds
ae1e9b11a5 Fix the momentary SAC calculation for the profile coloring
There was tons wrong with the code.  You can't just average the SAC rate
over different plot entries, since they may not be the same duration.
And it got the beginning and end conditions wrong etc etc.

This should at least get much closer.  And it's structured to be a lot
more understandable, I hope, even if the math is a bit more involved (ie
doing the proper time-pressure integration etc).  It may still have
bugs, but at least it now gets the right coloration at the beginning of
a dive, and just eye-balling the slope vs color it seems to do the right
thing.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2015-10-23 23:50:08 +02:00
Dirk Hohndel
6703e1091b Latest strings for translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-23 22:50:28 +09:00
Jan Mulder
604971ca0c Add missing tr() implementations
One specific string did not translate. First, Dirk and I (via IRC)
suspected a leading space was the issue (see commit eccac1321f).
However, I found out that the problem was still there. A non translated
string "%1 shown", when applying a filter on the divelist, and looking at
a trip line. It shows always untranslated "%1 shown". Extracting
to-be-translated strings from the code, I found 2 errors: Class
<classname> lacks Q_OBJECT macro.

This patch adds a missing tr() definition and implementation to 2 structs.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-23 22:48:41 +09:00
Jan Mulder
f682ea0085 Fix broken translation in divelist
Fixes a broken translation in the divelist introduced in commit 45b1d0d73d.
Now, the (.. dives) string on a trip line in de divelist is translated (again).

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-23 22:47:52 +09:00
Dirk Hohndel
04179eb237 Update ReleaseNotes to track latest changes / fixes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-23 22:27:08 +09:00
Robert C. Helling
2a977a0fcd Set a cylinder if the default cylinder is bogus
Apparently, it can happen that the default cylinder is not set
even though same_string(prefs.default_cylinder, "") is false.
Then we fall back to the 11.1l air cylinder.

This should silence a warnign about "Too many gases".

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-23 05:57:46 +09:00
Dirk Hohndel
6495b629fe Interpretive dance to parse Suunto EON Steel tank sizes
Admittedly, imperial tank sizes are a bit weird.

But it must have taken some effort to break things as creatievly as Suunto did.
The UI allows only multiples of 100psi and multiples of 10cuft. Which shows
that the developers have no idea what typical imperial tanks look like. AL72?
AL63? HP tanks at 3440psi? LP+ at 2640psi?

Yeah, I get it - you had no idea, someone showed you an AL80 and you made silly
assumptions.

But even then, what the heck are you storing in your data, dear Suunto? The
pressures are off by the very logical factor of 1.00069182389937. And then
regardless whether I use the wrong pressure or the corrected pressure, the wet
sizes are too small by a non-constant factor.

So this code takes the junk that libdivecomputer truthfully passes through from
the Suunto parser and tries to convert it into something that matches what the
user most likely entered in the EON Steel UI. Ugly. Stupid. But it seems to
work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-22 20:35:02 +09:00
Guido Lerch
f1c682b55a Fixing annoying compiler warning
Adding { } to if clause to avoid dangling warning
/Users/guidolerch/src/subsurface/qt-models/cylindermodel.cpp:117:
warning: add explicit braces to avoid dangling else [-Wdangling-else]

[Dirk Hohndel: combined two of Guido's patches to one that is simpler]

Signed-off-by: Guido Lerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-22 19:37:50 +09:00
Guido Lerch
ac8e05c4ec Fixing build warning about freediving
This just fixes an annoying warning that freediving wasn't covered in the
switch statement.

Signed-off-by: Guido Lerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-22 07:14:51 +09:00
Guido Lerch
07b4878c52 Uemis fix for Ubuntu
Fixing a bug preventing to download files on Ubuntu.
On Ubuntu some files are recognized as DIR and not as regular files.
This is a fix that works but most lilely does not address
the root cause which would need an expert to look at..

Signed-off-by: Guido Lerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-22 07:10:26 +09:00
Dirk Hohndel
569cfe1bc8 When calculating the offset, both times are localtime
So we don't need to take the relative time zone into account.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-22 07:04:32 +09:00
Dirk Hohndel
c0fb98711b Don't clear out the time stamp we remembered
Otherwise the offset calculation ends up completely wrong.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-22 07:04:32 +09:00
Dirk Hohndel
e121223fec Latest translation updates
Includes the remainder of Hebrew done by Benjamin

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-22 06:59:45 +09:00
Steve
4722df805d Update install file to build on Fedora 23
Updated packages required to build on Fedora

[Dirk Hohndel: dropped part already fixed earler]

Signed-off-by: Steve Williams <stevewilliams@internode.on.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-20 17:32:33 +09:00