no message

This commit is contained in:
Mario Voigt 2020-08-23 16:22:46 +02:00
parent 775b3effc0
commit dc5995fbf9
2 changed files with 22 additions and 10 deletions

View File

@ -5,7 +5,7 @@
<label>Running this extension works for current selection or if nothing is selected for whole document. It allows to flatten elements into one group and to drop elements while processing. Some element IDs might change while doing.</label>
<label>Enable the checkbox "Ignore custom element types" to ignore custom selections, or disable it and select items you want to drop while ungrouping. Unchecked elements will be dropped.</label>
<separator/>
<label appearance="header">Custom Element Types</label>
<label appearance="header">Custom Element Types To Keep</label>
<hbox>
<vbox>
<label appearance="header">Geometry</label>
@ -19,15 +19,12 @@
</vbox>
<separator/>
<vbox>
<label appearance="header">Objects / Misc</label>
<param name="clipPath" type="bool" gui-text="clipPath">true</param>
<param name="defs" type="bool" gui-text="defs">true</param>
<param name="image" type="bool" gui-text="image">true</param>
<param name="script" type="bool" gui-text="script">true</param>
<param name="svg" type="bool" gui-text="svg">true</param>
<label appearance="header">Text</label>
<param name="text" type="bool" gui-text="text">true</param>
<param name="tspan" type="bool" gui-text="tspan">true</param>
<param name="use" type="bool" gui-text="use">true</param>
<param name="flowRoot" type="bool" gui-text="flowRoot">true</param>
<param name="flowRegion" type="bool" gui-text="flowRegion">true</param>
<param name="flowPara" type="bool" gui-text="flowPara">true</param>
</vbox>
<separator/>
<vbox>
@ -39,6 +36,16 @@
<param name="meshpatch" type="bool" gui-text="meshpatch">true</param>
<param name="stop" type="bool" gui-text="stop">true</param>
</vbox>
<separator/>
<vbox>
<label appearance="header">Objects / Misc</label>
<param name="clipPath" type="bool" gui-text="clipPath">true</param>
<param name="defs" type="bool" gui-text="defs">true</param>
<param name="image" type="bool" gui-text="image">true</param>
<param name="script" type="bool" gui-text="script">true</param>
<param name="svg" type="bool" gui-text="svg">true</param>
<param name="use" type="bool" gui-text="use">true</param>
</vbox>
</hbox>
<separator/>
<param name="allitems" type="bool" gui-text="Ignore custom element types">true</param>

View File

@ -26,7 +26,6 @@ class MigrateGroups(inkex.Effect):
self.arg_parser.add_argument("--allitems", type=inkex.Boolean, default=True)
self.arg_parser.add_argument("--droponly", type=inkex.Boolean, default=False)
self.arg_parser.add_argument("--showdroplist", type=inkex.Boolean, default=False)
self.arg_parser.add_argument("--circle", type=inkex.Boolean, default=True)
self.arg_parser.add_argument("--clipPath", type=inkex.Boolean, default=True)
self.arg_parser.add_argument("--defs", type=inkex.Boolean, default=True)
@ -49,7 +48,10 @@ class MigrateGroups(inkex.Effect):
self.arg_parser.add_argument("--script", type=inkex.Boolean, default=True)
self.arg_parser.add_argument("--stop", type=inkex.Boolean, default=True)
self.arg_parser.add_argument("--use", type=inkex.Boolean, default=True)
self.arg_parser.add_argument("--flowRoot", type=inkex.Boolean, default=True)
self.arg_parser.add_argument("--flowRegion", type=inkex.Boolean, default=True)
self.arg_parser.add_argument("--flowPara", type=inkex.Boolean, default=True)
def effect(self):
namespace = []
namespace.append("{http://www.w3.org/2000/svg}circle") if self.options.circle else ""
@ -74,6 +76,9 @@ class MigrateGroups(inkex.Effect):
namespace.append("{http://www.w3.org/2000/svg}script") if self.options.script else ""
namespace.append("{http://www.w3.org/2000/svg}stop") if self.options.stop else ""
namespace.append("{http://www.w3.org/2000/svg}use") if self.options.use else ""
namespace.append("{http://www.w3.org/2000/svg}flowRoot") if self.options.flowRoot else ""
namespace.append("{http://www.w3.org/2000/svg}flowRegion") if self.options.flowRegion else ""
namespace.append("{http://www.w3.org/2000/svg}flowPara") if self.options.flowPara else ""
#check if we have selected elements or if we should parse the whole document instead
selected = [] #list of elements to parse