Commit graph

13 commits

Author SHA1 Message Date
Tomaz Canabrava
69903903d2 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>
2013-08-30 07:14:30 -03:00
Tomaz Canabrava
3aa55462dc 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>
2013-07-18 12:01:48 -07:00
Tomaz Canabrava
7e029980b8 '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.

[Dirk Hohndel: removed the inadvertendly added boost header]

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-07-18 12:01:05 -07:00
Tomaz Canabrava
1a0a4b7e08 Fixes the Combobox behavior on the inline-edit
This patch fixes the combobox behavior on the inline edit
to what it was ( well, similar to ) the GTK version,
up and arrow keys will walk you to the list of choices,
and it will update the other data as soon as you walks over it

one drawback is that you cant ( for now, since I do have a
very big headache at the moment ) cancel, since the cancel
will just forgets the item and do not call 'setData' on the
model, but we already called it while walking on the list.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-16 19:13:58 -03:00
Tomaz Canabrava
c5a0c4e0d7 Support for key_up and down in the combobox delegate.
Adds spport for key_up and key_down in the combobox
delegates, now when you press key_up or down, it will
show the list of choices instead of going one-by-one
in the lineedit.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-07-16 15:31:44 -03:00
Tomaz Canabrava
f9b4c6b889 Better handling of default sizes on the Cylinder and Weight widgets
Better handling of default sizes on the Cylinder and weight widgets,
the weigth widget didn't had a CSS applied so it looked odd compared
to the cylinder one, also the default behavior for the combobox delegate
didn't worked very well with the css applied, being too small.
this patch fixes that.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-16 12:33:27 -03:00
Tomaz Canabrava
10ea572f5a Create a 'ComboBoxDelegate' to concentrate the comboboxness of delegates.
This patch creates a ComboBoxDelegate where the other specific delegates
should inherit from. this adds a little code cleanup for the current
version, and will help as soon as more delegates got added to the code.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-06-16 10:15:19 -03:00
Dirk Hohndel
01a3bd2cc6 Add weightsystem delegate to enable editing of weightsystem
This is very much analogous to the way cylinders are implemented.
That means that just like with cylinders, if the user enters a new type
and hits 'tab' before hitting 'enter', Subsurface will crash.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-23 21:36:33 -07:00
Tomaz Canabrava
babbfa9204 Added support for Completing on the Cylinder Type delegate
I had to immprove the TankInfoModel with two new methods,
insertRows and setData, because the delegate used this
model to show what kind of Tanks we are offering.
Since the user can enter a new type of Tank, it's important
to add this tank to all lists using the delegates.

I Also added two new methods on the delegate itself,
to correctly shows the data, and set the data on the
model. This also will help dirk with a working example
on how to edit things while using a delegate.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-23 15:33:20 -03:00
Dirk Hohndel
115e5e5fbc The never ending, futile fight for whitespace consistency
I just need to write a tool that does this...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-22 21:31:45 -07:00
Tomaz Canabrava
fc4243eef0 Added a Delegate for editing Cylinders
Now when you edit 'Type', a drop-down list will appear
and will enable you to choose from it's contents.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-05-22 14:11:49 -03:00
Tomaz Canabrava
82b1b04920 Test the CSS for styling the TableView
This is a test and I shouldn't be taken seriously.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-02 16:56:13 -07:00
Tomaz Canabrava
2f4d6bbe53 Added support for showing the Stars on the DiveTable
For the stars on the dive table I had to rework a bit my
StarRating widget, because it used a pixmap for each widget
that were created. Not it uses only 2 pixmaps: the active
and inactive ones.

A new file was created named modeldelegates(h, cpp) that
should hold all delegates of the models. For the GTK / C
folks, a 'Delegate' ia s way to bypass the default behavior
of the view that's displaying the data.

I also added the code to display the stars if no delegate
is set ( good for debugging. )

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-04-27 12:27:27 -03:00