I'm not quite pleased with the variant translation being inside this function, so I'll move it to VersionUpgrade21to22 soon I think.
Contributes to issue CURA-844.
A translation dictionary makes it much easier to edit the translations. Also this now just translates one printer, instead of a list.
Contributes to issue CURA-844.
This solution is a bit neater in code. It makes the function perform a single purpose, since it no longer translates a list of setting names but just one. Also it now neatly puts the translations in a separate, easy-to-modify dict. Only disadvantage is when simple key look-up is not sufficient, such as when renaming lots of settings at once, where substring matching would make the code a bit shorter. But we shouldn't do such a rename anyway.
Contributes to issue CURA-844.
It is not entirely accurate in the translated version, since the new current_settings is not machine-dependent any more. However, without information on the original file name, this is as good as it gets, since that instance profile there only mentions the machine it is dependent on in the file name.
Contributes to issue CURA-844.
Two big things had to happen for this: The resource types of quality and machine stack have to be defined before the initialisation of the version upgrade manager, since the version upgrade manager needs to know those storage locations at initialisation. But the storage location is still prefaced with '.config/UM' at this point, so instead we pass on the resource type (but the resource type still has to be defined before the init).
The other big change is that we now have to name the configuration type 'quality' and 'machine_stack' instead of 'instance_container' and 'container_stack' to coincide with the resource type. This allows us to be more consistent in later plug-ins when we also have to upgrade other instance container types.
Contributes to issue CURA-844.
They might not exist any more because the relation of profiles to printers changed from 2.1 to 2.2 for some machines (notably the UM2+ variants). But then it'll just make it empty when loading.
Contributes to issue CURA-844.
Lots of things have changed in how this works. Sadly, I can't translate things like the material, from PLA to ultimaker2_plus_0.4mm_pla. Not without implementing the entire container registry in the plug-in anyway.
Contributes to issue CURA-844.
Machine instances have the exact same file structure as preferences, except that machine instances require a name field (was already correctly implemented), but preferences didn't require it. This now forbids preferences to have a name field, so that the distinction between the two can be made.
Contributes to issue CURA-844.
I just couldn't stand it...
'I have to sort my books', she cried
With self-indulgent glee
With senseless, narcissistic pride:
'I'm just so OCD'
'How random, guys', I smiled and said
Then left without a peep
And washed my hands until they bled
And cried myself to sleep
Contributes to issue CURA-844.
This code is basically moved from Uranium to here. This is needed to allow for upgrade plug-ins to define their own configuration types.
Contributes to issue CURA-844.
After settings rework, we decided to make the upgrade plug-ins define their own configuration types. This is basically the definition for these configuration types. Only the get_version function is not yet implemented.
Contributes to issue CURA-844.
They no longer mention the version number in their function names. I'd rather have named them import/export but that gave a name clash with Python's 'import' keyword.
Contributes to issue CURA-844.