Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[processing] more complete scope for expressions in outputs
- Loading branch information
Showing
with
7 additions
and
1 deletion.
-
+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('') |
|
|
|
|
|