From 5ea98e5e89405645f6e36125056a131c923b0324 Mon Sep 17 00:00:00 2001
From: Kaalleen <36401965+kaalleen@users.noreply.github.com>
Date: Sun, 4 Jul 2021 11:45:06 +0200
Subject: convert satin to stroke (#1265)
---
templates/convert_to_stroke.xml | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 templates/convert_to_stroke.xml
(limited to 'templates')
diff --git a/templates/convert_to_stroke.xml b/templates/convert_to_stroke.xml
new file mode 100644
index 00000000..620258ba
--- /dev/null
+++ b/templates/convert_to_stroke.xml
@@ -0,0 +1,20 @@
+
+
+ {% trans %}Convert Satin to Stroke{% endtrans %}
+ org.inkstitch.convert_to_stroke.{{ locale }}
+ convert_to_stroke
+ {% trans %}Converts a satin column into a running stitch.{% endtrans %}
+ false
+
+ all
+
+
+
+
+
+
+
+
--
cgit v1.3.1
From 1f725f42bbd299b6e5192a5404471a4fd89ae7f8 Mon Sep 17 00:00:00 2001
From: Kaalleen <36401965+kaalleen@users.noreply.github.com>
Date: Wed, 21 Jul 2021 17:20:04 +0200
Subject: install custom palette extension (#1171)
---
lib/extensions/__init__.py | 2 ++
lib/extensions/install_custom_palette.py | 42 ++++++++++++++++++++++++++++++++
templates/install_custom_palette.xml | 20 +++++++++++++++
3 files changed, 64 insertions(+)
create mode 100644 lib/extensions/install_custom_palette.py
create mode 100644 templates/install_custom_palette.xml
(limited to 'templates')
diff --git a/lib/extensions/__init__.py b/lib/extensions/__init__.py
index 9a11e3bd..64e6af02 100644
--- a/lib/extensions/__init__.py
+++ b/lib/extensions/__init__.py
@@ -18,6 +18,7 @@ from .global_commands import GlobalCommands
from .import_threadlist import ImportThreadlist
from .input import Input
from .install import Install
+from .install_custom_palette import InstallCustomPalette
from .layer_commands import LayerCommands
from .lettering import Lettering
from .lettering_custom_font_dir import LetteringCustomFontDir
@@ -57,6 +58,7 @@ __all__ = extensions = [StitchPlanPreview,
Cleanup,
BreakApart,
ImportThreadlist,
+ InstallCustomPalette,
Simulator,
Reorder,
DuplicateParams,
diff --git a/lib/extensions/install_custom_palette.py b/lib/extensions/install_custom_palette.py
new file mode 100644
index 00000000..da546cad
--- /dev/null
+++ b/lib/extensions/install_custom_palette.py
@@ -0,0 +1,42 @@
+# Authors: see git history
+#
+# Copyright (c) 2021 Authors
+# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
+
+import os
+import shutil
+
+import inkex
+
+from ..i18n import _
+from ..utils import guess_inkscape_config_path
+from .base import InkstitchExtension
+
+
+class InstallCustomPalette(InkstitchExtension):
+ def __init__(self, *args, **kwargs):
+ InkstitchExtension.__init__(self, *args, **kwargs)
+ self.arg_parser.add_argument("-f", "--filepath", type=str, default="", dest="filepath")
+
+ def effect(self):
+ gpl = self.options.filepath
+ if not os.path.isfile(gpl):
+ inkex.errormsg(_("File does not exist."))
+
+ palette_name = os.path.basename(gpl)
+ if not palette_name.endswith('.gpl'):
+ inkex.errormsg(_("Wrong file type. Ink/Stitch only accepts gpl color palettes."))
+
+ if not palette_name.startswith('InkStitch'):
+ palette_name = 'InkStitch %s' % palette_name
+
+ palette_path = os.path.join(guess_inkscape_config_path(), 'palettes')
+
+ if not os.path.isdir(palette_path):
+ inkex.errormsg(_("Ink/Stitch cannot find your palette folder automatically. Please install your palette manually."))
+ dest = os.path.join(palette_path, palette_name)
+ shutil.copyfile(gpl, dest)
+
+ if not os.path.isfile(dest):
+ inkex.errormsg("Something wwent wrong. Ink/Stitch wasn't able to copy your palette "
+ "file into the Inkscape palettes folder. Please do it manually.")
diff --git a/templates/install_custom_palette.xml b/templates/install_custom_palette.xml
new file mode 100644
index 00000000..cb2865c7
--- /dev/null
+++ b/templates/install_custom_palette.xml
@@ -0,0 +1,20 @@
+
+
+ {% trans %}Install custom palette{% endtrans %}
+ org.inkstitch.install_custom_palette.{{ locale }}
+ install_custom_palette
+
+
+
+
+ all
+
+
+
+
+
+
+
+
--
cgit v1.3.1