68 Commits

Author SHA1 Message Date
Lipu Fei
1aa6708677 Fix typing 2019-09-23 10:59:31 +02:00
Ghostkeeper
4a68e7ec95
Fix favorite materials without material manager
We just track it via the preference value itself rather than duplicating that in any other data structure. It's simple enough.

Contributes to issue CURA-6776.
2019-09-20 09:57:36 +02:00
Ghostkeeper
0eb3c5c0d6
Refer material manager functions through to material management model
That's where the materials are duplicated now. So we only maintain one implementation of that.

Contributes to issue CURA-6600.
2019-09-17 17:50:38 +02:00
Jaime van Kessel
d548404dfd Fix typing issues 2019-08-29 16:23:10 +02:00
Ghostkeeper
9297890d78
Fix typing of approximate diameter and add typing to function for it
Seems I forgot to add typing and that's biting my bum right now.

Contributes to issue CURA-6600.
2019-08-27 17:21:22 +02:00
Ghostkeeper
3952366798
Move createMaterial to MaterialManagementModel and simplify it a bit
We can reuse our duplicateMaterial function again but in a simpler way. Also finding the preferred material is simpler with our container tree.
However there seems to be a problem with finding the preferred material; it's not finding generic_pla for UM3 and AA0.4 anyway, and then falls back on a random material. This needs to be fixed in the variant node class.

Contributes to issue CURA-6600.
2019-08-27 17:21:22 +02:00
Ghostkeeper
957894b614
Fix duplicating a favourite material
The duplicate must also be favourite.

Contributes to issue CURA-6600.
2019-08-27 17:21:21 +02:00
Ghostkeeper
1874a6453d
Move duplicateMaterial into MaterialManagementModel
To move away from the deprecated MaterialManager class.

Contributes to issue CURA-6600.
2019-08-27 17:21:21 +02:00
Ghostkeeper
3dc7c7b61c
Move removeMaterial to MaterialManagementModel
Moving away from the MaterialManager.

Contributes to issue CURA-6600.
2019-08-27 15:47:40 +02:00
Ghostkeeper
99ccddefa4
Move setMaterialName to MaterialManagementModel
No longer use the material manager which is deprecated.

Contributes to issue CURA-6600.
2019-08-27 15:47:40 +02:00
Ghostkeeper
5b8ed91b04
Create new MaterialManagementModel and move canMaterialBeRemoved
Just like the QualityManagementModel, this class is intended to be used as proxy for the material management page in the preferences. I'm intending to move all relevant pyqtSlots from the material manager into this one. The advantage of this switch is that the material manager had no well-bounded scope and so tended to become a big mess of all sorts of functions. This one has a clear scope: serve as a proxy for the buttons you can press in the preferences screen for materials.

Contributes to issue CURA-6600.
2019-08-27 15:47:40 +02:00
Ian Paschal
8da7773600 Remove unused code
Contributes to CURA-5162, CURA-5378
2018-08-23 16:04:51 +02:00
Ghostkeeper
bb7fccbd48
Add logging for every setting model update
You can clearly see that some models are updated 4 times or so now.

Contributes to issue CURA-4606.
2018-03-12 14:48:56 +01:00
Ghostkeeper
d8853b8a98
Sort profile models case-insensitively
Cast every sorting key to uppercase before doing this. Don't cast to lowercase or there will be problems with characters that don't have lowercase and with Turkish dotted i vs. undotted i.

Fixes #3460.
2018-03-09 11:40:33 +01:00
Lipu Fei
d6f6dbe45e Rename to available_material_dict 2018-03-01 15:12:34 +01:00
Lipu Fei
b4c3536999 Move getAvailableMaterials() into MaterialManager 2018-03-01 15:02:57 +01:00
Lipu Fei
c21174eea8 Fix the usage of protected variables in material models 2018-03-01 11:55:29 +01:00
Lipu Fei
580244a546 Split material models into separate files 2018-03-01 11:50:55 +01:00