mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 21:19:01 +08:00
Do not allow restore different version
This commit is contained in:
parent
7b3f334678
commit
a0d3dae920
@ -14,6 +14,7 @@ from UM.Logger import Logger
|
||||
from UM.Message import Message
|
||||
from UM.Platform import Platform
|
||||
from UM.Resources import Resources
|
||||
from UM.Version import Version
|
||||
from cura.CuraApplication import CuraApplication
|
||||
|
||||
|
||||
@ -116,7 +117,12 @@ class Backup:
|
||||
"Tried to restore a Cura backup without having proper data or meta data."))
|
||||
return False
|
||||
|
||||
# TODO: handle restoring older data version.
|
||||
current_version = CuraApplication.getInstance().getVersion()
|
||||
version_to_restore = self.meta_data.get("cura_release", "master")
|
||||
if current_version != version_to_restore:
|
||||
# Cannot restore version older or newer than current because settings might have changed.
|
||||
# Restoring this will cause a lot of issues so we don't allow this for now.
|
||||
return False
|
||||
|
||||
version_data_dir = Resources.getDataStoragePath()
|
||||
archive = ZipFile(io.BytesIO(self.zip_file), "r")
|
||||
|
Loading…
x
Reference in New Issue
Block a user