Fix running processing algs through locator

This commit is contained in:
Nyall Dawson 2017-06-11 20:54:03 +10:00
parent f5a0243c9d
commit be2ec2f1a7

View File

@ -72,17 +72,16 @@ class AlgorithmLocatorFilter(QgsLocatorFilter):
self.resultFetched.emit(result)
def triggerResult(self, result):
a = QgsApplication.processingRegistry().algorithmById(result.userData)
if a:
alg = a.getCopy()
message = alg.checkBeforeOpeningParametersDialog()
if message:
alg = QgsApplication.processingRegistry().algorithmById(result.userData)
if alg:
ok, message = alg.canExecute()
if not ok:
dlg = MessageDialog()
dlg.setTitle(self.tr('Missing dependency'))
dlg.setMessage(message)
dlg.exec_()
return
dlg = alg.getCustomParametersDialog()
dlg = alg.createCustomParametersWidget()
if not dlg:
dlg = AlgorithmDialog(alg)
canvas = iface.mapCanvas()