From c7e914ecc075138e3c023a513ffd2f37a3c1e01d Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sun, 13 Dec 2020 22:15:32 -0800 Subject: [PATCH] Added hidden preference to suppress the opencamlib error --- src/Mod/Path/InitGui.py | 3 ++- src/Mod/Path/PathScripts/PathPreferences.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/InitGui.py b/src/Mod/Path/InitGui.py index d1feaff6a5..3b7f906e91 100644 --- a/src/Mod/Path/InitGui.py +++ b/src/Mod/Path/InitGui.py @@ -129,7 +129,8 @@ class PathWorkbench (Workbench): threedcmdgroup = ['Path_3dTools'] FreeCADGui.addCommand('Path_3dTools', PathCommandGroup(threedopcmdlist, QtCore.QT_TRANSLATE_NOOP("Path", '3D Operations'))) except ImportError: - FreeCAD.Console.PrintError("OpenCamLib is not working!\n") + if not PathPreferences.suppressOpenCamLibWarning(): + FreeCAD.Console.PrintError("OpenCamLib is not working!\n") self.appendToolbar(QtCore.QT_TRANSLATE_NOOP("Path", "Project Setup"), projcmdlist) self.appendToolbar(QtCore.QT_TRANSLATE_NOOP("Path", "Tool Commands"), toolcmdlist) diff --git a/src/Mod/Path/PathScripts/PathPreferences.py b/src/Mod/Path/PathScripts/PathPreferences.py index f750016372..ee6c842c43 100644 --- a/src/Mod/Path/PathScripts/PathPreferences.py +++ b/src/Mod/Path/PathScripts/PathPreferences.py @@ -58,7 +58,8 @@ GeometryTolerance = "GeometryTolerance" LibAreaCurveAccuracy = "LibAreaCurveAccuarcy" WarningSuppressRapidSpeeds = "WarningSuppressRapidSpeeds" -WarningSuppressSelectionMode = "WarningSuppressSelectionMode" +WarningSuppressSelectionMode = "WarningSuppressSelectionMode" +WarningSuppressOpenCamLib = "WarningSuppressOpenCamLib" EnableExperimentalFeatures = "EnableExperimentalFeatures" @@ -267,6 +268,9 @@ def suppressRapidSpeedsWarning(): def suppressSelectionModeWarning(): return preferences().GetBool(WarningSuppressSelectionMode, False) +def suppressOpenCamLibWarning(): + return preferences().GetBool(WarningSuppressOpenCamLib, False) + def lastFileToolLibrary(): filename = preferences().GetString(LastFileToolLibrary)