Skip to content
Permalink
Browse files
first fix for new vector api in SEXTANTE
  • Loading branch information
alexbruy committed Feb 1, 2013
1 parent 2f23b1e commit 7af82cab89f42001efc67ead71807c2df92a711b
Showing with 19 additions and 15 deletions.
  1. +19 −15 python/plugins/sextante/gui/ParametersPanel.py
@@ -25,36 +25,41 @@

import os
import locale

from PyQt4 import QtCore, QtGui
from sextante.gui.OutputSelectionPanel import OutputSelectionPanel

from sextante.core.QGisLayers import QGisLayers
from sextante.parameters.ParameterRaster import ParameterRaster
from sextante.core.SextanteConfig import SextanteConfig

from sextante.gui.OutputSelectionPanel import OutputSelectionPanel
from sextante.gui.InputLayerSelectorPanel import InputLayerSelectorPanel
from sextante.gui.FixedTablePanel import FixedTablePanel
from sextante.gui.RangePanel import RangePanel
from sextante.gui.MultipleInputPanel import MultipleInputPanel
from sextante.gui.NumberInputPanel import NumberInputPanel
from sextante.gui.ExtentSelectionPanel import ExtentSelectionPanel
from sextante.gui.FileSelectionPanel import FileSelectionPanel
from sextante.gui.CrsSelectionPanel import CrsSelectionPanel

from sextante.parameters.ParameterRaster import ParameterRaster
from sextante.parameters.ParameterVector import ParameterVector
from sextante.parameters.ParameterTable import ParameterTable
from sextante.parameters.ParameterBoolean import ParameterBoolean
from sextante.parameters.ParameterTableField import ParameterTableField
from sextante.parameters.ParameterSelection import ParameterSelection
from sextante.parameters.ParameterFixedTable import ParameterFixedTable
from sextante.gui.FixedTablePanel import FixedTablePanel
from sextante.parameters.ParameterRange import ParameterRange
from sextante.gui.RangePanel import RangePanel
from sextante.parameters.ParameterMultipleInput import ParameterMultipleInput
from sextante.parameters.ParameterNumber import ParameterNumber
from sextante.gui.MultipleInputPanel import MultipleInputPanel
from sextante.gui.NumberInputPanel import NumberInputPanel
from sextante.gui.ExtentSelectionPanel import ExtentSelectionPanel
from sextante.parameters.ParameterExtent import ParameterExtent
from sextante.core.SextanteConfig import SextanteConfig
from sextante.parameters.ParameterFile import ParameterFile
from sextante.gui.FileSelectionPanel import FileSelectionPanel
from sextante.parameters.ParameterCrs import ParameterCrs
from sextante.gui.CrsSelectionPanel import CrsSelectionPanel
from sextante.parameters.ParameterString import ParameterString

from sextante.outputs.OutputHTML import OutputHTML
from sextante.outputs.OutputRaster import OutputRaster
from sextante.outputs.OutputTable import OutputTable
from sextante.outputs.OutputVector import OutputVector
from sextante.parameters.ParameterString import ParameterString

class ParametersPanel(QtGui.QWidget):

@@ -320,13 +325,13 @@ def getFields(self, layer, datatype):
fieldTypes = [QtCore.QVariant.Int, QtCore.QVariant.Double]

fieldNames = []
fieldMap = layer.pendingFields()
fields = layer.pendingFields()
if len(fieldTypes) == 0:
for idx, field in fieldMap.iteritems():
for field in fields:
if not field.name() in fieldNames:
fieldNames.append( unicode( field.name() ) )
else:
for idx, field in fieldMap.iteritems():
for field in fields:
if field.type() in fieldTypes and not field.name() in fieldNames:
fieldNames.append( unicode( field.name() ) )
return sorted( fieldNames, cmp=locale.strcoll )
@@ -375,4 +380,3 @@ def setTableContent(self):
self.tableWidget.setCellWidget(i,1, item)
self.tableWidget.setRowHeight(i,22)
i+=1

0 comments on commit 7af82ca

Please sign in to comment.