'Cancel' action Cancels editing Cylinders.

Made the default 'Cancel' action correctly cancel
the cylinder edition. This is needed only because
we bypassed the default behavior on Qt that took
care of this, because we wanted to have more control
on how the view would update the items accordingly
with wich one of the cylinders were selected
on the edition pane - the pressure and size of the
cylinders needed to have it's data set, but the Qt
Model/View system *thinks* that cancel-edition is
simply 'do not commit the edition data, then.' wich
would not work with us, because we passed the strange
data already. So, I created a backup data that serves
us very well. When the user cancels, this backup data
is added back on the cylinder, making everything as
it was before.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Added the code to revert Weigths when user cancels edition

This is a follow up commit to the previous one that
enabled cancel for cylinders, everything in the commit
log for the cylinders also applyes here.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Fixes incorrect editing policies.

The Working Press didn't correctly updated when there was a 'bar'
or 'psi' in the string ( and that was defalt behaviour );

The o2 didn't correctly updated when there was a '%' on the string
(and that was default behaviour ),

The He didn't correctly updated when there was a '%' on the string,
and that was also default behavior.

Now all of them correctly updates.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
use QWebView to show the user manual

Looks like the QTextBrowser can't render the manual correctly.
Also, QWebView provides a better way to find contents on a webpage,
which is an important feature for an user manual (to be implemented).

Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
fixing planner's gas dialog

Before this commit this dialog had a weird behavior in which
when it was shown, the whole screen was still active. In case of a
alt+tab, this dialog is sent to behind the application window, but still
visible in the task bar.

This commit basically changes this behavior to a regular pop-up.

Signed-off-by: Danilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk>
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>