Esempio n. 1
0
  void InstrumentSelector::handleConfigChange(Mantid::Kernel::ConfigValChangeNotification_ptr pNf)
  {
    if(!m_updateOnFacilityChange)
      return;

    QString prop = QString::fromStdString(pNf->key());
    QString newV = QString::fromStdString(pNf->curValue());
    QString oldV = QString::fromStdString(pNf->preValue());

    if ( newV != oldV )
    {
      if ( ( prop == "default.facility" ) && ( newV != QString::fromStdString(m_currentFacility->name()) ) )
      {
        fillWithInstrumentsFromFacility(newV);
      }
      else if ( ( prop == "default.instrument" ) && ( newV != this->currentText() ) )
      {
        this->setCurrentIndex(this->findText(newV));
      }
    }

  }