aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2013-09-25Set the Cylinders and Weigths to all selected dives after pressing 'Accept'Gravatar Tomaz Canabrava
This bit of magic actually performs the save on the dive list for the changed weigths and cylinders, it will set the cylinders only if there's a change on the cylinder model, and it will set the weight only if there's a change in the weigth model. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Code cleanup - create a method for cleaning the Palette.Gravatar Tomaz Canabrava
Code cleanup, create a method for cleaning the palette, less code is better in this case. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Only mark dive list as changed if 'Accepted' was clicked.Gravatar Tomaz Canabrava
The old code marked the dive list as changed on any of the changes in the model, this was incorrect since the user could just cancel the edition, wich means that the divelist shouldn't be marked as changed at all. when the user clicks on'accept', and the item is indeed changed on the dive list, then we mark_divelist_changed to TRUE Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Added a 'changed' member on Cylinder/Weigth models to know when to Apply a ↵Gravatar Tomaz Canabrava
change. Added a 'changed' member on Cylinders and weigth models to mark when one was changed or not. Only the changed data should be inserted on the selected dives, so if the user changes the cylinders on a multi edit, there's no need ( and it will actually break things if we did that ) set the weigths too. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Enable Edition by clicking anywhere on the Cylinders and Weigths.Gravatar Tomaz Canabrava
This patch enables edition on the selected dives as soon the user press delete or any other column on the Cylinder / weigthsystem. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Revert to the old values of Cylinders and Weigthsystems on cancelGravatar Tomaz Canabrava
This patch enables canceling the edition of cylinders and weigth systems, as soon as the user press cancel, the old values are re-populated on all selected entries. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Created a placeholder for the Equipment Edition.Gravatar Tomaz Canabrava
This creates a placeholder for the equipment edition, it will ease the 'revert' and 'apply' when editing multi dives. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-25Added more wildcards to the GitignoreGravatar Tomaz Canabrava
Gitignore is now ignoring callgrind files and kdevelop projects, this was annoying me. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-24Disable info widget when canceling 'add dive' for a first diveGravatar Dirk Hohndel
One more corner case that we cover correctly. Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-24Only offer to merge dives if they are consecutive in the divelistGravatar Dirk Hohndel
You cannot merge dives if there is another, unselected dive "between" them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-24Much easier way to detect if more than one dive is selectedGravatar Dirk Hohndel
Instead of getting data from Qt just use our internal notion of the number of selected dive to decide if more than one dive is selected (and therefore if we need to show the 'merge dives' option in the context menu). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-24Document MaxOSX DBUS workaround in the READMEGravatar Robert Helling
This documents the temporary workaround for the libmarblewidget (and plugin) issues on MacOS in the README. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-23Add "merge selected dives" to dive list popup menuGravatar Dirk Hohndel
This is fairly straight forward. What I dislike is the check for the magic number of "14 indeces". I'm sure there's a better way to tell if more than one dive is selected... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-23Call refreshDisplay() after editing a diveGravatar Dirk Hohndel
We now can change the dive date and the order of dives could have changed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-23Remove o2/he from plot_data and fix gas plot textGravatar Anton Lundin
plot_data.o2 and plot_data.he was wrong for all dives, due to that cylinderindex was set right first in populate_pressure_information, and thus those two contained bogus information. This makes the plot-text use cylinderindex-lookup as everything else. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22Correctly handle empty dive list after deleteGravatar Dirk Hohndel
Things need to be cleared out and disabled. But fixing this bug leaves another issue - while the newly selected dive after a delete acts as if it was selected, it doesn't show up as selected in the dive list. Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22Support imperial measurements in dive planner / add diveGravatar Dirk Hohndel
This was not as hard as I assumed it would be. I may still change the horizontal dimension to be the more logical seconds instead of minutes, but for now this achieves the main goal. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22Whitespace fixes in dive plannerGravatar Dirk Hohndel
I know this may seem anal retentive... but it's driving me insane. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22Prevent nodes in planner / dive add profile edit to run past each otherGravatar Dirk Hohndel
I always disliked the fact that when you moved the handlers around you could just 'run over' the neighbors. This also (as a somewhat intended side effect) prevents vertical descents and ascents). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22Don't exit profile editor when hitting ESC in dive add modeGravatar Dirk Hohndel
I'm sure there are more issues like this where we need to handle things differently depending on whether we are planning a dive or adding a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22Fix tab order for dive info editGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22Only load default file if no file is given on the command lineGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22Disable the info widget when no dive is selectedGravatar Dirk Hohndel
This solves the odd case when closing the data file that clicking in the info widget caused the input fields to respond and the little warning icon to show up. Also some minor whitespace cleanup for readability. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22Hack to clear the date when no dive is displayedGravatar Dirk Hohndel
This mostly happens with no XML file or when closing the current XML file. Sadly the user still can click on the empty date field (even if nothing else is active on the screen) and a date reappears. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22Fix crash when closing the data fileGravatar Dirk Hohndel
Only dereference the dive pointer if there actually is a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22Fix crash when adding dive to empty dive listGravatar Dirk Hohndel
Only look up the dive number of a previous dive if there is a previous dive. Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-22Fix enabling info widget when closing a diveGravatar Alexandre Dupas
If the close action is triggered while there is no current dive (empty history), the info widget is enabled. To avoid this behavior, we only enable the info widget during update if the dive index is valid. Signed-off-by: Alexandre Dupas <alexandre.dupas@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-21Simplify the default dive profile given in add diveGravatar Dirk Hohndel
Suggested-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-21In planner / add dive use 'ESC' to hide the gas selection popupGravatar Dirk Hohndel
Not sure if there are other keys we should support. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-21Allow editing of date & time and air & water temperaturesGravatar Dirk Hohndel
Add two more rows to the widget - this is getting quite busy. There still is some weirdness where the focus isn't returned where it should be and a few other details, but overall getting there. Added helper functions to parse a temperature and to deal with the timezone offset - with that latter one I also fixed the time offset bug in the planner. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-20Adding a dive changes the dive listGravatar Dirk Hohndel
Duh. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-20When adding a dive, make the final ascent slowerGravatar Dirk Hohndel
Simply trying to role-model safe behavior I guess. Fundamentally all this should be configurable (so I added comments about that on the planner side as well). One of the interseting side effects of this implementation is that if the user removes the safety stop and comes up directly from a deeper depth, the slope of the ascent will change at 5m :-) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-20When manually adding a dive, start with a simple diveGravatar Dirk Hohndel
This is much friendlier than just showing an empty profile. I picked a nice and simple three level dive. 25 minutes at 18m, 15 minutes at 9m, and a safety stop. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-20Simplistic solution to add dive number to dive addedGravatar Dirk Hohndel
If this is the last dive and if the previous dive had a number, give this dive the next number. Of course there are a couple of issues with the current implementation. We have no way of changing the date / time of the added dive, so we KNOW that it will be the last one. But I put that check there so that once we add the ability to change the date / time (and hopefully remember to then move the dive to the correct spot in the dive_table), we only assign a number if it is the last dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-19Merge branch 'addDive'Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-19Hook up cancelling out of adding a diveGravatar Dirk Hohndel
This was surprisingly easy - which of course has me worried that I'm missing something that I should do when cancelling out of this dialog. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-19Hook up adding a diveGravatar Dirk Hohndel
This gets things mostly right. It creates a dive and uses the planner widget to create samples which are copied into the dive. It fills in some reasonable defaults (DC model, timestamp), but doesn't allow editing the timestamp (or the temperatures and air pressure). On accept the planner gets reset and the dive appears correctly in the dive list. Cancel still needs to be handled. And I bet there are many subtle bugs lurking here and there. But it's a start. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-19Identify below floor event type properly.Gravatar Michael Andreen
This event is on when accumulating deco time. Once you reach the floor deco time will start decreasing and the event will stop. Going below the floor again will re-activate the event. Also identify event type 13 in DM4 imports as airtime. Signed-off-by: Michael Andreen <harv@ruin.nu> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-19Fixes for gps coordinates handling.Gravatar Michael Andreen
Reset coordinates properly when clicking undo. When auto-completing location, only copy coordinates if they have not been manually edited. Set the background to red if the gps coordinates won't change, e.g. there is a parse error, the change is too small or only whitespace changes. Signed-off-by: Michael Andreen <harv@ruin.nu> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-19Fix unbalanced braces issues in dive.hGravatar Dirk Hohndel
The compiler doesn't warn about this, but this looks better. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-19Continous update of plannerGravatar Robert Helling
Make the planner update its display continuously upon moving points including deco. This appears fast enough on typical PCs. If this ends up being to slow on some systems we may have to make it configurable. [Dirk Hohndel: cleaned up the two patches and turned into one commit] Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Fix updateDiveInfo to clear coordinates when called with invalid diveGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Don't show the planner widget when adding a diveGravatar Dirk Hohndel
This looks like it might work, but since we keep recreating the dive, the info entered in the info pane is actually lost. But it's a step in the right direction. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Only calculate deco stops in planner modeGravatar Dirk Hohndel
In add dive mode simply bring the diver safely back to the surface (currently with a fixed ascent rate of 30ft/min (or 9m/min)). We should make that rate configurable (for the planner as well as the dive add function). Also, the dive add function should offer to automatically include a safety stop. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Rename createDecostops to drawProfileGravatar Dirk Hohndel
After all, that's what the function does. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Use Planner dialog to add diveGravatar Dirk Hohndel
Right now this is just calling the same code and setting a flag whether we are planning or adding a dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Fix the annoying tab order issue in the notes tabGravatar Dirk Hohndel
This had been driving me crazy for a while, finally figured out how to fix it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Added the Message and the Buttons on the Equipment TabGravatar Tomaz Canabrava
Added the Message and the ok/cancel buttons on the Equipment Tab, they don't control the Equipment edition yet, but already does the same as the Notes one, Now I need to merge the other part - the actuall Equipment Edition. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-18Add a Warning icon on the changed tabs, for edition of dives.Gravatar Tomaz Canabrava
Adds a Warning icon on the changed tabs, this is important as usability, for you could change something on the 'notes' tab, change the tab and did't realized that something was changed ( by forgotting or something ), then clicking on the cancel button. so now there's a friendly reminder that you actually changed something. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-18Good deal of Code Cleanup for the maintabGravatar Tomaz Canabrava
Some cleanup was needed in the MainTab code for ages, now the Edition / Cancel / Ok of the Notes tab is way more intuitive on the code level. This is needed to support multidive edition on the Cylinders and Weigths too, since it's a bit more complicated, I didn't want to start with a Spaguetti Code. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>