mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-01 06:41:06 -07:00
Do not allow restore different version
This commit is contained in:
parent
7b3f334678
commit
a0d3dae920
1 changed files with 7 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ from UM.Logger import Logger
|
||||||
from UM.Message import Message
|
from UM.Message import Message
|
||||||
from UM.Platform import Platform
|
from UM.Platform import Platform
|
||||||
from UM.Resources import Resources
|
from UM.Resources import Resources
|
||||||
|
from UM.Version import Version
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -116,7 +117,12 @@ class Backup:
|
||||||
"Tried to restore a Cura backup without having proper data or meta data."))
|
"Tried to restore a Cura backup without having proper data or meta data."))
|
||||||
return False
|
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()
|
version_data_dir = Resources.getDataStoragePath()
|
||||||
archive = ZipFile(io.BytesIO(self.zip_file), "r")
|
archive = ZipFile(io.BytesIO(self.zip_file), "r")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue