Planner: Show gas changes at the correct depth.

Gas changes (can) have a bogus waypoint following at the same depth with 0
time. Those were confusing the decision whether to show a waypoint.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Planner: add a few more line breaks in the html notes

This looks much better now.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Planner: make the warnings visually stand out more

HTML is nice here.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Planner: fix editing the dive planner points table

The edit starts with the current value, but our data() function didn't
return that in the edit role.

Thanks Tomaz for explaining this to me.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make most of the shortcuts widget specific

Having the window specific means that you can't have a key do different
things on different widgets.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Planner: reject plan if escape key is pressed

This seems intuitive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Cancel dive edit when escape key is pressed

Also seems intuitive. What's odd is that in the Planner you get a
confirmation dialog while here you don't. We should be consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix dive water temperature XML parsing

We parsed it rigth for dive computers, but not for the manually filled
per-dive case. The git save seems to have gotten it right.

I think this has been broken since the whole "move as much as possible to
the dive computer sections", but I didn't actually check.

Reported-by: roberto forini <forini.r@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add photo saving for the XML backend.

This code correctly saves the added pictures on the xml backend.
next: git backend.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fix linked list corruption, move code to C.

The picture list is a single linked list where the pictures have a node to
their next element. When adding the same picture to two dives, things got
way way wrong and crashes were appearing.

This will replicate the information (filename, latitude and longitude) for
each dive that has the picture, BUT it still tries to save as much as
possible on the actual pixmap.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a static 'instance()' member for the Photos model.

This will make referencing it from  a few places more easy.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Connect & disconnect the PictureModel on the profile

Ignore the warnings for now, this patch connects and disconnects the (not
done yet) plotPictures() method.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a method to plot the pictures on the profile.

It plots in the wrong place for now, because I need to change the model a
bit. But it shares the same pixmap with the other widget which is nice. :)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Also hold a pointer to the struct picture on the model.

Changes to hold a pointer to the struct picture on the model, so we can
use it to determine the correct positioning of the image on the profile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Do not plot pictures that don't have a timestamp.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Another futile attempt to keep whitespace consistent

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
CCR code: Change to sample structure

1) All the variables in the sample structures are strongly typed
2) Two additional types were declared in units.h:
     o2pressure_t
     bearing_t
3) The following variables were added:
     diluentpressure
     o2setpoint
     o2sensor[3]
4) Changes to a number of files were made to chanf
     sample->po2 to sample->po2.mbar
     bearing to bearring.degrees

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When calculating the maximum of unsigned values, use unsigned variable

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Ask before discarding edits

This is equivalent to what we do for the planner.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Dive edit: don't free the taglist of the master dive

We do all of our edits on a copy of the dive - but the tag_list points to
the tag_list of the master dive (based on how we create that copy of the
master dive). So only free the tag_list if it is already different from
the master dive.

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