Draft: move PathLinkArray GuiCommand to gui_patharray module

This commit is contained in:
vocx-fc
2020-04-10 00:03:00 -05:00
committed by Yorik van Havre
parent f58212c07d
commit 720dc919c3
2 changed files with 27 additions and 12 deletions

View File

@@ -191,19 +191,9 @@ from draftguitools.gui_draft2sketch import Draft2Sketch
from draftguitools.gui_array_simple import Array
from draftguitools.gui_array_simple import LinkArray
from draftguitools.gui_patharray import PathArray
from draftguitools.gui_patharray import PathLinkArray
class PathLinkArray(PathArray):
"The PathLinkArray FreeCAD command definition"
def __init__(self):
PathArray.__init__(self,True)
def GetResources(self):
return {'Pixmap' : 'Draft_PathLinkArray',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Draft_PathLinkArray", "PathLinkArray"),
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Draft_PathLinkArray", "Creates links of a selected object along a selected path.")}
class PointArray(Modifier):
"""The PointArray FreeCAD command definition"""
@@ -436,7 +426,6 @@ from draftguitools.gui_snaps import ShowSnapBar
# modification commands
FreeCADGui.addCommand('Draft_Clone',Draft_Clone())
FreeCADGui.addCommand('Draft_PathLinkArray',PathLinkArray())
FreeCADGui.addCommand('Draft_PointArray',PointArray())
FreeCADGui.addCommand('Draft_Mirror',Mirror())

View File

@@ -109,3 +109,29 @@ class PathArray(gui_base_original.Modifier):
Gui.addCommand('Draft_PathArray', PathArray())
class PathLinkArray(PathArray):
"""Gui Command for the PathLinkArray tool based on the PathArray tool."""
def __init__(self):
super().__init__(use_link=True)
def GetResources(self):
"""Set icon, menu and tooltip."""
_menu = "Path Link array"
_tip = ("Like the PathArray tool, but creates a 'Link array' "
"instead.\n"
"A 'Link array' is more efficient when handling many copies "
"but the 'Fuse' option cannot be used.")
return {'Pixmap': 'Draft_PathLinkArray',
'MenuText': QT_TRANSLATE_NOOP("Draft_PathLinkArray", _menu),
'ToolTip': QT_TRANSLATE_NOOP("Draft_PathLinkArray", _tip)}
def Activated(self):
"""Execute when the command is called."""
super().Activated(name=_tr("Link path array"))
Gui.addCommand('Draft_PathLinkArray', PathLinkArray())