Commit graph

9890 commits

Author SHA1 Message Date
Tomaz Canabrava
eb2c78e953 Random fixes and improvements
Whitespace fixes, constructor fixes, new slot (still unused)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:15:22 -07:00
Tomaz Canabrava
fdec250723 Whitespace fix
Sorry.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:15:22 -07:00
Tomaz Canabrava
dd21ab6b11 Fix correct size of the popup
Correct the popup visibility.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:15:22 -07:00
Tomaz Canabrava
317c3de91d Handle dive site activation
Connect the view activated signal to send us the index.
Removing debug output that I forgot inside it.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:15:22 -07:00
Tomaz Canabrava
534e07399a Made it possible to keypress again
Click outside of the popup closes it, also handles theme
enter / return keys.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:15:22 -07:00
Tomaz Canabrava
fdd28fddf2 Start to handle keypresses
Keypress management is one of the main functions of the completer, so we
must create an event filter and hook things up properly.
key esq / enter should close the popup (and not leave us with a popup open
and no way to close it - it breaks X)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:15:22 -07:00
Tomaz Canabrava
c4c7e7a7f4 Display the popup in the correct place
The popup should be shown beneath the QLineEdit. this code here
is shamelessy stolen from the QCompleter source code because I
really didn't want to rethink the correct way of doing this.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:15:22 -07:00
Tomaz Canabrava
012e8ccb46 Re-add the 'plus' button on the delegate
This was missing in the delegate - now it's prettier.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:15:22 -07:00
Tomaz Canabrava
8c9a4ecd4b Stabilize the location model/proxy model
Since I removed the old location edit from the UI, I also need to
remove a bit of code from the UI that was calling it.

fix a few crashes regarding the old location edit.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:15:19 -07:00
Tomaz Canabrava
be6e190bd2 Skeleton of the new LocationCombobox
This is the bare minimum skeleton of the new completer for the dive site
management. Nothing works, yet, nothing is hoocked up, yet.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 14:07:07 -07:00
Dirk Hohndel
148b30849a MXE build script: more cleanups
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 12:25:14 -07:00
Dirk Hohndel
a30e78140f Hide a couple of debugging messages
They are useful to show when trying to figure out what's going on, so just
move them behind a check for verbose.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 12:20:21 -07:00
Dirk Hohndel
c9f72e510a Show progress bar when loading from cloud storage by default
It turns out that I forgot to make sure that the progress bar is shown if
the user has things set up so that the cloud storage is the default dive
file that they open.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 12:16:45 -07:00
Dirk Hohndel
48e47c9048 Windows XP doesn't contain a valid CA for our cloud certificate
This is the authentication check and cloud server availability check which
are different from the one git does. The mechanism for overriding things
is different from there, but this should work just as well.

We intercept the SslErrors signal and if we get the known good hash for
our certificate, we simply call it good.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 12:11:20 -07:00
Lubomir I. Ivanov
03b2674a13 planner.c: fix missing brances warning
for a 'struct gasmix' initialization, the 'permille' value
from franction_t should have it's own braces.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 09:15:10 -07:00
Lubomir I. Ivanov
a3421a08f0 planner.c: fix warnings about unused variables
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 09:14:59 -07:00
Lubomir I. Ivanov
4c5c7e1733 load-git.c: fix warning about sscanf() argument
Type of the 4th argument is detected as "enum <anonymous> *",
we cast it to (int *) when passed to sscanf().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 09:14:52 -07:00
Lubomir I. Ivanov
b4b16ab7ab libdivecomputer.c: fix warnings about unused variables
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 09:14:40 -07:00
Lubomir I. Ivanov
334b70c65f file.c: fix warnings about unused variables
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 09:14:30 -07:00
Lubomir I. Ivanov
4f1ac6804f divesite.c: fix warnings about unused variables
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 09:13:45 -07:00
Lubomir I. Ivanov
34147426de deco.c: fix warnings about unused variables
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 09:11:40 -07:00
Dirk Hohndel
f622516dd0 Cloud storage: more user friendly handling of local cache corruption
When dealing with cloud storage most of the time the user will not be
familiar with git. So if the local cache is corrupted don't leave them to
clean up the mess. Instead just move things out of the way (just in case
they know how to extract data from the damaged local repository) and ask
them to restart the operation which should give them a fresh copy of their
data from the remote server (minus any local changes that hadn't been
synced to the server before things went bad).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 05:14:46 -07:00
Dirk Hohndel
aeedc2a619 Add helper function to safely move away file or directory
Try numberical suffix until you find one that isn't used yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 05:10:43 -07:00
Dirk Hohndel
c7ae8c8655 Update MXE cross build script
Small addition for completeness

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-23 05:01:19 -07:00
Dirk Hohndel
3b15ab5f28 MXE build: small tweaks
While this should be fixed in cmake, for now just manuallt get
libssrfmarblewidget.dll and QtXml.dll in place

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22 20:23:30 -07:00
Dirk Hohndel
e66f0895c6 Dive merging: make sure that the profile is redrawn
This uses the just introduced refreshProfile() function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22 19:59:58 -07:00
Dirk Hohndel
aeac5fcb6d Add refreshProfile member function to MainWindow class
While the whole idea of calling these functions through the MainWindow
instance is atrocious, until we change the architecture of all this
refreshProfile() is a useful function to have.

In order to make this cleaner to implement I allowed an argument to
ProfileWidget's replot() which allows picking a specific dive. By
defaulting this to 0 we get the previous behavior when calling replot()
without an argument.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22 19:58:14 -07:00
Willem Ferguson
a761a33069 User manual: Bluetooth UI description
1) Inser Bluetooth UI description at end of section dealing with dive download.
2) Delete existing text in appendices that detail pairing a Bluetooth device with
   the Subsurface computer.

One image is added to the manual.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22 19:36:54 -07:00
Anton Lundin
113ab59d81 qtbluetooth: Break read/write loops on bad state
This introduces a state check to only continue to try to read/write from
the bluetooth device while its in a sane state.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22 19:36:54 -07:00
Anton Lundin
8417e84e82 qtbluetooth: add a read timeout
This adds a read timeout to the qt serial bluetooth code. This is needed
for error handling and error recovery purposes.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22 19:36:54 -07:00
Linus Torvalds
34da4801f4 Be much more careful about merging dives
This patch changes the dive merging to be much more careful about
things, because it turns out that we had several small oddities that
caused big merge issues.

The oddities are:

 - the dive "duration" is actually how long we spend under water.

   But that means that when we do "dive->when + dive.duration.seconds"
   to calculate the end of the dive, that is nonsensical if you came up
   to the surface in the middle of a dive.

   Now, normally you don't see profiles like that, but once you start
   merging dives together, it can go from "small detail" to "dominant
   factor".

 - We have two different cases of merging: the automatic "merge new dive
   computer download if it looks like the same dive" (which always has a
   merge offset of 0, since we merge it as a new dive computer) and the
   "merge two different dives into one longer dive.

   The code assumed that it could look at the "downloaded" flag for the
   dive to check one or the other, but that doesn't really work.
   Reading a dive from an XML file isn't any different from downloading
   it.

   So we need to change the logic to determine what kind of merge it is
   to actually check the passed-in time offset.

With this, Stuart Vernon's test-case of eight dives with short surface
intervals in between end up merging correctly into one dive.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Stuart Vernon <stuartv@force2.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22 19:36:54 -07:00
Dirk Hohndel
000a93fb64 Cmake: fix installation of translations
Umm, that one's embarrassing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22 09:32:38 -07:00
Rick Walsh
084b4152e4 TestPlan: Add test for repeating dive
If variables were accidentally carried through from a previous calculated plan,
subsequent plan could be affected.  This test aims to detect if this happens.
Commit 8994270 corrected such a bug.  If it were reverted, this test would fail
(as it should).

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22 07:36:37 -07:00
Guillaume GARDET
236713efaa 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-09-22 07:28:03 -07:00
Lubomir I. Ivanov
0b0e203dbd Cmake: add LIBMARBLE_FROM_PKGCONFIG and some Marble related fixes
This patch adds the option to retrive Marble with pkg-config in a
similar way to Grantlee, libgit2, etc.

It reorganizes the "if(NO_MARBLE)" case to be the "else()" of
if(NOT NO_MARBLE).

Also, it adds the "-r" option to "rm" here:
add_custom_target(link_marble_data ALL COMMAND rm -rf ./marbledata ...

as otherwise it fails on Win32/Msys with "marbledata is a directory".

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22 07:18:53 -07:00
Dirk Hohndel
7351ff62d7 More updates to MXE build script
Two more changes that are needed for this to build successfully.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-21 22:22:03 -07:00
Dirk Hohndel
5982092858 Update MXE cross build script
Instructions how to use it are in the script.
As of today this doesn't create working binaries - this worked perfectly
fine back when MXE was still based on Qt5.4

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-21 21:39:41 -07:00
Miika Turkia
692ef8f141 Add wily to Ubuntu packaging
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-21 13:11:12 -07:00
Robert C. Helling
e644fe5d97 Fix image offset calculation
It seems this has never worked and nobody ever tested it. There was some
confusion with time zones since Qt takes by default local time when
converting from/to epoch while the exif library used UTC.

For my single test dive, this works now. But this needs more testing!!!

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-21 10:26:11 -07:00
Willem Ferguson
ce134fb763 User manual update 1) replace three images 2) change text of user manual to reflect the three images correctly
Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-21 10:16:50 -07:00
Willem Ferguson
d8baaac124 Systematic user manual update (Part 3)
From DiveList section to printing section

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-21 10:16:35 -07:00
Linus Torvalds
4d9d4825a5 Fix plot entry creation
This was originally triggered by an odd merge of two dives that should
have been the same, but that showed a corner case where the plot entry
creation could create broken results that violated our assumptions about
time stamps being monotonous.

When setting up the plot entries we create surface entries at the
beginning and end. We then fill in the plot entries between them based on
the samples from the dive computer plus our own interpolation (so we have
one entry at least every ten seconds). The loop ends when we are out of
space - which in this instance caused us to exit before updating the
maxtime and therefore the final plot entries having time stamps that were
smaller than the last entry filled in by the inner loop.

This patch makes sure we have enough space in the plot entry structure and
moves the exit from the inner loop until after we have updated the
maxtime.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-20 15:10:31 -07:00
Dirk Hohndel
04773705e3 Fix build error on Windows with Qt5.5
I'm not quite sure why this works, but it appears to do the trick.
Apparently you are supposed not to have the meta type declaration in a
shared header file. Also, with Qt5.5 you can't have the declaration for
QBluetoothDeviceInfo, not even on Windows.

This may need more tweaking to make sure it works on all combinations of
OS and Qt version.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-20 15:08:14 -07:00
Dirk Hohndel
d0fba482b7 Cloud storage: in verbose mode give lots of progress information
If a user gets stuck accessing cloud storage it's often hard to figure out
which step is hanging which makes it much harder to narrow down the
problem. With this patch calling Subsurface with '-v' will give somewhat
finely grained progress information on stderr.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-20 10:15:34 -07:00
Dirk Hohndel
54ec332c2f Cloud storage: verbose output to console
If Subsurface is started with the verbose flag, also give progress
information on the consol (just in case there are issues with the progress
dialog).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-20 10:15:34 -07:00
Dirk Hohndel
06d6ca94f3 When calling save-as with cloud storage as default, pick sane filename
Passing the cloud URL to the file select box leaves "git syntax" in the
filename which makes us look for a directory with a git repository in it
and give non-sensical error messages to the user.

With this we simply use the users email address as local filename with a
.ssrf suffix.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-20 10:15:34 -07:00
Rick Walsh
899427079e VPMB: Reset ceiling pressures at start of planned dive
We do not want to remember max_bottom_ceiling_pressure from the previous planned
dive - it makes the Boyle's law compensation incorrect if the previous planned
dive was a deeper deep-to-shallow multi-level dive.

E.g. Plan these dives (without applying this patch) with VPM-B nominal
conservatism:
	Plan 30 m for 20 min (total run time = 28 min)
	Now plan 100 m for 20 min, followed by 70 m @ 23 min and 70 m at 30 min
	Re-plan 30 m for 20 min (total run time = 50 min)

With this change, the re-planned dive run time is 28 min, as it should be.

We probably don't have to reset first_ceiling_pressure too, but it's cleaner if
we do.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-20 08:00:09 -07:00
Robert C. Helling
28c1dc754d Only calculate crushing pressure in VPM-B mode
Don't do this expensive calculation when not needed.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-20 07:56:25 -07:00
Dirk Hohndel
a77d1a3f56 Warn about non-monotonous plot data and prevent infinite loop
The data are supposed to be sorted with monotonous time stamp. And while
the actual bug that causes this needs to be identified and fixed, this is
at least a stop gap measure that shows the issue and prevents Subsurface
from hanging.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-20 07:54:28 -07:00
Linus Torvalds
e4d2092f33 Uemis downloader: start downloading using the correct dive ID
The logic to pick the initial dive ID for the uemis downloader was very
confused, and did not work at all when restarting a download when the
Uemis filled up, and the "Force download all dives" flag was set.  It
also required a rather odd Uemis-specific callback from the download UI
because of how it picked the initial ID.

This changes the logic to just look at the list of downloaded dives when
restarting, which simplifies the logic a lot, gets rid of the odd
special callback, and also means that the whole "Force download" issue
just goes away.  It seems to work now.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-19 21:30:33 -07:00