Skip to content

Commit

Permalink
Move top level icon in to fembygen/icons` #44
Browse files Browse the repository at this point in the history
  • Loading branch information
Serince committed Nov 17, 2023
1 parent 36fd1b5 commit 303e564
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
24 changes: 15 additions & 9 deletions InitGui.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
import FreeCAD, FreeCADGui
import FreeCAD
import FreeCADGui


class FEMbyGEN(Workbench):
MenuText = "FEMbyGEN"
ToolTip = "Parametric FEM analysis"
Icon = FreeCAD.getUserAppDataDir() + "Mod/FEMbyGEN/icon.svg"
"FEMbyGEN workbench object"

def __init__(self):
self.__class__.Icon = FreeCAD.getUserAppDataDir() + "Mod/FEMbyGEN/fembygen/icons/icon.svg"
self.__class__.MenuText = "FEMbyGEN"
self.__class__.ToolTip = "Parametric FEM analysis"

from PySide import QtCore
ICONS_PATH = FreeCAD.getUserAppDataDir() + "Mod/FEMbyGEN/fembygen/icons/"
QtCore.QDir.addSearchPath("icons", ICONS_PATH)

def Initialize(self):
"""This function is executed when FreeCAD starts"""

from fembygen import Initiate, Alias, Generate, FEA,createGeo, Results, Topology
FreeCADGui.addIconPath(FreeCAD.getUserAppDataDir() + "Mod/FEMbyGEN/fembygen/icons/")

self.list = ["Initiate", "Alias","Generate", "FEA","createGeo", "Results", "Topology"] # A list of command names created in the line above
from fembygen import Initiate, Alias, Generate, FEA, createGeo, Results, Topology
self.list = ["Initiate", "Alias", "Generate", "FEA", "createGeo", "Results",
"Topology"] # A list of command names created in the line above

self.appendToolbar("Commands", self.list) # creates a new toolbar with your commands
self.appendMenu("FEMbyGEN", self.list) # creates a new menu


def Activated(self):
"""This function is executed when the workbench is activated"""
return
Expand Down
2 changes: 1 addition & 1 deletion fembygen/Initiate.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(self, vobj):
vobj.Proxy = self

def getIcon(self):
icon_path = FreeCAD.getUserAppDataDir() + "Mod/FEMbyGEN/icon.svg"
icon_path = FreeCAD.getUserAppDataDir() + 'Mod/FEMbyGEN/fembygen/icons/Initiate.svg'
return icon_path

def attach(self, vobj):
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ version=2.0
tracker=https://forum.freecadweb.org/viewtopic.php?f=18&t=71905
repository=https://github.com/Serince/FEMbyGEN
license=LGPL
icon="icon.svg"
icon="fembygen/icons/icon.svg"

[dependencies]
workbenches=FemWorkbench
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<workbench>
<classname>FEMbyGEN</classname>
<subdirectory>./</subdirectory>
<icon>icon.svg</icon>
<icon>fembygen/icons/icon.svg</icon>
<tag>FEM</tag>
<tag>FEA</tag>
<tag>solver</tag>
Expand Down

0 comments on commit 303e564

Please sign in to comment.