diff --git a/src/Mod/Path/CMakeLists.txt b/src/Mod/Path/CMakeLists.txt
index 75a2231d8aeb..e6cc466f6078 100644
--- a/src/Mod/Path/CMakeLists.txt
+++ b/src/Mod/Path/CMakeLists.txt
@@ -69,6 +69,7 @@ SET(PathScripts_SRCS
PathScripts/PathToolLibraryManager.py
PathScripts/DogboneDressup.py
PathScripts/PathPreferencesPathJob.py
+ PathScripts/PathPreferences.py
)
SET(PathScripts_NC_SRCS
diff --git a/src/Mod/Path/Gui/Resources/Path.qrc b/src/Mod/Path/Gui/Resources/Path.qrc
index c85011817e03..3269fd0653b2 100644
--- a/src/Mod/Path/Gui/Resources/Path.qrc
+++ b/src/Mod/Path/Gui/Resources/Path.qrc
@@ -86,6 +86,7 @@
panels/ContourEdit.ui
panels/ProfileEdgesEdit.ui
panels/DogboneEdit.ui
+ panels/DlgSelectPostProcessor.ui
preferences/PathJob.ui
diff --git a/src/Mod/Path/Gui/Resources/panels/DlgSelectPostProcessor.ui b/src/Mod/Path/Gui/Resources/panels/DlgSelectPostProcessor.ui
new file mode 100644
index 000000000000..82c34ef23a6e
--- /dev/null
+++ b/src/Mod/Path/Gui/Resources/panels/DlgSelectPostProcessor.ui
@@ -0,0 +1,81 @@
+
+
+ Dialog
+
+
+
+ 0
+ 0
+ 400
+ 300
+
+
+
+ Post Processor
+
+
+
+
+ 30
+ 240
+ 341
+ 32
+
+
+
+ Qt::Horizontal
+
+
+ QDialogButtonBox::Cancel|QDialogButtonBox::Ok
+
+
+
+
+
+ 20
+ 30
+ 351
+ 191
+
+
+
+ <html><head/><body><p>Select one of the post processors.</p><p>FreeCAD comes with several post processors pre-installed, please make sure at least one of them is enabled in your preferences.</p></body></html>
+
+
+
+
+
+
+ buttonBox
+ accepted()
+ Dialog
+ accept()
+
+
+ 248
+ 254
+
+
+ 157
+ 274
+
+
+
+
+ buttonBox
+ rejected()
+ Dialog
+ reject()
+
+
+ 316
+ 260
+
+
+ 286
+ 274
+
+
+
+
+
diff --git a/src/Mod/Path/Gui/Resources/panels/JobEdit.ui b/src/Mod/Path/Gui/Resources/panels/JobEdit.ui
index 1b1c7921d432..8184d3b1e01c 100644
--- a/src/Mod/Path/Gui/Resources/panels/JobEdit.ui
+++ b/src/Mod/Path/Gui/Resources/panels/JobEdit.ui
@@ -35,15 +35,15 @@
- 2
+ 0
0
0
- 378
- 409
+ 363
+ 443
@@ -146,7 +146,7 @@
0
0
378
- 409
+ 391
@@ -215,8 +215,8 @@
0
0
- 378
- 409
+ 424
+ 376
@@ -283,7 +283,7 @@
-
- Use default
+
-
diff --git a/src/Mod/Path/Gui/Resources/preferences/PathJob.ui b/src/Mod/Path/Gui/Resources/preferences/PathJob.ui
index 16efd86c1abf..5a810d249e48 100644
--- a/src/Mod/Path/Gui/Resources/preferences/PathJob.ui
+++ b/src/Mod/Path/Gui/Resources/preferences/PathJob.ui
@@ -62,7 +62,7 @@
-
-
+
0
diff --git a/src/Mod/Path/PathScripts/PathJob.py b/src/Mod/Path/PathScripts/PathJob.py
index dc1ddb361431..9bb5458e09d8 100644
--- a/src/Mod/Path/PathScripts/PathJob.py
+++ b/src/Mod/Path/PathScripts/PathJob.py
@@ -25,11 +25,11 @@
import FreeCAD
import Path
from PySide import QtCore, QtGui
-import os
-import glob
from PathScripts.PathPostProcessor import PostProcessor
-from PathScripts.PathPost import CommandPathPost as PathPost
+from PathScripts.PathPreferences import PathPreferences
import Draft
+import os
+import glob
FreeCADGui = None
@@ -49,7 +49,7 @@ def translate(context, text, disambig=None):
return QtGui.QApplication.translate(context, text, disambig)
class OutputPolicy:
- Default = 'Use default'
+ Default = ''
Dialog = 'Open File Dialog'
DialogOnConflict = 'Open File Dialog on conflict'
Overwrite = 'Overwrite existing file'
@@ -61,7 +61,7 @@ class ObjectPathJob:
def __init__(self, obj):
# obj.addProperty("App::PropertyFile", "PostProcessor", "CodeOutput", "Select the Post Processor file for this project")
obj.addProperty("App::PropertyFile", "OutputFile", "CodeOutput", QtCore.QT_TRANSLATE_NOOP("App::Property","The NC output file for this project"))
- obj.OutputFile = PathPost.defaultOutputFile()
+ obj.OutputFile = ''
obj.setEditorMode("OutputFile", 0) # set to default mode
obj.addProperty("App::PropertyEnumeration", "OutputPolicy", "CodeOutput", QtCore.QT_TRANSLATE_NOOP("App::Property","The policy on how to save output files and resolve name conflicts"))
obj.OutputPolicy = OutputPolicy.All
@@ -69,10 +69,10 @@ 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 = PostProcessor.allEnabled()
- obj.PostProcessor = 'dumper'
+ obj.PostProcessor = PathPreferences.allEnabledPostProcessors([''])
+ obj.PostProcessor = ''
obj.addProperty("App::PropertyString", "PostProcessorArgs", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property", "Arguments for the Post Processor (specific to the script)"))
- obj.PostProcessorArgs = ""
+ obj.PostProcessorArgs = ''
obj.addProperty("App::PropertyString", "MachineName", "Output", QtCore.QT_TRANSLATE_NOOP("App::Property","Name of the Machine that will use the CNC program"))
obj.addProperty("Path::PropertyTooltable", "Tooltable", "Base", QtCore.QT_TRANSLATE_NOOP("App::Property","The tooltable used for this CNC program"))
@@ -92,11 +92,6 @@ def __init__(self, obj):
obj.Proxy = self
- defaultPostProcessor = PostProcessor.default()
- if defaultPostProcessor:
- obj.PostProcessor = defaultPostProcessor
- obj.PostProcessorArgs = PostProcessor.defaultArgs()
-
if FreeCAD.GuiUp:
ViewProviderJob(obj.ViewObject)
@@ -111,7 +106,7 @@ def onChanged(self, obj, prop):
mode = 2
obj.setEditorMode('Placement', mode)
- if prop == "PostProcessor":
+ if prop == "PostProcessor" and obj.PostProcessor:
processor = PostProcessor.load(obj.PostProcessor)
if processor.units:
obj.MachineUnits = processor.units
@@ -236,7 +231,7 @@ def __init__(self):
self.form = FreeCADGui.PySideUic.loadUi(":/panels/JobEdit.ui")
#self.form = FreeCADGui.PySideUic.loadUi(FreeCAD.getHomePath() + "Mod/Path/JobEdit.ui")
- for post in PostProcessor.allEnabled():
+ for post in PathPreferences.allEnabledPostProcessors(['']):
self.form.cboPostProcessor.addItem(post)
self.updating = False
@@ -341,7 +336,7 @@ def open(self):
def setFile(self):
filename = QtGui.QFileDialog.getSaveFileName(self.form, translate("PathJob", "Select Output File", None), None, translate("Path Job", "All Files (*.*)", None))
- if filename:
+ if filename and filename[0]:
self.obj.OutputFile = str(filename[0])
self.setFields()
diff --git a/src/Mod/Path/PathScripts/PathPost.py b/src/Mod/Path/PathScripts/PathPost.py
index cae311c93214..6faf8bf714eb 100644
--- a/src/Mod/Path/PathScripts/PathPost.py
+++ b/src/Mod/Path/PathScripts/PathPost.py
@@ -24,10 +24,12 @@
''' Post Process command that will make use of the Output File and Post Processor entries in PathJob '''
import FreeCAD
import FreeCADGui
+from PySide import QtCore, QtGui
+from PathScripts import PathUtils
+from PathScripts.PathPreferences import PathPreferences
from PathScripts.PathPostProcessor import PostProcessor
import os
import sys
-from PySide import QtCore, QtGui
# Qt tanslation handling
try:
@@ -39,30 +41,44 @@ def translate(context, text, disambig=None):
def translate(context, text, disambig=None):
return QtGui.QApplication.translate(context, text, disambig)
+class DlgSelectPostProcessor:
+
+ def __init__(self, parent=None):
+ self.dialog = FreeCADGui.PySideUic.loadUi(":/panels/DlgSelectPostProcessor.ui")
+ for post in PathPreferences.allEnabledPostProcessors():
+ item = QtGui.QListWidgetItem(post)
+ item.setFlags(QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled)
+ self.dialog.lwPostProcessor.addItem(item)
+ self.tooltips = {}
+ self.dialog.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(False)
+ self.dialog.lwPostProcessor.itemDoubleClicked.connect(self.dialog.accept)
+ self.dialog.lwPostProcessor.itemSelectionChanged.connect(self.enableOkButton)
+ self.dialog.lwPostProcessor.setMouseTracking(True)
+ self.dialog.lwPostProcessor.itemEntered.connect(self.updateTooltip)
+
+ def enableOkButton(self):
+ self.dialog.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)
+
+ def updateTooltip(self, item):
+ if item.text() in self.tooltips.keys():
+ tooltip = self.tooltips[item.text()]
+ else:
+ processor = PostProcessor.load(item.text())
+ self.tooltips[item.text()] = processor.tooltip
+ tooltip = processor.tooltip
+ self.dialog.lwPostProcessor.setToolTip(tooltip)
-class CommandPathPost:
-
- DefaultOutputFile = "DefaultOutputFile"
- DefaultOutputPolicy = "DefaultOutputPolicy"
-
- @classmethod
- def saveDefaults(cls, path, policy):
- preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
- preferences.SetString(cls.DefaultOutputFile, path)
- preferences.SetString(cls.DefaultOutputPolicy, policy)
-
- @classmethod
- def defaultOutputFile(cls):
- preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
- return preferences.GetString(cls.DefaultOutputFile, "")
+ def exec_(self):
+ if self.dialog.exec_() == 1:
+ posts = self.dialog.lwPostProcessor.selectedItems()
+ return posts[0].text()
+ return None
- @classmethod
- def defaultOutputPolicy(cls):
- preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
- return preferences.GetString(cls.DefaultOutputPolicy, "")
+class CommandPathPost:
def resolveFileName(self, job):
- path = "tmp.tap"
+ print("resolveFileName(%s)" % job.Label)
+ path = PathPreferences.defaultOutputFile()
if job.OutputFile:
path = job.OutputFile
filename = path
@@ -89,8 +105,8 @@ def resolveFileName(self, job):
filename = filename.replace('%M', M)
policy = job.OutputPolicy
- if not policy or policy == 'Use default':
- policy = self.defaultOutputPolicy()
+ if not policy or policy == '':
+ policy = PathPreferences.defaultOutputPolicy()
openDialog = policy == 'Open File Dialog'
if os.path.isdir(filename) or not os.path.isdir(os.path.dirname(filename)):
@@ -118,9 +134,20 @@ def resolveFileName(self, job):
else:
filename = None
- #print("resolveFileName(%s, %s) -> '%s'" % (path, policy, filename))
+ print("resolveFileName(%s, %s) -> '%s'" % (path, policy, filename))
return filename
+ def resolvePostProcessor(self, job):
+ if hasattr(job, "PostProcessor"):
+ post = PathPreferences.defaultPostProcessor()
+ if job.PostProcessor:
+ post = job.PostProcessor
+ if post and PostProcessor.exists(post):
+ return post
+ dlg = DlgSelectPostProcessor()
+ return dlg.exec_()
+
+
def GetResources(self):
return {'Pixmap': 'Path-Post',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Path_Post", "Post Process"),
@@ -129,8 +156,9 @@ def GetResources(self):
def IsActive(self):
if FreeCAD.ActiveDocument is not None:
- for o in FreeCAD.ActiveDocument.Objects:
- if o.Name[:3] == "Job":
+ if FreeCADGui.Selection.getCompleteSelection():
+ for o in FreeCAD.ActiveDocument.Objects:
+ if o.Name[:3] == "Job":
return True
return False
@@ -139,41 +167,45 @@ def Activated(self):
translate("Path_Post", "Post Process the Selected path(s)"))
FreeCADGui.addModule("PathScripts.PathPost")
# select the Path Job that you want to post output from
- obj = FreeCADGui.Selection.getCompleteSelection()
-
- # default to the dumper post and default .tap file
- postname = "dumper"
- postArgs = ""
-
- print "in activated %s" %(obj)
-
- # check if the user has a project and has set the default post and
- # output filename
- if hasattr(obj[0], "Group") and hasattr(obj[0], "Path"):
- # # Check for a selected post post processor if it's set
- job = obj[0]
-
- if hasattr(obj[0], "PostProcessor"):
- postobj = obj[0]
-
- # need to check for existance of these: obj.PostProcessor,
- # obj.OutputFile
- if postobj and postobj.PostProcessor:
- sys.path.append(os.path.split(postobj.PostProcessor)[0])
- lessextn = os.path.splitext(postobj.PostProcessor)[0]
- postname = os.path.split(lessextn)[1]
-
- if hasattr(postobj, "PostProcessorArgs"):
- postArgs = postobj.PostProcessorArgs
-
- filename = self.resolveFileName(job)
- if filename:
- processor = PostProcessor.load(postname)
- processor.export(obj, filename, postArgs)
-
- FreeCAD.ActiveDocument.commitTransaction()
- else:
+ selected = FreeCADGui.Selection.getCompleteSelection()
+ print "in activated %s" %(selected)
+
+ # try to find the job, if it's not directly selected ...
+ jobs = set()
+ for obj in selected:
+ if hasattr(obj, 'OutputFile') or hasattr(obj, 'PostProcessor'):
+ jobs.add(obj)
+ elif hasattr(obj, 'Path') or hasattr(obj, 'ToolNumber'):
+ job = PathUtils.findParentJob(obj)
+ if job:
+ jobs.add(job)
+ if len(jobs) != 1:
+ FreeCAD.Console.PrintError("Please select a single job or other path object\n")
FreeCAD.ActiveDocument.abortTransaction()
+ else:
+ job = jobs.pop()
+ print("Job for selected objects = %s" % job.Name)
+
+ # check if the user has a project and has set the default post and
+ # output filename
+ postArgs = PathPreferences.defaultPostProcessorArgs()
+ if hasattr(job, "PostProcessorArgs") and job.PostProcessorArgs:
+ postArgs = job.PostProcessorArgs
+ elif hasattr(job, "PostProcessor") and job.PostProcessor:
+ postArgs = ''
+
+ postname = self.resolvePostProcessor(job)
+ if postname:
+ filename = self.resolveFileName(job)
+
+ if postname and filename:
+ print("post: %s(%s, %s)" % (postname, filename, postArgs))
+ processor = PostProcessor.load(postname)
+ processor.export(selected, filename, postArgs)
+
+ FreeCAD.ActiveDocument.commitTransaction()
+ else:
+ FreeCAD.ActiveDocument.abortTransaction()
FreeCAD.ActiveDocument.recompute()
if FreeCAD.GuiUp:
diff --git a/src/Mod/Path/PathScripts/PathPostProcessor.py b/src/Mod/Path/PathScripts/PathPostProcessor.py
index f56ac4ce24e3..d302ab1619a1 100644
--- a/src/Mod/Path/PathScripts/PathPostProcessor.py
+++ b/src/Mod/Path/PathScripts/PathPostProcessor.py
@@ -23,60 +23,13 @@
# ***************************************************************************
import FreeCAD
-import os
-import glob
-
+from PathScripts.PathPreferences import PathPreferences
class PostProcessor:
- Default = "PostProcessorDefault"
- DefaultArgs = "PostProcessorDefaultArgs"
- Blacklist = "PostProcessorBlacklist"
-
- @classmethod
- def all(cls):
- path = FreeCAD.getHomePath() + ("Mod/Path/PathScripts/")
- posts = glob.glob(path + '/*_post.py')
- allposts = [ str(os.path.split(os.path.splitext(p)[0])[1][:-5]) for p in posts]
-
- grp = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro")
- path = grp.GetString("MacroPath", FreeCAD.getUserAppDataDir())
- posts = glob.glob(path + '/*_post.py')
-
- allposts.extend([ str(os.path.split(os.path.splitext(p)[0])[1][:-5]) for p in posts])
- allposts.sort()
- return allposts
-
- @classmethod
- def allEnabled(cls):
- blacklist = cls.blacklist()
- return [processor for processor in cls.all() if not processor in blacklist]
-
-
- @classmethod
- def default(cls):
- preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
- return preferences.GetString(cls.Default, "")
-
- @classmethod
- def defaultArgs(cls):
- preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
- return preferences.GetString(cls.DefaultArgs, "")
-
- @classmethod
- def blacklist(cls):
- preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
- blacklist = preferences.GetString(cls.Blacklist, "")
- if not blacklist:
- return []
- return eval(blacklist)
-
@classmethod
- def saveDefaults(cls, processor, args, blacklist):
- preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
- preferences.SetString(cls.Default, processor)
- preferences.SetString(cls.DefaultArgs, args)
- preferences.SetString(cls.Blacklist, "%s" % (blacklist))
+ def exists(cls, processor):
+ return processor in PathPreferences.allAvailablePostProcessors()
@classmethod
def load(cls, processor):
diff --git a/src/Mod/Path/PathScripts/PathPreferences.py b/src/Mod/Path/PathScripts/PathPreferences.py
new file mode 100644
index 000000000000..3bdf899e8784
--- /dev/null
+++ b/src/Mod/Path/PathScripts/PathPreferences.py
@@ -0,0 +1,101 @@
+# -*- coding: utf-8 -*-
+
+# ***************************************************************************
+# * *
+# * Copyright (c) 2014 Yorik van Havre *
+# * *
+# * This program is free software; you can redistribute it and/or modify *
+# * it under the terms of the GNU Lesser General Public License (LGPL) *
+# * as published by the Free Software Foundation; either version 2 of *
+# * the License, or (at your option) any later version. *
+# * for detail see the LICENCE text file. *
+# * *
+# * This program is distributed in the hope that it will be useful, *
+# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+# * GNU Library General Public License for more details. *
+# * *
+# * You should have received a copy of the GNU Library General Public *
+# * License along with this program; if not, write to the Free Software *
+# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
+# * USA *
+# * *
+# ***************************************************************************
+
+import FreeCAD
+import os
+import glob
+
+class PathPreferences:
+ PostProcessorDefault = "PostProcessorDefault"
+ PostProcessorDefaultArgs = "PostProcessorDefaultArgs"
+ PostProcessorBlacklist = "PostProcessorBlacklist"
+
+ @classmethod
+ def allAvailablePostProcessors(cls):
+ path = FreeCAD.getHomePath() + ("Mod/Path/PathScripts/")
+ posts = glob.glob(path + '/*_post.py')
+ allposts = [ str(os.path.split(os.path.splitext(p)[0])[1][:-5]) for p in posts]
+
+ grp = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Macro")
+ path = grp.GetString("MacroPath", FreeCAD.getUserAppDataDir())
+ posts = glob.glob(path + '/*_post.py')
+
+ allposts.extend([ str(os.path.split(os.path.splitext(p)[0])[1][:-5]) for p in posts])
+ allposts.sort()
+ return allposts
+
+ @classmethod
+ def allEnabledPostProcessors(cls, include = None):
+ blacklist = cls.postProcessorBlacklist()
+ enabled = [processor for processor in cls.allAvailablePostProcessors() if not processor in blacklist]
+ if include:
+ include.extend(enabled)
+ return include
+ return enabled
+
+
+ @classmethod
+ def defaultPostProcessor(cls):
+ preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
+ return preferences.GetString(cls.PostProcessorDefault, "")
+
+ @classmethod
+ def defaultPostProcessorArgs(cls):
+ preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
+ return preferences.GetString(cls.PostProcessorDefaultArgs, "")
+
+ @classmethod
+ def postProcessorBlacklist(cls):
+ preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
+ blacklist = preferences.GetString(cls.PostProcessorBlacklist, "")
+ if not blacklist:
+ return []
+ return eval(blacklist)
+
+ @classmethod
+ def savePostProcessorDefaults(cls, processor, args, blacklist):
+ preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
+ preferences.SetString(cls.PostProcessorDefault, processor)
+ preferences.SetString(cls.PostProcessorDefaultArgs, args)
+ preferences.SetString(cls.PostProcessorBlacklist, "%s" % (blacklist))
+
+
+ DefaultOutputFile = "DefaultOutputFile"
+ DefaultOutputPolicy = "DefaultOutputPolicy"
+
+ @classmethod
+ def saveOutputFileDefaults(cls, file, policy):
+ preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
+ preferences.SetString(cls.DefaultOutputFile, file)
+ preferences.SetString(cls.DefaultOutputPolicy, policy)
+
+ @classmethod
+ def defaultOutputFile(cls):
+ preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
+ return preferences.GetString(cls.DefaultOutputFile, "")
+
+ @classmethod
+ def defaultOutputPolicy(cls):
+ preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
+ return preferences.GetString(cls.DefaultOutputPolicy, "")
diff --git a/src/Mod/Path/PathScripts/PathPreferencesPathJob.py b/src/Mod/Path/PathScripts/PathPreferencesPathJob.py
index 2cba8164c625..b5a0e4389538 100644
--- a/src/Mod/Path/PathScripts/PathPreferencesPathJob.py
+++ b/src/Mod/Path/PathScripts/PathPreferencesPathJob.py
@@ -25,8 +25,8 @@
import FreeCAD
import FreeCADGui
from PySide import QtCore, QtGui
+from PathScripts.PathPreferences import PathPreferences
from PathScripts.PathPostProcessor import PostProcessor
-from PathScripts.PathPost import CommandPathPost as PathPost
class Page:
@@ -45,11 +45,11 @@ def saveSettings(self):
item = self.form.postProcessorList.item(i)
if item.checkState() == QtCore.Qt.CheckState.Unchecked:
blacklist.append(item.text())
- PostProcessor.saveDefaults(processor, args, blacklist)
+ PathPreferences.savePostProcessorDefaults(processor, args, blacklist)
path = str(self.form.leOutputFile.text())
policy = str(self.form.cboOutputPolicy.currentText())
- PathPost.saveDefaults(path, policy)
+ PathPreferences.saveOutputFileDefaults(path, policy)
def selectComboEntry(self, widget, text):
index = widget.findText(text, QtCore.Qt.MatchFixedString)
@@ -60,8 +60,8 @@ def selectComboEntry(self, widget, text):
def loadSettings(self):
self.form.defaultPostProcessor.addItem("")
- blacklist = PostProcessor.blacklist()
- for processor in PostProcessor.all():
+ blacklist = PathPreferences.postProcessorBlacklist()
+ for processor in PathPreferences.allAvailablePostProcessors():
self.form.defaultPostProcessor.addItem(processor)
item = QtGui.QListWidgetItem(processor)
if processor in blacklist:
@@ -70,15 +70,15 @@ def loadSettings(self):
item.setCheckState(QtCore.Qt.CheckState.Checked)
item.setFlags( QtCore.Qt.ItemFlag.ItemIsSelectable | QtCore.Qt.ItemFlag.ItemIsEnabled | QtCore.Qt.ItemFlag.ItemIsUserCheckable)
self.form.postProcessorList.addItem(item)
- self.selectComboEntry(self.form.defaultPostProcessor, PostProcessor.default())
+ self.selectComboEntry(self.form.defaultPostProcessor, PathPreferences.defaultPostProcessor())
- self.form.defaultPostProcessorArgs.setText(PostProcessor.defaultArgs())
- self.form.leOutputFile.setText(PathPost.defaultOutputFile())
- self.selectComboEntry(self.form.cboOutputPolicy, PathPost.defaultOutputPolicy())
+ self.form.defaultPostProcessorArgs.setText(PathPreferences.defaultPostProcessorArgs())
+ self.form.leOutputFile.setText(PathPreferences.defaultOutputFile())
+ self.selectComboEntry(self.form.cboOutputPolicy, PathPreferences.defaultOutputPolicy())
self.form.postProcessorList.itemEntered.connect(self.setProcessorListTooltip)
self.form.defaultPostProcessor.currentIndexChanged.connect(self.updateDefaultPostProcessorToolTip)
- self.form.browseFileSystem.clicked.connect(self.browseFileSystem)
+ self.form.pbBrowseFileSystem.clicked.connect(self.browseFileSystem)
def getPostProcessor(self, name):
if not name in self.processor.keys():
@@ -111,6 +111,6 @@ def updateDefaultPostProcessorToolTip(self):
self.form.defaultPostProcessorArgs.setToolTip(self.postProcessorArgsDefaultTooltip)
def browseFileSystem(self):
- foo = QtGui.QFileDialog.getExistingDirectory(QtGui.qApp.activeWindow(), "Path - Output File/Directory", self.form.defaultOutputPath.text())
+ foo = QtGui.QFileDialog.getExistingDirectory(QtGui.qApp.activeWindow(), "Path - Output File/Directory", self.form.leOutputFile.text())
if foo:
- self.form.defaultOutputPath.setText(foo)
+ self.form.leOutputFile.setText(foo)