diff options
Diffstat (limited to 'lib/extensions/base.py')
| -rw-r--r-- | lib/extensions/base.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/extensions/base.py b/lib/extensions/base.py index 70ca4701..8d5cccad 100644 --- a/lib/extensions/base.py +++ b/lib/extensions/base.py @@ -117,15 +117,17 @@ class InkstitchExtension(inkex.Effect): if g.get(INKSCAPE_GROUPMODE) == "layer": g.set("style", "display:none") - def ensure_current_layer(self): + def get_current_layer(self): # if no layer is selected, inkex defaults to the root, which isn't # particularly useful - if self.svg.get_current_layer() is self.document.getroot(): + current_layer = self.svg.get_current_layer() + if current_layer is self.document.getroot(): try: - self.current_layer = self.document.xpath(".//svg:g[@inkscape:groupmode='layer']", namespaces=inkex.NSS)[0] + current_layer = self.document.xpath(".//svg:g[@inkscape:groupmode='layer']", namespaces=inkex.NSS)[0] except IndexError: # No layers at all?? Fine, we'll stick with the default. pass + return current_layer def no_elements_error(self): if self.svg.selected: @@ -134,7 +136,7 @@ class InkstitchExtension(inkex.Effect): else: inkex.errormsg(_("There are no objects in the entire document that Ink/Stitch knows how to work with.") + "\n") - inkex.errormsg(_("Tip: Select some objects and use Path -> Object to Path to convert them to paths.") + "\n") + inkex.errormsg(_("Tip: Run Extensions > Ink/Stitch > Troubleshoot > Troubleshoot Objects") + "\n") def descendants(self, node, selected=False, troubleshoot=False): # noqa: C901 nodes = [] |
