Fix potential crash when merging trips

strdup doesn't like to be passed a NULL pointer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Manually add trips from dive list context menu

We had all the logic, we were just lacking the UI.

Fixes #243

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix dive planner widget

In commit 0f50b73f9e88 ("Fix planner / add dive handling of DiveHandler
Points") some issues were introduced. While it is fine to remove the
artificial first point at the surface, the commit broke the special
handling for o2 == -1, i.e., the usual case where a default gas needs to
be picked.

This generalizes the algorithm previously used to also look to the right,
now that we are no longer guaranteed that there is a first point to our
left.

This also cleans up some whitespace damage introduced in the same commit.

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