From 357ecb5800cb046b2e8158ffe2ab84b923c305ec Mon Sep 17 00:00:00 2001 From: drallod Date: Sat, 28 Jan 2017 22:23:31 -0600 Subject: [PATCH] Path: Issue #0002817: Check if default post processor hasn't been lost --- src/Mod/Path/PathScripts/PathJob.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathJob.py b/src/Mod/Path/PathScripts/PathJob.py index d9cb13aaa..036e927e7 100644 --- a/src/Mod/Path/PathScripts/PathJob.py +++ b/src/Mod/Path/PathScripts/PathJob.py @@ -56,8 +56,13 @@ class ObjectPathJob: obj.addProperty("App::PropertyString", "Description", "Path", QtCore.QT_TRANSLATE_NOOP("App::Property","An optional description for this job")) obj.addProperty("App::PropertyEnumeration", "PostProcessor", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property","Select the Post Processor")) - obj.PostProcessor = PathPreferences.allEnabledPostProcessors(['']) - obj.PostProcessor = PathPreferences.defaultPostProcessor() + obj.PostProcessor = postProcessors = PathPreferences.allEnabledPostProcessors() + defaultPostProcessor = PathPreferences.defaultPostProcessor() + # Check to see if default post processor hasn't been 'lost' (This can happen when Macro dir has changed) + if defaultPostProcessor in postProcessors: + obj.PostProcessor = defaultPostProcessor + else: + obj.PostProcessor = postProcessors[0] obj.addProperty("App::PropertyString", "PostProcessorArgs", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property", "Arguments for the Post Processor (specific to the script)")) obj.PostProcessorArgs = PathPreferences.defaultPostProcessorArgs() obj.addProperty("App::PropertyString", "MachineName", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property","Name of the Machine that will use the CNC program"))