/**
 * Handles configuration values being changed.
 *
 * Currently checks for data search paths and default facility.
 *
 * @param pNf Poco notification
 */
void IndirectDataReduction::handleConfigChange(
    Mantid::Kernel::ConfigValChangeNotification_ptr pNf) {
  std::string key = pNf->key();
  std::string value = pNf->curValue();

  if (key == "datasearch.directories" || key == "defaultsave.directory") {
    readSettings();
  } else if (key == "default.facility") {
    QString facility = QString::fromStdString(value);

    filterUiForFacility(facility);
    m_uiForm.iicInstrumentConfiguration->setFacility(facility);
  }
}
Пример #2
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));
      }
    }

  }
Пример #3
0
/** Update the output directory label if the Mantid system output
*  directory has changed
*  @param pDirInfo :: a pointer to an object with the output directory name in
* it
*/
void SANSAddFiles::changeOutputDir(
    Mantid::Kernel::ConfigValChangeNotification_ptr pDirInfo) {
  if (pDirInfo->key() == "defaultsave.directory") {
    setOutDir(pDirInfo->curValue());
  }
}