Skip to content

Commit

Permalink
Add icon path to FreeCAD resources list
Browse files Browse the repository at this point in the history
  • Loading branch information
hasecilu committed Nov 16, 2024
1 parent 4d87de3 commit 38834ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
26 changes: 13 additions & 13 deletions freecad/gears/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def GetResources(self):
class CreateInvoluteGear(BaseCommand):
NAME = "InvoluteGear"
GEAR_FUNCTION = InvoluteGear
Pixmap = os.path.join(BaseCommand.ICONDIR, "involutegear.svg")
Pixmap = "involutegear"
MenuText = QT_TRANSLATE_NOOP("FCGear_InvoluteGear", "Involute Gear")
ToolTip = QT_TRANSLATE_NOOP(
"FCGear_InvoluteGear", "Create an external involute gear"
Expand All @@ -110,7 +110,7 @@ class CreateInvoluteGear(BaseCommand):
class CreateInternalInvoluteGear(BaseCommand):
NAME = "InternalInvoluteGear"
GEAR_FUNCTION = InternalInvoluteGear
Pixmap = os.path.join(BaseCommand.ICONDIR, "internalinvolutegear.svg")
Pixmap = "internalinvolutegear"
MenuText = QT_TRANSLATE_NOOP(
"FCGear_InternalInvoluteGear", "Internal Involute Gear"
)
Expand All @@ -122,47 +122,47 @@ class CreateInternalInvoluteGear(BaseCommand):
class CreateInvoluteRack(BaseCommand):
NAME = "InvoluteRack"
GEAR_FUNCTION = InvoluteGearRack
Pixmap = os.path.join(BaseCommand.ICONDIR, "involuterack.svg")
Pixmap = "involuterack"
MenuText = QT_TRANSLATE_NOOP("FCGear_InvoluteRack", "Involute Rack")
ToolTip = QT_TRANSLATE_NOOP("FCGear_InvoluteRack", "Create an Involute rack")


class CreateCycloidRack(BaseCommand):
NAME = "CycloidRack"
GEAR_FUNCTION = CycloidGearRack
Pixmap = os.path.join(BaseCommand.ICONDIR, "cycloidrack.svg")
Pixmap = "cycloidrack"
MenuText = QT_TRANSLATE_NOOP("FCGear_CycloidRack", "Cycloid Rack")
ToolTip = QT_TRANSLATE_NOOP("FCGear_CycloidRack", "Create an Cycloid rack")


class CreateCrownGear(BaseCommand):
NAME = "CrownGear"
GEAR_FUNCTION = CrownGear
Pixmap = os.path.join(BaseCommand.ICONDIR, "crowngear.svg")
Pixmap = "crowngear"
MenuText = QT_TRANSLATE_NOOP("FCGear_CrownGear", "Crown Gear")
ToolTip = QT_TRANSLATE_NOOP("FCGear_CrownGear", "Create a Crown gear")


class CreateCycloidGear(BaseCommand):
NAME = "CycloidGear"
GEAR_FUNCTION = CycloidGear
Pixmap = os.path.join(BaseCommand.ICONDIR, "cycloidgear.svg")
Pixmap = "cycloidgear"
MenuText = QT_TRANSLATE_NOOP("FCGear_CycloidGear", "Cycloid Gear")
ToolTip = QT_TRANSLATE_NOOP("FCGear_CycloidGear", "Create a Cycloid gear")


class CreateBevelGear(BaseCommand):
NAME = "BevelGear"
GEAR_FUNCTION = BevelGear
Pixmap = os.path.join(BaseCommand.ICONDIR, "bevelgear.svg")
Pixmap = "bevelgear"
MenuText = QT_TRANSLATE_NOOP("FCGear_BevelGear", "Bevel Gear")
ToolTip = QT_TRANSLATE_NOOP("FCGear_BevelGear", "Create a Bevel gear")


class CreateHypoCycloidGear(BaseCommand):
NAME = "HypocycloidGear"
GEAR_FUNCTION = HypoCycloidGear
Pixmap = os.path.join(BaseCommand.ICONDIR, "hypocycloidgear.svg")
Pixmap = "hypocycloidgear"
MenuText = QT_TRANSLATE_NOOP("FCGear_HypoCycloidGear", "HypoCycloid Gear")
ToolTip = QT_TRANSLATE_NOOP(
"FCGear_HypoCycloidGear", "Create a HypoCycloid gear with its pins"
Expand All @@ -172,39 +172,39 @@ class CreateHypoCycloidGear(BaseCommand):
class CreateWormGear(BaseCommand):
NAME = "WormGear"
GEAR_FUNCTION = WormGear
Pixmap = os.path.join(BaseCommand.ICONDIR, "wormgear.svg")
Pixmap = "wormgear"
MenuText = QT_TRANSLATE_NOOP("FCGear_WormGear", "Worm Gear")
ToolTip = QT_TRANSLATE_NOOP("FCGear_WormGear", "Create a Worm gear")


class CreateTimingGearT(BaseCommand):
NAME = "TimingGearT"
GEAR_FUNCTION = TimingGearT
Pixmap = os.path.join(BaseCommand.ICONDIR, "timinggear_t.svg")
Pixmap = "timinggear_t"
MenuText = QT_TRANSLATE_NOOP("FCGear_TimingGearT", "Timing Gear T-shape")
ToolTip = QT_TRANSLATE_NOOP("FCGear_TimingGearT", "Create a Timing gear T-shape")


class CreateTimingGear(BaseCommand):
NAME = "TimingGear"
GEAR_FUNCTION = TimingGear
Pixmap = os.path.join(BaseCommand.ICONDIR, "timinggear.svg")
Pixmap = "timinggear"
MenuText = QT_TRANSLATE_NOOP("FCGear_TimingGear", "Timing Gear")
ToolTip = QT_TRANSLATE_NOOP("FCGear_TimingGear", "Create a Timing gear")


class CreateLanternGear(BaseCommand):
NAME = "LanternGear"
GEAR_FUNCTION = LanternGear
Pixmap = os.path.join(BaseCommand.ICONDIR, "lanterngear.svg")
Pixmap = "lanterngear"
MenuText = QT_TRANSLATE_NOOP("FCGear_LanternGear", "Lantern Gear")
ToolTip = QT_TRANSLATE_NOOP("FCGear_LanternGear", "Create a Lantern gear")


class CreateGearConnector(BaseCommand):
NAME = "GearConnector"
GEAR_FUNCTION = GearConnector
Pixmap = os.path.join(BaseCommand.ICONDIR, "gearconnector.svg")
Pixmap = "gearconnector"
MenuText = QT_TRANSLATE_NOOP("FCGear_GearConnector", "Combine two gears")
ToolTip = QT_TRANSLATE_NOOP("FCGear_GearConnector", "Combine two gears")

Expand Down
2 changes: 2 additions & 0 deletions freecad/gears/init_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def Initialize(self):
CreateGearConnector,
)

gui.addIconPath(os.path.join(__dirname__, "icons"))

self.appendToolbar(QT_TRANSLATE_NOOP("Workbench", "Gear"), self.commands)
self.appendMenu(QT_TRANSLATE_NOOP("Workbench", "Gear"), self.commands)
gui.addCommand("FCGear_InvoluteGear", CreateInvoluteGear())
Expand Down

0 comments on commit 38834ac

Please sign in to comment.