aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2011-10-29Merge branches 'mingw-port-cleanup' and 'combobox-text-entry-fix' of ↵Gravatar Linus Torvalds
git://github.com/dirkhh/subsurface * 'mingw-port-cleanup' of git://github.com/dirkhh/subsurface: Use Registry on Windows to store preferences * 'combobox-text-entry-fix' of git://github.com/dirkhh/subsurface: Update the known locations / buddies / divemasters as user enters them
2011-10-28Update the known locations / buddies / divemasters as user enters themGravatar Dirk Hohndel
The code that allowed a user to start typing the name of a location, buddy or divemaster and that would then offer completions has one flaw - it doesn't add any new names that you enter to its store of names until you save and restart the app. This patch fixes that. When reading the code I also noted that the location_changed, divemaster_changed, buddy_changed variables have become meaningless. They are set to 1 and tested, but never changed. I wasn't sure if I should remove the variables (as the code seems to work without them having any impact), or if we should go back to actually tracking these changes to prevent unnecessarily marking the divelist as changed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-28Use Registry on Windows to store preferencesGravatar Dirk Hohndel
No change at all to non-Windows builds. Everything seems to work with preferences - but only tested on Win7 Remaining issue: displaying an icon (or the logo in the About dialog) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-27Don't use gconf on WindowsGravatar Dirk Hohndel
So far this just removes the gconf code - so no preferences for Windows. It also removes the unsused gconf references in main.c Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-27Cleanup Makefile and make it work for cross compiling with MinGWGravatar Dirk Hohndel
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-25Rearrange the event filter dialogGravatar Dirk Hohndel
Create a table with four rows of toggle events and resize it as needed. This may not create the most beautiful layout, but it works. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-25Add menu item and dialog to select which events to displayGravatar Dirk Hohndel
Right now they are displayed in one hbox which doesn't work if you have many events - but the code itself works and correctly toggles the events on and off. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-25Don't plot an event if an event is disabled in ev_namelistGravatar Dirk Hohndel
We don't have a way to actually configure this in the app, yet, but toggling the bits in the debugger shows that this works, so commit this code now. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-25Remember the event names as we encounter themGravatar Dirk Hohndel
First step to being able to filter the events that we display in the profile. We could (in theory) walk all the dives in the divelist when we need this data, but it seems much more convenient to have them in an array in one place. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-24Avoid using strptimeGravatar Dirk Hohndel
It's less portable (missing on Windows, for example) and it's kind of overkill here - the same is easily done with a sscanf. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-24Annotate Makefile with hints about building under WindowsGravatar Dirk Hohndel
You can build subsurface with MinGW. It requires installing lots of random packages, plus some things still don't work. One is that xml2-config appears to be missing. So this annotates the Makefile to tell a person building under Windows how to work around this. But we can't make this platform conditional as this workaround is hardcoding the install path. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-24Stop including regex.hGravatar Dirk Hohndel
I removed the regex code from the uemis parser a long time ago, but forgot to remove the #include <regex.h> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-24Merge branch 'bugfixes' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'bugfixes' of git://github.com/dirkhh/subsurface: Updated changes file Create packaging directory and add spec and changes file Makefile fixes
2011-10-24Updated changes fileGravatar Dirk Hohndel
Turns out that I forgot the -a in the last commit. Sorry Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-24Create packaging directory and add spec and changes fileGravatar Dirk Hohndel
These work for me on OBS Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-24Makefile fixesGravatar Dirk Hohndel
The stupid lib vs lib64 problem. I'm sure there's a more portable way to handle this, but this at least seems to work. Also fix the install target. Seriously, you create a directory with mode 644 and claim that this ever worked? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-24Subsurface 1.1v1.1Gravatar Linus Torvalds
We've added a fair amount of features since 1.0 (like multi-tank) and we've made things a lot prettier and supports editing much more information. So let's make a new release. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-24Merge branch 'ui' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'ui' of git://github.com/dirkhh/subsurface: Disable sorting by dive number Fix oversight in preference implementation Make columns for temperature, cylinder, and nitrox optional Show dive number in dive list Improve time marker handling and add printing of some time labels
2011-10-23Disable sorting by dive numberGravatar Dirk Hohndel
This is based on Linus idea and code - just adding it to my UI branch in case he didn't actually add it to his code... It makes no sense to sort by dive number - every sane person will have dive numbers be chronological; so they can sort by date instead. But removing this option wastes less space and makes the dive list look much better Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-23Fix oversight in preference implementationGravatar Dirk Hohndel
Not being careful enough doing copy and paste and then making manual changes... this inconsistency caused subsurface to always store the opposite of what you wanted in the preferences for SAC and O2%. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-23Make columns for temperature, cylinder, and nitrox optionalGravatar Dirk Hohndel
Just like SAC and OTU these can now be turned on and off through the preferences. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-23Show dive number in dive listGravatar Dirk Hohndel
Make sure that renumbering the divelist correctly shows up on the display. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-23Improve time marker handling and add printing of some time labelsGravatar Dirk Hohndel
We now draw time markers at most every 5 min, but no more than 12 markers. For convenience we do 5, 10, 15 or 30 min intervals. This allows for 6h dives - enough (I hope) for even the craziest divers - but just in case, for those 8h depth-record-breaking dives, we double the interval if this still doesn't get us to 12 or fewer time markers. We label the first and then every other time marker with the minute text. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-23Handle 'gas change' events correctlyGravatar Linus Torvalds
Dirk wrote the multi-cylinder support assuming that the dive computer always gives the selected cylinder index in the sample data - that's what his Uemis does, and it makes sense for any dive computer that supports multiple pressure transmitters. However, the other case is a dive computer where the pressure samples are all from cylinder 0, and any other cylinder will have the starting and ending pressure set by hand. And the gas change events show when the cylinder change happened. So this creates a "turn gas change events into pressure sample fixups" phase just before we actually analyze the pressures. That way the pressure analysis can alway sdo the right thing, regardless of how the data was originally stores in the dive. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-23Split the cylinder pressure analysis into a second loopGravatar Linus Torvalds
For the dive computers that give cylinder change events, we want to re-write the cylinder index and pressure information with the event information before we start analyzing the pressures. So instead of filling the plot info and analyzing in one loop, split it up into two phases. We'll do the "fix up cylinder pressure info based on events" in between those phases. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-23Merge branch 'plot-multitank' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'plot-multitank' of git://github.com/dirkhh/subsurface: Plot tank pressures for multiple tanks Change plot_info to use depth (instead of val) for depth value
2011-10-23Plot tank pressures for multiple tanksGravatar Dirk Hohndel
The code keeps track of the segments of time when a specific tank was used and interpolates the pressure values for that tank based on a simulated average SAC rate for the times in which no pressure readings are available. This changes the way we used to plot the pressure when only beginning and end pressure of a tank are known; it used to be a straight line, now it is a sloped line where the steepness of the slope is proportional to the depth at that point - which is much more realistic. We also plot the pressures in two colors now. The old green for pressure data that came from the input file (that is not the same thing as saying it came from the computer - divelog for example appear to create pressure readings in the samples even if it only has beginning and end pressure). Interpolated values are plotted in yellow. If you have a sub-standard dive computer which has a frequently failing pressure sensor, you can now tell the parts of the plot where data was missing and we are filling in. The function that prints the pressure text labels had to be completely redone as it previously assumed one tank for the whole dive and simplisticly printed that tank's start and end pressure at the beginning and end of the profile plot with the y-values being the maximum and minimum pressure... This commit introduces a custom simplistic single linked list data structure to keep track of the pressure information per segment - Linus hated the idea of using GList for this purpose, and I have to admit that in the end this was very straight forward to implement and made the code easier to read and debug. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-23Enable inline completion/selection for the location/buddy/dm fieldsGravatar Linus Torvalds
This makes Tab completion work, and seems a whole lot more natural. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-23Keep the people/location lists sortedGravatar Linus Torvalds
This makes the combo box entry drop-down list be a whole lot more useful. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-23Make the divemaster/buddy/location text entries be combo box entriesGravatar Linus Torvalds
The text entries have completions, but if you want to see the full list of possibilities, I'm not seeing how to do that without turning the GtkEntry into a GtkComboBoxEntry. The list of people/locations are not sorted, though, which makes the full list less than readable. Will have to do that too. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-23Add completions to the dive location, buddy and divemaster entriesGravatar Linus Torvalds
This way you can just type the first few characters of a location you've been to before, and it will show you a list of possible completions. Same for buddies and divemasters (which take the completions from a list of people you've used before). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-23Add 'activate' callback for the cylinder completionGravatar Linus Torvalds
This makes us fill in the size/pressure data for a cylinder even if we just type the name (rather than pick an entry from the list) Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-22Change plot_info to use depth (instead of val) for depth valueGravatar Dirk Hohndel
Also changed a couple of corresponding local variables Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-22Add a completion for the cylinder type entry combo boxGravatar Linus Torvalds
This allows us to start typing the cylinder description and we'll get a matching list that we can select. This is similar to selecting one from the model, and works in addition to the explicit selection. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-22Add cylinder data to cylinder model as we record each diveGravatar Linus Torvalds
This way the cylinder model list will contain all the different cylinders that we have ever seen, rather than only containing the models that we have *edited*. That makes it much more practical to add new dives with the same cylinders that we've used before, because now those cylinders will show up as cylinder models even if we haven't looked and edited the old dives first. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-22Fix the reading of the cylinder start/end pressure from cylinder modelsGravatar Linus Torvalds
The cylinder model doesn't contain the start/end pressures, they just contain the cylinder type information. So trying to read the start and end pressure from the cylinder model change callback is totally bogus. We need to set the start/end pressures from the cylinder info when we create the cylinder widget, and not touch them when the type changes. So split up the "set_cylinder_spinbuttons()" function in two: one that sets the type information, and one that sets the start/end pressure. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-21Merge branch 'minor-fixes' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
* 'minor-fixes' of git://github.com/dirkhh/subsurface: Fix "Keep window size for new notebook pages" to not set minimum size Make the first filename on the command line the default filename
2011-10-21Fix "Keep window size for new notebook pages" to not set minimum sizeGravatar Dirk Hohndel
Turns out I used the wrong function to keep the size of notebook pages that were ripped off. Using gtk_widget_set_size_request on the new notebook creates a hard minimum size for this window. Instead we should use gtk_window_set_default_size on the new window that is the parent of the notebook. This has the desired effect of creating the new window with the same size as the one the page was ripped off from - without making that the minimum size for this window. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-21Repaint dive after equipment change only after updating the cylinder infoGravatar Linus Torvalds
Repainting the dive will end up touching the cylinder list store, so we should finish setting the cylinder info before we repaint it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-21Make the first filename on the command line the default filenameGravatar Dirk Hohndel
From a usecase point of view - if we call with multiple file names then most likely it's subsurface MyDives.xml new_dive1.xml new_dive2.xml and therefore the existing "database" is the first filename, not the last one (as the current implementation assumes). Frankly, this is a bit arbitrary - but this one seems to make more sense. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2011-10-21Repaint the dive after equipment changesGravatar Linus Torvalds
Those changes may have changed cylinder sizes and beginning/end pressures, so the dive profile and SAC rate may be different. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-21Merge branch 'multiple_selection' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
2011-10-20Allow multiple selections in the dive listGravatar Dirk Hohndel
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>
2011-10-20Fixed off by one error in uemis importerGravatar Dirk Hohndel
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>
2011-10-20Merge branch 'guifixes' of git://github.com/dirkhh/subsurfaceGravatar Linus Torvalds
2011-10-20Add quick hack for "no sample pressure but tank index changed" caseGravatar Linus Torvalds
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>
2011-10-20Fix up multi-cylinder code as per DirkGravatar Linus Torvalds
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>
2011-10-20Keep window size for new notebook pagesGravatar Dirk Hohndel
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>
2011-10-19Parse the xml sample cylinder index properlyGravatar Linus Torvalds
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>
2011-10-19Start some rough multi-cylinder pressure data plot infrastructureGravatar Linus Torvalds
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>