CAM: Replace complete tool management (PR 21425)

This commit is contained in:
Samuel Abels
2025-05-19 20:25:00 +02:00
parent ecb3ede295
commit b14d8ff98e
169 changed files with 22274 additions and 2905 deletions

View File

@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
# * *
@@ -20,6 +21,10 @@
# * USA *
# * *
# ***************************************************************************
import FreeCAD
FreeCAD.__unit_test__ += ["TestCAMGui"]
class PathCommandGroup:
@@ -58,6 +63,7 @@ class CAMWorkbench(Workbench):
# Add preferences pages - before loading PathGui to properly order pages of Path group
import Path.Dressup.Gui.Preferences as PathPreferencesPathDressup
import Path.Tool.assets.ui.preferences as AssetPreferences
import Path.Main.Gui.PreferencesJob as PathPreferencesPathJob
translate = FreeCAD.Qt.translate
@@ -74,8 +80,8 @@ class CAMWorkbench(Workbench):
from Path.Main.Gui import JobCmd as PathJobCmd
from Path.Main.Gui import SanityCmd as SanityCmd
from Path.Tool.Gui import BitCmd as PathToolBitCmd
from Path.Tool.Gui import BitLibraryCmd as PathToolBitLibraryCmd
from Path.Tool.toolbit.ui import cmd as PathToolBitCmd
from Path.Tool.library.ui import cmd as PathToolBitLibraryCmd
from PySide.QtCore import QT_TRANSLATE_NOOP
@@ -87,6 +93,10 @@ class CAMWorkbench(Workbench):
PathPreferencesPathJob.JobPreferencesPage,
QT_TRANSLATE_NOOP("QObject", "CAM"),
)
FreeCADGui.addPreferencePage(
AssetPreferences.AssetPreferencesPage,
QT_TRANSLATE_NOOP("QObject", "CAM"),
)
FreeCADGui.addPreferencePage(
PathPreferencesPathDressup.DressupPreferencesPage,
QT_TRANSLATE_NOOP("QObject", "CAM"),
@@ -335,7 +345,7 @@ class CAMWorkbench(Workbench):
for cmd in self.dressupcmds:
self.appendContextMenu("", [cmd])
menuAppended = True
if isinstance(obj.Proxy, Path.Tool.Bit.ToolBit):
if isinstance(obj.Proxy, Path.Tool.ToolBit):
self.appendContextMenu("", ["CAM_ToolBitSave", "CAM_ToolBitSaveAs"])
menuAppended = True
if menuAppended: