From c1194ecee097781f2bdca1efdd4a2925e43fa521 Mon Sep 17 00:00:00 2001 From: "Morgan 'ARR\\!' Allen" Date: Wed, 30 Apr 2025 20:27:04 -0700 Subject: [PATCH] remove Activate() from Syncable subclasses --- freecad/kiconnect/commands/cmd_sync_from.py | 10 ++-------- freecad/kiconnect/commands/cmd_sync_to.py | 11 ++--------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/freecad/kiconnect/commands/cmd_sync_from.py b/freecad/kiconnect/commands/cmd_sync_from.py index 2005d88..c91470e 100644 --- a/freecad/kiconnect/commands/cmd_sync_from.py +++ b/freecad/kiconnect/commands/cmd_sync_from.py @@ -10,6 +10,8 @@ from ..project import Project from .Syncable import Syncable class SyncFrom(Syncable): + method = 'sync_from' + def GetResources(self): tooltip = '

Reload Board from KiCAD.

' iconFile = os.path.join(settings.ICONPATH, 'import_brd_file.svg') @@ -20,12 +22,4 @@ class SyncFrom(Syncable): '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()) diff --git a/freecad/kiconnect/commands/cmd_sync_to.py b/freecad/kiconnect/commands/cmd_sync_to.py index e7190b7..52689d3 100644 --- a/freecad/kiconnect/commands/cmd_sync_to.py +++ b/freecad/kiconnect/commands/cmd_sync_to.py @@ -9,6 +9,8 @@ from ..project import Project from .Syncable import Syncable class SyncTo(Syncable): + method = 'sync_to' + def GetResources(self): tooltip = '

Update Board in KiCAD.

' iconFile = os.path.join(settings.ICONPATH, 'export_to_pcbnew.svg') @@ -19,13 +21,4 @@ class SyncTo(Syncable): '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())