Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] use active layer by default in field calculator algorithm
(fix #19686)

(cherry picked from commit 95209d1)
  • Loading branch information
alexbruy authored and nyalldawson committed Jan 22, 2019
1 parent f9b0f77 commit a2cb07e
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 a2cb07e

Please sign in to comment.