Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Removes limitation on maximum no of selectable features. Fixes #2503.…
… Patch thanks to alexbruy.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13020 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
cfarmer committed Mar 8, 2010
1 parent da14012 commit 73f32cf
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions python/plugins/fTools/tools/doSubsetSelect.py
@@ -1,8 +1,8 @@
#-----------------------------------------------------------
#
#
# Random selection within subsets
#
# A QGIS plugin for randomly selecting features from
# A QGIS plugin for randomly selecting features from
# within multiple user defined subsets based on an input field.
#
# Copyright (C) 2008 Carson Farmer
Expand All @@ -11,23 +11,23 @@
# WEB : www.geog.uvic.ca/spar/carson
#
#-----------------------------------------------------------
#
#
# licensed under the terms of GNU GPL 2
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#
#--------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
Expand All @@ -42,7 +42,7 @@ def __init__(self, iface):
self.iface = iface
# Set up the user interface from Designer.
self.setupUi(self)
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)
self.setWindowTitle(self.tr("Random selection within subsets"))
# populate layer list
self.progressBar.setValue(0)
Expand All @@ -58,6 +58,8 @@ def update(self, inputLayer):
changedField = self.getFieldList(changedLayer)
for i in changedField:
self.inField.addItem(unicode(changedField[i].name()))
maxFeatures = changedLayer.dataProvider().featureCount()
self.spnNumber.setMaximum( maxFeatures )

def accept(self):
if self.inShape.currentText() == "":
Expand Down Expand Up @@ -158,7 +160,7 @@ def getFieldList(self, vlayer):
return myFields

def getUniqueValues(self, provider, index):
allAttrs = provider.attributeIndexes()
allAttrs = provider.attributeIndexes()
provider.select(allAttrs)
feat = QgsFeature()
values = []
Expand Down

0 comments on commit 73f32cf

Please sign in to comment.