Ghostkeeper
a90b4cc136
Fix finding global qualities: Metadata is not boolean
...
It's a string, strangely.
Contributes to issue CURA-6600.
2019-08-26 15:05:01 +02:00
Ghostkeeper
af9c5cd55c
Find global qualities for quality_definition as well
...
We don't have global qualities specific to e.g. the Ultimaker 3 Extended.
Contributes to issue CURA-6600.
2019-08-26 14:47:58 +02:00
Ghostkeeper
3655981c41
Use container tree to get the current printer's quality groups
...
Contributes to issue CURA-6600.
2019-08-26 14:00:35 +02:00
Ghostkeeper
51710c2868
Use new MachineNode.getQualityChangesGroups instead of quality manager
...
I hope that the machine node doesn't become a collection of functions that don't fit anywhere else, but this isn't contributing to that hope. However I still think that this is particular to a certain printer, so it's within the object-oriented programming paradigm. And it's also within the scope of the class, which is getting the available profiles. So it still sort of fits.
Contributes to issue CURA-6600.
2019-08-23 17:29:32 +02:00
Ghostkeeper
b1ce9b64d4
Add function to construct QualityChangesGroups for machine
...
It doesn't cache these any more, but reconstructs them when asked for.
Contributes to issue CURA-6600.
2019-08-23 17:26:57 +02:00
Ghostkeeper
bcd450daa0
Don't make QualityChangesGroup hold ContainerNodes
...
It can't hold ContainerNodes since the quality changes are no longer nodes in any tree.
This now makes it hold metadata instead.
Contributes to issue CURA-6600.
2019-08-23 17:11:21 +02:00
Ghostkeeper
430bcc90a8
Make QualityChangesGroup depend on intent
...
This is probably the main implementation of CURA-6600.
2019-08-23 16:44:08 +02:00
Ghostkeeper
1febfde3cc
Fix switching to printers without variant
...
Since the 'empty_variant' nozzle is now just in the tree, this check is no longer even necessary.
Contributes to issue CURA-6600.
2019-08-23 15:38:58 +02:00
Ghostkeeper
4fb656ea7b
Don't use deprecated Preferences.getInstance()
...
Contributes to issue CURA-6600.
2019-08-23 14:46:42 +02:00
Ghostkeeper
40b562093d
Don't unnecessarily deprecate the getMetaDataEntry functionality
...
If possible you should group the metadata queries but otherwise this is still fine to use.
Contributes to issue CURA-6600.
2019-08-23 13:43:30 +02:00
Ghostkeeper
99bf82dee3
Fix displaying list of nozzles
...
Make it use the ContainerTree structure since the original VariantManager's structure is not populated any more.
Contributes to issue CURA-6600.
2019-08-23 13:22:25 +02:00
Ghostkeeper
37bd7c6b0e
Always return a MaterialNode from getDefaultMaterial
...
Its function is, after all, to find the default. It should always have a default. Sometimes that will be the empty material, but so be it.
Contributes to issue CURA-6600.
2019-08-22 17:13:46 +02:00
Ghostkeeper
9bcf2698d5
Log warning when preferred material can't be found
...
Contributes to issue CURA-6600.
2019-08-22 17:02:09 +02:00
Ghostkeeper
9dca6c0127
Return empty node if preferred node couldn't be found
...
Or any node, really. There must now always be a subnode.
Contributes to issue CURA-6600.
2019-08-22 16:52:38 +02:00
Ghostkeeper
d06ce211ff
Document new requirement that there must always be one child
...
Contributes to issue CURA-6600.
2019-08-22 16:47:57 +02:00
Ghostkeeper
46cf7aafa9
Encode empty containers in container tree if necessary
...
You can now be assured that there is ALWAYS at least one child node, except for child nodes of intent profiles which don't exist.
Contributes to issue CURA-6600.
2019-08-22 16:44:52 +02:00
Ghostkeeper
81a33af3aa
Use variant node's preferredMaterial function from MaterialManager too
...
We can reuse that code.
Contributes to issue CURA-6600.
2019-08-22 15:46:29 +02:00
Ghostkeeper
0302ae4257
Don't find any variants if the machine says it doesn't have them
...
Even if there might be a matching variant...
Contributes to issue CURA-6600.
2019-08-22 15:44:41 +02:00
Ghostkeeper
999e19940e
Also don't add any materials added later if there are no materials
...
Keeps it consistent.
Contributes to issue CURA-6600.
2019-08-22 15:43:16 +02:00
Ghostkeeper
6f77c8735c
Don't load any materials for printers that don't have them
...
For instance the Ultimaker 2 shouldn't display any materials.
Contributes to issue CURA-6600.
2019-08-22 15:37:05 +02:00
Ghostkeeper
295ad564c0
Add function to find preferred material for configuration of printer/nozzle
...
This is supposed to replace the material manager's getDefaultMaterial function.
Contributes to issue CURA-6600.
2019-08-22 15:34:24 +02:00
Ghostkeeper
7b83e51439
Use container tree to determine default material
...
Using the new architecture here.
Contributes to issue CURA-6600.
2019-08-22 15:04:20 +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
Ghostkeeper
5d76f96354
Fix getting available materials without material manager
...
It's a bit weird still that this is executed in the _canUpdate... Oh well.
Contributes to issue CURA-6600.
2019-08-22 09:25:26 +02:00
Ghostkeeper
4ad6f4f635
Update materials models when container tree updates
...
Instead of relying on MaterialManager to do this.
Contributes to issue CURA-6600.
2019-08-22 09:25:25 +02:00
Ghostkeeper
6c6dd0efad
Add signals to signal that a material got changed or removed
...
The material models need to know this.
Contributes to issue CURA-6600.
2019-08-22 09:25:25 +02:00
Ghostkeeper
b7213ad020
Don't require material manager any more to find available materials
...
We have our container tree for that.
Contributes to issue CURA-6600.
2019-08-22 09:25:17 +02:00
Jaime van Kessel
80dd8a0061
Merge branch 'feature_intent_container_tree' of github.com:Ultimaker/Cura into feature_intent_container_tree
2019-08-21 09:43:04 +02:00
Jaime van Kessel
47d082b5dc
Fix updating of material models
...
CURA-6600
2019-08-21 09:42:49 +02:00
ChrisTerBeke
a179d7118d
Fix renaming mistake from 1fa5628cb2
2019-08-20 17:17:52 +02:00
Remco Burema
507cb356d2
Remove (all?, most?) deprecated ContainerNode.getMetaDataEntry calls.
...
part of CURA-6600
2019-08-20 15:38:45 +02:00
Jaime van Kessel
b5d826fab9
Fix deprecation warning
...
CURA-6600
2019-08-20 14:49:47 +02:00
Ghostkeeper
46b489c3f9
getAvailableMaterialsForMachineExtruder can never return None
...
So no need to check for it.
Contributes to issue CURA-6600.
2019-08-19 17:32:39 +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
Ghostkeeper
04c53c7190
Fix connecting to metadata changes
...
Otherwise the number of parameters is wrong.
Contributes to issue CURA-6600.
2019-08-19 16:24:27 +02:00
Ghostkeeper
10dbf3f735
Fix getting GUID from metadata
...
I keep making this mistake. A donkey may not hit its leg twice on the same stone, but I ain't no ass.
Contributes to issue CURA-6600.
2019-08-19 16:24:00 +02:00
Ghostkeeper
30b2f943fd
Update material node when its metadata changes
...
This should keep the tree up to date if anything is added, removed or changed in the container registry.
Contributes to issue CURA-6600.
2019-08-19 15:13:19 +02:00
Ghostkeeper
41c573b087
Fix filtering by GUID
...
Get the correct metadata entry, please.
Contributes to issue CURA-6600.
2019-08-19 15:06:02 +02:00
Ghostkeeper
38937d8ac4
Remove material node when material is deleted
...
Contributes to issue CURA-6600.
2019-08-19 14:47:08 +02:00
Jaime van Kessel
4ff8991196
Ensure that materials get filtered by diameter again
...
CURA-6600
2019-08-19 14:10:36 +02:00
Jaime van Kessel
d29b3078b3
Clean up no longer used code
...
CURA-6600
2019-08-19 13:15:38 +02:00
Jaime van Kessel
fcbfa88d97
Fix creation of new materials
...
CURA-6600
2019-08-19 13:13:08 +02:00
Jaime van Kessel
88857a7be8
Fix setMaterialName
...
CURA-6600
2019-08-19 13:06:09 +02:00
Jaime van Kessel
646222f2ac
Fix removing of material
...
CURA-6600
2019-08-19 13:01:05 +02:00
Jaime van Kessel
49e8c8d9d9
Fix the check to see if a material can be removed
...
CURA-6600
2019-08-19 12:52:31 +02:00
Jaime van Kessel
2417705dfd
Prevent crashes when duplicating a material
...
CURA-6600
2019-08-19 11:42:52 +02:00
Jaime van Kessel
76b58134ae
Fix getRootMaterialIdForDiameter
...
CURA-6600
2019-08-19 11:07:35 +02:00
Jaime van Kessel
4dd5cb1a85
Fix getMaterialByType
...
CURA-6600
2019-08-19 09:44:39 +02:00
Ghostkeeper
80baeb9873
Remove _added functions for nodes that can't be added during runtime
...
Among the machines, variants, materials, qualities and intents, only machines and materials can ever be added during runtime. For the rest, we don't need to listen to these signals.
Contributes to issue CURA-6600.
2019-08-16 16:28:42 +02:00