/**
 * 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
 /**
  * Handles a change in directory.
  *
  * @param pNf :: notification
  */
 void IndirectLoadAscii::handleDirectoryChange(Mantid::Kernel::ConfigValChangeNotification_ptr pNf)
 {
   std::string key = pNf->key();
   if ( key == "defaultsave.directory" )
   {
     loadSettings();
   }
 }
示例#3
0
void IndirectDataReduction::handleDirectoryChange(Mantid::Kernel::ConfigValChangeNotification_ptr pNf)
{
  std::string key = pNf->key();

  if ( key == "datasearch.directories" || key == "defaultsave.directory" )
  {
    loadSettings();
  }
}
示例#4
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));
      }
    }

  }
示例#5
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());
  }
}