Skip to content

Commit

Permalink
Fix modeler and batch file dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-morvan committed Feb 9, 2017
1 parent 2f68d1a commit c43b04f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions python/plugins/processing/gui/BatchPanel.py
Expand Up @@ -211,10 +211,10 @@ def save(self):
return return
toSave.append({self.PARAMETERS: algParams, self.OUTPUTS: algOutputs}) toSave.append({self.PARAMETERS: algParams, self.OUTPUTS: algOutputs})


filename, __ = str(QFileDialog.getSaveFileName(self, filename, __ = QFileDialog.getSaveFileName(self,
self.tr('Save batch'), self.tr('Save batch'),
None, None,
self.tr('JSON files (*.json)'))) self.tr('JSON files (*.json)'))
if filename: if filename:
if not filename.endswith('.json'): if not filename.endswith('.json'):
filename += '.json' filename += '.json'
Expand Down
7 changes: 4 additions & 3 deletions python/plugins/processing/modeler/ModelerDialog.py
Expand Up @@ -474,9 +474,10 @@ def saveModel(self, saveAs):
self.hasChanged = False self.hasChanged = False


def openModel(self): def openModel(self):
filename, selected_filter = str(QFileDialog.getOpenFileName(self, filename, selected_filter = QFileDialog.getOpenFileName(self,
self.tr('Open Model'), ModelerUtils.modelsFolders()[0], self.tr('Open Model'),
self.tr('Processing models (*.model *.MODEL)'))) ModelerUtils.modelsFolders()[0],
self.tr('Processing models (*.model *.MODEL)'))
if filename: if filename:
try: try:
alg = ModelerAlgorithm.fromFile(filename) alg = ModelerAlgorithm.fromFile(filename)
Expand Down

0 comments on commit c43b04f

Please sign in to comment.