Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] allow selecting input from open layers only if input is a
layer-type (e.g. raster, vector, mesh). All other inputs can be selected
only from filesystem
  • Loading branch information
alexbruy committed May 14, 2019
1 parent 449c9ce commit 5844a0f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/plugins/processing/gui/BatchInputSelectionPanel.py
Expand Up @@ -85,8 +85,13 @@ def _table(self):
def showPopupMenu(self):
popupmenu = QMenu()

if (isinstance(self.param, QgsProcessingParameterMultipleLayers) and
self.param.layerType() != QgsProcessing.TypeFile):
isLayerParam = isinstance(self.param, (QgsProcessingParameterRasterLayer,
QgsProcessingParameterVectorLayer,
QgsProcessingParameterMeshLayer,
QgsProcessingParameterFeatureSource))

if isLayerParam or (isinstance(self.param, QgsProcessingParameterMultipleLayers) and
self.param.layerType() != QgsProcessing.TypeFile):
selectLayerAction = QAction(self.tr('Select from Open Layers…'), self.pushButton)
selectLayerAction.triggered.connect(self.showLayerSelectionDialog)
popupmenu.addAction(selectLayerAction)
Expand Down

0 comments on commit 5844a0f

Please sign in to comment.