21 Commits

Author SHA1 Message Date
Jelle Spijker
120541a8db
Updated comments in Models
Converted doxygen style comments to reStructuredText style in the files
 found in Cura/cura/Model directory recursively  using the script
dox_2_rst.py (provided in the Uranium repo). Comments were manually
 checked and changed if needed.

 Note: dox_2rst.py struggles with decorated functions.
2020-05-08 18:59:38 +02:00
Ghostkeeper
94eb76a844
Merge branch 'master' into CURA-6793_performance
Conflicts:
	cura/Machines/MaterialManager.py -> File was deleted in Master but I changed things for the lazy loading.
	cura/Machines/Models/BaseMaterialsModel.py -> I clarified documentation on a line above a place where a timer was added in between.

Contributes to issue CURA-6793.
2019-10-23 09:58:08 +02:00
Lipu Fei
5602c71ec7 Fix material model update and signal recursion
CURA-6904
2019-10-21 09:53:14 +02:00
Ghostkeeper
7348c70af6
Don't get whole container to just get metadata
A performance improvement, especially in the material models.

Contributes to issue CURA-6793.
2019-10-16 13:56:23 +02:00
Ghostkeeper
8ef410e826
Update the _available_materials in the actual _update function
It's confusing that this would be updated in the _canUpdate function. Just cleanliness.

Contributes to issue CURA-6600.
2019-08-22 09:25:26 +02:00
Ghostkeeper
ea1c99b708
Update _favorite_ids in BaseMaterialsModel._update
And make all subclasses run its super _update as well to make sure that this gets updated for them. It's necessary for the _createMaterialItem functionality because it needs to add an is_favorite role.

Contributes to issue CURA-6600.
2019-08-22 09:25:26 +02:00
Remco Burema
507cb356d2 Remove (all?, most?) deprecated ContainerNode.getMetaDataEntry calls.
part of CURA-6600
2019-08-20 15:38:45 +02:00
Ghostkeeper
5abb03e269
No longer update all material models when favourites change
The MaterialManager.materialsUpdated signal was only called once upon init and for the rest when a favourite was added or removed. So only the FavoriteMaterialsModel would need to listen to it.
Because the MaterialManager is being deprecated, the favourite materials model now just listens to the preferences changing instead, as it was supposed to be doing anyway.

Contributes to issue CURA-6600.
2019-08-19 17:09:16 +02:00
Jaime van Kessel
646222f2ac Fix removing of material
CURA-6600
2019-08-19 13:01:05 +02:00
Ghostkeeper
7d1f8e981b
Fix models using new MaterialNode class
The new one doesn't have getMetadata. Maybe we should allow it to have that actually.

Contributes to issue CURA-6600.
2019-08-13 17:20:58 +02:00
Ghostkeeper
1b11164340
Remove unused import and add documentation 2018-12-18 16:09:19 +01:00
Jaime van Kessel
f67ac8d7c4 Update far less agressively for the material models
CURA-6016
2018-12-11 10:59:17 +01:00
Jaime van Kessel
e7d9f0ce45 Added typing for various setting classes 2018-09-10 15:24:11 +02:00
Ian Paschal
2304aeaceb Expanded states preserved when updating models
Did this so that models can be updated more often fixing bugs where when a material is set as "not favorite" in the favorites section, its updated accordingly in its "normal" section.

It's also the ground work for saving material section expansion to preferences.

Contributes to CURA-5378
2018-08-24 12:10:32 +02:00
Ian Paschal
6be9b5e27f Consolidate models some more
Contributes to CURA-5162, CURA-5378
2018-08-23 16:58:23 +02:00
Ian Paschal
56a5f59964 Cleaner code
I was hoping to completely nix the generic materials model (since it's basically just a brand "Generic", but then in the QML it has to be have the same in terms of sub-menus or fold-outs and that looked stupid (Generic -> ABS -> ABS)). So we keep that one for now. It is cleaner though.

Contributes to CURA-5162, CURA-5378
2018-08-23 16:39:40 +02:00
Ian Paschal
6225fff1f8 Re-added material detail view
Contributes to CURA-5378
2018-08-22 15:58:58 +02:00
Ian Paschal
cb713eea6a Improve models
Contributes to CURA-5162, CURA-5378
2018-08-22 12:33:29 +02:00
Ian Paschal
68bccd8bf7 Improve the Favorites, Base, and Brand materials models (WIP)
Contribuetes to CURA-5378
2018-08-20 17:16:54 +02:00
Ian Paschal
e8cda90021 Add favorites to materials menu
Contributes to CURA-5162
2018-08-16 13:04:58 +02:00
Ian Paschal
8493948ba1 Add a favorite materials model
Contributes to CURA-5162
2018-08-15 14:06:07 +02:00