mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-24 06:39:38 +08:00

We now have a (format) version and a setting version. Ideally we'd like major-minor version numbers in our profiles. However, introducing major-minor version numbers requires substantial changes to the version upgrade manager to compare version numbers, find a path towards the current version, or even keeping track of the current version. Therefore we just collapse the two version numbers into one: Multiply the major version number by a million and you'll never exceed it in the minor versioning. The only problem is that we now have to update the versioning for all of our three upgrade plug-ins, because they all need to know locally how to find the version number of their file types (because the upgrade manager has no knowledge of the file types) and they have no access to each other because a plug-in may be disabled. Contributes to issue CURA-3427.
45 lines
1.7 KiB
Python
45 lines
1.7 KiB
Python
# Copyright (c) 2017 Ultimaker B.V.
|
|
# Cura is released under the terms of the AGPLv3 or higher.
|
|
|
|
from . import VersionUpgrade24to25
|
|
|
|
from UM.i18n import i18nCatalog
|
|
catalog = i18nCatalog("cura")
|
|
|
|
upgrade = VersionUpgrade25to26.VersionUpgrade25to26()
|
|
|
|
def getMetaData():
|
|
return {
|
|
"plugin": {
|
|
"name": catalog.i18nc("@label", "Version Upgrade 2.5 to 2.6"),
|
|
"author": "Ultimaker",
|
|
"version": "1.0",
|
|
"description": catalog.i18nc("@info:whatsthis", "Upgrades configurations from Cura 2.5 to Cura 2.6."),
|
|
"api": 3
|
|
},
|
|
"version_upgrade": {
|
|
# From To Upgrade function
|
|
("preferences", 4000000): ("preferences", 4000001, upgrade.upgradePreferences),
|
|
("quality", 2000000): ("quality", 2000001, upgrade.upgradeInstanceContainer),
|
|
("variant", 2000000): ("variant", 2000001, upgrade.upgradeInstanceContainer), #We can re-use upgradeContainerStack since there is nothing specific to quality, variant or user profiles being changed.
|
|
("user", 2000000): ("user", 2000001, upgrade.upgradeInstanceContainer)
|
|
},
|
|
"sources": {
|
|
"quality": {
|
|
"get_version": upgrade.getCfgVersion,
|
|
"location": {"./quality"}
|
|
},
|
|
"preferences": {
|
|
"get_version": upgrade.getCfgVersion,
|
|
"location": {"."}
|
|
},
|
|
"user": {
|
|
"get_version": upgrade.getCfgVersion,
|
|
"location": {"./user"}
|
|
}
|
|
}
|
|
}
|
|
|
|
def register(app):
|
|
return { "version_upgrade": upgrade }
|