From d6df8084f4a0fe8c8e174ea230d158512bd8f094 Mon Sep 17 00:00:00 2001 From: Kaalleen Date: Thu, 24 Jun 2021 22:25:13 +0200 Subject: add start markers, add troubleshoot pattern warning and fix wxpython language issue --- lib/elements/pattern.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lib/elements/pattern.py (limited to 'lib/elements/pattern.py') diff --git a/lib/elements/pattern.py b/lib/elements/pattern.py new file mode 100644 index 00000000..98f29456 --- /dev/null +++ b/lib/elements/pattern.py @@ -0,0 +1,32 @@ +# Authors: see git history +# +# Copyright (c) 2010 Authors +# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. + +import inkex + +from ..i18n import _ +from .element import EmbroideryElement +from .validation import ObjectTypeWarning + + +class PatternWarning(ObjectTypeWarning): + name = _("Pattern Element") + description = _("This element will only be stitched out as a pattern within the specified object.") + steps_to_solve = [ + _("If you want to remove the pattern configuration for a pattern object follow these steps:"), + _("* Select pattern element(s)"), + _('* Run Extensions > Ink/Stitch > Troubleshoot > Remove embroidery settings...'), + _('* Make sure "Remove params" is enables'), + _('* Click "Apply"') + ] + + +class PatternObject(EmbroideryElement): + + def validation_warnings(self): + repr_point = next(inkex.Path(self.parse_path()).end_points) + yield PatternWarning(repr_point) + + def to_patches(self, last_patch): + return [] -- cgit v1.2.3 From ecacb9829e9c2b7050486707211f9d176aafdf75 Mon Sep 17 00:00:00 2001 From: Kaalleen Date: Mon, 28 Jun 2021 20:05:50 +0200 Subject: pattern markers --- lib/elements/pattern.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/elements/pattern.py') diff --git a/lib/elements/pattern.py b/lib/elements/pattern.py index 98f29456..c66ffbdc 100644 --- a/lib/elements/pattern.py +++ b/lib/elements/pattern.py @@ -30,3 +30,7 @@ class PatternObject(EmbroideryElement): def to_patches(self, last_patch): return [] + + +def is_pattern(node): + return "marker-start:url(#inkstitch-pattern-marker)" in node.get('style', '') -- cgit v1.2.3 From a152e1edea19ae16f8226032f9cd2ded004b168c Mon Sep 17 00:00:00 2001 From: Kaalleen Date: Tue, 29 Jun 2021 21:00:45 +0200 Subject: only check embroiderable tags for pattern marker --- lib/elements/pattern.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/elements/pattern.py') diff --git a/lib/elements/pattern.py b/lib/elements/pattern.py index c66ffbdc..fa54b7ba 100644 --- a/lib/elements/pattern.py +++ b/lib/elements/pattern.py @@ -6,6 +6,7 @@ import inkex from ..i18n import _ +from ..svg.tags import EMBROIDERABLE_TAGS from .element import EmbroideryElement from .validation import ObjectTypeWarning @@ -33,4 +34,6 @@ class PatternObject(EmbroideryElement): def is_pattern(node): + if node.tag not in EMBROIDERABLE_TAGS: + return False return "marker-start:url(#inkstitch-pattern-marker)" in node.get('style', '') -- cgit v1.2.3 From 52d9ee6a6d97b2ea752f5fdd3080a160a3574f82 Mon Sep 17 00:00:00 2001 From: Kaalleen Date: Wed, 30 Jun 2021 14:05:13 +0200 Subject: structuring --- lib/elements/pattern.py | 7 ------- 1 file changed, 7 deletions(-) (limited to 'lib/elements/pattern.py') diff --git a/lib/elements/pattern.py b/lib/elements/pattern.py index fa54b7ba..98f29456 100644 --- a/lib/elements/pattern.py +++ b/lib/elements/pattern.py @@ -6,7 +6,6 @@ import inkex from ..i18n import _ -from ..svg.tags import EMBROIDERABLE_TAGS from .element import EmbroideryElement from .validation import ObjectTypeWarning @@ -31,9 +30,3 @@ class PatternObject(EmbroideryElement): def to_patches(self, last_patch): return [] - - -def is_pattern(node): - if node.tag not in EMBROIDERABLE_TAGS: - return False - return "marker-start:url(#inkstitch-pattern-marker)" in node.get('style', '') -- cgit v1.2.3 From 8eba84a239ce655f32f131d6a82e3142693edd47 Mon Sep 17 00:00:00 2001 From: Kaalleen Date: Wed, 30 Jun 2021 21:47:33 +0200 Subject: update pattern troubleshoot description --- lib/elements/pattern.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/elements/pattern.py') diff --git a/lib/elements/pattern.py b/lib/elements/pattern.py index 98f29456..a32e72c0 100644 --- a/lib/elements/pattern.py +++ b/lib/elements/pattern.py @@ -12,13 +12,14 @@ from .validation import ObjectTypeWarning class PatternWarning(ObjectTypeWarning): name = _("Pattern Element") - description = _("This element will only be stitched out as a pattern within the specified object.") + description = _("This element will not be embroidered. " + "It will appear as a pattern in objects of it's group in the object panel. " + "Sub-group objects will be ignored.") steps_to_solve = [ - _("If you want to remove the pattern configuration for a pattern object follow these steps:"), - _("* Select pattern element(s)"), - _('* Run Extensions > Ink/Stitch > Troubleshoot > Remove embroidery settings...'), - _('* Make sure "Remove params" is enables'), - _('* Click "Apply"') + _("Turn the pattern marker off:"), + _('* Open the Fill and Stroke panel (Objects > Fill and Stroke)'), + _('* Go to the Stroke style tab'), + _('* Under "Markers" choose the first (empty) option in the first dropdown list.') ] -- cgit v1.2.3 From 736e10240a5c8357fac449371f8ac7451b7696b0 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Wed, 30 Jun 2021 19:48:51 -0400 Subject: slight wording adjustment --- lib/elements/pattern.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/elements/pattern.py') diff --git a/lib/elements/pattern.py b/lib/elements/pattern.py index a32e72c0..95ce81a1 100644 --- a/lib/elements/pattern.py +++ b/lib/elements/pattern.py @@ -13,10 +13,10 @@ from .validation import ObjectTypeWarning class PatternWarning(ObjectTypeWarning): name = _("Pattern Element") description = _("This element will not be embroidered. " - "It will appear as a pattern in objects of it's group in the object panel. " - "Sub-group objects will be ignored.") + "It will appear as a pattern applied to objects in the same group as it. " + "Objects in sub-groups will be ignored.") steps_to_solve = [ - _("Turn the pattern marker off:"), + _("To disable pattern mode, remove the pattern marker:"), _('* Open the Fill and Stroke panel (Objects > Fill and Stroke)'), _('* Go to the Stroke style tab'), _('* Under "Markers" choose the first (empty) option in the first dropdown list.') -- cgit v1.2.3 From 923ff3cb97c764f9999ac908c9b3aa321fd02301 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sat, 7 Aug 2021 12:37:17 -0400 Subject: fix more patch references --- lib/elements/pattern.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/elements/pattern.py') diff --git a/lib/elements/pattern.py b/lib/elements/pattern.py index 95ce81a1..4b92d366 100644 --- a/lib/elements/pattern.py +++ b/lib/elements/pattern.py @@ -29,5 +29,5 @@ class PatternObject(EmbroideryElement): repr_point = next(inkex.Path(self.parse_path()).end_points) yield PatternWarning(repr_point) - def to_patches(self, last_patch): + def to_stitch_groups(self, last_patch): return [] -- cgit v1.2.3