24 Commits

Author SHA1 Message Date
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
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
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
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
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
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
51aa82bd6c Use preferences upgrader
Instead of the placeholder.

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
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
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
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
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
ccf9796b51 Remove superfluous import
Preferences doesn't exist any more.

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
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