remove Activate() from Syncable subclasses

This commit is contained in:
Morgan 'ARR\!' Allen 2025-04-30 20:27:04 -07:00
parent cfc3370ad8
commit c1194ecee0
2 changed files with 4 additions and 17 deletions

View file

@ -10,6 +10,8 @@ from ..project import Project
from .Syncable import Syncable from .Syncable import Syncable
class SyncFrom(Syncable): class SyncFrom(Syncable):
method = 'sync_from'
def GetResources(self): def GetResources(self):
tooltip = '<p>Reload Board from KiCAD.</p>' tooltip = '<p>Reload Board from KiCAD.</p>'
iconFile = os.path.join(settings.ICONPATH, 'import_brd_file.svg') iconFile = os.path.join(settings.ICONPATH, 'import_brd_file.svg')
@ -20,12 +22,4 @@ class SyncFrom(Syncable):
'Pixmap' : iconFile 'Pixmap' : iconFile
} }
def Activated(self):
boards = [ sel for sel in Gui.Selection.getSelection() if sel.Type == 'KiConnect::Board' ]
for board in boards:
board.Proxy.sketch_outline(do_offset=False)
App.ActiveDocument.recompute()
Gui.addCommand('kiconn_sync_from', SyncFrom()) Gui.addCommand('kiconn_sync_from', SyncFrom())

View file

@ -9,6 +9,8 @@ from ..project import Project
from .Syncable import Syncable from .Syncable import Syncable
class SyncTo(Syncable): class SyncTo(Syncable):
method = 'sync_to'
def GetResources(self): def GetResources(self):
tooltip = '<p>Update Board in KiCAD.</p>' tooltip = '<p>Update Board in KiCAD.</p>'
iconFile = os.path.join(settings.ICONPATH, 'export_to_pcbnew.svg') iconFile = os.path.join(settings.ICONPATH, 'export_to_pcbnew.svg')
@ -19,13 +21,4 @@ class SyncTo(Syncable):
'Pixmap' : iconFile 'Pixmap' : iconFile
} }
def Activated(self):
boards = [ sel for sel in Gui.Selection.getSelection() if sel.Type == 'KiConnect::Board' ]
for board in boards:
board.Proxy.sync()
Gui.addCommand('kiconn_sync_to', SyncTo()) Gui.addCommand('kiconn_sync_to', SyncTo())