work in progress on rewriting the XML <-> FreeCAD conversion of forms (model, form,types...)
This commit is contained in:
parent
55e472a6ad
commit
2bf8f79823
42
ReloadCommand.py
Normal file
42
ReloadCommand.py
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
import os
|
||||||
|
import FreeCAD
|
||||||
|
import FreeCADGui as Gui
|
||||||
|
import PySide
|
||||||
|
from PySide import QtGui
|
||||||
|
from importlib import reload
|
||||||
|
|
||||||
|
# This command is inserted into each workbench by AppCommand.py
|
||||||
|
|
||||||
|
def R():
|
||||||
|
# Clear the report view:
|
||||||
|
Gui.getMainWindow().findChild(QtGui.QTextEdit, "Report view").clear()
|
||||||
|
# Reload modules:
|
||||||
|
import XternalAppsParametricTool
|
||||||
|
import ReloadCommand
|
||||||
|
mods = [XternalAppsParametricTool, ReloadCommand]
|
||||||
|
for m in mods:
|
||||||
|
reload(m)
|
||||||
|
print(str(len(mods)) + "modules reloaded")
|
||||||
|
|
||||||
|
|
||||||
|
class ReloadCommand():
|
||||||
|
def __init__(self, appName):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def GetResources(self):
|
||||||
|
return {
|
||||||
|
'Pixmap': os.path.dirname(__file__) + '/icons/' + "reload.svg",
|
||||||
|
'Accel': "Shit+R", # R for Reload
|
||||||
|
'MenuText': "Reload XternalApps (developper tool)",
|
||||||
|
'ToolTip': "Reload some modules of the XternalApps workbenches, needed for development only.",
|
||||||
|
}
|
||||||
|
|
||||||
|
def Activated(self):
|
||||||
|
R()
|
||||||
|
|
||||||
|
def IsActive(self):
|
||||||
|
# return false to grey out the command in the menus, toolbars etc.
|
||||||
|
return True
|
||||||
|
|
||||||
|
def createCommands(appName):
|
||||||
|
Gui.addCommand('XternalAppsReload' + appName + 'Command', ReloadCommand(appName))
|
105
icons/reload.svg
Normal file
105
icons/reload.svg
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
<?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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="128"
|
||||||
|
height="128"
|
||||||
|
viewBox="0 0 33.866666 33.866668"
|
||||||
|
version="1.1"
|
||||||
|
id="svg8"
|
||||||
|
sodipodi:docname="Reload.svg"
|
||||||
|
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
|
||||||
|
<defs
|
||||||
|
id="defs2" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="2.2792969"
|
||||||
|
inkscape:cx="130.81861"
|
||||||
|
inkscape:cy="148.45922"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:window-width="1672"
|
||||||
|
inkscape:window-height="966"
|
||||||
|
inkscape:window-x="4"
|
||||||
|
inkscape:window-y="80"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
units="px"
|
||||||
|
inkscape:snap-page="true"
|
||||||
|
inkscape:object-paths="true"
|
||||||
|
inkscape:snap-midpoints="true"
|
||||||
|
inkscape:snap-intersection-paths="true"
|
||||||
|
inkscape:snap-global="true"
|
||||||
|
inkscape:snap-center="true" />
|
||||||
|
<metadata
|
||||||
|
id="metadata5">
|
||||||
|
<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
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(0,-263.13332)">
|
||||||
|
<path
|
||||||
|
sodipodi:type="spiral"
|
||||||
|
style="fill:none;fill-rule:evenodd;stroke:#006faa;stroke-width:1.3308152;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
id="path821"
|
||||||
|
sodipodi:cx="16.933332"
|
||||||
|
sodipodi:cy="280.06665"
|
||||||
|
sodipodi:expansion="1"
|
||||||
|
sodipodi:revolution="2.0066974"
|
||||||
|
sodipodi:radius="14.244047"
|
||||||
|
sodipodi:argument="-19.676287"
|
||||||
|
sodipodi:t0="0.75082588"
|
||||||
|
d="M 9.3661191,287.62416 C 4.3827724,283.58775 4.1082881,276.05079 8.1218179,271.24383 12.848674,265.58252 21.517367,265.30815 27.011766,270.00114" />
|
||||||
|
<path
|
||||||
|
inkscape:transform-center-y="-2.2460813"
|
||||||
|
inkscape:transform-center-x="2.6468119"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path933"
|
||||||
|
d="m 24.153283,265.50303 c 0.757709,2.27387 1.697396,3.40252 2.851513,4.49216 -1.491338,-0.56238 -2.91791,-0.91136 -5.293624,-0.59422"
|
||||||
|
style="fill:none;stroke:#006faa;stroke-width:1.3308152;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
sodipodi:nodetypes="ccc" />
|
||||||
|
<path
|
||||||
|
d="m -24.500546,-272.50914 c -4.983347,-4.03641 -5.257831,-11.57337 -1.244301,-16.38033 4.726856,-5.66131 13.39555,-5.93568 18.8899485,-1.2427"
|
||||||
|
sodipodi:t0="0.75082588"
|
||||||
|
sodipodi:argument="-19.676287"
|
||||||
|
sodipodi:radius="14.244047"
|
||||||
|
sodipodi:revolution="2.0066974"
|
||||||
|
sodipodi:expansion="1"
|
||||||
|
sodipodi:cy="-280.06665"
|
||||||
|
sodipodi:cx="-16.933332"
|
||||||
|
id="path946"
|
||||||
|
style="fill:none;fill-rule:evenodd;stroke:#006faa;stroke-width:1.3308152;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
sodipodi:type="spiral"
|
||||||
|
transform="scale(-1)" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="ccc"
|
||||||
|
style="fill:none;stroke:#006faa;stroke-width:1.3308152;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
|
d="m 9.7133862,294.63028 c -0.7577103,-2.27387 -1.6974012,-3.40253 -2.8515157,-4.49217 1.4913376,0.56238 2.9179073,0.91136 5.2936265,0.59423"
|
||||||
|
id="path950"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
inkscape:transform-center-x="-2.6468132"
|
||||||
|
inkscape:transform-center-y="2.2460808" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.0 KiB |
Loading…
Reference in New Issue
Block a user