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>
By using the delete-event callback instead of the destroy callback we are
able to display our dialog (and the file-save dialog) while the program
window is still being displayed. Much nicer this way.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
As the application shuts down we do one more check to see if the dive that
is currently being displayed has been modified (we previously just checked
as we switch dives)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Track whether things changed in the global dive_list
So far this actually works if changing dive info (but only if dive
selected was changed after the dive info was changed).
We are not tracking changes to the cylinder information, yet.
also remove the duplicate static dive_list
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way we can avoid the need for quoting, since we can just use text
rendering instead of markup for the free-form fields. And we will want
to make the pango layout width different for the date and location,
since we want to fit the depth/duration to the right of them.
I still haven't set the different width for the date/location, but this
at least is going in the rigth direction.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The default cairo font seems to be sans, but the default pango font is
serif. Maybe it has something to do with my system font settings, but I
doubt it: my desktop font settings are all sans-serif. So I think pango
is just showing bad taste.
Anyway, this just hardcodes the font to "Sans". Maybe somebody wants to
make this all part of preferences some day, or pick it from their
desktop font preferences. In the meantime, just fix the pango brain-damage.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This makes things slightly prettier and adds back the depth and duration
details to the printout.
Still a few known problems: font choice, and the depth/duration thing
can end up overlapping with a long location name. But it looks pretty
good on the whole.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The plot_info was never freed, so every time you'd plot something, we'd
leak memory.
I'm running valgrind to see if there's anything bad going on. So far it
all looks fairly benign.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This gets us text wrapping etc. I think I have some serious memory leak
somewhere, though, because if I print out all my dives it eventually
ends up with broken dives and doesn't complete. But I am going to
commit this as a "it kind of works" point.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The layout is crap, the handling of long lines in notes (or location) is
wrong, the dive number handling is wrong.
The thing is just a toy.
But it's a toy that kind of works, and gives a much better idea of what
a real dive log printout might look like. With the right kind of dive
notes, it looks fine.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Ok, so this may be too much, but I'm just playing around with layout.
It could be a runtime choice too, of course.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Use the actual degree sign for temperatures (°F and °C), and make sure
everything uses the proper "set_source_rgb[a]()" wrappers to set the
colors.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Dirk wrote this before we have the 'plot_info' structure with the
cleaned-up dive info. No need to maintain that separate array of depths
and seconds.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Four dives per page sounds good. Maybe even six? But dangit, the
default font choice for cairo printing sucks. And I need to learn about
pango for actually printing the dive info.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org
That was stupid. The divelist column generation cleanup (commit
d3feb78df5: "Make helper function for creating TreeView columns in the
dive list") had a but too much copy-paste going on, and didn't always
have the right column indexes.. t still *looked* right, but sorting
didn't work at all.
Reported-by: Chris Lewis <chrislewis915@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The following are UI toolkit specific:
gtk-gui.c - overall layout, main window of the UI
divelist.c - list of dives subsurface maintains
equipment.c - equipment / tank information for each dive
info.c - detailed dive info
print.c - printing
The rest is independent of the UI:
main.c i - program frame
dive.c i - creates and maintaines the internal dive list structure
libdivecomputer.c
uemis.c
parse-xml.c
save-xml.c - interface with dive computers and the XML files
profile.c - creates the data for the profile and draws it using cairo
This commit should contain NO functional changes, just moving code around
and a couple of minor abstractions.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Instead of the hardcoding to "Sans 8", allow people to set it in the
preferences.
Also, make the unit choice be a frame in the preferences dialog instead.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* git://github.com/sirowain/subsurface:
Fix Segmentation fault when trying to print an empty plot.
Provide an icon for subsurface.
Added a comment about libusb dependency in Makefile.
* 'for-linus' of git://github.com/dirkhh/subsurface:
Attempt to get the location column to resize in a sensible way
Minor tweaks to column headers
[ Fixed up minor semantic merge conflict due to the change to make
'dive_list' internal to divelist.c ]
Passing it around is just annoying, and we only ever have one. Let's
not burden all the users with the silly thing.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
It's too damn easy to make mistakes and not even notice them (odd gtk
widget selection and keyboard input), or just start editing a cylinder
thing and realize it was wrong.
So instead of always saving the equipment information implicitly, add
explicit "Apply" and "Cancel" buttons that save the information (or
re-load it from the dive data structure)
So now you need to press an extra button for your changes to *really*
take effect. It can be a bit annoying, but it's better than the silent
accidental equipment change that could happen before.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Previously the SAC column was the one that expanded which is silly
We also used to cut the location off at 16 characters
Now we try to make the location the one that expands and allow up to 40
characters, but there's something broken, still. If you manually shrink
the location column to its minimum size then subsequently resizing the
window gets the desired behavior. But if you don't manually resize the
location column it doesn't shrink correctly for windows that are smaller
than the space we need for all columns to fully display (instead we get a
horizontal scrollbar)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>