Added initial support for download dive info from the subsurface web service.

Added initial support for download dive info from subsurface web service,
the current code only downloads and output the xml downloaded in the debug
area. Now I need to parse things up and plug the unplugged stuff.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Hoocked up the buttons and the parsing of the XML.

The XML is now being correctly parsed, Clicking on Help
will open the browser pointing to the api site, and clicking
on cancel will cancel the download.

Clicking on Apply still doesn't apply, but that's next. :)

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Hoocked up the Apply button.

Hoocked up the apply button - Didn't tested ( as I frankly don't know
what the expected result should be. ). but the app is not crashing, yey.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Fix movement of the tooltip overlay

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Merge branch '112_webservices' of https://github.com/tcanabrava/subsurface
Merge branch '129_moveOverlay' of https://github.com/tcanabrava/subsurface
Fix unused variable warning and spelling

Commit 4b405caa2c47 ("Clean up divelist dive selection") made the sort
model variable in headerClicked unused, so get rid of it.  Fix a speling
eror closeby while at it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Allow ctrl-click to select dives incrementally from the globe view

I guess we should support de-selecting dives this way too, but right now
the interfaces only do selection.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Keep last open dives directory

Last open dives directory is stored in settings, so no need to walk through all
subdirectories all the time.

Signed-off-by: Helio Chissini de Castro <helio@kde.org>
Hide/Show tooltip on mouse over view widget

Proper hide/show tooltip under ProfileGraphicsView. Events are not
properly handled and no custom tolltip status was stored.
Text are properly hidden now when tooltip is collapsed.

Reported-by: Tomaz Canabrava
Signed-off-by: Helio Chissini de Castro <helio@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make a map ctrl-click toggle the selection state

This way the map selection works like normal selections do.  Except we
don't do "ranged" selections (shift-click) for fairly obvious reasons.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Support for aquadivelog UDDF import

This implements limited support for importing dives from a Palm divelog
software called aquadivelog. Basic depth graph is imported but most of
the metadata is currently discarded.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Disable Document Mode for MainTab on MacOSX

Commit c4f06dc536392e31a477e592d30fb946f1499595 introduced Document
Mode on the MainTab QTabWidget. This doesn't look good on MacOSX.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix compile: mixup of GeoDataCoordinates and GeoDataPoint

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Use the official QItemSelectionModel::SelectionFlags

It's a typedef to the QFlags<QItemSelectionModel::SelectionFlag>.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Sort 'dive number' column by date, not number

Ok, so this sounds insane, but it fixes our currently broken sorting
of dive trips vs plain dives not in trips.

The reason for that is simple: the dive trips are sorted by date, but
that's column #0, and for plain dives is the dive number.

So currently the trip-vs-dive sorting looks at the date of the trip,
and compares that to the number of the dive. Since the date of the
trip is expressed as seconds-since-1970-in-UTC, unsurprisingly the
dive number is generally much smaller (even for some very avid divers
;), and so the plain dives end up sorting way at the bottom (or at the
top, if you do "oldest trips first"

Since the dive number *should* sort as the date, this stupid attached
patch just makes us return the dive date instead.

Now, there are other possible solutions to this:

 - make the date of the dive be column 0, and make the dive number be column 1.

   Quite frankly, while more logical for this particular problem, it
probably sucks as a solution. We do want to have a column we can sort
dives by that is date-based, but doesn't include trips. And while the
dive number *should* sort identically to the date one, the fact is
that you can have dives without any numbering, so it doesn't.

   In contrast, all dives have dates, and sorting numbered dives by
date should still result in sane behavior (and if it doesn't, then the
insanity comes from the dive numbering, and odd sorting is the fault
of the user and indicative of a problem)

 - We could possibly do something magical like sorting dives by number
when they are inside trips, or when no trips exist at all. But then
we'd sort by date when there are trips and the dive is outside the
trip. But quite frankly, that just sounds insane.

So on the whole, I don't love this patch, but it seems to be the least
confusing of the possibilities.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Include more information on Aquadivelog import

This adds information on cylinders and gas changes and some other basic
stuff like buddy, dive site, weights.

Visibility should probably be ignored as UDDF specifies it as meters and
we have a scale of 0-5. But currently it is copied as is to the
visibility field in Subsurface.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix webservice download dialog

We need to close the dialog after applying what was downloaded, and we
should not try to delete the manager in case of cancel (as that reliably
causes the SIGSEGV.

Suggested-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Ticket 127 - Repopulate context menu on preferences change

Ticket 127 mention that context menu is fixed on imperial mode, which is
partial true. Context menu only not have the changes on header model updated
when preferences are chenges during execution. Hard to note because if
program is closed and opened again, the context is initialized properly.
Since actions aren't bound to the header model, we need iteract of current
items and change the title.

Signed-off-by: Helio Chissini de Castro <helio@kde.org>
Merge branch 'fileopen' of github.com:heliocastro/subsurface