Skip to content
Permalink
Browse files

[processing] homogenize filter strings for models and scripts

  • Loading branch information
alexbruy committed Aug 3, 2018
1 parent 3e76088 commit 65ae32aaddfea1d5c58c4b6a4978903c471867d2
@@ -53,7 +53,7 @@ def execute(self):
lastDir = settings.value('Processing/lastModelsDir', '')
filename, selected_filter = QFileDialog.getOpenFileName(self.toolbox,
self.tr('Open Model', 'AddModelFromFileAction'), lastDir,
self.tr('Processing model files (*.model3 *.MODEL3)', 'AddModelFromFileAction'))
self.tr('Processing models (*.model3 *.MODEL3)', 'AddModelFromFileAction'))
if filename:
settings.setValue('Processing/lastModelsDir',
QFileInfo(filename).absoluteDir().absolutePath())
@@ -607,7 +607,7 @@ def exportAsSvg(self):
def exportAsPython(self):
filename, filter = QFileDialog.getSaveFileName(self,
self.tr('Save Model As Python Script'), '',
self.tr('Python files (*.py *.PY)'))
self.tr('Processing scripts (*.py *.PY)'))
if not filename:
return

@@ -634,7 +634,7 @@ def saveModel(self, saveAs):
filename, filter = QFileDialog.getSaveFileName(self,
self.tr('Save Model'),
ModelerUtils.modelsFolders()[0],
self.tr('Processing models (*.model3)'))
self.tr('Processing models (*.model3 *.MODEL3)'))
if filename:
if not filename.endswith('.model3'):
filename += '.model3'
@@ -51,7 +51,7 @@ def execute(self):
lastDir = settings.value('Processing/lastModelsDir', '')
filename, selected_filter = QFileDialog.getOpenFileName(self.toolbox,
self.tr('Open Model', 'AddModelFromFileAction'), lastDir,
self.tr('Processing model files (*.model3 *.MODEL3)', 'AddModelFromFileAction'))
self.tr('Processing models (*.model3 *.MODEL3)', 'AddModelFromFileAction'))
if filename:
settings.setValue('Processing/lastModelsDir',
QFileInfo(filename).absoluteDir().absolutePath())
@@ -50,7 +50,7 @@ def execute(self):
files, _ = QFileDialog.getOpenFileNames(self.toolbox,
self.tr("Add script(s)"),
lastDir,
self.tr("Script files (*.py *.PY)"))
self.tr("Processing scripts (*.py *.PY)"))
if files:
settings.setValue("processing/lastScriptsDir", os.path.dirname(files[0]))

@@ -51,7 +51,7 @@ def execute(self):
lastDir = settings.value('Processing/lastScriptsDir', '')
filename, selected_filter = QFileDialog.getOpenFileName(self.toolbox,
self.tr('Open Script', 'AddScriptFromFileAction'), lastDir,
self.tr('Script files (*.py)', 'AddScriptFromFileAction'))
self.tr('Processing scripts (*.py *.PY)', 'AddScriptFromFileAction'))
if filename:
settings.setValue('Processing/lastScriptsDir',
QFileInfo(filename).absoluteDir().absolutePath())
@@ -176,7 +176,7 @@ def openScript(self):
fileName, _ = QFileDialog.getOpenFileName(self,
self.tr("Open script"),
scriptDir,
self.tr("Script files (*.py *.PY)"))
self.tr("Processing scripts (*.py *.PY)"))

if fileName == "":
return
@@ -197,7 +197,7 @@ def saveScript(self, saveAs):
newPath, _ = QFileDialog.getSaveFileName(self,
self.tr("Save script"),
scriptDir,
self.tr("Script files (*.py *.PY)"))
self.tr("Processing scripts (*.py *.PY)"))

if newPath:
if not newPath.lower().endswith(".py"):

1 comment on commit 65ae32a

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson commented on 65ae32a Aug 3, 2018

Nice!

Please sign in to comment.
You can’t perform that action at this time.