summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-11-22Fixes the correct sizes of the tables when first open.Gravatar Tomaz Canabrava
This patch fixes the correct sizes of the tables when first opened. It was defaulting to 'resizeToContents', but most of the cases when first opened we got no content, and this was bad. Now I'm defaulting to 30 when on the 'REMOVE' column and 80 on other columns. Fixes #189 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Cleanup and bugfix gaschange event printingGravatar Anton Lundin
When a gaschange to air happened, the code did name += name=+ tr("air") which probably was due to the block being just confusing with all the ?: Unrolls to proper if statements, and fixes the bug. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Add optional support for stopdepth import from csvGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Add optional support for cns import from csv filesGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Add optional support for po2 import from csv filesGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Simplify params numbering in parse_csv_fileGravatar Anton Lundin
When we add more fields, we don't need to renumber the whole thing. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Give room for more options in csv dialogGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Make temperature optional in csv importGravatar Anton Lundin
This adds a checkbox to be able to import csv files without temperature. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Rework csvimportdialog to make room for featuresGravatar Anton Lundin
This rewires things a bit to make room for new features coming. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Try to get Windwos to find the pluginsGravatar Dirk Hohndel
This way the application path (i.e., install directory) will be searched for plugin DLLs. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Fix a couple of warningsGravatar Dirk Hohndel
Removing unused variables. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Added a configuration option to have gf_low apply at max depth instead of at ↵Gravatar Patrick Valsecchi
deepest ceiling. Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Refactoring of the configuration handling.Gravatar Patrick Valsecchi
Before, when clicking the OK button on the preferences GUI, we were updating in-memory preferences from the GUI, saving them to the configuration file from the GUI, reloading from the file to the in-memory preferences. Then, to add to the ducplication, when the application was exiting, some fields were saved again. Basically the first step and the last step were useless appart from the fact the the other steps where missing a few fields here and there. This patch removes the first step and fixes the missing fields. Signed-off-by: Patrick Valsecchi <patrick@thus.ch> ACKed-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Fix typoGravatar Henrik Brautaset Aronsen
All hail the groub! Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Hack to make tank selection work on MacGravatar Dirk Hohndel
This is an ugly hack as it partially breaks the ability to abort a selection (so if you click outside of the combobox, the last value you hovered over is selected). But this seems much better than not being able to select a different tank at all. Fixes #275 (and by 'Fixes' I mean "hacks to sort of make work"... but the trac automation is rather inflexible in which words it understands...) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Complete add bookmark for the profile context menuGravatar Dirk Hohndel
This (together with the commits fixing the QMessageBox title) should finally close all the issues in bug 250. Fixes #250 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Silence some warnings when building on MacGravatar Dirk Hohndel
The *-clang* selector doesn't appear to work correctly in my build environment (or I just don't understand how it is supposed to work). Either way, making this conditional on !mac works. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Improve UDDF export to include more dive dataGravatar Miika Turkia
Basic information like buddy, location and visibility is included in UDDF export. Also attempt to grab temperature information from both temperature and divetemperature tags. This partially fixes bug #224. However, at least divemaster and tags are not exported (as the UDDF spec either does not have these or has hidden the information of these fields somewhere between so many seemingly unnecessary other fields). See #224 Signed-off-by: Miika Turkia <miika.turkia@nixu.fi> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Improve UDDF importGravatar Miika Turkia
Some improvements on importing different versions of UDDF logs. Also include rating, gps coordinates and gas mixture in the import. Signed-off-by: Miika Turkia <miika.turkia@nixu.fi> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Work around QMessageBox not showing its title on MacGravatar Dirk Hohndel
This is a bit hacky and simply adds the title to the message text when compiling on a Mac, but hopefully this will be enough. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Quiet down warning about return in non-voidGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-21Quiet down warning about duplicate nameGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-20Don't interpolate gas consumption when at surfaceGravatar Anton Lundin
Don't calculate pressure-track for depth above SURFACE_THRESHOLD, because then we would guess that were actually at surface breathing. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-20Use the get_o2/get_he helpersGravatar Anton Lundin
We have helpers that take care of O2_IN_AIR and so on. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-20Remove duplicate of add_gas_switch_event in dive.cGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-20Use add_gas_switch_event in instead of duplicateGravatar Anton Lundin
There is a add_gas_switch_event, so don't duplicate the code. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-20Use get_cylinder_index in per_cylinder_mean_depthGravatar Anton Lundin
Use get_cylinder_index that handles SAMPLE_EVENT_GASCHANGE and SAMPLE_EVENT_GASCHANGE2. This also removes the need for a special case where get_gasidx returns -1, because get_cylinder_index always returns the "closest" gas that it finds. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-20Fix potential crash in the per tank sac calculationGravatar Dirk Hohndel
In an inconsistant XML file (like our own dives/test20.xml) it is possible that a gas change event refers to a non-existing gas. In that case get_gasidx returns -1 - which we shouldn't use as index into the arrays. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Trigger redraw of the Dive Info pane on preferences changeGravatar Dirk Hohndel
If we change the units we need to redraw the info on this pane. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Collect per tank SAC rateGravatar Dirk Hohndel
This is a bit painful, but we basically walk the samples and pick the valid tank from the events. And then we do a simple discrete integration to figure out the mean depth per tank and duration per tank. And then we assemble all that into per tank statistics. Strangely the value calculated here seems slightly higher than one would expect from the overall SAC rate. This inconsistency should be investigated a bit further, but my guess it it's based on the assumption that the DC provided mean depth is possibly more accurate than what we can calculate from the profile. Fixes #284 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Add gas change event from profile context menuGravatar Dirk Hohndel
This allows to add missing gas change events to the currently shown dive computer. Only gases defined in the Equipment section are offered. Fixes: #250 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Use the correct dive to create the gas listGravatar Dirk Hohndel
If we are adding a dive, it's the stagingDive, otherwise it's the current_dive that we need to look at. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Hiding events doesn't change the dive_tableGravatar Dirk Hohndel
So let's not mark it as changed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Small whitespace cleanupGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Hooked up 'Hide Events'Gravatar Tomaz Canabrava
With this commit one can hide all events of the selected type through a context menu on the profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Enable the 'Remove Event' callback.Gravatar Tomaz Canabrava
Based on the code in the Gtk branch. [Dirk Hohndel: whitespace cleanup and changed the message text] Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Adds half of the support for the menu on the profile.Gravatar Tomaz Canabrava
This adds the menu, it just doesn't do anything, yet. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Do per cylinder statisticsGravatar Anton Lundin
This shows how much gas form each cylinder was used. I would like to add SAC to that list too but it became a mess trying to calculate average depth per cylinder. Design based on idea in #284 Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Better handle the mouse movements on the Add Dive profileGravatar Tomaz Canabrava
Better handle the mouse movements on the add dive profile, when outside of the canvas boundaries. It had bugged me for quite a while, but this is so much better. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Enable gas selection through a context menuGravatar Tomaz Canabrava
This patch re-enables gas selection through in the add dive profile. Good thing ( and I really didn't think of that before ) is that it is less than half of the code of the other implementation. :D Fixes #265 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Fixes positioning the first Gas Label on the add dive profile.Gravatar Tomaz Canabrava
We didn't take into account that last == first when checking for the first item on the list. Now the gas is correctly placed on screen. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Removed obsolete Code ( gaslist on text click )Gravatar Tomaz Canabrava
This commit removes obsolete code, there was a gaslist selection when user clicked on the buttons, but this shouldn't be anymore, since the next commit will add a menu to select the gas for that particular point. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Print bailout on separate row from SP changeGravatar Anton Lundin
It looked kinda weird without a separator between the SP change and the bailout. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Fix trip summary line in dive listGravatar Dirk Hohndel
Two errors fixed. - With no location set, the summary line would start with a ','. - When auto creating a trip for a manually added dive or when editing the dates of dives in a trip, the timestamp for the trip was not updated after editing the dive. Fixes #293 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Only translate default tagsGravatar Maximilian Güntner
We translate only tags we know since possible translations of custom tags (provided by the user) may be out of context and therefore wrong. Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19A first update of subsurface V4.0 manualGravatar Willem Ferguson
This starts mostly from scratch. It removes big chunkgs of the old manual, the old pictures and starts with new visuals and new descriptions. A lot more work is needed, but it's a good start. Signed-off-by: Willem Ferguson <willem@willem-Precision-M4700.(none)> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Clear selected trips after restoring selectionGravatar Dirk Hohndel
The rememberSelection() / restoreSelection() functions ONLY handle selected dives, not selected trips. This is a bit of a misfeature, but because of that we need to make sure we clear our notion of selected trips when we use restoreSelection() Fixes #285 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Hook up MOD in the preferences dialogGravatar Dirk Hohndel
For some reason this was never connected. Oops. Fixes #267 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Sanity check on gas percentagesGravatar Dirk Hohndel
O2 + He + N2 = 100% (well, there are some other gases, but this is close enough) Since N2 can't be negative that means we should refuse any change where O2 + He > 100% (or o2.permille + he.permille > 1000). Fixes #280 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-19Immediately update the dive flag label when editing location textGravatar Dirk Hohndel
This seems like a much nicer user experience. Editing a location's name is immediately reflected on the globe label, the moment it happens. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>