Skip to content
Permalink
Browse files

Merge pull request #8945 from alexbruy/processing-fieldcalc

[processing] use active layer by default in field calculator algorithm (fix #19686)
  • Loading branch information
alexbruy committed Jan 22, 2019
2 parents b129850 + 95209d1 commit 0c4c8feb70ee619942cf6ff10d939e631d3b3515
Showing with 8 additions and 1 deletion.
  1. +8 −1 python/plugins/processing/algs/qgis/ui/FieldsCalculatorDialog.py
@@ -41,9 +41,10 @@
QgsProperty,
QgsProject,
QgsMessageLog,
QgsMapLayer,
QgsProcessingOutputLayerDefinition)
from qgis.gui import QgsEncodingFileDialog, QgsGui
from qgis.utils import OverrideCursor
from qgis.utils import OverrideCursor, iface

from processing.core.ProcessingConfig import ProcessingConfig
from processing.core.ProcessingLog import ProcessingLog
@@ -86,6 +87,12 @@ def __init__(self, alg):
self.layer = None

self.cmbInputLayer.setFilters(QgsMapLayerProxyModel.VectorLayer)
try:
if iface.activeLayer().type() == QgsMapLayer.VectorLayer:
self.cmbInputLayer.setLayer(iface.activeLayer())
except:
pass

self.cmbInputLayer.layerChanged.connect(self.updateLayer)
self.btnBrowse.clicked.connect(self.selectFile)
self.mNewFieldGroupBox.toggled.connect(self.toggleExistingGroup)

0 comments on commit 0c4c8fe

Please sign in to comment.
You can’t perform that action at this time.