summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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>
2013-09-16Planner: start time is relativeGravatar Dirk Hohndel
This almost fixes it, but the offset from UTC isn't calculated correctly it seems. Committing and hoping that a Qt expert can help. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-16Merge branch 'deviceProbe' of github.com:danilocesar/subsurfaceGravatar Dirk Hohndel
2013-09-16implement device probe in CGravatar Danilo Cesar Lemes de Paula
It's an attempt to build auto-completion for the dive-computers based on unpublished code inside libdivecomputer[1] [1] - http://git.libdivecomputer.org/?p=libdivecomputer.git;a=commitdiff;h=d44053a99435fb9fc1f408fb3f1629a54c938afc Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
2013-09-16Merge branch 'quirks' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Conflicts: qt-ui/modeldelegates.cpp qt-ui/modeldelegates.h
2013-09-16Merge branch 'multiDiveEdition' of https://github.com/tcanabrava/subsurfaceGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org> Conflicts: qt-ui/maintab.h
2013-09-16Plotted the Scale on the Ruler ( depth / time ) on the plannerGravatar Tomaz Canabrava
Plotted the Scale on the Ruler in the planner. There's a tiny bit issue - mostly noticiable while resizing, but it's not a killer. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-16Use the same line dimensions as the profile, on the planner.Gravatar Tomaz Canabrava
The Planner should be 'almost' like the profile, with the possibility to use the mouse and keyboard to input a new plan, so this is a bit of 'getting there.' I don't like too much code duplication but since the current Profile Graphics is a crude cut-and-paste from the old Cairo backend, it's easyer to start from scratch and have it well organized as Qt code. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-16Ok on the planner now correctly creates a Dive.Gravatar Tomaz Canabrava
Ok on the planner now correctly creates a dive, a few remarks, tougth: 1 - the number of the added dive is always 0 ( but I may be testing it wrong ) 2 - the information pane is working only when the mouse is clicked, this is a regression and it will be fixed. ;) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-16Move the creation of the dive plan to the modelGravatar Tomaz Canabrava
The dive plan was bein created on the Profile, this While this worked out, it created a bit of spaggethi code, so now the model will take control of *everything* on the planner. I tested it quite a bit and doesn't seems to have appeared a regression, wich is good. Now that a dive plan is bein created, I can just save it. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-16Plug the Cancel action on the Dive Planner Table and start the 'ok' code.Gravatar Tomaz Canabrava
Plug the cancel action on the dive planner ( before that, only by hitting the 'ESC' button things worked, so now you can also click on the Cancel box that's on the right of the planner profile window. Also, the beginning of the 'ok' code is also at place. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-16Position the X and Y labels of the RulersGravatar Tomaz Canabrava
Position the X and Y labels of the rulers, this way it's a bit more clear the deepness and the length of the trip. It's still not the best approach, but I'm getting close. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-10Fix row counting bugGravatar Dirk Hohndel
When updating the weight system model we have to remove the old ones and then correctly count the new ones. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-10Merge branch 'downloaddialog' of github.com:danilocesar/subsurfaceGravatar Dirk Hohndel
2013-09-10Change ws_info and tank_info typesGravatar Dirk Hohndel
This is correct C. But debuggers in C++ mode are broken and can't display the global variables. While I hate having to do this change, I hate not being able to debug my software because of broken tools even more. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-10Fill ws_info structure and use it when entering weight systemsGravatar Dirk Hohndel
The code to initialize the weight systems from the last datafile loaded had not been brought over from the Gtk version. We now correctly update the data structure when loading file (but not yet when editing values). Most likely the same needs to be done for the tanks as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-10improve DownloadDialog's error handlingGravatar Danilo Cesar Lemes de Paula
shows an error message when libdivecomputer returns an error. Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>