Commit graph

9346 commits

Author SHA1 Message Date
Tomaz Canabrava
7cd9e2b7bb Make icons work again
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
8cdae5ce24 Code cleanup
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
315641b0b4 Preferences: add GeoReference
Straigth port from the old version.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
5461eadd1b Preferences: start with all settings set
Load all settings as soon as we start the preferences.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
c06813317f Preferences: hook up the missing parts for the language prefs ui
And this actually made me find one memory leak on the old version:
We are constantly creating / leaking a new QSortFilterProxyModel
everytime a sync() is done on the settings. That's not a lot, maybe
once per time a user changes its settings... but it's still a leak.

And the code is more sanely separated this time. yey.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
c0d16267af Preferences: Apply / Cancel / Defaults
All functions that should control the preferences are
created.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
b7daffbf08 Preferences: Hook up the dialog buttons and make it work
Since I'm using a dialog created by hand, I also need to
hook things by hand. the code is very simple - debug output
kept in just to make sure things are indeed working.

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
b7a476169d Preferecnes: add the initial skeleton
This Preferences dialog should be visually similar to the
old one - the main difference is how it acts on the preferences.
It's also not based on .ui files since it's a very simple widget
I prefered to mount it by hand - no more than 6 lines of c++ code.

Right now we have only one preference page on this, and nothing
is hoocked up.

I've also changed mainwindow a bit to only show this dialog for
testing purposes.

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
255325e219 Preferences: add a new page for language
This is not hooked into anything - It's the bare minimum that I
need to continue creating the new preferences dialog. But take a
look at it... very simple. :)

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
b35ccc3a35 Preferences: start to port preferences to a more sane design
Our preferences dialog right now is a rather huge dialog
with more than 9 subpages, and all of those pages are programmed
inside of the same class, same methods and all that - which means
that if I change something on the dialog I can break any
other thing quite easily.

The idea of this patch series is to make it harder to break
user settings and the settings dialog.

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
225ac07005 Clear the main CMake file
A bit of dust was setting here, when I moved tons of things around
I forgot to remove some bits.

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
044e593957 CMake for tests in its own folder
Besides making it more simple to add a new test now since
you don't need to play hide and seek with the main cmake
this has another good thing: on IDE's that scan the cmake
to create targets on the project tree, the main project
was being popullated with test-targets on the main tree
and not inside the tests directory.

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
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