276 Commits

Author SHA1 Message Date
Ghostkeeper
71505a8b35
Use normal config only if not material(-specific) profile
Other profiles should just return an array with only their single profile.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
9a555fcab0
Fix call to VersionUpgrade21to22.machinesWithMachineQuality
It needs that stupidly long path if we're using imports inside a plug-in.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
1428f67798
Rename machines_with_machine_quality to machinesWithMachineQuality
As per the code style conventions. Sorry, I'm used to other conventions in one of my own projects.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
36f84017cf
Move _machines_with_machine_quality to VersionUpgrade21to22
It's going to need to be used by the upgrader of machine instances as well, that's why.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
7481f0802e
Split profiles into multiple if new printer has material profiles
If the old profile didn't specify any material, it would be global. But if the new machine specifies that its profiles are material-specific, these profiles have to be split into multiple profiles in order to be able to show them in Cura 2.2.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
af86375ba3
Output arrays of files rather than a single file
This is needed because the version upgrade system now allows for a version upgrader to output any number of files.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
f759b24034
Add translations for support roof to support interface
These setting names were changed.

Contributes to issue CURA-1013.
2016-08-01 15:03:14 +02:00
Ghostkeeper
70acdb168b
Automate removing settings from old profiles for renames
So we don't have to edit the actual code for simple setting renames.
2016-08-01 14:56:18 +02:00
Ghostkeeper
54685e8898
Rename setting skirt_minimal_length to skirt_brim_minimal_length
Also updated the description and made it a bit more accurate. Because this concerns not only the skirt, but also the brim.

Contributes to issue CURA-1678.
2016-07-22 17:12:34 +02:00
Ghostkeeper
d4f96ab62d
Rename setting skirt_line_width to skirt_brim_line_width
Also updated the description. Because this concerns not only the skirt, but also the brim.

Contributes to issue CURA-1678.
2016-07-22 17:00:30 +02:00
Ghostkeeper
cb4c1fd08c
Rename skirt_speed to skirt_brim_speed
Also updated the description. Because this concerns not only the skirt, but also the brim.

Contributes to issue CURA-1678.
2016-07-22 16:45:11 +02:00
Ghostkeeper
31901606b8
Properly translate default profiles
Otherwise the machine instance doesn't get loaded.

Contributes to issue CURA-844.
2016-07-18 16:02:41 +02:00
Ghostkeeper
b33c2f9c25
Even better fallbacks for unknown subprofiles
These fallbacks specify their types so that they can be found with the filters.

Contributes to issue CURA-844.
2016-07-13 12:06:18 +02:00
Ghostkeeper
6fbac2f7ee Better fallbacks if MachineInstance missing profiles
They now fallback to "empty" so that it can still construct a valid
instance, albeit with a missing profile (such as material), if some
profile is missing from the original machine instance file.

Contributes to issue CURA-844.
2016-07-11 00:49:18 +02:00
Ghostkeeper
8f5e56c66e
Make documentation specify filename without extension
Contributes to issue CURA-844.
2016-07-07 15:22:27 +02:00
Ghostkeeper
e6efba3868
Make version upgrade also translate file names
This was required since Cura 2.1 produced files with the same filename (bar extension). This then resulted in two containers with the same ID. If you had bad luck, an instance container was chosen as global container (depending on which was first in the unordered dictionary). This gives the current settings the postfix _current_settings, fixing that issue.

Contributes to issue CURA-844.
2016-07-07 15:13:58 +02:00
Ghostkeeper
1b0974ba9f Rename translation dicts to plural form
This is more in line with the rest of the code.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
19b4ec655e Move some things to metadata section
Why there is a difference between 'general' and 'metadata', only His Noodleness knows. Also put in a default for the type. It should apparently be 'quality' unless it is a user profile.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
8f34186a9b Rename settings section to values
It should be called 'values' in the new version.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
b841738b76 Translate variants in profile
Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
c50619e363 Add additional settings transformations since 2.1
These should be all the settings that were changed since Cura 2.1.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
93041191c2 Move translateVariant to VersionUpgrade21to22
Also make it a dictionary look-up, like the rest, instead of a series of if-statements.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
439629d0b5 Translate variants and machine names
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.
2016-07-07 13:51:41 +02:00
Ghostkeeper
f13db7de10 Make translatePrinter use dict
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.
2016-07-07 13:51:41 +02:00
Ghostkeeper
b5efb2eee8 Make profile translation use new translateSettingName
Forgot about this one.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
88b36ad3d7 Make translateSettingName use dictionary look-up
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.
2016-07-07 13:51:41 +02:00
Ghostkeeper
f07598a228 Translate profile names too
Not all profile name translations are entered yet, I think. I just did the material ones.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
7939a03114 Fix translating current_settings
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.
2016-07-07 13:51:41 +02:00
Ghostkeeper
86544d4172 Fix translate function
It was expected to return a list of translated names, even though it actually translates in-place.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
39212a601e Fix import
Didn't see this due to the sea of errors that it gives.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
a87e756a42 Translate machine names
Some names might be changed. I know of at least one: ultimaker2plus -> ultimaker2_plus.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
7f5b656c68 Update translation of metadata
A few fields are different now.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
002f43598b Correct storing upgraded config location
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.
2016-07-07 13:51:41 +02:00
Ghostkeeper
28cc1e8cf7 Translate material, variant and profile along
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.
2016-07-07 13:46:40 +02:00
Ghostkeeper
fbffff4c8d Write list creation as literal
Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
2de811accf Update how machine instances are translated to stacks
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.
2016-07-07 13:46:40 +02:00
Ghostkeeper
d1188899a7 Translate active machine setting
It was in machines/active_instance. Now it's in cura/active_machine. The setting value remains the same.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
e1db3e5316 Convert instance profiles as profiles
Treated in the same way.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
922b0df60b Don't read machine instances as preferences
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.
2016-07-07 13:46:40 +02:00
Ghostkeeper
07b6507133 Fix calls to translateSettings and translateSettingNames
They are one module deeper, due to the way that plug-ins are imported by Uranium.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
20d776c0d4 Fix joining strings on comma
The call worked a bit differently.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
a5abfe29cd Fix call to translateSettingNames
It's two modules deeper!

Bit of weird magic due to how our plug-in import system works.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
51aa82bd6c Use preferences upgrader
Instead of the placeholder.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
ec5aee253d Also increment the version number
Of course. Duh.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
e02a633ef2 Add preferences converter
Currently it removes the expanded categories setting, and translates the setting names in the visibility.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
04974a4308 Correct preferences version number
The old version was 2, so the new one needs to be 3.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
f04430ba57 Increment plug-in API version
It is now settings-rework-aware!

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
11d59709ef Add stub preferences converter
Needs to be implemented like the rest of them.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
24946d3f13 Fix references to exception classes
These were moved to VersionUpgrade module.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
66df680e1b Move getCfgVersion back inside class
To ask the cfgversion from the actual plug-in is more object-oriented programming.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00