Attacher: add command to Part workbench menu

+ add an icon to attachment editor
This commit is contained in:
DeepSOIC 2016-05-17 01:55:02 +03:00 committed by wmayer
parent 7f5197695d
commit 554d3736f9
5 changed files with 199 additions and 3 deletions

View File

@ -71,7 +71,8 @@ def editAttachment(feature = None,
class CommandEditAttachment:
'Command to edit attachment'
def GetResources(self):
return {'MenuText': QtCore.QT_TRANSLATE_NOOP("AttachmentEditor","Attachment..."),
return {'Pixmap': ':/icons/Part_Attachment.svg',
'MenuText': QtCore.QT_TRANSLATE_NOOP("AttachmentEditor","Attachment..."),
'Accel': "",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("AttachmentEditor","Edit attachment of selected object.")}

View File

@ -201,7 +201,7 @@ class AttachmentEditorTaskPanel(FrozenClass):
import os
self.form=uic.loadUi(os.path.dirname(__file__) + os.path.sep + 'TaskAttachmentEditor.ui')
# self.form.setWindowIcon(QtGui.QIcon(':/icons/PartDesign_InternalExternalGear.svg'))
self.form.setWindowIcon(QtGui.QIcon(':/icons/Part_Attachment.svg'))
self.form.setWindowTitle(_translate('AttachmentEditor',"Attachment",None))
self.refLines = [self.form.lineRef1,

View File

@ -3,6 +3,7 @@
<file>icons/PartFeature.svg</file>
<file>icons/PartFeature.xpm</file>
<file>icons/PartFeatureImport.xpm</file>
<file>icons/Part_Attachment.svg</file>
<file>icons/Part_Booleans.svg</file>
<file>icons/Part_Box.svg</file>
<file>icons/Part_Chamfer.svg</file>

View File

@ -0,0 +1,194 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64px"
height="64px"
id="svg2726"
sodipodi:version="0.32"
inkscape:version="0.48.4 r9939"
sodipodi:docname="Snap_Near.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1">
<defs
id="defs2728">
<linearGradient
id="linearGradient3766">
<stop
style="stop-color:#004bed;stop-opacity:1;"
offset="0"
id="stop3768" />
<stop
style="stop-color:#bbd7ff;stop-opacity:1;"
offset="1"
id="stop3770" />
</linearGradient>
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 32 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="64 : 32 : 1"
inkscape:persp3d-origin="32 : 21.333333 : 1"
id="perspective2734" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3144-4"
id="radialGradient3850-9"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
cx="225.26402"
cy="672.79736"
fx="225.26402"
fy="672.79736"
r="34.345188" />
<linearGradient
inkscape:collect="always"
id="linearGradient3144-4">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop3146-2" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop3148-0" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3766"
id="linearGradient3772"
x1="21.905107"
y1="26.587624"
x2="42.1202"
y2="26.587624"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3766"
id="linearGradient3774"
x1="-670.94934"
y1="-470.34324"
x2="-296.345"
y2="-470.34324"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.8890873"
inkscape:cx="-25.494424"
inkscape:cy="53.665776"
inkscape:current-layer="g4289"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1920"
inkscape:window-height="986"
inkscape:window-x="-11"
inkscape:window-y="-11"
inkscape:window-maximized="1" />
<metadata
id="metadata2731">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
id="g4289"
transform="matrix(0.1621282,0,0,0.1621282,6.3605986,-66.108806)">
<g
transform="translate(-1.4317723,-2.9082522)"
id="g3776-0"
style="stroke:#ffffff;stroke-width:37.00775065999999900;stroke-miterlimit:4;stroke-dasharray:none;stroke-linecap:round;stroke-opacity:1">
<path
transform="matrix(6.1679584,0,0,6.1679584,-39.231908,407.75637)"
inkscape:connector-curvature="0"
id="path3758-6"
d="M 51.683077,25.430539 C 54.768634,32.887302 46.797612,48.315086 49.36891,44.20101"
style="fill:none;stroke:#ffffff;stroke-width:6.00000003999999980;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
transform="matrix(6.1679584,0,0,6.1679584,-39.231908,407.75637)"
inkscape:connector-curvature="0"
id="path3760-1"
d="M 20.05612,25.17341 C 24.941585,16.945258 35.741034,15.14535 35.741034,15.14535"
style="fill:none;stroke:#ffffff;stroke-width:6.00000003999999980;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
sodipodi:nodetypes="cc"
transform="matrix(6.1679584,0,0,6.1679584,-39.231908,407.75637)"
inkscape:connector-curvature="0"
id="path3762-3"
d="M 28.027141,31.087393 C 29.171402,23.677761 39.824421,20.298174 39.85511,20.287944"
style="fill:none;stroke:#ffffff;stroke-width:6.00000003999999980;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
transform="matrix(6.1679584,0,0,6.1679584,-39.231908,407.75637)"
inkscape:connector-curvature="0"
id="path3764-8"
d="m 44.483445,27.230447 c 0.514259,5.913984 -7.713892,14.142136 -4.371206,10.54232"
style="fill:none;stroke:#ffffff;stroke-width:6.00000003999999980;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
</g>
<path
style="fill:none;stroke:#ff0000;stroke-width:18.50387573;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 84.473406,563.02492 C 114.60675,512.27402 181.2173,501.17226 181.2173,501.17226"
id="path3760"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#ff0000;stroke-width:18.50387573;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 235.14013,575.71263 c 3.17193,36.47721 -15.85965,47.57897 -26.96142,65.0246"
id="path3764"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<rect
style="color:#000000;fill:url(#linearGradient3774);fill-opacity:1;fill-rule:nonzero;stroke:#002e2e;stroke-width:18.50414658000000000;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect3942-4-9-9"
width="356.10019"
height="75.650246"
x="-661.69727"
y="-508.16837"
transform="matrix(-0.84147607,-0.54029438,0.53382966,-0.84559204,0,0)" />
<path
sodipodi:type="arc"
style="color:#000000;fill:url(#linearGradient3772);fill-opacity:1;fill-rule:nonzero;stroke:#002e2e;stroke-width:2.47313976000000000;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="path2998"
sodipodi:cx="32.012653"
sodipodi:cy="26.587624"
sodipodi:rx="8.8709764"
sodipodi:ry="8.8709764"
d="m 40.88363,26.587624 a 8.8709764,8.8709764 0 1 1 -17.741953,0 8.8709764,8.8709764 0 1 1 17.741953,0 z"
transform="matrix(7.4841974,0,0,7.4796769,6.8155747,314.62226)" />
<path
style="fill:none;stroke:#ff0000;stroke-width:18.50387573;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 279.54716,564.61088 c 21.25384,42.05943 10.63605,87.30118 -19.03158,114.18951"
id="path3758"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#ff0000;stroke-width:18.50387573;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 133.63833,599.50212 c 5.75535,-38.70724 40.00347,-59.68242 72.95442,-66.61056"
id="path3762"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -82,7 +82,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
<< "Part_CrossSections" << "Part_Compound" << "Part_MakeFace" << "Part_Extrude"
<< "Part_Revolve" << "Part_Mirror" << "Part_Fillet" << "Part_Chamfer"
<< "Part_RuledSurface" << "Part_Loft" << "Part_Sweep"
<< "Part_Offset" << "Part_Thickness";
<< "Part_Offset" << "Part_Thickness" << "Separator" << "Part_EditAttachment";
Gui::MenuItem* measure = new Gui::MenuItem;
root->insertItem(item,measure);