Part: update icon, object and command for CompoundFilter

The previous icon did not follow the general style and colors
of other icons in the workbench.

If there is no `Stencil` in the `CompoundFilter` object, raise
a `ValueError` exception when the `FilterType` is `'collision-pass'`
or `'window-distance'`.

Raise an exception when `items` is empty, or has a malformed string,
when `Filtertype` is `'specific items'`.

Fix the `getNullShapeShape` function to return a simple
`Part.Shape`, so that there is no error raised if `_nullShapeShape`
doesn't exist. This function doesn't work at all. It was probably
a prototype which was never fully developed; it may be removed
completely in the future.

The docstrings for the commands `CompoundFilter` and `ExplodeCompound`
were revised.

Clean up the spacing of the code so that lines aren't very long.
This commit is contained in:
vocx-fc
2020-10-08 18:16:24 -05:00
committed by wwmayer
parent f439384ccb
commit 0eafaa3031
4 changed files with 571 additions and 200 deletions

View File

@@ -55,7 +55,9 @@ class _CommandExplodeCompound:
return {'Pixmap': "Part_ExplodeCompound",
'MenuText': QtCore.QT_TRANSLATE_NOOP("Part_ExplodeCompound", "Explode compound"),
'Accel': "",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Part_ExplodeCompound", "Explode compound: split up a list of shapes into separate objects")}
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Part_ExplodeCompound",
"Split up a compound of shapes into separate objects.\n"
"It will create a 'Compound Filter' for each shape.")}
def Activated(self):
if len(FreeCADGui.Selection.getSelection()) == 1:
@@ -63,7 +65,7 @@ class _CommandExplodeCompound:
else:
mb = QtGui.QMessageBox()
mb.setIcon(mb.Icon.Warning)
mb.setText(_translate("Part_ExplodeCompound", "Select a shape that is a compound, first!", None))
mb.setText(_translate("Part_ExplodeCompound", "First select a shape that is a compound.", None))
mb.setWindowTitle(_translate("Part_ExplodeCompound", "Bad selection", None))
mb.exec_()