aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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>
2013-09-18Show DiveNotes when program starts.Gravatar Tomaz Canabrava
Equipment tab was opened by default, it should be DiveNotes as per the old GTK version. this fixes that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-18Destroy the main window before exiting the applicationGravatar Thiago Macieira
This ensures all widgets inside the window get destroyed too. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Show sample time in the mouseover.Gravatar Anton Lundin
This is really nice to have when looking at specific coutures of a dive or events. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Only calculate with he when he is present in eventGravatar Anton Lundin
Old gasswitch events only contains O2, so don't look at he part when the event doesn't contain a He part. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-18Use the right event typeGravatar Anton Lundin
11 is SAMPLE_EVENT_GASCHANGE, and thats the one that doesn't contain any He-part. The type where He and O2 is packed togeather is 25, SAMPLE_EVENT_GASCHANGE2. Left to implement is to figure out the type of the event when we read the xml, so we can create the right type there. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-17move process_dives to the mainthreadGravatar Danilo Cesar Lemes de Paula
Avoids a race condition. Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
2013-09-17Fix SIGSEGV after dive computer downloadGravatar Linus Torvalds
This fixes a crash in the current Qt subsurface code that can happen after downloading dives from a dive computer, and the new dives merge with old dives, causing the old dives to be re-allocated into the merged one. In that case, the list widgets don't get fully updated, and contain stale pointers to old dives that no longer exists. Doing anything that refreshes the display will hide this problem, and you do need to have multiple dive computers on the same dive to trigger it in the first place, so it's reasonably hard to hit, but very annoying when you do. This patch just makes us reload all the dive UI tables, which may be overkill. It also doesn't actually fix the fact that we seem to do "process_dives()" within the context of the downloader thread, which looks like a possible source of races. The "process_dives()" should also be moved to the main thread, but needs the preferDownloaded() information that is part of the download window, so it doesn't fit here. Somebody else (Tomaz?) will hopefully fix that part. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-17Improved handling of latitude and longitude.Gravatar Michael Andreen
Coordinates are copied when auto-completing location, they are also displayed and editable in maintab. Signed-off-by: Michael Andreen <harv@ruin.nu> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-17Enable opening files with .zip suffixGravatar Henrik Brautaset Aronsen
The test file dives/TestDiveDivingLog5.08allmetric.zip wouldn't load. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-17Update installer so we can cross-build for WindowsGravatar Dirk Hohndel
Marble doesn't work, yet (Google Maps aren't loaded), but at least Subsurface starts under Windows with the installer built. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-17Fix Windows compileGravatar Dirk Hohndel
When submitting commit 8f33b81de0f9 ("implement device probe in C"), Danilo explicitly asked me to make sure this compiles / works on Windows and Mac - and I promptly forgot to do so. Robert fixed the Mac build, this now at least compiles under Windows (but it's still untested). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-17Two header files missing for Mac OSXGravatar Robert Helling
I needed to add to include files to make the latest version compile. Here is a patch. Signed-off-by: Robert C. Helling <helling@atdotde.de> Best Robert Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-17Bugfix plot of ceiling violationGravatar Anton Lundin
Due to a bug in how the entry-list was handled, a point on the polygon was introduced at 0,0 that made a weird pink triangle across the whole profile. This was quite clearly seen in dives/test15.xml Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>