aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
AgeCommit message (Collapse)Author
2013-10-06Merge branch 'glib-removal-hack'Gravatar Dirk Hohndel
Fix obvious merge issue in Rules.mk Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-06Trying to switch to Qt translationGravatar Dirk Hohndel
This compiles and looks about right, but it doesn't appear to work, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-05Modify the dialog text for the question to make more sense.Gravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Turn off Qt including the C++ Standard Library headersGravatar Thiago Macieira
We don't use any of the Standard Library features or classes in Subsurface, except for three uses of std::sort, for which I added the necessary #include. It's always a good idea to include directly the headers you want, without relying on indirect inclusion On my machine, the build time dropped from 16.96s to 13.38s or a 12% improvement. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Make the classes generated by uic be real members of our classesGravatar Thiago Macieira
This means we don't have to new/delete them, which is a waste of overhead. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-03Include the ui_*.h headers in the main headers.Gravatar Thiago Macieira
This means we can also remove the forward declarations. This is the first step in removing the memory allocation for the ui sub-classes. Without the second step, this commit is just making the compilation time increase for no good reason :-) Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-09-26Fixed the display of Subsurface in Smaller ScreensGravatar Tomaz Canabrava
This patch fixes the display of subsurface in smaller screens by creating ScrollArea containers that are now englobbing each of the Tab-pages and the Planner Widget. Some of those widgets were pretty big by the amount of things on it and it was too big for small ( 14" and 15" ) screens. This seems to fix it, and looks good both on Gtk+ and Oxygen styles. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.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-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-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-19Merge branch 'addDive'Gravatar Dirk Hohndel
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-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-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-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-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-09Make the Plus Button on the planner work.Gravatar Tomaz Canabrava
Clicking on the plus button now adds a new stop on the planner. The depth is always 10m and the time is 10 minutes after the last stop. can be changed by double clicking or dragging the balls around the canvas. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-09Last gas used will be used on new dive planner point.Gravatar Tomaz Canabrava
This patch makes the last gas used on the planner the default. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-09Signal that the model changed when editing plan specific information.Gravatar Tomaz Canabrava
Signal that the model changed when editing plan specific information, when you changes the ATM pressure or any other information, the graphic of the plan will be generated again to mirror your actual dive. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-09Plug most of the dive planner - non - model stuff.Gravatar Tomaz Canabrava
Plug most of the dive planner controls that weren't plugged yet - StartTime, ATMPressure, BottomSAC, DecoStopSAC, LowGF and highGF are being used by the calculations now. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-09Enable the CC SetPoint on the planner, also input bug fix.Gravatar Tomaz Canabrava
Enabled the CC SetPoint settings on the table, changing it will automatically reflect the canvas. Also fixed a bug that prevented the 'Air' handling on the diveplanner table to show the list of options using arrow up and down. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-03Fixed a incorrect signal that shouldn't be there.Gravatar Tomaz Canabrava
Fixed a incorrect signal-connection call that should'nt be there anymore because the TableView now correctly knows what to do with models. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-09-02Code Cleanup: Merged the three TableViews shared codeGravatar Tomaz Canabrava
Merged the shared code for the three table views into one code, this way less code is needed if we need to construct another tableview in the future. I still need to clean some of the models too. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30More Code CleanupGravatar Tomaz Canabrava
The code now seems to be mostly working. There is unfortunately a QAction shortcut conflict between the implementation and the MainWindow. - I'm gonna fix that in the next commit. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30More Code Cleanup.Gravatar Tomaz Canabrava
Just a bit of code cleanup so that I don't bloat the software too much. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Fix '+' sign for time on the planer, plus code cleanup.Gravatar Tomaz Canabrava
The plus sign for time was in a very strange position, this puts it back to where it belongs, plus a bit of code cleanup since the planner was in heavily modifications, this will be needed quite a bit. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Make planned points deletion works on the Table too.Gravatar Tomaz Canabrava
Now the planner deletes points by clicking on the trash icon on the table. The dive planner is almost finished. <3 next: add a point from the table. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Moves deletion logic of divepoints to the Model.Gravatar Tomaz Canabrava
Deletes the logic of divepoints to the model, this makes automatic updates on the table on deletions. ( remember, to select dive points, ctrl+click on it. ) if you want to delete it, press 'delete', it will be removed from the graphics part and also from the table. Next: delete point by clicking on the table trash- icon. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Gas choices working, both directions ( Planner and Table )Gravatar Tomaz Canabrava
The gas choice now works and correctly ( I hope ) calculates the gas choosen to show on the planner. User can choose the gas from the list on the visual planner, and also on the table. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Added support for changing Depth and Time on the Table.Gravatar Tomaz Canabrava
Added support for changing depth and time on the table. It now works both ways, one can edit the planner via the table for a fine tuning. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Started the work of Editable Model for the PlannerGravatar Tomaz Canabrava
This commit is the start of the Editable Model work for the planner, it creates a new delegate and shares the code for the model that creates the gas types, so we only need to change in one place to add new gases. The table is already edition-enabled, but the outcome is still undone, next commit - put all together. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Code Cleanup - Remove temporaries.Gravatar Tomaz Canabrava
Just code cleanup, removing temporaries. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-30Code cleanup - Dead Code.Gravatar Tomaz Canabrava
Just removing an #if 0 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-28Made the TableViews share a bit of code, code cleanup.Gravatar Tomaz Canabrava
Made the tableviews share a bit of code, and code cleanup. The tableviews for Cylinders, Weigth and Dive Planner Points now shares the CSS and I also implemented the save / load methods for the dive planner points, so the functionality is mostly done on the vieualization side. - since we are now using three tables maybe it's a better idea to create one class SubSurfaceTable that knows how to handle saving / loading of the columns... TODO for the future. ;) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-28Added a 'remove' icon on the dive planner table.Gravatar Tomaz Canabrava
Added a 'remove' icon on the dive planner table, this makes the ui more consistent between the other tables that also manages addition and removal of data. the delete method is still unimplemented. next - css. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Fixed moving a dive point between dive pointsGravatar Tomaz Canabrava
Fixed moving a dive point between dive points. this fixes mostly everything that I have broked by using a Qt Model instead of a linked list - but a model is better to make everything updated and only poke in one place. sharing code++. :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Made possible to add a divepoint between two others.Gravatar Tomaz Canabrava
Made possible to add a divepoint between two others, this also implemented the last patch in the correct way. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>