summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2011-09-26Stop libdivecomputer import when we start seeing old divesGravatar Linus Torvalds
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>
2011-09-26Add a copy of the GPL v2 to the projectv1.0Gravatar Linus Torvalds
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-26Add the version to the MakefileGravatar Linus Torvalds
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>
2011-09-26Update README to reflect the fact that /dev/ttyUSB0 is no longer hardcodedGravatar Linus Torvalds
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>
2011-09-26Add a GtkEntry to allow editing of the device nameGravatar Linus Torvalds
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>
2011-09-26Add a "Dive Computer" frame around the dive computer choice in importGravatar Linus Torvalds
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>
2011-09-26Add a xml file filter to the file open dialogGravatar Linus Torvalds
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>
2011-09-24Add an 'About' dialogGravatar Linus Torvalds
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>
2011-09-24Use 'gtk_dialog_get_content_area()' instead of accessing dialog directlyGravatar Linus Torvalds
I'm reading gtk docs, and trying to clean things up a bit. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Show events on the dive profileGravatar Linus Torvalds
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>
2011-09-22Add cheesy "install" targetGravatar Linus Torvalds
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>
2011-09-22Drop surface events when reading from an XML file tooGravatar Linus Torvalds
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>
2011-09-22Merge latitude and longitude data properlyGravatar Linus Torvalds
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>
2011-09-22Merge dive events correctly tooGravatar Linus Torvalds
It's very similar to the sample merging. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Start handling dive eventsGravatar Linus Torvalds
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>
2011-09-22Properly merge dive buddies and divemaster informationGravatar Linus Torvalds
When we merge dives, we didn't merge these fields properly. Do it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-22Improve libdivecomputer event printoutGravatar Linus Torvalds
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>
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-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>