From 903428106f7e22ace036068b68881d671218b1f4 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Wed, 22 Jan 2025 18:27:25 +0100 Subject: do not request update for legacy fonts (#3456) --- lib/update.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/update.py') diff --git a/lib/update.py b/lib/update.py index a0bdb084..33ae6cc7 100644 --- a/lib/update.py +++ b/lib/update.py @@ -16,7 +16,7 @@ from .svg.tags import EMBROIDERABLE_TAGS, INKSTITCH_ATTRIBS INKSTITCH_SVG_VERSION = 3 -def update_inkstitch_document(svg, selection=None): +def update_inkstitch_document(svg, selection=None, warn_unversioned=True): document = svg.getroot() # get the inkstitch svg version from the document search_string = "//*[local-name()='inkstitch_svg_version']//text()" @@ -54,17 +54,18 @@ def update_inkstitch_document(svg, selection=None): update_legacy_params(EmbroideryElement(element), file_version, INKSTITCH_SVG_VERSION) else: # this is the automatic update when a legacy inkstitch svg version was recognized - automatic_version_update(document, file_version, INKSTITCH_SVG_VERSION) + automatic_version_update(document, file_version, INKSTITCH_SVG_VERSION, warn_unversioned) _update_inkstitch_svg_version(svg) -def automatic_version_update(document, file_version, INKSTITCH_SVG_VERSION): +def automatic_version_update(document, file_version, INKSTITCH_SVG_VERSION, warn_unversioned): # make sure the user really wants to update if file_version == 0: - do_update = RequestUpdate() - if do_update.cancelled is True: - return + if warn_unversioned: + do_update = RequestUpdate() + if do_update.cancelled is True: + return # well then, let's update legeacy params for element in document.iterdescendants(): if element.tag in EMBROIDERABLE_TAGS: -- cgit v1.2.3