def __init__(self, iface):
      QWidget.__init__(self)
      self.iface = iface
      self.algorithm = ('invdist', 'average', 'nearest', 'datametrics')
      self.datametrics = ('minimum', 'maximum', 'range')

      self.setupUi(self)
      BasePluginWidget.__init__(self, self.iface, "gdal_grid")

      # set the default QSpinBoxes value
      self.invdistPowerSpin.setValue(2.0)

      self.outputFormat = Utils.fillRasterOutputFormat()
      self.lastEncoding = Utils.getLastUsedEncoding()

      self.setParamsStatus(
        [
          (self.inputLayerCombo, [SIGNAL("currentIndexChanged(int)"), SIGNAL("editTextChanged(const QString &)")] ),
          (self.outputFileEdit, SIGNAL("textChanged(const QString &)")),
          (self.zfieldCombo, SIGNAL("currentIndexChanged(int)"), self.zfieldCheck),
          (self.algorithmCombo, SIGNAL("currentIndexChanged(int)"), self.algorithmCheck),
          (self.stackedWidget, SIGNAL("currentChanged(int)"), self.algorithmCheck),
          ([self.invdistPowerSpin, self.invdistSmothingSpin, self.invdistRadius1Spin, self.invdistRadius2Spin, self.invdistAngleSpin, self.invdistNoDataSpin], SIGNAL("valueChanged(double)")),
          ([self.invdistMaxPointsSpin, self.invdistMinPointsSpin], SIGNAL("valueChanged(int)")),
          ([self.averageRadius1Spin, self.averageRadius2Spin, self.averageAngleSpin, self.averageNoDataSpin], SIGNAL("valueChanged(double)")),
          (self.averageMinPointsSpin, SIGNAL("valueChanged(int)")),
          ([self.nearestRadius1Spin, self.nearestRadius2Spin, self.nearestAngleSpin, self.nearestNoDataSpin], SIGNAL("valueChanged(double)")),
          (self.datametricsCombo, SIGNAL("currentIndexChanged(int)")),
          ([self.datametricsRadius1Spin, self.datametricsRadius2Spin, self.datametricsAngleSpin, self.datametricsNoDataSpin], SIGNAL("valueChanged(double)")),
          (self.datametricsMinPointsSpin, SIGNAL("valueChanged(int)"))
        ]
      )

      self.connect(self.selectInputFileButton, SIGNAL("clicked()"), self.fillInputFileEdit)
      self.connect(self.selectOutputFileButton, SIGNAL("clicked()"), self.fillOutputFileEdit)
      self.connect(self.inputLayerCombo, SIGNAL("currentIndexChanged(int)"), self.fillFieldsCombo)

      # fill layers combo
      self.fillInputLayerCombo()