Skip to content

Commit 9ce7e54

Browse files
authoredDec 20, 2018
allow selection of file paths for mesh layers [processings] (#8702)
allow selection of file paths for mesh layers
1 parent be34a0e commit 9ce7e54

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed
 

‎python/plugins/processing/gui/BatchInputSelectionPanel.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
QgsProcessingParameterRasterLayer,
4141
QgsProcessingParameterDefinition,
4242
QgsProcessingParameterVectorLayer,
43+
QgsProcessingParameterMeshLayer,
4344
QgsProcessingParameterFeatureSource)
4445

4546
from processing.gui.MultipleInputDialog import MultipleInputDialog
@@ -101,11 +102,15 @@ def showPopupMenu(self):
101102
def showLayerSelectionDialog(self):
102103
layers = []
103104
if (isinstance(self.param, QgsProcessingParameterRasterLayer) or
104-
(isinstance(self.param, QgsProcessingParameterMultipleLayers) and
105-
self.param.layerType() == QgsProcessing.TypeRaster)):
105+
(isinstance(self.param, QgsProcessingParameterMultipleLayers) and
106+
self.param.layerType() == QgsProcessing.TypeRaster)):
106107
layers = QgsProcessingUtils.compatibleRasterLayers(QgsProject.instance())
107108
elif isinstance(self.param, QgsProcessingParameterVectorLayer):
108109
layers = QgsProcessingUtils.compatibleVectorLayers(QgsProject.instance())
110+
elif (isinstance(self.param, QgsProcessingParameterMeshLayer) or
111+
(isinstance(self.param, QgsProcessingParameterMultipleLayers) and
112+
self.param.layerType() == QgsProcessing.TypeMesh)):
113+
layers = QgsProcessingUtils.compatibleMeshLayers(QgsProject.instance())
109114
else:
110115
datatypes = [QgsProcessing.TypeVectorAnyGeometry]
111116
if isinstance(self.param, QgsProcessingParameterFeatureSource):

‎python/plugins/processing/gui/wrappers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,13 @@ def setComboBoxFilters(self, combo):
10151015
def selectFile(self):
10161016
filename, selected_filter = self.getFileName(self.combo.currentText())
10171017
if filename:
1018-
self.combo.setEditText(filename)
1018+
if isinstance(self.combo, QgsMapLayerComboBox):
1019+
items = self.combo.additionalItems()
1020+
items.append(filename)
1021+
self.combo.setAdditionalItems(items)
1022+
self.combo.setCurrentIndex(self.combo.findText(filename))
1023+
else:
1024+
self.combo.setEditText(filename)
10191025
self.widgetValueHasChanged.emit(self)
10201026

10211027

0 commit comments

Comments
 (0)
Please sign in to comment.