implement device probe in C

It's an attempt to build auto-completion for the dive-computers
based on unpublished code inside libdivecomputer[1]

[1] -
http://git.libdivecomputer.org/?p=libdivecomputer.git;a=commitdiff;h=d44053a99435fb9fc1f408fb3f1629a54c938afc

Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
Merge branch 'deviceProbe' of github.com:danilocesar/subsurface
Planner: start time is relative

This almost fixes it, but the offset from UTC isn't calculated correctly
it seems. Committing and hoping that a Qt expert can help.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Bugfix plot of ceiling violation

Due to a bug in how the entry-list was handled, a point on the polygon
was introduced at 0,0 that made a weird pink triangle across the whole
profile. This was quite clearly seen in dives/test15.xml

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Two header files missing for Mac OSX

I needed to add to include files to make the latest version compile. Here
is a patch.

Signed-off-by: Robert C. Helling <helling@atdotde.de>

Best
Robert
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix Windows compile

When submitting commit 8f33b81de0f9 ("implement device probe in C"),
Danilo explicitly asked me to make sure this compiles / works on Windows
and Mac - and I promptly forgot to do so. Robert fixed the Mac build, this
now at least compiles under Windows (but it's still untested).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Update installer so we can cross-build for Windows

Marble doesn't work, yet (Google Maps aren't loaded), but at least
Subsurface starts under Windows with the installer built.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Enable opening files with .zip suffix

The test file dives/TestDiveDivingLog5.08allmetric.zip wouldn't load.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Improved handling of latitude and longitude.

Coordinates are copied when auto-completing location, they are also
displayed and editable in maintab.

Signed-off-by: Michael Andreen <harv@ruin.nu>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix SIGSEGV after dive computer download

This fixes a crash in the current Qt subsurface code that can happen
after downloading dives from a dive computer, and the new dives merge
with old dives, causing the old dives to be re-allocated into the
merged one.

In that case, the list widgets don't get fully updated, and contain
stale pointers to old dives that no longer exists. Doing anything that
refreshes the display will hide this problem, and you do need to have
multiple dive computers on the same dive to trigger it in the first
place, so it's reasonably hard to hit, but very annoying when you do.

This patch just makes us reload all the dive UI tables, which may be
overkill. It also doesn't actually fix the fact that we seem to do
"process_dives()" within the context of the downloader thread, which
looks like a possible source of races. The "process_dives()" should
also be moved to the main thread, but needs the preferDownloaded()
information that is part of the download window, so it doesn't fit
here. Somebody else (Tomaz?) will hopefully fix that part.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
move process_dives to the mainthread

Avoids a race condition.

Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
Use the right event type

11 is SAMPLE_EVENT_GASCHANGE, and thats the one that doesn't contain any
He-part. The type where He and O2 is packed togeather is 25,
SAMPLE_EVENT_GASCHANGE2.

Left to implement is to figure out the type of the event when we read
the xml, so we can create the right type there.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Only calculate with he when he is present in event

Old gasswitch events only contains O2, so don't look at he part when
the event doesn't contain a He part.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Show sample time in the mouseover.

This is really nice to have when looking at specific coutures of a dive
or events.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Destroy the main window before exiting the application

This ensures all widgets inside the window get destroyed too.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Show DiveNotes when program starts.

Equipment tab was opened by default, it should be DiveNotes
as per the old GTK version. this fixes that.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Good deal of Code Cleanup for the maintab

Some cleanup was needed in the MainTab code for ages,
now the Edition / Cancel / Ok of the Notes tab is
way more intuitive on the code level.

This is needed to support multidive edition on the
Cylinders and Weigths too, since it's a bit more
complicated, I didn't want to start with a Spaguetti
Code.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Add a Warning icon on the changed tabs, for edition of dives.

Adds a Warning icon on the changed tabs, this is important as
usability, for you could change something on the 'notes' tab,
change the tab and did't realized that something was changed
( by forgotting or something ), then clicking on the cancel
button. so now there's a friendly reminder that you actually
changed something.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added the Message and the Buttons on the Equipment Tab

Added the Message and the ok/cancel buttons on the Equipment
Tab, they don't control the Equipment edition yet, but already
does the same as the Notes one, Now I need to merge the other
part - the actuall Equipment Edition.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Fix the annoying tab order issue in the notes tab

This had been driving me crazy for a while, finally figured out how to fix
it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>