Skip to content
Permalink
Browse files

changed behaviour of pyculator when no selection exist

  • Loading branch information
volaya committed Oct 28, 2012
1 parent 016789a commit 8f6ae95366ee112fbdd039b5aae92a91cea1f0e1
@@ -55,7 +55,7 @@ def defineCharacteristics(self):
self.name = "Field Pyculator"
self.group = "Algorithms for vector layers"
self.addParameter(ParameterVector(self.INPUT_LAYER, "Input layer", ParameterVector.VECTOR_TYPE_ANY, False))
self.addParameter(ParameterBoolean(self.USE_SELECTED, "Use only selected features", False))
self.addParameter(ParameterBoolean(self.USE_SELECTED, "Use only selected features (all if noone selected)", False))
self.addParameter(ParameterString(self.FIELD_NAME, "Result field name", "NewField"))
self.addParameter(ParameterString(self.GLOBAL, "Global expression", multiline = True))
self.addParameter(ParameterString(self.FORMULA, "Formula", "value = ", multiline = True))
@@ -116,8 +116,12 @@ def processAlgorithm(self, progress):
(unicode(sys.exc_info()[0].__name__), unicode(sys.exc_info()[1])))


QtGui.QMessageBox.critical(None, "", str(vprovider))
#run
if not useSelected:

features = layer.selectedFeatures()
nFeatures = len(features)
if not useSelected or nFeatures == 0:
feat = QgsFeature()
if need_attrs:
attr_ind = vprovider.attributeIndexes()
@@ -579,6 +579,8 @@ def setParamTableFieldValue(self, param, widget):
return True

def setParamStringValue(self, param, widget):
if widget.currentText() == "":
return False
idx = widget.findText(widget.currentText())
if idx < 0:
name = self.getSafeNameForHarcodedParameter(param)

0 comments on commit 8f6ae95

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