Skip to content
Permalink
Browse files

[processing] more complete scope for expressions in outputs

  • Loading branch information
volaya committed Apr 25, 2016
1 parent 7805c64 commit e9a3089670947318426eae2b314ec1c1a6806657
Showing with 7 additions and 1 deletion.
  1. +7 −1 python/plugins/processing/gui/OutputSelectionPanel.py
@@ -108,12 +108,18 @@ def selectOutput(self):

def showExpressionsBuilder(self):
context = QgsExpressionContext()
context.appendScope(QgsExpressionContextUtils.projectScope())
context.appendScope(QgsExpressionContextUtils.globalScope())
scope = QgsExpressionContextUtils.projectScope()
self.addVariablesToScope(scope)
dlg = QgsExpressionBuilderDialog(None, self.leText.text(), self, "generic", context)
dlg.setWindowTitle(self.tr("Expression based output"));
if dlg.exec_() == QDialog.Accepted:
self.leText.setText(dlg.expressionText())

def addVariablesToScope(self, scope):
for param in self.ag.parameters:
scope.setVariable("%s_value" % param.name, "")

def saveToTemporaryFile(self):
self.leText.setText('')

0 comments on commit e9a3089

Please sign in to comment.