]> git.tdb.fi Git - ext/subsurface.git/log
ext/subsurface.git
12 years agoMerge branch 'multiple_selection' of git://github.com/dirkhh/subsurface
Linus Torvalds [Fri, 21 Oct 2011 04:50:23 +0000 (07:50 +0300)]
Merge branch 'multiple_selection' of git://github.com/dirkhh/subsurface

12 years agoAllow multiple selections in the dive list
Dirk Hohndel [Fri, 21 Oct 2011 03:59:13 +0000 (20:59 -0700)]
Allow multiple selections in the dive list

At this point we don't do anything with this - the commit just provides
the infrastructure changes so that this becomes possible. Subsurface
behaves the same if exactly one dive is selected and simply keeps the last
selected dive if zero or more than one dives are selected.

The goal is to be able to select multiple dives and then do actions on
them. For example pick a tank used for all of them. Or edit the location
or (yet to be implemented) other equipment data like weight carried.
And also to be able to merge multiple dives.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFixed off by one error in uemis importer
Dirk Hohndel [Thu, 20 Oct 2011 20:11:26 +0000 (13:11 -0700)]
Fixed off by one error in uemis importer

I clearly had never tried this with a dive that used the "just air"
setting the uemis. With this fix the cylinder data for that one tank is
read correctly.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branch 'guifixes' of git://github.com/dirkhh/subsurface
Linus Torvalds [Thu, 20 Oct 2011 19:30:44 +0000 (22:30 +0300)]
Merge branch 'guifixes' of git://github.com/dirkhh/subsurface

12 years agoAdd quick hack for "no sample pressure but tank index changed" case
Linus Torvalds [Thu, 20 Oct 2011 19:25:38 +0000 (22:25 +0300)]
Add quick hack for "no sample pressure but tank index changed" case

This isn't right if you switch back to the same cylinder multiple times,
but for the first time it kind of works - just take the beginning
cylinder pressure if we have one.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoFix up multi-cylinder code as per Dirk
Linus Torvalds [Thu, 20 Oct 2011 10:55:55 +0000 (13:55 +0300)]
Fix up multi-cylinder code as per Dirk

Too much cut-and-paste, as Dirk points out.  With multiple cylinders,
we're not necessarily going to start at time zero.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoKeep window size for new notebook pages
Dirk Hohndel [Thu, 20 Oct 2011 10:04:18 +0000 (03:04 -0700)]
Keep window size for new notebook pages

We used to set a fixed size instead of just copying the size that the
existing notebook has - which didn't really feel right when resizing and
then ripping of a page.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoParse the xml sample cylinder index properly
Linus Torvalds [Wed, 19 Oct 2011 17:06:11 +0000 (10:06 -0700)]
Parse the xml sample cylinder index properly

We would save it in the xml file, but then not actually read it back
properly.  Oops.  Not that we actually have any multi-tank dives yet, so
it doesn't matter.  Yet.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoStart some rough multi-cylinder pressure data plot infrastructure
Linus Torvalds [Wed, 19 Oct 2011 16:47:46 +0000 (09:47 -0700)]
Start some rough multi-cylinder pressure data plot infrastructure

It doesn't actually do multiple cylinders correctly yet, but it should
be a nice framework for it.  And accidentally (not) it also ends up
drawing the final line for the end pressure of a single-cylinder dive
that has been fixed up by hand too.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoDon't overwrite the end pressure with sample data if one already exists
Linus Torvalds [Wed, 19 Oct 2011 16:25:47 +0000 (09:25 -0700)]
Don't overwrite the end pressure with sample data if one already exists

If we have en explicit end pressure in the dive information, we should
not change it just because we also have some samples.  The sample data
may not be complete (read: "Linus wireless connection dropped during the
dive again, and he fixed up the end pressure manually afterwards").

The beginning pressure already works correctly, because it will only use
the sample data for the first sample if no pressure existed before.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd start/end pressure to cylinder edit dialog
Linus Torvalds [Mon, 17 Oct 2011 18:12:11 +0000 (11:12 -0700)]
Add start/end pressure to cylinder edit dialog

This finally allows you to set the start/end pressures by hand.

HOWEVER! Right now, if we have samples with pressures, those samples
will always end up overriding anything you set manually.  Which can be
very annoying if your wireless air integration fails halfway through.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agodeclare a var for libdivecomputer's cflags
Martin Gysel [Mon, 17 Oct 2011 13:54:01 +0000 (15:54 +0200)]
declare a var for libdivecomputer's cflags

This allows us the specifiy libdivecomputer's cflags (and also the
library, static or dynamic) outside of the Makefile

Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agocreate man dir before installing files in it
Martin Gysel [Mon, 17 Oct 2011 13:54:00 +0000 (15:54 +0200)]
create man dir before installing files in it

Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agouse DESTDIR according to my understanding of GNU standards
Martin Gysel [Mon, 17 Oct 2011 13:53:59 +0000 (15:53 +0200)]
use DESTDIR according to my understanding of GNU standards

make DESRDIR a prefix of everything according my understanding
of the GNU standards. This is also useful(/needed) for installing
in Gentoo. Declare BINDIR for bin/program directory.

Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoDon't use dynamic linking for libdivecomputer
Linus Torvalds [Fri, 14 Oct 2011 04:06:13 +0000 (16:06 +1200)]
Don't use dynamic linking for libdivecomputer

Commit bd8948386d55 ("Since we don't want configure, use gnumake to find
libdivecomputer") was totally broken.  Sure, using GNU make features is
fine.  But then hiding in that commit is the fact that it also changed
it to use "-ldivecomputer" instead of just linking with the static
libdivecomputer archive.

And that's just a really bad idea.  Dynamic linking is useful for things
like libc, where it allows sharing of the code pages across all the
programs using it.  For something like libdivecomputer it's just a *bad*
idea, and doesn't even work.  The libdivecomputer interfaces aren't
stable enough to make it a good idea even if it *did* work, and the
libdivecomputer "make install" phase doesn't do the proper ldconfig etc
setup anyway.

Static linking is just simpler and better.  It also means that the
binary will work even if you move it around to another machine - since
libdivecomputer isn't exactly a "standard library"..

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoInstall manpage
Dirk Hohndel [Wed, 12 Oct 2011 20:30:08 +0000 (13:30 -0700)]
Install manpage

(and fix two white space issues)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoAdd a simplistic man page
Dirk Hohndel [Wed, 12 Oct 2011 20:17:21 +0000 (13:17 -0700)]
Add a simplistic man page

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFix Makefile syntax error
Dirk Hohndel [Wed, 12 Oct 2011 04:09:46 +0000 (21:09 -0700)]
Fix Makefile syntax error

it looks prettier, but we can't have a tab in front of the $(error)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoHave "make install" act more as expected for a desktop application
Dirk Hohndel [Tue, 11 Oct 2011 22:58:38 +0000 (15:58 -0700)]
Have "make install" act more as expected for a desktop application

I'm trying to get subsurface to get closer to becoming a "regular desktop
application"; so far this is based on the recommendations and guidelines
on OpenSUSE and Fedora.

The icon is now named subsurface.svg and make install installs it in the
correct location. At runtime subsurface first checks if an icon is
installed and if it is it uses that - otherwise it falls back to the old
code that tries to read the svg file from the current directory.

We also install a subsurface.desktop file

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMake should expand $(DESTDIR) on install
Dirk Hohndel [Tue, 11 Oct 2011 02:43:28 +0000 (19:43 -0700)]
Make should expand $(DESTDIR) on install

This clearly was intentionaly - I just have no idea why you would want to
do it?

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoSince we don't want configure, use gnumake to find libdivecomputer
Dirk Hohndel [Tue, 11 Oct 2011 00:53:59 +0000 (17:53 -0700)]
Since we don't want configure, use gnumake to find libdivecomputer

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoDon't drop precision from floating point GP coordinates
Linus Torvalds [Sun, 9 Oct 2011 02:19:16 +0000 (14:19 +1200)]
Don't drop precision from floating point GP coordinates

Using '%f' limits the precision to 6 decimals, which may well be
perfectly ok.  But at least in theory you *could* have higher precision,
and gps units will report it, so don't mindlessly limit us to what %f
shows.

This arbitrarily uses '%.12g' instead.  %g will drop excess zeroes at
the end, so it actually results in the same (or shorter) ascii
representation unless you have the extra precision.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoRemove some useless casts from and to void pointers
Julian Andres Klode [Thu, 6 Oct 2011 19:08:48 +0000 (21:08 +0200)]
Remove some useless casts from and to void pointers

Remove casts from/to void*.  They are unneeded in C, can hide problems
in the future, and are far too C++ish.  Furthermore, they were
inconsistent with the rest of the code and even with regards to
themselves (at least in terms of whether or not to have space after the
cast).

In this case, we temporarily lose const specifiers in libdivecomputer.c
due to the unneeded cast, so it seems better to avoid the cast at all,
so you get warned about a const->non-const cast if you ever change it to
do something like this.

The casts in gtk-gui.c are just useless semantically, although they
might be useful as a hint to the reader that the void pointers are char
arrays.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMake FileChooserButton end import dialog
Dirk Hohndel [Wed, 5 Oct 2011 21:12:03 +0000 (14:12 -0700)]
Make FileChooserButton end import dialog

If we choose a file in the import dialog then this should imply clicking
OK in that dialog - no reason for a two step process.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMark the FileChooserButton as UNABLE to select multiple files
Dirk Hohndel [Wed, 5 Oct 2011 21:16:51 +0000 (14:16 -0700)]
Mark the FileChooserButton as UNABLE to select multiple files

That's a gtk limitation.

So you have to import XML files one at a time. If this is too big of a
restriction then we need to redesign the import dialog.

Sgned-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFix import tracking
Dirk Hohndel [Wed, 5 Oct 2011 21:09:49 +0000 (14:09 -0700)]
Fix import tracking

Minor logical flaw that breaks the model.
When the --import parameter is found we need to mark that the FOLLOWING
dives are imported, not the ones loaded so far.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoAdd XML file import back and treat open and import differently
Dirk Hohndel [Wed, 5 Oct 2011 18:36:15 +0000 (11:36 -0700)]
Add XML file import back and treat open and import differently

Open (or adding a file name on the command line) means that this is just
one of the files that you consider part of your dive history. So dives
don't get automagically numbered and the dive_list is not considered
"changed" just because another file was opened.

Import (or adding a file on the command line after --import) means that
you are importing the content of this file to your dive history. So if the
imported file has un-numbered dives that are newer than everything else,
those get correctly renumbered. And importing marks the dive_list as
changed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoAdd an '--import' command line option
Dirk Hohndel [Wed, 5 Oct 2011 18:36:15 +0000 (11:36 -0700)]
Add an '--import' command line option

This option indicates that all files that come AFTER it on the command
line are being added to our divelist. The dives in these files should
receive numbers (assuming they are un-numbered and are all newer then the
dives in the files before the --import option, and assuming those dives
are numbered).

This also marks the dive_list changed after the new dives are added.

Using this option gives us a reasonable user experience in the case where
a user has one file with all their dives and wants to add newer dives
after this (after extracting them from a dive computer - as in the case of
a uemis owner where there is no direct import from the dive computer,
yet). Something like

subsurface MyDives.xml --import NewDives.SDA

It also doesn't break Linus' vision where the user has many files on the
command line which don't imply a changed dive_list.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMark divelist changed when renumbering or adding dives
Dirk Hohndel [Wed, 5 Oct 2011 16:24:52 +0000 (09:24 -0700)]
Mark divelist changed when renumbering or adding dives

The behavior is not yet consistent when calling with multiple file names
on the command line (as we don't add number to the later ones in this
case), but at least it catches the case if you manually renumber the dives
or if you import new dives that get added at the end - which are the two
most typical cases.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFor a manual renumber, default to the existing first dive number
Linus Torvalds [Wed, 5 Oct 2011 15:37:14 +0000 (08:37 -0700)]
For a manual renumber, default to the existing first dive number

If renumbering a list of dives, default the start number to the existing
first dive number.  That way, if you do need to renumber (overlapping
import or whatever), but your at least had your really old dives already
numbered, we start off with a sane default.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAutomatically renumber new dives when they are "obvious".
Linus Torvalds [Wed, 5 Oct 2011 15:31:31 +0000 (08:31 -0700)]
Automatically renumber new dives when they are "obvious".

When importing (or reading xml from files) new dives, we now renumber
them based on preexisting dive data, *if* such re-numbering is obvious.

NOTE! In order to be "obvious", there can be no overlap between old and
new dives: all the new dives have to come at the end.  That's what
happens with a normal libdivecomputer import, since we cut the import
short when we find a preexisting dive.

But if any of the new dives overlap the old dives in any way, or already
have been numbered separately, the automatic renumbering is not done,
and you need to do a manual renumber.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMove 'dive_list_update_dives()' call into 'report_dives()'
Linus Torvalds [Wed, 5 Oct 2011 15:06:48 +0000 (08:06 -0700)]
Move 'dive_list_update_dives()' call into 'report_dives()'

All the callers were always calling report_dives first, followed by
dive_list_update_dives().  And there really was no reason to have the
callers call two separate functions for the "I've added new dives" case.
So just call dive_list_update_dives() directly from report_dives(), and
remove it from the callers.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMake the dive merging code more tolerant
Dirk Hohndel [Wed, 5 Oct 2011 03:33:17 +0000 (20:33 -0700)]
Make the dive merging code more tolerant

Depending on the tool used to import a dive from the uemis Zurich we end
up with different time stamps for the dive - just by a few seconds, but
the existing code insisted on an exact match.

We now allow for up to 60 seconds in difference and still consider two
dives as the same.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoShorten the tooltip timeout
Dirk Hohndel [Tue, 4 Oct 2011 23:06:27 +0000 (16:06 -0700)]
Shorten the tooltip timeout

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoChange event symbol to bigger yellow triangle with exclamation point
Dirk Hohndel [Tue, 4 Oct 2011 22:14:54 +0000 (15:14 -0700)]
Change event symbol to bigger yellow triangle with exclamation point

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoReplace event text with small red triangle and tooltip
Dirk Hohndel [Tue, 4 Oct 2011 19:27:55 +0000 (12:27 -0700)]
Replace event text with small red triangle and tooltip

We draw a little red triangle (of hardcoded size - not sure if this SHOULD
scale with the size of the plot... I like it better if it doesn't) to the
left of an event.

We then maintain an array of rectangles that each circumscribe one of
those event triangles and if the mouse pointer enters one of these
rectangles then we display (after a short delay) a tooltip with the event
text.

Manually creating these rectangles, maintaining the coordinate offset,
checking if we are inside one of these rectangles and then showing a
tooltip... this all seems like there should be gtk functions to do this by
default... but if there are then I failed to find them. So instead I
manually implemented the necessary logic.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoChange plot routine to take a drawing_area as argument
Dirk Hohndel [Tue, 4 Oct 2011 19:14:26 +0000 (12:14 -0700)]
Change plot routine to take a drawing_area as argument

Previously we passed in width and height and the routine itself decided to
keep 5% margin around each edge - oddly doing this with double precision,
even though this is all integer coordinates.

Instead we are now passing in a drawing_area. We are kind of abusing the
cairo_rectangle_int_t data type here - but it seemed silly to redefine a
new data type for this.
Width and height give the size of the TOTAL drawing area (as before).
x and y give the offset from the edges - so the EFFECTIVE drawing area is
width-2x and height-2y
This is in preparation for adding tooltips - those need to know the
coordinate offsets from the edges - so having this hard coded inside the
plot function didn't make sense anymore.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFix small typo in uemis event name
Dirk Hohndel [Tue, 4 Oct 2011 19:06:42 +0000 (12:06 -0700)]
Fix small typo in uemis event name

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branch 'uemis-integration' of git://github.com/dirkhh/subsurface
Linus Torvalds [Mon, 3 Oct 2011 20:19:23 +0000 (13:19 -0700)]
Merge branch 'uemis-integration' of git://github.com/dirkhh/subsurface

* 'uemis-integration' of git://github.com/dirkhh/subsurface:
  Much nicer implementation of uemis sample parsing - and add events, too
  Add working pressure to uemis tank data

12 years agoMuch nicer implementation of uemis sample parsing - and add events, too
Dirk Hohndel [Mon, 3 Oct 2011 19:27:14 +0000 (12:27 -0700)]
Much nicer implementation of uemis sample parsing - and add events, too

This is something I wanted to do for a while. Every uemis sample is simply
a packed structure with no padding. Instead of grabbing random bytes from
the middle of an unstructured data blob let's just define the structure
and access its members.

And while we do that, add support for the more useful uemis events as
well.

A couple of the warnings are disabled by default (compile time flag) as
they are just crazy - any normal dive will give you dozens and dozens of
speed warnings. Same goes for the PO2 green warning (I haven't looked but
this seems to trigger on a PO2 over 1.0 or something). Completely useless
and just hides actually useful info.

I still want to redo the way we visualize events in general - just
printing the text ontop of the profile really is suboptimal. Especially as
the uemis really seems to love to repeat several of the warnings quite
frequently.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branch 'uemis-integration' of git://github.com/dirkhh/subsurface
Linus Torvalds [Mon, 3 Oct 2011 19:13:54 +0000 (12:13 -0700)]
Merge branch 'uemis-integration' of git://github.com/dirkhh/subsurface

* 'uemis-integration' of git://github.com/dirkhh/subsurface:
  Remove the ability to 'Import' .SDA files
  Integrate loading of uemis SDA files into the regular xml parsing
  First steps towards integrating SDA files into the default XML loading

12 years agoAdd working pressure to uemis tank data
Dirk Hohndel [Mon, 3 Oct 2011 16:55:17 +0000 (09:55 -0700)]
Add working pressure to uemis tank data

Turns out they use 202.6bar as default working pressure. WTF?
Also I had misunderstood the way I should record the pressure internally
(which happened to work since I didn't set the working pressure). This is
now fixed as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoAdd working pressure to uemis tank data
Dirk Hohndel [Mon, 3 Oct 2011 16:55:17 +0000 (09:55 -0700)]
Add working pressure to uemis tank data

Turns out they use 202.6bar as default working pressure. WTF?
Also I had misunderstood the way I should record the pressure internally
(which happened to work since I didn't set the working pressure). This is
now fixed as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoRemove the ability to 'Import' .SDA files
Dirk Hohndel [Mon, 3 Oct 2011 15:27:36 +0000 (08:27 -0700)]
Remove the ability to 'Import' .SDA files

We can instead 'Open' these files as they are just bastardized XML files.

This gets us back to a more consistent point where 'Import' gets data
directly from the dive computer (and hopefully soon we will add the
ability to load a dive directly from a uemis SDA to libdivecomputer),
and 'Open' loads a file from the filesystem of the computer we are
running on (this last sentence phrased so awkwardly as the uemis Zurich
SDA is a computer and presents a file system when connected via USB - it
just doesn't have the dive data in an accessible format in that file
system).

As a bonus we get to throw away quite a bit of code (the uemis specific
file handling, mini-XML parser with helper functions, the file open dialog
in the importer). Yay!

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoIntegrate loading of uemis SDA files into the regular xml parsing
Dirk Hohndel [Mon, 3 Oct 2011 04:59:54 +0000 (21:59 -0700)]
Integrate loading of uemis SDA files into the regular xml parsing

There are a few interesting issues with this:

- this requires a change to the SDA file format; thankfully I control that
  format, too (the default files are not valid XML files)
- once again, the fact that adding samples can change the dive pointer
  messes with me - I decided to change the interface of ALL of the
  XXX_dive_match functions to take a struct dive**
  I know this is not ideal as all the other functions don't need that -
  but I would have hated the inconsistency
- there is the issue that we now overload two _different_ uemis formats in
  the same function - that's certainly a potential point of confusion
- a minor detail is the problem that the SDA format is kinda odd to parse
  and that we trigger on the duration field by it being the only float.
  Yeah, that's not ideal - but again, I control the format, so I _know_
  this is true.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFirst steps towards integrating SDA files into the default XML loading
Dirk Hohndel [Mon, 3 Oct 2011 00:47:20 +0000 (17:47 -0700)]
First steps towards integrating SDA files into the default XML loading

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoRemove cylinder index from cylinder list model
Linus Torvalds [Mon, 3 Oct 2011 02:14:00 +0000 (19:14 -0700)]
Remove cylinder index from cylinder list model

Instead of having to keep the index up-to-date as we edit entries
around, just figure out the entry index from the model itself.  Gtk
seems to make it unnecessarily hard, but what else is new?

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMake cylinders editable with a double-click
Linus Torvalds [Mon, 3 Oct 2011 02:03:46 +0000 (19:03 -0700)]
Make cylinders editable with a double-click

You can still just select them and click the "Edit" button too, but now
you can double-click them (or select them and press "enter") for editing
too.

It seems to be the natural interface.

Also, remove the index column (that was there for debugging), and add
grid lines.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoChange calling convention of 'edit_cylinder_info'
Linus Torvalds [Mon, 3 Oct 2011 00:16:50 +0000 (17:16 -0700)]
Change calling convention of 'edit_cylinder_info'

Instead of passing it the model and iterator (which requires that we
create the new entry for an 'add' event even if we then cancel the
operation), just make the caller do the final cylinder list update.

This way we can make 'add' work more sanely: if you cancel the add, we
now do not create an empty cylinder entry at the end.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMake the cylinder 'delete' action actually delete the cylinder info
Linus Torvalds [Sun, 2 Oct 2011 23:58:53 +0000 (16:58 -0700)]
Make the cylinder 'delete' action actually delete the cylinder info

It used to just update the cylinder list widget data, not the actual
dive information.

It still needs an "accept or cancel" dialog, I suspect.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoFirst cut at working cylinder editing dialog
Linus Torvalds [Sun, 2 Oct 2011 23:41:17 +0000 (16:41 -0700)]
First cut at working cylinder editing dialog

This currently only does the same old things we used to do (so still no
start/end pressure or trimix support), but despite that this is already
more flexible than the old model:

 - we can now add new cylinders, rather than just edit the information of
   the first two cylinders of the dive

 - because the cylinder editing is being done in a edit dialog, it is
   now much more reasonable to use multiple lines and expand all the
   things we can edit.

But to actually make this fully fledged, we'll need to add all the other
info to the cylinder edit dialog, and probably add a confirmation dialog
for the "delete cylinder" case too.

Oh, and right now deleting a cylinder doesn't mark the dive info changed.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoStart hooking up the cylinder editing widget
Linus Torvalds [Sun, 2 Oct 2011 23:16:08 +0000 (16:16 -0700)]
Start hooking up the cylinder editing widget

We don't actually fill the widget info correctly yet, nor do we take the
actual size from the changes, but this starts to hook things up.

Soon.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd the ability to add new cylinders
Linus Torvalds [Sun, 2 Oct 2011 20:42:51 +0000 (13:42 -0700)]
Add the ability to add new cylinders

This is totally useless since you cannot actually *edit* the resulting
new dive yet, but we'll get there.  And this already conceptually shows
a capability that we didn't use to have with the old interface.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agocylinder list: set edit/delete button sensitivity
Linus Torvalds [Sun, 2 Oct 2011 20:27:03 +0000 (13:27 -0700)]
cylinder list: set edit/delete button sensitivity

They are only sensitive when there is a cylinder selected.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoStart re-organizing the cylinder entry in equipment.c
Linus Torvalds [Sun, 2 Oct 2011 20:13:27 +0000 (13:13 -0700)]
Start re-organizing the cylinder entry in equipment.c

This leaves the actual editing code unconnected, so now you can only see
the cylinder information, not actually edit it.  However, with the big
re-organization I really do want to have this as a half-way point where
I have created the new cylinder tree-view.

I now need to connect the "add/edit" buttons to dialogs that then use
the editing widgets - so I've left that widget code around, because I'll
be able to reuse a lot of it.  Not all, but the cylinder type model code
in particular will be re-used pretty much as-is.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoSplit up generic code to generate a gtk tree view column
Linus Torvalds [Sun, 2 Oct 2011 20:05:12 +0000 (13:05 -0700)]
Split up generic code to generate a gtk tree view column

We used to do this just for the dive list, but the new cylinder view
will want to do a lot of the same boilerplate gtk stuff, so make it a
bit more generic and move it to gtk-gui.c.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoprepare_sample reallocs the dive - don't keep pointers around
Dirk Hohndel [Sun, 2 Oct 2011 17:30:02 +0000 (10:30 -0700)]
prepare_sample reallocs the dive - don't keep pointers around

Thanks Valgrind

This diff looks pointless at first until you see that I reference dive
again earlier in the loop and then after the end of the loop.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoWe forgot to pick up the 'value' field of a dive event
Linus Torvalds [Sat, 1 Oct 2011 04:55:51 +0000 (21:55 -0700)]
We forgot to pick up the 'value' field of a dive event

Just missed that one entirely in the xml parser for some reason.
Probably because the fields don't have much semantic meaning, so I
didn't even realize that I had missed one of the random integer values
in an event.

On my suunto, the 'value' field seems to contain things like the new
Oxygen percentage of a gas change event etc.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoDistinguish internally between min pressure and end pressure
Dirk Hohndel [Fri, 30 Sep 2011 13:49:24 +0000 (06:49 -0700)]
Distinguish internally between min pressure and end pressure

And don't artificially end dives on min pressure

This may be a problem for dive computers like Linus' Suunto Vyper Air
where the failure mode seems to be _high_ pressure readings (that's scary,
btw). If the transmitter fails at the end of the dive the pressure plot
ends with incorrect high pressure. But that's simply a bug with the dive
computer and not something that subsurface should hack around. Maybe we
should offer a way to edit the incorrect data points instead.

Always ending on the minimum pressure is definitely wrong as it causes
bogus plots when you do a valve shutdown during the dive (which means that
valid data gets plotted incorrectly).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFix the profile coloring
Dirk Hohndel [Fri, 30 Sep 2011 05:49:12 +0000 (22:49 -0700)]
Fix the profile coloring

We were missing the last sample (which is usually a fast ascent).
Also, reduced the velocity smoothing to 15 seconds as the 30 seconds were
hiding too much valid information

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoCorrectly parse the braindamaged tank size information from uemis
Dirk Hohndel [Fri, 30 Sep 2011 05:12:42 +0000 (22:12 -0700)]
Correctly parse the braindamaged tank size information from uemis

Admittedly the cuft ratings are stupid, but still, it's not that hard.
In order to correctly describe a tank based on the cuft system you need to
know the cuft AND the working pressure. But the uemis Zurich always
assumes that the working pressure is 200bar. That's pretty close to
3000psi and therefore works "good enough" for Aluminum tanks - but in
general this will of course fail (e.g. for HP or LP tanks).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoFix uemis parser to work with base64 data that isn't a multiple of 3
Dirk Hohndel [Fri, 30 Sep 2011 01:01:58 +0000 (18:01 -0700)]
Fix uemis parser to work with base64 data that isn't a multiple of 3

I had forgotten the '=' sign as valid character in base64 code

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoYes Linus, gas pressure can indeed go up during a dive
Dirk Hohndel [Fri, 30 Sep 2011 00:45:26 +0000 (17:45 -0700)]
Yes Linus, gas pressure can indeed go up during a dive

At first glance it seems logical to make the ending pressure be the
lowest pressure observed during a dive. But if you do valve shut down
drills with a tech setup (where you have a fully redundant double
tank setup with two valves, two regulators and a manifold in between),
then you continue to breath from what is indeed the same "tank", but still
the valve on which your air pressure transmitter sits does get shut down
and de-pressurized. So your pressure goes down by quite a bit, and then
comes back up when the valve is turned back on.

And the ending pressure of the dive (which is used for things like the SAC
calculation) is indeed potentially higher than the lowest pressure
observed during a dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoAllow larger tanks (change maximum from 200 to 300 cuft)
Dirk Hohndel [Fri, 30 Sep 2011 00:42:58 +0000 (17:42 -0700)]
Allow larger tanks (change maximum from 200 to 300 cuft)

We don't handle doubles any different than single tanks - so while
200 cuft was a sane maximum size for a tank, once you dive with
doubles this logic fails.

We may or may not decide to implement special handling for doubles at some
point, but for now simply allow for tanks all the way up to double-150.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoRemove average depth from print
Dirk Hohndel [Wed, 28 Sep 2011 22:53:16 +0000 (15:53 -0700)]
Remove average depth from print

It looks confusing in black and white

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branch 'ui' of git://github.com/dirkhh/subsurface
Linus Torvalds [Wed, 28 Sep 2011 03:27:28 +0000 (20:27 -0700)]
Merge branch 'ui' of git://github.com/dirkhh/subsurface

* 'ui' of git://github.com/dirkhh/subsurface:
  The notebook pages can only be dropped back into the main notebook
  Linus would like to be less on the bleeding edge of Gtk+
  Use the correct signal to avoid Gtk-CRITICAL error message
  Clean up the drag and drop code and allow ripping off the Dive Profile

12 years agoThe notebook pages can only be dropped back into the main notebook
Dirk Hohndel [Wed, 28 Sep 2011 02:47:19 +0000 (19:47 -0700)]
The notebook pages can only be dropped back into the main notebook

Disable the secondary notebooks that are created when ripping off a page
(dive_list or dive_profile) as drop targets for other pages.

Also fix the incorrect arguments for the drag callback function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoLinus would like to be less on the bleeding edge of Gtk+
Dirk Hohndel [Wed, 28 Sep 2011 00:11:08 +0000 (17:11 -0700)]
Linus would like to be less on the bleeding edge of Gtk+

So we go back to the old interfaces to identify the notebook as part of
one group - the one that was just recently deprecated

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoUse the correct signal to avoid Gtk-CRITICAL error message
Dirk Hohndel [Wed, 28 Sep 2011 00:03:15 +0000 (17:03 -0700)]
Use the correct signal to avoid Gtk-CRITICAL error message

We used the wrong signal - "data-drag-received" is intended to check
whether the target will accept the drop. What we want is the "drag-drop"
signal which tells the widget that something was dropped on it.

Also fix an embarrassing lack of NULL pointer checks in my string
comparisons...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoClean up the drag and drop code and allow ripping off the Dive Profile
Dirk Hohndel [Tue, 27 Sep 2011 23:23:59 +0000 (16:23 -0700)]
Clean up the drag and drop code and allow ripping off the Dive Profile

Linus had used some deprecated interfcase and didn't correctly untangle
the new window that he created (hiding it the window... very nifty).

I think I'm closer to the real solution with a data structure that keeps
track of the components of the new top level window that I need to be able
to untangle (and eventually, destroy) at the end.

The one error I also can't seem to get rid of is the
Clean up the drag and drop code and allow ripping of the Dive Profile

Gtk-CRITICAL **: IA__gtk_selection_data_set: assertion `length <= 0' failed

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoAdd note on dive computers using the same import engine
Linus Torvalds [Tue, 27 Sep 2011 21:09:21 +0000 (14:09 -0700)]
Add note on dive computers using the same import engine

Lots of dive computers are just variations on a theme, or sometimes even
just rebadged copies of each others with different manufacturer and
model names.  The import dialog may not mention your exact dive computer
by name, but that doesn't necessarily mean that you cannot import data
from it.

Make that clearer in the README, and list the rough list of dive
computers supported by libdivecomputer.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd drag-n-drop support to be able to re-integrate the dive list
Linus Torvalds [Tue, 27 Sep 2011 19:54:53 +0000 (12:54 -0700)]
Add drag-n-drop support to be able to re-integrate the dive list

This is somewhat hacky, and there is clearly something I still don't
understand about gtk selections and drag-n-drop.  Dropping it back
works, but I get a nasty error when I do it:

   (subsurface:8512): Gtk-CRITICAL **: IA__gtk_selection_data_set: assertion `length <= 0' failed

even though I actually never set any selection at all directly.  So
there must be some internal gtk rule that I am violating, but I can't
see what it is.

I probably shouldn't commit it with a known ugly wart like that, but I
really have no clue.  Maybe somebody else can figure out what is up.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoDon't mark the divelist window transient
Linus Torvalds [Tue, 27 Sep 2011 18:38:31 +0000 (11:38 -0700)]
Don't mark the divelist window transient

That also makes it always stay in front of the other window, which is
just annoying.  I only did it because I wanted to make sure it dies when
the main window does, but since we just kill the main loop when closing
either window, that just isn't an issue.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge branch 'otu-tracking-v2' of git://github.com/dirkhh/subsurface
Linus Torvalds [Tue, 27 Sep 2011 18:05:39 +0000 (11:05 -0700)]
Merge branch 'otu-tracking-v2' of git://github.com/dirkhh/subsurface

* 'otu-tracking-v2' of git://github.com/dirkhh/subsurface:
  Store options in gconf
  Add preference option to chose if SAC and/or OTU should be in divelist

Fix up trivial conflicts in gtk-gui.c (cleanup in gtk dialog wrt
gtk_dialog_get_content_area() having introduced a new 'vbox' widget)

12 years agoA Makefile 'clean' target is quite standard.
Cristian Ionescu-Idbohrn [Tue, 27 Sep 2011 16:43:53 +0000 (18:43 +0200)]
A Makefile 'clean' target is quite standard.

Signed-off-by: Cristian Ionescu-Idbohrn <cii@axis.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoStore options in gconf
Dirk Hohndel [Tue, 27 Sep 2011 17:46:59 +0000 (10:46 -0700)]
Store options in gconf

While it's not the most elegant way to do this I opted to store the
options with "inverted polarity" - i.e., the options that are supposed to
default to "True" are stored inverted since gconf reports an unset option
(first time the user runs the program) as "False".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMerge branch 'otu-tracking-v2' of git://github.com/dirkhh/subsurface
Linus Torvalds [Tue, 27 Sep 2011 17:46:42 +0000 (10:46 -0700)]
Merge branch 'otu-tracking-v2' of git://github.com/dirkhh/subsurface

* 'otu-tracking-v2' of git://github.com/dirkhh/subsurface:
  Make OTU column invisible by default
  Add OTU to divelist
  Calculate OTUs for every dive

Fix up trivial conflicts in dive.h (due to dive event handling also
adding a field to the dive structure)

12 years agoMake the dive list start as a plain notebook page
Linus Torvalds [Tue, 27 Sep 2011 17:38:07 +0000 (10:38 -0700)]
Make the dive list start as a plain notebook page

I've been wondering how to make 'subsurface' work better on a small
screen (I used to travel with a crappy netbook - I may have upgraded my
laptop since, but it is still a design goal of mine to make sure it all
works fine in that kind of environment).

And ever since the dive list was made much wider and moved below the
notebook, it's annoyed me how much room it all takes if I want to have
both a reasonable plot window and several dives visible at the same
time.

The solution seems to be to just make the dive list be a notebook page.
That makes the default layout very dense.

At the same time, when you have the pixels, it's horrible, because you
would want to see the dive list and move between dives while at the same
time also seeing the dive profile change.  But that is solvable by
simply making the dive list notebook page be detachable, so if you have
a nice big screen, just detach the dive list page and now you have
independent windows for the dive list and the dive info.

NOTE! I don't have any way to re-attach the dang thing.  I think I'd
need to learn about drag-and-drop targets etc.  So once you've detached
the dive list, it stays detached.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd preference option to chose if SAC and/or OTU should be in divelist
Dirk Hohndel [Tue, 27 Sep 2011 17:16:40 +0000 (10:16 -0700)]
Add preference option to chose if SAC and/or OTU should be in divelist

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoMake OTU column invisible by default
Dirk Hohndel [Mon, 26 Sep 2011 23:05:24 +0000 (16:05 -0700)]
Make OTU column invisible by default

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
12 years agoUpdate Mares IconHd parsing to current libdivecomputer interface
Linus Torvalds [Mon, 26 Sep 2011 20:14:41 +0000 (13:14 -0700)]
Update Mares IconHd parsing to current libdivecomputer interface

The libdivecomputer interfaces are pure crap.  There are no generic
"open the dive computer" or "create a parser for the dive computer"
interfaces, instead each dive computer you support has its own open and
parser generator interface.

And they change.  Happily fairly seldom, but they change.  And two days
ago, Jef changed the interface for the Mares Icon HD computer in order
to support the newer HD Net Ready variant.

I've asked Jef to make a sane interface for "open the dive computer" and
"just create the parser" for libdivecomputer, but he claims that he
cannot just track the device model details internally.  Which is
obviously a completely bogus claim, since the way *we* track the model
details is to just feed it back from the silly event.

libdivecomputer should just do that internally and not bother us with
its crazy internal model numbers.  But whatever.

In the meantime, work around this braindamage, and hope that
libdivecomputer comes to its senses some day.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoStop libdivecomputer import when we start seeing old dives
Linus Torvalds [Mon, 26 Sep 2011 20:04:14 +0000 (13:04 -0700)]
Stop libdivecomputer import when we start seeing old dives

I don't know about other dive computers, but the Suunto Vyper Air is
slow as hell to import all the dives from.  And libdivecomputer seems to
be importing dives "most recent first", so this just makes it stop
importing dives when it finds a dive that we've already seen.

Caveat: libdivecomputer has this fancy notion of "dive fingerprints",
and claims that's the way to do things.  That seems to be overly
complicated, and not worth the bother.

If you worry about the import finishing early due to already having some
dives with the same date in your dive list, just import starting from an
empty state, and thus get a pure "dive computer only" state with no
early out.  Then you can just load the old dives afterwards, and depend
on subsurface merging any duplicates.

But for normal operation, when you just want to import a couple of new
dives from your dive computer, the "exit import early when you see a
duplicate" is the right thing to do.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd a copy of the GPL v2 to the project
Linus Torvalds [Mon, 26 Sep 2011 18:18:28 +0000 (11:18 -0700)]
Add a copy of the GPL v2 to the project

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd the version to the Makefile
Linus Torvalds [Mon, 26 Sep 2011 18:04:50 +0000 (11:04 -0700)]
Add the version to the Makefile

Not quite the same format as for the kernel, but I want to do the normal
"edit the makefile before making a release" model that I'm used to.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoUpdate README to reflect the fact that /dev/ttyUSB0 is no longer hardcoded
Linus Torvalds [Mon, 26 Sep 2011 17:06:00 +0000 (10:06 -0700)]
Update README to reflect the fact that /dev/ttyUSB0 is no longer hardcoded

Yay.  It's not like we're all done, but the hardcoded dive computer
location was one of those "I don't want to release 1.0 with this".

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd a GtkEntry to allow editing of the device name
Linus Torvalds [Mon, 26 Sep 2011 16:44:27 +0000 (09:44 -0700)]
Add a GtkEntry to allow editing of the device name

Ok, so some file chooser widget with a popup dialog would have been more
professional, but I'm lazy.  Plus I suspect the popup would look
horrible when populated with /dev entries, and I don't think there is
any sane filter function.

So this works, and means that you don't *have* to recompile the whole
program just because you have your dive computer on something else than
a USB serial line.

I suspect I should save the default name as a config variable too.
Maybe a setting in the preferences dialog.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd a "Dive Computer" frame around the dive computer choice in import
Linus Torvalds [Mon, 26 Sep 2011 16:19:30 +0000 (09:19 -0700)]
Add a "Dive Computer" frame around the dive computer choice in import

I'll add a widget to allow the user to select the device too, so let's
name things to make them more obvious.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd a xml file filter to the file open dialog
Linus Torvalds [Mon, 26 Sep 2011 16:18:23 +0000 (09:18 -0700)]
Add a xml file filter to the file open dialog

My home directory is a mess.  Don't show all the crap, just the stuff
that might be relevant.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd an 'About' dialog
Linus Torvalds [Sat, 24 Sep 2011 22:48:13 +0000 (15:48 -0700)]
Add an 'About' dialog

It's really just about the logo, but whatever.  Dirk tells me I need one
of these in order to call it 1.0.  And I'm not going to fall into the
trap of thinking that 1.0 needs to be something polished, it just needs
to be working well enough..

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoUse 'gtk_dialog_get_content_area()' instead of accessing dialog directly
Linus Torvalds [Sat, 24 Sep 2011 22:26:37 +0000 (15:26 -0700)]
Use 'gtk_dialog_get_content_area()' instead of accessing dialog directly

I'm reading gtk docs, and trying to clean things up a bit.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoShow events on the dive profile
Linus Torvalds [Fri, 23 Sep 2011 04:15:36 +0000 (21:15 -0700)]
Show events on the dive profile

This is *really* ugly.  We really should just create some kind of widget
that when moused over will show the event.  Or something.  Rather than
putting text on top of other text: the events - when they happen - are
usually bunched together (PO2 warnings, max depth, fast ascent leading
to mandatory safety stop, you name it).

But at least this way we see that the data is there, even if we see it
in ugly ways.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoAdd cheesy "install" target
Linus Torvalds [Fri, 23 Sep 2011 03:59:10 +0000 (20:59 -0700)]
Add cheesy "install" target

It just puts the subsurface binary in $(HOME)/bin.

.. and then the binary won't find the icon file, so this is really not
enough of an install to get it really working, but whatever.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoDrop surface events when reading from an XML file too
Linus Torvalds [Fri, 23 Sep 2011 03:51:03 +0000 (20:51 -0700)]
Drop surface events when reading from an XML file too

Remember those useless surface events that we ignore when we import a
dive from a dive computer? Yeah, they exist in the libdivelog xml files
too.  So ignore them when we see them there too.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge latitude and longitude data properly
Linus Torvalds [Fri, 23 Sep 2011 03:50:07 +0000 (20:50 -0700)]
Merge latitude and longitude data properly

When merging two identical dives and one of them has lat/long data, pick
it up correctly for the merged dive.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoMerge dive events correctly too
Linus Torvalds [Fri, 23 Sep 2011 03:28:04 +0000 (20:28 -0700)]
Merge dive events correctly too

It's very similar to the sample merging.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoStart handling dive events
Linus Torvalds [Fri, 23 Sep 2011 01:02:54 +0000 (18:02 -0700)]
Start handling dive events

Parse them, save them, take them from libdivecomputer.

This doesn't merge them or show them in the profile yet, though.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoProperly merge dive buddies and divemaster information
Linus Torvalds [Fri, 23 Sep 2011 01:01:01 +0000 (18:01 -0700)]
Properly merge dive buddies and divemaster information

When we merge dives, we didn't merge these fields properly. Do it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoImprove libdivecomputer event printout
Linus Torvalds [Thu, 22 Sep 2011 23:55:55 +0000 (16:55 -0700)]
Improve libdivecomputer event printout

Ignore surface events - they are meaningless anyway and just add noise.

Print out other events properly, including correct time offset etc.

We still don't actually *save* the events, but now it might be worth
doign so.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoClean up event handling from libdivecomputer
Linus Torvalds [Thu, 22 Sep 2011 23:45:28 +0000 (16:45 -0700)]
Clean up event handling from libdivecomputer

This just moves the event handling out into its own helper function.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoFix progress bar during libdivecomputer imports
Linus Torvalds [Thu, 22 Sep 2011 23:38:24 +0000 (16:38 -0700)]
Fix progress bar during libdivecomputer imports

As reported by Mauro Dreissig, the progress bar doesn't work and causes
a SIGSEGV due to a missing allocation.  The code broke when Dirk
separated out the GUI from the core code, and I hadn't tried
divecomputer downloads since.

Reported-by: Mauro Dreissig <mukadr@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>