File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 44import wx .aui
55import threading
66import time
7-
8- plugin = GenerateInteractiveBomPlugin ()
9- plugin .register ()
10-
7+ import sys
118
129def check_for_bom_button ():
1310 # From Miles McCoo's blog
@@ -42,6 +39,12 @@ def callback(_):
4239 top_tb .Realize ()
4340
4441
45- t = threading .Thread (target = check_for_bom_button )
46- t .daemon = True
47- t .start ()
42+ plugin = GenerateInteractiveBomPlugin ()
43+ plugin .register ()
44+
45+ # Add a button the hacky way if plugin button is not supported
46+ # in pcbnew, unless this is linux.
47+ if not plugin .pcbnew_icon_support and not sys .platform .startswith ('linux' ):
48+ t = threading .Thread (target = check_for_bom_button )
49+ t .daemon = True
50+ t .start ()
Original file line number Diff line number Diff line change @@ -479,6 +479,9 @@ def defaults(self):
479479 """
480480 self .name = "Generate Interactive HTML BOM"
481481 self .category = "Read PCB"
482+ self .pcbnew_icon_support = hasattr (self , "show_toolbar_button" )
483+ self .show_toolbar_button = True
484+ self .icon_file_name = os .path .join (os .path .dirname (__file__ ), 'icon.png' )
482485 self .description = "Generate interactive HTML page that contains BOM " \
483486 "table and pcb drawing."
484487
You can’t perform that action at this time.
0 commit comments