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>
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>
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>
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>
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>
* '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)
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>
* '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)
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
The calculation assumes that the cylinderindex in each sample tells us
which PO2 the dive was breathing at that time. This needs to be verified
with dives where there is an actual gas switch.
No idea where to display them, yet. Far fewer people will care about this
than care about SAC - does this still rate a spot in the dive_list?
I guess I could make it part of the dive_info - but it's not editable.
It doesn't seem to fit with the equipment page (even though this is the
one editable field that is related - nitrox %)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Update for the current library situation, and notes about
libdivecomputer installation location.
And remove the "we don't interface directly with libdivecomputer", since
that is obviously not true any more.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Just seems to look nicer this way. And actually implements consistent
alignment management for the columns to begin with.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The whole auto-expansion of an entry in the middle thing really doesn't
work very well in gtk. Give up on it.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This is some crazy stuff. Apparently the only sane way to do this is by
hooking into the "realize" callback for the dive list widget.
Whatever. Dirk did the googling to figure this all out.
Suggested-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
We should always strive to have a dive selected, so pick the first one
(that was how the dive list logic worked anyway, it just wasn't truly
selected at the tree-view level, so it wasn't *visibly* the selected
dive).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
It used to be "index 0" which originally was the date string, but not
only has that changed (it's now just the dive index), it's kind of
pointless to search for a date string.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This is left-overs from an earlier age when we did this. But we just do
the "show_all" at the end.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Show "m" or "ft" instead of "max/m" vs "max/ft". The column really
doesn't want to be that wide. The column header is already the widest
part of it even with this short name (due to the sort order arrow
thing).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* 'quit-handling' of git://github.com/dirkhh/subsurface:
Use the last (or only) filename on command line as default for saving
Show the "save changes" dialog before the main window is destroyed
Check for changes at regular 'quit' events as well
Catch changes to the info of the current dive when quitting
Tracking changes to tanks is trivial
Simplistic first attempt to get changes saved when quitting subsurface
It's getting to the point where I'm happy with this. This just makes
the spacing between the location and the notes a bit bigger to visually
separate them more, and adds units ("min") to the dive duration (and
removes the seconds, that really didn't make any sense at an overview
level).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
For really long dive locations, we now limit the width to the same size
as the date and time, and force it to a single line - with an ellipsis
if it ends up being too big.
Also, since we no longer use any markup anywhere, we migth as well show
the dive buddy information too, as we don't need no stinking quoting.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>