summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.h
AgeCommit message (Collapse)Author
2013-10-06First steps towards removing glib dependenciesGravatar Dirk Hohndel
- remove the build flags and libraries from the Makefile / Configure.mk - remove the glib types (gboolean, gchar, gint64, gint) - comment out / hack around gettext - replace the glib file helper functions - replace g_ascii_strtod - replace g_build_filename - use environment variables instead of g_get_home_dir() & g_get_user_name() - comment out GPS string parsing (uses glib utf8 macros) This needs massive cleanup, but it's a snapshot of what I have right now, in case people want to look at it. 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-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-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-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-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-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-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-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-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-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-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-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-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-26Moved a lot of code to the Model, cleaning the interface.Gravatar Tomaz Canabrava
Moved a lot of code that handled the positioning of the DiveHandles on the interface to the model. there are a few bugs left ( regressions ) that I will fix in the next commits. With this commit an edition of the points on the widget will trigger a repaint of the planner profile. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Moving Handler on Graphics Updates the Model on the PlannerGravatar Tomaz Canabrava
Moving the handler on the graphics updates the model on the planner Unfortunately, the graphics will move back to it's original position because of the legacy code used to calculate the dive plan. Next: fix the legacy code used to calculate the dive plan. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Moved the creation of the data plan point to the model.Gravatar Tomaz Canabrava
Moved the creation of the data plan point to the model, this way when the user creates a data point on the graphical planner, or when the user creates the point on the QWidget based view, both of them will be updated. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26First implementation of the Shared Model for the PlannerGravatar Tomaz Canabrava
This implementation of the shared model already shares some, but not all data between the two views, but it's already a huge improvement. When the user clicks on the visual planner, it will update the view on the qt-widget based view. The editing of the view is still not allowed, and removing nodes is not allowed too ( yet. ) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Started the Model to handle the DivePointsGravatar Tomaz Canabrava
Started the model to handle the divepoints between the Qt Widget interface and the QGraphicsView one. good thing is that we share code. Bad is that a model is harder to work, but doable. :) With this finished ( in a couple of commits ) one can insert a point on the Qt widget or on the graphics view and it will be 'mirrored' to both interfaces. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Code Cleanup: Buttons on Graphical PlannerGravatar Tomaz Canabrava
Removed a bunch of non-used graphics buttons, since the new widget now contains everything needed for the creation / cancelation of the dive plan. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-08-26Added a new widget to control the PlannerGravatar Tomaz Canabrava
Added a new widget to control the DivePlanner, now we have two widgets, a graphics one and a qt sidget based one. the Technical divers will most likely use the QtWidget one while the hobbists will most likely use the QGraphicsView one. there's not a option to choose one, they both will appear at the same time. Next step: make the screens to work. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-21Added the possibility to choose gases in the planner.Gravatar Tomaz Canabrava
Added the possibility to choose gases in the planner, now the user should click on the name of the gas, a popup window will appear, asking the user to choose what gas he wants for that ascent / descent. now we need to hook that up with the createDecoStops method that calculates the decompression. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-21Good code cleanup.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-21Added the current gas used on the plannerGravatar Tomaz Canabrava
Added the current gas used on the planner, now it's a matter of choosing the new gas, that will be done in the next commit.e Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-21Removed unused code.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-21Added button to reduce dive time on the planner.Gravatar Tomaz Canabrava
Added a button and a method to reduce time on the dive planner. The dive planner will not reduce below deco-time and it will also not reduce below TIME_INITIAL_MAX. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-21Added ( finally ) the code to reduce depth on the plannerGravatar Tomaz Canabrava
Added the code to reduce depth on the planner. Depth cannot be lower than 40m and it also won't let the user reduce if there's any point on the 'reduced' area. the icon is ugly - we need an artist. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-04Added the left / right shortcuts for moving the handlers around in time.Gravatar Tomaz Canabrava
Added the left / right shortcuts for moving the handlers around in time, this also made me wonder why we have the 'previous dc' on the menu, it got actually to broke my code on the shortcuts for the planner because they are active everytime - should they be active only when the profile's visible or they serve any other purpose? If they serve only for the profile, I'll get them out of the menu and put them in their proper place - the profile view. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-04Added 'up' and 'down' actions on the dive planner.Gravatar Tomaz Canabrava
Added 'up' and 'down' keyboard actions on the dive planner, you need to select the handlers with ctrl + click, then press up to make the handler go 1m up, or down, to make the handler go 1m down. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-04Added a 'delete' action, with the keyboard.Gravatar Tomaz Canabrava
Added a delete action from the keyboard, there's also a possibility to add the same action from the menu, but I frankly don't like much the idea. so, to delete a handler now, you need to select it ( ctrl + click ) then press the delete button. Multiple delection is also possible. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-04Added a shortcut to 'esc', so it clears the selection or cancels the plan.Gravatar Tomaz Canabrava
Added a shortcut to the esc key, so it clears the selection, if there's no selection, it acts just like clicking on the 'cancel' button. Next: delete selected handlers. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-04Make possible to 'select' an handler by ctrl+clickGravatar Tomaz Canabrava
Make possible to select an handler by ctrl+click on it, this will be used in the future for the shortcut actions, like delete, arrow keys, and such. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-04Make it possible to drag a handle between handlersGravatar Tomaz Canabrava
Make it possible to drag a handle between handlers, this way the configuration of the dive is more acurate and easyer to make. I'v discovered a problem where it's a bit hard to 'grab' the handler, investigating it now. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-02Make the increase time button to work.Gravatar Tomaz Canabrava
Makes the increase time button to work, it will increase the minimum time, not the correct time of the dive. the total time is calculated by the deco, and does not come from this, unless the deco is smaller than the minimum time. This patch also fixes the problem where a button would only click once - I was holding the first clicked button as the 'mouse grabber', bad tomaz. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-02Change the color of the DepthString based on it's deepnessGravatar Tomaz Canabrava
Change the color of the DepthString based on it's deepness on the profile planner. The new color of the profileString ( the string that follows the mouse stating how deep you are) is now interpolated from SAMPLE_SHALLOW and SAMPLE_DEEP - but since those two colors were the same and I had to change it so that could work, I want somebody to check if my choose of colors were ok. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-02Use the same profile colors on the planer for the Time and DepthGravatar Tomaz Canabrava
Use the same profile colors on the planner for the Time and Depth rulers. this needed a new method on the rulers - setColor, that will call the setPen method and make everything behave properly. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-02Change the rules so they work with percentages.Gravatar Tomaz Canabrava
Changed the ruler so that they work with percentages, also added a new method to the rules to set the size of the ticks. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-02Added a method and a simple stub to position things using percentage.Gravatar Tomaz Canabrava
Added a method and a simple stub to position things on the canvas using percentage - this way I have a proper control on where I want to put things on screen and it will make simpler for future changes, even if the amount of code written is a bit bigger. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-27Make planner prettier. but still ugly.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-27Removed memleak created by the diveplan calculationsGravatar Tomaz Canabrava
Removed a small memleak created by the diveplan calculations. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>