From 7459dc03b286a7d2c4131cbefafad1085c391560 Mon Sep 17 00:00:00 2001 From: hasecilu Date: Sat, 16 Nov 2024 14:22:25 -0600 Subject: [PATCH] Add icon path to FreeCAD resources list Icons were renamed the same as the commands. --- freecad/gears/commands.py | 26 +++++++++---------- ...{gearworkbench.svg => FCGearWorkbench.svg} | 3 +++ ...rkbench_alt.svg => FCGearWorkbenchAlt.svg} | 17 +++++++----- .../{bevelgear.svg => FCGear_BevelGear.svg} | 4 +-- .../{crowngear.svg => FCGear_CrownGear.svg} | 4 +-- ...cycloidgear.svg => FCGear_CycloidGear.svg} | 4 +-- ...cycloidrack.svg => FCGear_CycloidRack.svg} | 4 +-- ...connector.svg => FCGear_GearConnector.svg} | 4 +-- ...oidgear.svg => FCGear_HypoCycloidGear.svg} | 4 +-- ...ar.svg => FCGear_InternalInvoluteGear.svg} | 4 +-- ...volutegear.svg => FCGear_InvoluteGear.svg} | 4 +-- ...voluterack.svg => FCGear_InvoluteRack.svg} | 4 +-- ...lanterngear.svg => FCGear_LanternGear.svg} | 4 +-- .../{timinggear.svg => FCGear_TimingGear.svg} | 4 +-- ...ggear_alt.svg => FCGear_TimingGearAlt.svg} | 4 +-- ...iminggear_t.svg => FCGear_TimingGearT.svg} | 4 +-- .../{wormgear.svg => FCGear_WormGear.svg} | 4 +-- freecad/gears/init_gui.py | 4 ++- 18 files changed, 57 insertions(+), 49 deletions(-) rename freecad/gears/icons/{gearworkbench.svg => FCGearWorkbench.svg} (99%) rename freecad/gears/icons/{gearworkbench_alt.svg => FCGearWorkbenchAlt.svg} (98%) rename freecad/gears/icons/{bevelgear.svg => FCGear_BevelGear.svg} (99%) rename freecad/gears/icons/{crowngear.svg => FCGear_CrownGear.svg} (99%) rename freecad/gears/icons/{cycloidgear.svg => FCGear_CycloidGear.svg} (99%) rename freecad/gears/icons/{cycloidrack.svg => FCGear_CycloidRack.svg} (99%) rename freecad/gears/icons/{gearconnector.svg => FCGear_GearConnector.svg} (99%) rename freecad/gears/icons/{hypocycloidgear.svg => FCGear_HypoCycloidGear.svg} (99%) rename freecad/gears/icons/{internalinvolutegear.svg => FCGear_InternalInvoluteGear.svg} (99%) rename freecad/gears/icons/{involutegear.svg => FCGear_InvoluteGear.svg} (99%) rename freecad/gears/icons/{involuterack.svg => FCGear_InvoluteRack.svg} (98%) rename freecad/gears/icons/{lanterngear.svg => FCGear_LanternGear.svg} (99%) rename freecad/gears/icons/{timinggear.svg => FCGear_TimingGear.svg} (99%) rename freecad/gears/icons/{timinggear_alt.svg => FCGear_TimingGearAlt.svg} (99%) rename freecad/gears/icons/{timinggear_t.svg => FCGear_TimingGearT.svg} (99%) rename freecad/gears/icons/{wormgear.svg => FCGear_WormGear.svg} (99%) diff --git a/freecad/gears/commands.py b/freecad/gears/commands.py index ed7b9ac..82f48b8 100644 --- a/freecad/gears/commands.py +++ b/freecad/gears/commands.py @@ -100,7 +100,7 @@ def GetResources(self): class CreateInvoluteGear(BaseCommand): NAME = "InvoluteGear" GEAR_FUNCTION = InvoluteGear - Pixmap = os.path.join(BaseCommand.ICONDIR, "involutegear.svg") + Pixmap = "FCGear_InvoluteGear" MenuText = QT_TRANSLATE_NOOP("FCGear_InvoluteGear", "Involute Gear") ToolTip = QT_TRANSLATE_NOOP( "FCGear_InvoluteGear", "Create an external involute gear" @@ -110,7 +110,7 @@ class CreateInvoluteGear(BaseCommand): class CreateInternalInvoluteGear(BaseCommand): NAME = "InternalInvoluteGear" GEAR_FUNCTION = InternalInvoluteGear - Pixmap = os.path.join(BaseCommand.ICONDIR, "internalinvolutegear.svg") + Pixmap = "FCGear_InternalInvoluteGear" MenuText = QT_TRANSLATE_NOOP( "FCGear_InternalInvoluteGear", "Internal Involute Gear" ) @@ -122,7 +122,7 @@ class CreateInternalInvoluteGear(BaseCommand): class CreateInvoluteRack(BaseCommand): NAME = "InvoluteRack" GEAR_FUNCTION = InvoluteGearRack - Pixmap = os.path.join(BaseCommand.ICONDIR, "involuterack.svg") + Pixmap = "FCGear_InvoluteRack" MenuText = QT_TRANSLATE_NOOP("FCGear_InvoluteRack", "Involute Rack") ToolTip = QT_TRANSLATE_NOOP("FCGear_InvoluteRack", "Create an Involute rack") @@ -130,7 +130,7 @@ class CreateInvoluteRack(BaseCommand): class CreateCycloidRack(BaseCommand): NAME = "CycloidRack" GEAR_FUNCTION = CycloidGearRack - Pixmap = os.path.join(BaseCommand.ICONDIR, "cycloidrack.svg") + Pixmap = "FCGear_CycloidRack" MenuText = QT_TRANSLATE_NOOP("FCGear_CycloidRack", "Cycloid Rack") ToolTip = QT_TRANSLATE_NOOP("FCGear_CycloidRack", "Create an Cycloid rack") @@ -138,7 +138,7 @@ class CreateCycloidRack(BaseCommand): class CreateCrownGear(BaseCommand): NAME = "CrownGear" GEAR_FUNCTION = CrownGear - Pixmap = os.path.join(BaseCommand.ICONDIR, "crowngear.svg") + Pixmap = "FCGear_CrownGear" MenuText = QT_TRANSLATE_NOOP("FCGear_CrownGear", "Crown Gear") ToolTip = QT_TRANSLATE_NOOP("FCGear_CrownGear", "Create a Crown gear") @@ -146,7 +146,7 @@ class CreateCrownGear(BaseCommand): class CreateCycloidGear(BaseCommand): NAME = "CycloidGear" GEAR_FUNCTION = CycloidGear - Pixmap = os.path.join(BaseCommand.ICONDIR, "cycloidgear.svg") + Pixmap = "FCGear_CycloidGear" MenuText = QT_TRANSLATE_NOOP("FCGear_CycloidGear", "Cycloid Gear") ToolTip = QT_TRANSLATE_NOOP("FCGear_CycloidGear", "Create a Cycloid gear") @@ -154,7 +154,7 @@ class CreateCycloidGear(BaseCommand): class CreateBevelGear(BaseCommand): NAME = "BevelGear" GEAR_FUNCTION = BevelGear - Pixmap = os.path.join(BaseCommand.ICONDIR, "bevelgear.svg") + Pixmap = "FCGear_BevelGear" MenuText = QT_TRANSLATE_NOOP("FCGear_BevelGear", "Bevel Gear") ToolTip = QT_TRANSLATE_NOOP("FCGear_BevelGear", "Create a Bevel gear") @@ -162,7 +162,7 @@ class CreateBevelGear(BaseCommand): class CreateHypoCycloidGear(BaseCommand): NAME = "HypocycloidGear" GEAR_FUNCTION = HypoCycloidGear - Pixmap = os.path.join(BaseCommand.ICONDIR, "hypocycloidgear.svg") + Pixmap = "FCGear_HypoCycloidGear" MenuText = QT_TRANSLATE_NOOP("FCGear_HypoCycloidGear", "HypoCycloid Gear") ToolTip = QT_TRANSLATE_NOOP( "FCGear_HypoCycloidGear", "Create a HypoCycloid gear with its pins" @@ -172,7 +172,7 @@ class CreateHypoCycloidGear(BaseCommand): class CreateWormGear(BaseCommand): NAME = "WormGear" GEAR_FUNCTION = WormGear - Pixmap = os.path.join(BaseCommand.ICONDIR, "wormgear.svg") + Pixmap = "FCGear_WormGear" MenuText = QT_TRANSLATE_NOOP("FCGear_WormGear", "Worm Gear") ToolTip = QT_TRANSLATE_NOOP("FCGear_WormGear", "Create a Worm gear") @@ -180,7 +180,7 @@ class CreateWormGear(BaseCommand): class CreateTimingGearT(BaseCommand): NAME = "TimingGearT" GEAR_FUNCTION = TimingGearT - Pixmap = os.path.join(BaseCommand.ICONDIR, "timinggear_t.svg") + Pixmap = "FCGear_TimingGearT" MenuText = QT_TRANSLATE_NOOP("FCGear_TimingGearT", "Timing Gear T-shape") ToolTip = QT_TRANSLATE_NOOP("FCGear_TimingGearT", "Create a Timing gear T-shape") @@ -188,7 +188,7 @@ class CreateTimingGearT(BaseCommand): class CreateTimingGear(BaseCommand): NAME = "TimingGear" GEAR_FUNCTION = TimingGear - Pixmap = os.path.join(BaseCommand.ICONDIR, "timinggear.svg") + Pixmap = "FCGear_TimingGear" MenuText = QT_TRANSLATE_NOOP("FCGear_TimingGear", "Timing Gear") ToolTip = QT_TRANSLATE_NOOP("FCGear_TimingGear", "Create a Timing gear") @@ -196,7 +196,7 @@ class CreateTimingGear(BaseCommand): class CreateLanternGear(BaseCommand): NAME = "LanternGear" GEAR_FUNCTION = LanternGear - Pixmap = os.path.join(BaseCommand.ICONDIR, "lanterngear.svg") + Pixmap = "FCGear_LanternGear" MenuText = QT_TRANSLATE_NOOP("FCGear_LanternGear", "Lantern Gear") ToolTip = QT_TRANSLATE_NOOP("FCGear_LanternGear", "Create a Lantern gear") @@ -204,7 +204,7 @@ class CreateLanternGear(BaseCommand): class CreateGearConnector(BaseCommand): NAME = "GearConnector" GEAR_FUNCTION = GearConnector - Pixmap = os.path.join(BaseCommand.ICONDIR, "gearconnector.svg") + Pixmap = "FCGear_GearConnector" MenuText = QT_TRANSLATE_NOOP("FCGear_GearConnector", "Combine two gears") ToolTip = QT_TRANSLATE_NOOP("FCGear_GearConnector", "Combine two gears") diff --git a/freecad/gears/icons/gearworkbench.svg b/freecad/gears/icons/FCGearWorkbench.svg similarity index 99% rename from freecad/gears/icons/gearworkbench.svg rename to freecad/gears/icons/FCGearWorkbench.svg index 3579612..5459fdc 100644 --- a/freecad/gears/icons/gearworkbench.svg +++ b/freecad/gears/icons/FCGearWorkbench.svg @@ -13,6 +13,8 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> + FreeCAD Gear Workbench 2024 + FreeCAD Gear Workbench diff --git a/freecad/gears/icons/gearworkbench_alt.svg b/freecad/gears/icons/FCGearWorkbenchAlt.svg similarity index 98% rename from freecad/gears/icons/gearworkbench_alt.svg rename to freecad/gears/icons/FCGearWorkbenchAlt.svg index b2f2260..3143a87 100644 --- a/freecad/gears/icons/gearworkbench_alt.svg +++ b/freecad/gears/icons/FCGearWorkbenchAlt.svg @@ -7,7 +7,7 @@ id="svg2869" version="1.1" sodipodi:docname="gearworkbench_alt.svg" - inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)" + inkscape:version="1.4 (e7c3feb100, 2024-10-09)" viewBox="0 0 64 64" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" @@ -16,6 +16,8 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> + FreeCAD Gear Workbench Alternative 2024 + FreeCAD Gear Workbench Alternative diff --git a/freecad/gears/icons/bevelgear.svg b/freecad/gears/icons/FCGear_BevelGear.svg similarity index 99% rename from freecad/gears/icons/bevelgear.svg rename to freecad/gears/icons/FCGear_BevelGear.svg index bb879ce..1c64640 100644 --- a/freecad/gears/icons/bevelgear.svg +++ b/freecad/gears/icons/FCGear_BevelGear.svg @@ -14,7 +14,7 @@ xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> bevelgear + id="title23">FCGear Bevel Gear 2024 - bevelgear + FCGear Bevel Gear diff --git a/freecad/gears/icons/crowngear.svg b/freecad/gears/icons/FCGear_CrownGear.svg similarity index 99% rename from freecad/gears/icons/crowngear.svg rename to freecad/gears/icons/FCGear_CrownGear.svg index 61aa4a0..d170f08 100644 --- a/freecad/gears/icons/crowngear.svg +++ b/freecad/gears/icons/FCGear_CrownGear.svg @@ -14,7 +14,7 @@ xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> crowngear + id="title23">FCGear Crown Gear 2024 - crowngear + FCGear Crown Gear diff --git a/freecad/gears/icons/cycloidgear.svg b/freecad/gears/icons/FCGear_CycloidGear.svg similarity index 99% rename from freecad/gears/icons/cycloidgear.svg rename to freecad/gears/icons/FCGear_CycloidGear.svg index 15ff581..a41a8f9 100644 --- a/freecad/gears/icons/cycloidgear.svg +++ b/freecad/gears/icons/FCGear_CycloidGear.svg @@ -14,7 +14,7 @@ xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> cycloidgear + id="title23">FCGear Cycloid Gear 2024 - cycloidgear + FCGear Cycloid Gear diff --git a/freecad/gears/icons/cycloidrack.svg b/freecad/gears/icons/FCGear_CycloidRack.svg similarity index 99% rename from freecad/gears/icons/cycloidrack.svg rename to freecad/gears/icons/FCGear_CycloidRack.svg index 5228926..8140fca 100644 --- a/freecad/gears/icons/cycloidrack.svg +++ b/freecad/gears/icons/FCGear_CycloidRack.svg @@ -14,7 +14,7 @@ xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> cycloidrack + id="title23">FCGear Cycloid Rack 2024 - cycloidrack + FCGear Cycloid Rack diff --git a/freecad/gears/icons/gearconnector.svg b/freecad/gears/icons/FCGear_GearConnector.svg similarity index 99% rename from freecad/gears/icons/gearconnector.svg rename to freecad/gears/icons/FCGear_GearConnector.svg index e2ea966..fc9507c 100644 --- a/freecad/gears/icons/gearconnector.svg +++ b/freecad/gears/icons/FCGear_GearConnector.svg @@ -14,7 +14,7 @@ xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> gearconnector + id="title23">FCGear Gear Connector 2024 - gearconnector + FCGear Gear Connector diff --git a/freecad/gears/icons/hypocycloidgear.svg b/freecad/gears/icons/FCGear_HypoCycloidGear.svg similarity index 99% rename from freecad/gears/icons/hypocycloidgear.svg rename to freecad/gears/icons/FCGear_HypoCycloidGear.svg index 24cab9e..0725c66 100644 --- a/freecad/gears/icons/hypocycloidgear.svg +++ b/freecad/gears/icons/FCGear_HypoCycloidGear.svg @@ -14,7 +14,7 @@ xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> hypocycloidgear + id="title23">FCGear Hypo Cycloid Gear 2024 - hypocycloidgear + FCGear Hypo Cycloid Gear diff --git a/freecad/gears/icons/internalinvolutegear.svg b/freecad/gears/icons/FCGear_InternalInvoluteGear.svg similarity index 99% rename from freecad/gears/icons/internalinvolutegear.svg rename to freecad/gears/icons/FCGear_InternalInvoluteGear.svg index 97bde7a..6bcb6b2 100644 --- a/freecad/gears/icons/internalinvolutegear.svg +++ b/freecad/gears/icons/FCGear_InternalInvoluteGear.svg @@ -14,7 +14,7 @@ xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> internalinvolutegear + id="title23">FCGear Internal Involute Gear 2024 - internalinvolutegear + FCGear Internal Involute Gear diff --git a/freecad/gears/icons/involutegear.svg b/freecad/gears/icons/FCGear_InvoluteGear.svg similarity index 99% rename from freecad/gears/icons/involutegear.svg rename to freecad/gears/icons/FCGear_InvoluteGear.svg index 64e0ec9..64b4fe1 100644 --- a/freecad/gears/icons/involutegear.svg +++ b/freecad/gears/icons/FCGear_InvoluteGear.svg @@ -14,7 +14,7 @@ xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> involutegear + id="title23">FCGear Involute Gear 2024 - involutegear + FCGear Involute Gear diff --git a/freecad/gears/icons/involuterack.svg b/freecad/gears/icons/FCGear_InvoluteRack.svg similarity index 98% rename from freecad/gears/icons/involuterack.svg rename to freecad/gears/icons/FCGear_InvoluteRack.svg index 7330d59..d910e9b 100644 --- a/freecad/gears/icons/involuterack.svg +++ b/freecad/gears/icons/FCGear_InvoluteRack.svg @@ -14,7 +14,7 @@ xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> involuterack + id="title23">FCGear Involute Rack 2024 - involuterack + FCGear Involute Rack diff --git a/freecad/gears/icons/lanterngear.svg b/freecad/gears/icons/FCGear_LanternGear.svg similarity index 99% rename from freecad/gears/icons/lanterngear.svg rename to freecad/gears/icons/FCGear_LanternGear.svg index a66a0a1..a444f4c 100644 --- a/freecad/gears/icons/lanterngear.svg +++ b/freecad/gears/icons/FCGear_LanternGear.svg @@ -14,7 +14,7 @@ xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> lanterngear + id="title23">FCGear Lantern Gear 2024 - lanterngear + FCGear Lantern Gear diff --git a/freecad/gears/icons/timinggear.svg b/freecad/gears/icons/FCGear_TimingGear.svg similarity index 99% rename from freecad/gears/icons/timinggear.svg rename to freecad/gears/icons/FCGear_TimingGear.svg index a1fd784..70b66d4 100644 --- a/freecad/gears/icons/timinggear.svg +++ b/freecad/gears/icons/FCGear_TimingGear.svg @@ -14,7 +14,7 @@ xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> timinggear + id="title23">FCGear Timing Gear 2024 - timinggear + FCGear Timing Gear diff --git a/freecad/gears/icons/timinggear_alt.svg b/freecad/gears/icons/FCGear_TimingGearAlt.svg similarity index 99% rename from freecad/gears/icons/timinggear_alt.svg rename to freecad/gears/icons/FCGear_TimingGearAlt.svg index b10ac66..350c552 100644 --- a/freecad/gears/icons/timinggear_alt.svg +++ b/freecad/gears/icons/FCGear_TimingGearAlt.svg @@ -14,7 +14,7 @@ xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> timinggear + id="title23">FCGear Timing Gear 2024 - timinggear + FCGear Timing Gear diff --git a/freecad/gears/icons/timinggear_t.svg b/freecad/gears/icons/FCGear_TimingGearT.svg similarity index 99% rename from freecad/gears/icons/timinggear_t.svg rename to freecad/gears/icons/FCGear_TimingGearT.svg index c7fb1ab..096ebe6 100644 --- a/freecad/gears/icons/timinggear_t.svg +++ b/freecad/gears/icons/FCGear_TimingGearT.svg @@ -14,7 +14,7 @@ xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> timinggear_t + id="title23">FCGear Timing Gear T 2024 - timinggear_t + FCGear Timing Gear T diff --git a/freecad/gears/icons/wormgear.svg b/freecad/gears/icons/FCGear_WormGear.svg similarity index 99% rename from freecad/gears/icons/wormgear.svg rename to freecad/gears/icons/FCGear_WormGear.svg index 02dc5a3..3f4ee25 100644 --- a/freecad/gears/icons/wormgear.svg +++ b/freecad/gears/icons/FCGear_WormGear.svg @@ -14,7 +14,7 @@ xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> wormgear + id="title23">FCGear Worm Gear 2024 - wormgear + FCGear Worm Gear diff --git a/freecad/gears/init_gui.py b/freecad/gears/init_gui.py index c80dba6..5626c4b 100644 --- a/freecad/gears/init_gui.py +++ b/freecad/gears/init_gui.py @@ -88,7 +88,7 @@ class GearWorkbench(gui.Workbench): MenuText = app.Qt.translate("Workbench", "Gear") ToolTip = app.Qt.translate("Workbench", "Gear Workbench") - Icon = os.path.join(__dirname__, "icons", "gearworkbench.svg") + Icon = os.path.join(__dirname__, "icons", "FCGearWorkbench.svg") commands = [ "FCGear_InvoluteGear", "FCGear_InternalInvoluteGear", @@ -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())