Take only used gases into account when showing gas in divelist

Here is a patch that restricts the gases listed in the divelist to those
that are actually used. I seem to have the indentation now under control
but I am not sure about the logic:

1) First gas (with index 0) is always used.

2) If there is a gas switch event, the new gas is also used (determined by
walking the list of dive computers and then the list of events).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Correctly handle first gas when deciding if gas is used

Gas with index 0 is assumed to be the first gas only if there is no
gaschage event in the first 30 seconds of the dive.

[Dirk Hohndel: minor formatting change in a logical expression]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Generate heading event on DM4 import

Previously the heading information was on bookmark event, but now we
trigger a heading event when direction info is available.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Manually add bookmarks in the profile context menu

Use the infrastructure created for manually adding gas change events to
also be able to add bookmarks.

[Dirk Hohndel: This combines two commits for clarity. I also cleaned up
               the indentation and changed the code to no longer print the
               exact same text twice.]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Finetune event triangle position to have the top point at the event time

This should make it easier to then delete events from the context menu.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Manually remove events in the profile context menu

As logical extension of the ability to add bookmarks and gas changes this
adds the ability to remove (any arbitrary) event that happens at the mouse
position (specifically, that is within +/- six (scaled) pixels around the
x-position (time) of the mouse). That's the same width that the triangle
marker occupies which was moved to be centered around the event time in
commit 5752e9742e86 ("Finetune event triangle position to have the top
point at the event time").

Fixes #60

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