Added a new widget to control the Planner

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>
Code Cleanup: Buttons on Graphical Planner

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>
Changed the WindowHint of the planner popup to 'Popup'

Changed the Window Hint of the planner popup to 'Popup'
this removes ghost items from the task bar.

Hint By: Danilo Cesar
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Started the Model to handle the DivePoints

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>
First implementation of the Shared Model for the Planner

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>
Moved the creation of the data plan point to the model.

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>
Moving Handler on Graphics Updates the Model on the Planner

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>
Moved a lot of code to the Model, cleaning the interface.

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>
Fixed a bug where moving a handler would mess the planner

Fixed a bug where moving a handler would mess the planner
by calculating invalid values to the planner on the model
side.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Fixed invalid values on the TableView

The values of the dive points on the tableview were
too big, I'm now dividing time by 60 and depth by 1000
to get the correct results.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Fixed entering a dive stop before another dive stop.

Fixed entering a dive stop before another dive stop,
the correct way is to fix the position of them but
this is easyer - I'll update the correct one in
a couple of patches.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Made possible to add a divepoint between two others.

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>
Fixed moving a dive point between dive points

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>
Added a 'remove' icon on the dive planner table.

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>
Made the TableViews share a bit of code, code cleanup.

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>
Code cleanup - Dead Code.

Just removing an #if 0

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Code Cleanup - Remove temporaries.

Just code cleanup, removing temporaries.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Started the work of Editable Model for the Planner

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>
Added support for changing Depth and Time on the Table.

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>
Gas choices working, both directions ( Planner and Table )

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>