500 Commits

Author SHA1 Message Date
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
Ghostkeeper
c1b738953b Align documentation better
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.
2016-07-07 13:46:39 +02:00
Ghostkeeper
68afd08afd Fix links to upgrade functions
These are bound methods of an instance.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
5143d0b9f1 Implement getCfgVersion
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.
2016-07-07 13:46:39 +02:00
Ghostkeeper
8a44705413 Update metadata with dynamic config types
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.
2016-07-07 13:46:39 +02:00
Ghostkeeper
6572d939bf Convert for+if to list comprehension
It's a simple filter, so why not?

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
28da3c1a4f Improve documentation for translate function
It says now that the function updates the settings to what they should be in the new version.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
f7ca489877 Rename exportTo -> export
Because exportTo doesn't make sense if there is no parameter to which we're exporting.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
f2f993916d Rename import/export functions
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.
2016-07-07 13:46:39 +02:00
Ghostkeeper
fdf37c2ab0 Codestyle: Start comments with space
Forgot this one.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
7ad2fbc95d Codestyle: Start comments with space
We didn't really discuss this one, but apparently it's in PEP8 so I'd better do it.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
0e92929be4 Codestyle: Wrap doxygen documentation at 80 chars
Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
41ee575cc1 Correct copyright year
These files were made in 2016.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
cce642a3e1 Extrapolate settings translations
It is now in one place. Or rather, two: There is another function to translate only setting names.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
f7be4831b8 Add translation for combing
Combing was made into an enum instead of a boolean.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
17f4703337 Fix self parameter
It must have access to self to get the values to store in the file.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
149e873eb6 Pass strings to writing configparser
When setting fields in configparser, it must be a string. No ints.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
aeecdd9e0e Add self to parameters of function
Yeah this was a method, not a static method.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
816e94c760 Fix multiple exceptions
Turns out that this syntax needs to be surrounded in brackets.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
ccf9796b51 Remove superfluous import
Preferences doesn't exist any more.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
724f9ce010 Return None if config file wasn't correct
This was actually specified in the original function description.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
0d553c10f1 Fix import of SettingsError
It is in a submodule.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
9bc5f97902 Implement conversion of profiles 2.1->2.2
This works more or less the same as for machine instances. The code was copied from version 2.1 of the unserialise function of profiles, and optimised a bit. The output function is written from scratch. It has some code duplication. Maybe we have to do something about that.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
00f356f06e Add translation of speed_support_lines
This setting had its key changed to speed_support_infill

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
242559bd7e Remove preferences upgrade from 2.1->2.2
No preferences will need to be upgraded.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
b643fe8fd0 Translucent translation of machine instances
Machine instances are translucently translated from version 1 to version 2. No setting changes are applied yet, nor has the format itself changed.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
2f4e63a944 Add boilerplate version upgrade plug-in
This plug-in does nothing at the moment. It merely says that it is able to upgrade configuration from version 2.1 to 2.2, but then raises exceptions when you actually try to use it. This is by design. I will now implement the functions that do the conversion.

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