From 6a4c911b488fb9b73e6e1a85c6a670f6291ec1c0 Mon Sep 17 00:00:00 2001 From: DeepSOIC Date: Mon, 26 Oct 2015 02:35:53 +0300 Subject: [PATCH] Icons: Workbench icon, and hacky way of using it --- InitGui.py | 9 +- PyResources/icons/Lattice.svg | 273 ++++++++++++++++++++++++++++++++++ latticeDummy.py | 1 + 3 files changed, 282 insertions(+), 1 deletion(-) create mode 100644 PyResources/icons/Lattice.svg create mode 100644 latticeDummy.py diff --git a/InitGui.py b/InitGui.py index 72648d5..cd65472 100644 --- a/InitGui.py +++ b/InitGui.py @@ -21,7 +21,6 @@ #* * #*************************************************************************** - __Comment__ = 'Advanced array tools and parametric compounding tools' __Web__ = 'http://forum.freecadweb.org/viewtopic.php?f=22&t=12464' __Wiki__ = '' @@ -33,8 +32,16 @@ __Status__ = 'alpha' __Requires__ = 'freecad 0.16.5155' __Communication__ = 'vv.titov@gmail.com; DeepSOIC on FreeCAD forum' + + class LatticeWorkbench (Workbench): MenuText = 'Lattice' + def __init__(self): + # Hack: obtain path to Lattice by loading a dummy Py module + import os + import latticeDummy + self.__class__.Icon = os.path.dirname(latticeDummy.__file__) + u"/PyResources/icons/Lattice.svg".replace("/", os.path.sep) + def Initialize(self): cmdsArrayTools = [] cmdsCompoundTools = [] diff --git a/PyResources/icons/Lattice.svg b/PyResources/icons/Lattice.svg new file mode 100644 index 0000000..9d79293 --- /dev/null +++ b/PyResources/icons/Lattice.svg @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/latticeDummy.py b/latticeDummy.py new file mode 100644 index 0000000..f0103b5 --- /dev/null +++ b/latticeDummy.py @@ -0,0 +1 @@ +#just an empty module, that is used for determining path \ No newline at end of file