From de2e3b060987ed3f83a73edd2a05b68b7820736d Mon Sep 17 00:00:00 2001 From: Huy Nguyen <165433447+huynguyen1989@users.noreply.github.com> Date: Sat, 31 Aug 2024 07:05:19 +0000 Subject: [PATCH 1/2] Fix registering icon file and show on toolbar button --- __init__.py | 6 +++++- action_place_footprints.py | 4 ---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/__init__.py b/__init__.py index 28b9d97..f066f44 100644 --- a/__init__.py +++ b/__init__.py @@ -22,7 +22,11 @@ class PlaceFootprints(pcbnew.ActionPlugin): def defaults(self): self.name = "Place Footprints" self.category = "Place Footprints" - self.description = "Places selected footprints either by reference or by sheet in different configurations (linear, circular, matrix)" + self.description = "place selected footprints or footprints from multiple sheets " \ + "in linear, circular or matrix arrangement" + self.icon_file_name = os.path.join(os.path.dirname(__file__), 'place_footprints_light.png') + self.dark_icon_file_name = os.path.join(os.path.dirname(__file__), 'place_footprints_dark.png') + self.show_toolbar_button = True def Run(self): caption = self.name diff --git a/action_place_footprints.py b/action_place_footprints.py index a77979b..31aa400 100644 --- a/action_place_footprints.py +++ b/action_place_footprints.py @@ -355,10 +355,6 @@ def __init__(self): self.category = "Place Footprints" self.description = "place selected footprints or footprints from multiple sheets " \ "in linear, circular or matrix arrangement" - self.icon_file_name = os.path.join( - os.path.dirname(__file__), 'place_footprints_light.png') - self.dark_icon_file_name = os.path.join( - os.path.dirname(__file__), 'place_footprints_dark.png') self.debug_level = logging.INFO From fe006ba30ef7af43e7c83c03ae815f052dc770b3 Mon Sep 17 00:00:00 2001 From: Huy Nguyen <165433447+huynguyen1989@users.noreply.github.com> Date: Sat, 31 Aug 2024 07:45:25 +0000 Subject: [PATCH 2/2] Put back block to action_place_footprints.py - Keep self.show_toolbar_button = True in both files "__init__ & action_place_footprints.py --- action_place_footprints.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action_place_footprints.py b/action_place_footprints.py index 31aa400..260665e 100644 --- a/action_place_footprints.py +++ b/action_place_footprints.py @@ -355,6 +355,10 @@ def __init__(self): self.category = "Place Footprints" self.description = "place selected footprints or footprints from multiple sheets " \ "in linear, circular or matrix arrangement" + + self.icon_file_name = os.path.join(os.path.dirname(__file__), 'place_footprints_light.png') + self.dark_icon_file_name = os.path.join(os.path.dirname(__file__), 'place_footprints_dark.png') + self.show_toolbar_button = True self.debug_level = logging.INFO