aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2011-09-22Clean up event handling from libdivecomputerGravatar Linus Torvalds
This just moves the event handling out into its own helper function. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Fix progress bar during libdivecomputer importsGravatar Linus Torvalds
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>
2011-09-22Add OTU to divelistGravatar Dirk Hohndel
and change OTUs to be tracked as int, not double Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-22Calculate OTUs for every diveGravatar Dirk Hohndel
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>
2011-09-22Update the README a bitGravatar Linus Torvalds
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>
2011-09-22Merge branch 'alignment-change' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'alignment-change' of git://github.com/dirkhh/subsurface: Minor change to the alignment of the divelist columns
2011-09-22Minor change to the alignment of the divelist columnsGravatar Dirk Hohndel
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>
2011-09-22Clean up library handlingGravatar Linus Torvalds
.. and pick up libusb-1.0 automatically if it's installed. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Put the location last in the dive listGravatar Linus Torvalds
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>
2011-09-22Put the default focus on the dive list at startupGravatar Linus Torvalds
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>
2011-09-22Fix up some minor whitespace issuesGravatar Linus Torvalds
Dirk clearly isn't as anal as I am about pretty whitespace. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Select the first dive after filling the dive listGravatar Linus Torvalds
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>
2011-09-22Make the dive list searching act on the locationGravatar Linus Torvalds
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>
2011-09-22Don't do individual 'gtk_widget_show()' callsGravatar Linus Torvalds
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>
2011-09-22In divelist maxdepth column, only show depth unitGravatar Linus Torvalds
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>
2011-09-22In summary printout, show divemaster if there was no buddyGravatar Linus Torvalds
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-21Merge branch 'quit-handling' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* '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
2011-09-21Small printing tweaksGravatar Linus Torvalds
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>
2011-09-21Add helper function for doing depth unit calculationsGravatar Linus Torvalds
.. and use it for printing too. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-21Fix dive location width problemGravatar Linus Torvalds
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>
2011-09-21Use the last (or only) filename on command line as default for savingGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-21Show the "save changes" dialog before the main window is destroyedGravatar Dirk Hohndel
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>
2011-09-21Check for changes at regular 'quit' events as wellGravatar Dirk Hohndel
Also make the dialog box less offensively ugly Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-21Catch changes to the info of the current dive when quittingGravatar Dirk Hohndel
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>
2011-09-21Tracking changes to tanks is trivialGravatar Dirk Hohndel
That's the one I should have started with. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-09-21Simplistic first attempt to get changes saved when quitting subsurfaceGravatar Dirk Hohndel
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>
2011-09-21Do the pango text layout in multiple chunksGravatar Linus Torvalds
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>
2011-09-21Sue me: I'm not a fan of SerifGravatar Linus Torvalds
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>
2011-09-21Fix array underrun when calculating velocityGravatar Linus Torvalds
That code is messy. And it was buggy. Noticed by valgrind. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-21Fix up printing some moreGravatar Linus Torvalds
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>
2011-09-21September comes before OctoberGravatar Tero Roponen
This patch fixes the ordering of month names. Signed-off-by: Tero Roponen <tero.roponen@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-20Fix 'struct plot_info' memory leakGravatar Linus Torvalds
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>
2011-09-20Printing: use pango markup for text generationGravatar Linus Torvalds
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>
2011-09-20Add completely BS dive text printingGravatar Linus Torvalds
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>
2011-09-20Try printing six dives per pageGravatar Linus Torvalds
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>
2011-09-20Fix up printing some moreGravatar Linus Torvalds
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>
2011-09-20Print out only simplified depth profileGravatar Linus Torvalds
None of the colors, nothing like that. Just a gray fill and a plain black depth line. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-20Clean up and simplify depth plotGravatar Linus Torvalds
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>
2011-09-20Start fleshing out the dive printing a bit moreGravatar Linus Torvalds
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
2011-09-20Don't show the smoothed dive profile or the min/max infoGravatar Linus Torvalds
It was good for debugging, it's not something we really want to show people. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-20Fix divelist sortingGravatar Linus Torvalds
That was stupid. The divelist column generation cleanup (commit d3feb78df527: "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>
2011-09-20Fix preferences dialogGravatar Linus Torvalds
Dirk took some old code when he did the merge of the newly split gui code. Fix it up. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-20Separate out the UI from the program logicGravatar Dirk Hohndel
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>
2011-09-20Make the divelist font configurableGravatar Linus Torvalds
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>
2011-09-20Merge git://github.com/sirowain/subsurfaceGravatar Linus Torvalds
* 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.
2011-09-20Merge branch 'for-linus' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* '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 ]
2011-09-20Make 'struct DiveList' entirely internal to divelist.cGravatar Linus Torvalds
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>
2011-09-20Add "Apply"/"Cancel" buttons to dive equipment pageGravatar Linus Torvalds
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>
2011-09-20Attempt to get the location column to resize in a sensible wayGravatar Dirk Hohndel
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>
2011-09-20Minor tweaks to column headersGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>