Skip to content

Commit

Permalink
[processing] homogenize filter strings for models and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Aug 3, 2018
1 parent 3e76088 commit 65ae32a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/modeler/ModelerDialog.py
Expand Up @@ -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

Expand All @@ -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'
Expand Down
Expand Up @@ -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())
Expand Down
Expand Up @@ -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]))

Expand Down
Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/script/ScriptEditorDialog.py
Expand Up @@ -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
Expand All @@ -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"):
Expand Down

1 comment on commit 65ae32a

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Please sign in to comment.