Skip to content
Permalink
Browse files

make "use value from field" available in Random Points tools, also show

only integer fields (fix #4570)
  • Loading branch information
alexbruy committed May 22, 2012
1 parent fbdebd1 commit c94269cce2a3189596f470b0f0e0175108a8ed4d
Showing with 4 additions and 3 deletions.
  1. +4 −3 python/plugins/fTools/tools/doRandPoints.py
@@ -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))
@@ -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)

0 comments on commit c94269c

Please sign in to comment.
You can’t perform that action at this time.