Add descriptions for different formats in the export dialog

When choosing a format from the export dialog a two line description of
the format appears. This is helpful and prevents confusion.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Rework the Export dialog

The UI design looked too tight in my screen.
The explanation texts were a bit inconsistent (and in one case simply
wrong).
The explanation for the initial selection wasn't shown.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add Subsurface XML export to Export dialog

Also be consistent about the default folder we use when opening the file
dialog.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Change how the handler handlers itself.

This patch adds a itemChange method, that emits a 'changed'
signal when the handler is moved. I'll use that signal on
the profile to call the correct method.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make the planner actually work.

This commit makes the planner actually work. There ar still
a few edges, but oh, joy - the new Profile gave a very unexpected
and nice addition to it - Grab the last handler of the initial
dive, and move it to the right, or get any handler, and move it
to the bottom to see what I mean.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fixe movement of DiveHandlers when moving the NotificationArea

The QGraphicsView system moves every selected item when the user
clicks and drags one. This patch makes a cache of all selected
items and removes the selection on them. When the user stops dragging
the Notification, the selection is restored.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove code already ported to the new profile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove unused code.

This code is not ported to the new profile, but from what I
can understand from it, it doesn't need to be. The purpose
of this code was to setup the correct colors and strings
for the current mouse position, we already do this on the
Profile in a different way, on the Notification Area.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make mouse dragging work as it should.

This patch makes mouse dragging work as it should, a tiny
bit different than the old version, but I think it's a better
way. What's missing: Keyboard actions.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove the depth / time increase and decrease functions.

The new profile code handles the resizing of the profile area in order to
accomodate the depth and time of the dive much more intuitively - the old
manual buttons to do so are no longer needed.

This also removes a few other unused methods.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove a ton of code.

The code removed was already ported to the New Profile.
We managed to clean quite a bit. huhhy

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Remove export and save as from dive list context menu

The context menu is getting way too big and confusing. This is now much
more cleanly done from the File->Export dialog.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add some helper functions

First step towards getting the "add to trip" logic in the divelist context
menu to be consistent and correct.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Port the KeyPress actions to the new profile.

[Dirk Hohndel: combined two commits into one and cleaned up some
               whitespace issues]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Dive list: more consistent handling of "add to trip"

When multiple dives are selected, we need to be smarter about when to show
"add to trip immediately above" or "... below". This code is quite
readable, I think, and does the trick.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Dive list: move trip selection / deselection logic to divelist.c

This is core logic, not UI code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Dive list: work around odd problem with selections

According to the documentation clearSelection() should emit
selectionChanged() - but I can verify in the debugger that sometimes this
doesn't appear to happen - consequently our notion of what's selected gets
confused.

To work around this, after calling clearSelection() we simply manuall
deselect all dives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Dive list: move trip merging logic into divelist.c

This also fixes a couple of issues with the existing code:
- removes a memory leak
- treats null and "" the same

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Rename the export dialog

Give the export dialog a better name than just dialog.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correctly implement multi dive selection

The old code had several issues. It broke the synchronization between
dive->select and Qt selected status and worse, it would partially unselect
previously selected dives when called.

This patch, however, causes the selection via the map to be glacially slow
because it forces a redraw of every single selected profile.

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