Added hidden preference to suppress the opencamlib error

This commit is contained in:
Markus Lampert
2020-12-13 22:15:32 -08:00
parent 69e9639a9e
commit c7e914ecc0
2 changed files with 7 additions and 2 deletions

View File

@@ -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)

View File

@@ -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)