aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2014-07-08make GPS coordinates autofilling really workGravatar Gaetan Bisson
Move the gpsHasChanged() call on selected dive when coordinates have changed *before* autofilling, otherwise it erases the autofilled values. Also update displayed_dive when autofilling, otherwise values are stored but not displayed immediately after saving. Signed-off-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-07Planner: Show gas consumption in pressure units as well and warn if not ↵Gravatar Robert C. Helling
enough reserve. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-07Planner: don't allow negative depthsGravatar Robert C. Helling
This patch allows only non-negative depths in the divepoints table as negative depths confuse the planenr/deco algortihm. The spinbox appearing in the table should get a setMinimum(0) but I was not able to find the correct way to implement that. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-06UI restructure: remove the backupDive we no longer needGravatar Dirk Hohndel
Since we have a dedicated dive that we use to display things, we can simply get the information from the current dive and use it to setup said displayed_dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-06UI restructure: cleanup the code when canceling an editGravatar Dirk Hohndel
This was way too complicated because we used to edit a "live" dive that was on the dive list. All we really need to do is systematically make sure that all the widgets are in the correct state. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-06When copying dives, make copies of samples/events in first DCGravatar Dirk Hohndel
We carefully copied the dive computers and their samples and events, but only for the second and later DCs. For the first DC we simply copied the pointers but not what they were pointing at. So when the copied dive was freed, those pointers in the original went to freed memory. Not good. Fixes #599 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-05Show the gas mixing information only when neededGravatar Miika Turkia
Recreational divers, especially ones diving with air, do not need to be shown that their gas can be mixed with 0 liters of O2 and He. And similarly Nitrox diver does not need to know about 0 liters of He. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-05Planner: reset deco gas used memberGravatar Dirk Hohndel
Otherwise every recalculation will continue to incorrectly increase the deco gas used value. Fixes #598 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-05When adding a waypoint, use the gasmix of the _next_ waypoint.Gravatar Robert C. Helling
This corrects the logic of adding a waypoint actually meaning that a previous segment is subdivided into two. Both new segments should by default use the gas of the old one. Since the gas is stored in the waypoint (divedatapoint) at the end, we need to use the _next_ gas. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-05Remove gasmix_is_nullGravatar Robert C. Helling
The semantic of fo2==fhe==0 to mean "same gasmix as before" apparently is not used anywhere and gets in the way of the semantic "this is air". If there is really need for mix meaning "same as before", please use another value, e.g. one with a specific negative percentage. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Add dive: don't throw away the pressure data enteredGravatar Dirk Hohndel
Previously we were trying to get rid of the tracked gas pressures that were added when using the plan infrastructure to create a dive. Now that this isn't the case anymore we can stop doing that which magically makes setting start and end pressure while adding a dive work as expected. Fixes #582 Fixes #553 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Planner: don't set cylinder start and end pressure when adding diveGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Planner: only track gas when planning a diveGravatar Dirk Hohndel
When adding a dive we don't have SAC data so we should simply have the user manually enter their gas consumption. That still doesn't work, but this is one required step to get it to work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Don't add a close button to KMessageWidgetGravatar Dirk Hohndel
Commit 77a55db9d3e2 ("Use QDialogButtonBox in KMessageWidget") added a close button to all our uses of that widget. As much as I stare at the code I can't figure out why. For now I'll simply brute-force disable them... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Use QDialogButtonBox in KMessageWidgetGravatar Anton Lundin
QDialogButtonBox can auto-choose the order of the actions based on the current interfaces guidelines, but in this case its a guessing game. It does a half-decent job off guessing. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Make planner buttons consistent with MaintabGravatar Anton Lundin
Move the Save/Abort buttons in the planner to the top left and change them to Save/Cancel to be consistent with where our Save/Cancel buttons are in the Maintab. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04UI restructure: simplify setup of add and plan modeGravatar Dirk Hohndel
Recreate the helper function (which now does something fairly different) to share the common code between the two modes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04UI restructure: correctly setup planningGravatar Dirk Hohndel
I had tested this mostly with add dive and completely forgot to track the same changes in the planning routine. Oops. This allowed to get rid of a no longer useful helper as well. Fixes #594 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04UI restructureGravatar Dirk Hohndel
Don't clear out the model after we already set up the cylinders. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Remove unused labelGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04HTML: depth value must be positiveGravatar Gehad elrobey
Remove negative sign from the inverted y-axis Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Clean list_lib and remove unused code from canvas profile.Gravatar Gehad elrobey
Comment some functions. remove leftover code from list_lib. Some code organization. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04HTML: add temperature curve to profile.Gravatar Gehad elrobey
Add temperature curve to profile view, The curve is tracable by mouse. The temperature has a hidden axis that doesn't appear in the detailed view. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04HTML: dive numbering starts from one instead of zeroGravatar Gehad elrobey
since the practise is that the first dive is number 1. so change the first dive number to 1 instead of 0. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04HTML: add events to detailed profile viewGravatar Gehad elrobey
Export events to detailed dive view and add events to the profile. Events names must appear on mouse hover. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Typo fixes on User ManualGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Minor edits on HTML export (User Manual)Gravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04User manual: HTML export updateGravatar Gehad elrobey
This patch updated the export section in the user manual. Some changes to the description of the HTML export options. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-04Clear out old events in create_dive_from_planGravatar Anton Lundin
Previous code where accumulating events from each iteration of the planning. This code clears the old ones before adding new ones. Fixes #595 [Dirk Hohndel: removed printf, updated comment, slightly moved the code, added parenthesis to silence warning] Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03Planner: initialize drop_stone_mode as falseGravatar Dirk Hohndel
Otherwise it could be used uninitialized when adding dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: when adding a dive via displayed_dive it needs valid idGravatar Dirk Hohndel
Otherwise we have one (or - yikes - more) dives with id 0. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03Don't crash if get_divenr is called with NULL argumentGravatar Dirk Hohndel
We shouldn't be doing that, but still, let's not crash. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03Small cleanupsGravatar Dirk Hohndel
Add commented out options to subsurface.pro that enable debuging the planner. Remove obsolete comment. Clean up the selection tracking. Force the re-sort of the divelist inside the reload instead of explicitly calling it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03Remove non-existant variable from debug statementGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03Autofill GPS coordinates for added dives.Gravatar Gaetan Bisson
Prior to commit 95cb4e, when a new dive was added with the same location name as a previous dive, the GPS coordinates for that new dive would be automatically set to that of the matching previous dive. This restores this feature, by duplicating code further down qt-ui/maintab.cpp that handles the case where multiple dives are modified at once. Signed-off-by: Gaetan Bisson <bisson@archlinux.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: add back the missing plan dive notesGravatar Dirk Hohndel
This was removed in the big rewrite by mistake. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03Planner: Add backgas breaksGravatar Robert C. Helling
If the corresponding checkbox is checked the planner does interrupt pure O2 deco after 12min for 6min on cylinder 0. To make this work for air I removed the gasmix_is_null logic. I guess that makes the planner feature complete for the next release. [Dirk Hohndel: trivial merge into latest master] Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: use displayed_dive for add dive and plan diveGravatar Dirk Hohndel
This gets rid of the stagingDive and stops the constant adding and removing of dives from the divelist (that was an INSANE design, seriously). When adding or planning a dive all work is now done in the dedicated displayed_dive. Add dive mostly works - when the user clicks save the dive is added to the dive list and selected. Plan dive is mostly untested. It passed trivial "start planner, save" testing so it's not entirely broken, but I'm sure there's more work to be done there. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: don't use random dives from the divelist for dataGravatar Dirk Hohndel
Everything should come from the displayed_dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: make planner act on displayed_diveGravatar Dirk Hohndel
Instead of constantly creating and deleting dives and messing with the dive list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: add clone_dive helperGravatar Dirk Hohndel
This is kind of the inverse to copy_dive(). Instead of duplicating all the data that the dive points to, it moves it to a new struct dive and zeroes out the old one so there are no two sets of pointers to these data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: get rid of "current" pointer in cylinders and weightsGravatar Dirk Hohndel
Instead always display the display_dive. Now the only thing left to slay is the stagingDive... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: only switch to edit mode if user made changeGravatar Dirk Hohndel
With this patch a simple click into the main tab does not start editing mode. Only once a value is modified do we show the message box and disable the other widgets. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: track if any data was modifiedGravatar Dirk Hohndel
Instead of comparing the dive structures (which doesn't work since the strings are actually copies), track if the user made changes. Cylinders and weights still need to be compared as they are handled in different widgets. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: improve memory handling in maintabGravatar Dirk Hohndel
Free strings before overwriting them. Use copy_dive() instead of just copying the dive structure. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03Add a "smart strdup" helper named copy_string()Gravatar Dirk Hohndel
If the string is non-NULL, copy it, otherwise return NULL. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: updateDiveInfo displays displayed_diveGravatar Dirk Hohndel
Instead of passing in a divenr of -1 to make it clear things this changes things to use an options "clear" flag. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: always display pictures for displayed diveGravatar Dirk Hohndel
The only time this is ever wrong is in print mode, so let's never show pictures in print mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: updateDiveInfo shows the selected dive by defaultGravatar Dirk Hohndel
So don't be redundant. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-03UI restructure: plotDive: plot current dive by default & use displayed_diveGravatar Dirk Hohndel
No longer use the dive structure that is passed in but instead always use the displayed_dive to display things. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>