Skip to content

Commit

Permalink
[processing] more complete scope for expressions in outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
volaya committed Apr 25, 2016
1 parent 7805c64 commit e9a3089
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/plugins/processing/gui/OutputSelectionPanel.py
Expand Up @@ -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('')

Expand Down

0 comments on commit e9a3089

Please sign in to comment.