Skip to content

Commit

Permalink
[processing] more checks before running model
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Jan 19, 2016
1 parent 4b079ae commit f762380
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/plugins/processing/gui/ProcessingToolbox.py
Expand Up @@ -222,9 +222,9 @@ def executeAlgorithm(self):
message = alg.checkBeforeOpeningParametersDialog()
if message:
dlg = MessageDialog()
dlg.setTitle(self.tr('Missing dependency'))
dlg.setTitle(self.tr('Error executing algorithm'))
dlg.setMessage(
self.tr('<h3>Missing dependency. This algorithm cannot '
self.tr('<h3>This algorithm cannot '
'be run :-( </h3>\n%s') % message)
dlg.exec_()
return
Expand Down
6 changes: 6 additions & 0 deletions python/plugins/processing/modeler/ModelerAlgorithm.py
Expand Up @@ -511,6 +511,12 @@ def commandLineName(self):
else:
return 'modeler:' + os.path.basename(self.descriptionFile)[:-6].lower()

def checkBeforeOpeningParametersDialog(self):
for alg in self.algs.values():
algInstance = ModelerUtils.getAlgorithm(alg.consoleName)
if algInstance is None:
return "The model you are trying to run contains an algorithm that is not available: <i>%s</i>" % alg.consoleName

def setModelerView(self, dialog):
self.modelerdialog = dialog

Expand Down

0 comments on commit f762380

Please sign in to comment.