Skip to content

Commit

Permalink
make "use value from field" available in Random Points tools, also show
Browse files Browse the repository at this point in the history
only integer fields (fix #4570)
  • Loading branch information
alexbruy committed May 22, 2012
1 parent fbdebd1 commit c94269c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/plugins/fTools/tools/doRandPoints.py
Expand Up @@ -50,12 +50,12 @@ def __init__(self, iface):

def populateLayers( self ):
layers = ftools_utils.getLayerNames([QGis.Polygon, "Raster"])
QObject.disconnect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)
self.inShape.blockSignals(True)
self.inShape.clear()
self.inShape.blockSignals(False)
self.inShape.addItems(layers)
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)

# If input layer is changed, update field list
# If input layer is changed, update field list
def update(self, inputLayer):
self.cmbField.clear()
changedLayer = ftools_utils.getMapLayerByName(unicode(inputLayer))
Expand All @@ -67,6 +67,7 @@ def update(self, inputLayer):
changedLayer = ftools_utils.getVectorLayerByName(inputLayer)
changedFields = ftools_utils.getFieldList(changedLayer)
for i in changedFields:
if changedFields[i].typeName() == "Integer":
self.cmbField.addItem(unicode(changedFields[i].name()))
else:
self.rdoUnstratified.setChecked(True)
Expand Down

0 comments on commit c94269c

Please sign in to comment.