summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/elements/element.py4
-rw-r--r--lib/extensions/cutwork_segmentation.py9
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/elements/element.py b/lib/elements/element.py
index 84141d4f..df9e1b95 100644
--- a/lib/elements/element.py
+++ b/lib/elements/element.py
@@ -343,7 +343,7 @@ class EmbroideryElement(object):
@property
@param('trim_after',
- _ ('Trim After'),
+ _('Trim After'),
tooltip=_('Add a TRIM command after stitching this object.'),
type='boolean',
default=False,
@@ -353,7 +353,7 @@ class EmbroideryElement(object):
@property
@param('stop_after',
- _ ('Stop After'),
+ _('Stop After'),
tooltip=_('Add a STOP command after stitching this object.'),
type='boolean',
default=False,
diff --git a/lib/extensions/cutwork_segmentation.py b/lib/extensions/cutwork_segmentation.py
index 672aeade..22b39e4b 100644
--- a/lib/extensions/cutwork_segmentation.py
+++ b/lib/extensions/cutwork_segmentation.py
@@ -61,9 +61,9 @@ class CutworkSegmentation(InkstitchExtension):
self.sectors = {index: sector for index, sector in self.sectors.items() if sector['start'] != sector['end']}
self.new_elements = []
+ parent = None
for element in self.elements:
if isinstance(element, Stroke):
-
# save parent and index to be able to position and insert new elements later on
parent = element.node.getparent()
index = parent.index(element.node)
@@ -73,8 +73,11 @@ class CutworkSegmentation(InkstitchExtension):
# fill self.new_elements list with line segments
self._prepare_line_sections(element, linestring.coords)
- self._insert_elements(parent, element, index)
+ if parent is None:
+ inkex.errormsg(_("Please select at least one element with a stroke color."))
+ return
+ self._insert_elements(parent, index)
self._remove_originals()
def _get_sectors(self, angle):
@@ -150,7 +153,7 @@ class CutworkSegmentation(InkstitchExtension):
# clear point_list in self.sectors
self.sectors[sector['id']].update({'point_list': []})
- def _insert_elements(self, parent, element, index):
+ def _insert_elements(self, parent, index):
self.new_elements.reverse()
if self.options.sort_by_color is True:
self.new_elements = sorted(self.new_elements, key=lambda x: x[1], reverse=True)