Rather than successfully importing the profile and then not showing
anything, we now display an error. Not the perfect solution but the
easiest for now.
Contributes to #1873
CURA-3738
Getting limit_to_extruder from definition in QML returns a
SettingFunction which hasn't been evaluated. This causes the comparison
not to be working. We change it to use the global stack to evaluate so
we can get an actual extruder number string.
Another small bug I found when looking through this MachineManager code. My IDE was complaining that the preferred_material_name was not always initialised and that preferred_material was an unused variable.
Doesn't contribute to issue CURA-3803.
These may have different parameters, such as which machine and extruder they are updating the material and variant of. If we only pass the last signal on, then we're missing the update of other extruders.
Contributes to issue CURA-3803.
We know now that it must be a Cura Container Stack. This should be a bit faster, and makes the error message I was getting a bit more clear.
Contributes to issue CURA-3803.
Not just the active extruder. The non-active extruder may change when loading a project file which happened to have the same printer (so no new printer is created) and the same material and variant in the active extruder but not the same material or variant in another extruder.
Contributes to issue CURA-3803.
It may also be any other class that implements the Definition Container Interface.
Not really related to CURA-3803 but I'm putting it there anyway as I found it during that development.
For the 0.8mm profiles the variants specify 5%, so we remove it from those profiles. The 0.4mm variants specify 15% so for those we need to override it.
The UM3 definition sets the setting to 3mm. Nothing else sets it to another value except FDM Printer. I left the UM3 setting in and removed all travel_avoid_distance settings in the UM3 profiles.
Otherwise we may only change one of the extruders next time, and it'll still have the other change in this dictionary from the previous time we are syncing from the printer.
Contributes to issue CURA-3788.