Skip to content

Commit

Permalink
Path: Issue #2817:
Browse files Browse the repository at this point in the history
Check if default post processor hasn't been lost
  • Loading branch information
drallod committed Jan 29, 2017
1 parent fc2010b commit 357ecb5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Mod/Path/PathScripts/PathJob.py
Expand Up @@ -56,8 +56,13 @@ def __init__(self, obj):

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"))
Expand Down

0 comments on commit 357ecb5

Please sign in to comment.