When you make the ID of the subprofile unique it doesn't get linked to the base profile any more since the '#2' gets put at the end.
Contributes to issue CURA-4243.
The original was based on reading the original file back, but that won't work if the files are provided by an arbitrary container provider. Instead we'll actually make a copy of all the profiles that need to be copied. It's much faster as well.
Contributes to issue CURA-4243.
CURA-4129
isContainerUsed() is used to enable/disable the "Remove" button on the
Material Manager dialog. When a custom material is created, it creates
multiple containers, one for each extruder variant. In the dialog, it
only checks if the material for the currently active extruder is being
used or not. This causes a problem when 2 extruders are of different
types and one uses a custom material. Then, the "Remove" button will
not be correctly enabled/disable in the Material Manager dialog when
the other extruder is activated.
It doesn't give a problem right now since we're only iterating over lists of length 1 here, but in the future this could cause weird bugs.
Contributes to issue CURA-2822.
Properties is a dictionary inside the metadata dictionary. If you change one of the properties, it'll check afterwards if the dictionary is different from what it was before, but since the dictionary is passed by reference all the time, it'll think that the dictionary didn't change: The reference is still the same, so the thing it checks against is updated along.
This solution is a bit ugly but it does notice when the metadata changed inside the properties and then emits a change signal.
Contributes to issue CURA-2822.
NB: previously the "approximate_diameter" metadata was stored as a number. This caused some issues passing arguments from QML to Python. Now "approximate_diameter" is stored as a string.
Instead of cloning the 2.85 mm generic PLA material and setting its diameter, we now clone the generic PLA with the same diameter as the current machine. This will also clone all the machine-specific settings included in that base file.
Except when we fill the instancecontainer via deserialising. Because then we want to retain the original version number.
Contributes to issue CURA-3427.