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

@@ -43,7 +43,10 @@ PostProcessorOutputPolicy = "PostProcessorOutputPolicy"
LastPathToolBit = "LastPathToolBit"
LastPathToolLibrary = "LastPathToolLibrary"
LastPathToolShape = "LastPathToolShape"
LastPathToolShape = "LastPathToolShape"
UseLegacyTools = "UseLegacyTools"
UseRelativeToolPaths = "UseRelativeToolPaths"
# Linear tolerance to use when generating Paths, eg when tessellating geometry
GeometryTolerance = "GeometryTolerance"
@@ -146,6 +149,17 @@ def searchPathsTool(sub='Bit'):
appendPath(os.path.join(FreeCAD.getHomePath(), "Mod/Path/"), sub)
return paths
def toolsUseLegacyTools():
return preferences().GetBool(UseLegacyTools, True)
def toolsStoreRelativePaths():
return preferences().GetBool(UseRelativeToolPaths, True)
def setToolsSettings(legacy, relative):
pref = preferences()
pref.SetBool(UseLegacyTools, legacy)
pref.SetBool(UseRelativeToolPaths, relative)
def defaultJobTemplate():
template = preferences().GetString(DefaultJobTemplate)
if 'xml' not in template: