Added preference to choose between legacy tools and new tool bits.

This commit is contained in:
Markus Lampert
2019-11-09 17:09:30 -08:00
parent 0a84f3168e
commit a2935d5ff0
6 changed files with 105 additions and 23 deletions

View File

@@ -74,15 +74,22 @@ class CommandToolBitLibraryLoad:
return not self.selectedJob() is None
def Activated(self):
job = self.selectedJob()
self.Execute(job)
@classmethod
def Execute(cls, job):
import PathScripts.PathToolBitLibraryGui as PathToolBitLibraryGui
import PathScripts.PathToolControllerGui as PathToolControllerGui
job = self.selectedJob()
library = PathToolBitLibraryGui.ToolBitLibrary()
if 1 == library.open(dialog=True):
if 1 == library.open(dialog=True) and job:
for nr, tool in library.selectedOrAllTools():
tc = PathToolControllerGui.Create("TC: {}".format(tool.Label), tool, nr)
job.Proxy.addToolController(tc)
FreeCAD.ActiveDocument.recompute()
return True
return False
if FreeCAD.GuiUp:
FreeCADGui.addCommand('Path_ToolBitLibraryOpen', CommandToolBitLibraryOpen())