Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 0c4c8fe
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0c4c8fe

Please sign in to comment.