diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp index 6fdeb2655b8cb89726fb901b23ed5d0c068c6d1f..8378f43b2733d0ab412cb04a2418a2c6551e1bea 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp @@ -168,12 +168,16 @@ void DirectConvertToEnergy::setDefaultInstrument(const QString & name) */ void DirectConvertToEnergy::instrumentSelectChanged(const QString& name) { - if(! m_uiForm.cbInst->isVisible()) - return; + m_uiForm.instLoadProgressLabel->setVisible(true); QString defFile = (Mantid::API::ExperimentInfo::getInstrumentFilename(name.toStdString())).c_str(); - if(defFile == "") + if((defFile == "") || !m_uiForm.cbInst->isVisible()) + { + m_uiForm.instLoadProgressLabel->setText(QString("Instument loading failed!")); + m_uiForm.cbInst->setEnabled(true); + m_uiForm.pbRun->setEnabled(true); return; + } m_curInterfaceSetup = name; @@ -184,7 +188,6 @@ void DirectConvertToEnergy::instrumentSelectChanged(const QString& name) instLoader->setProperty("Filename", defFile.toStdString()); instLoader->setProperty("OutputWorkspace", outWS.toStdString()); - m_uiForm.instLoadProgressLabel->setVisible(true); m_algRunner->startAlgorithm(instLoader); } @@ -193,16 +196,15 @@ void DirectConvertToEnergy::instrumentSelectChanged(const QString& name) */ void DirectConvertToEnergy::instrumentLoadingDone(bool error) { - if(error) + QString curInstPrefix = m_uiForm.cbInst->itemData(m_uiForm.cbInst->currentIndex()).toString(); + if((curInstPrefix == "") || error) { - m_curInterfaceSetup = ""; + m_uiForm.instLoadProgressLabel->setText(QString("Instument loading failed!")); + m_uiForm.cbInst->setEnabled(true); + m_uiForm.pbRun->setEnabled(true); return; } - QString curInstPrefix = m_uiForm.cbInst->itemData(m_uiForm.cbInst->currentIndex()).toString(); - if(curInstPrefix == "") - return; - if(m_directInstruments == NULL) { m_directInstruments = new Homer(qobject_cast<QWidget*>(this->parent()), m_uiForm); diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectConvertToEnergy.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectConvertToEnergy.cpp index 862372750a970050d949f4bfa91774476b727c8f..57164aa068f27330f731c22d93d4c7884333998a 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectConvertToEnergy.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectConvertToEnergy.cpp @@ -161,12 +161,16 @@ void IndirectConvertToEnergy::setDefaultInstrument(const QString & name) */ void IndirectConvertToEnergy::instrumentSelectChanged(const QString& name) { - if(! m_uiForm.cbInst->isVisible()) - return; + m_uiForm.instLoadProgressLabel->setVisible(true); QString defFile = (Mantid::API::ExperimentInfo::getInstrumentFilename(name.toStdString())).c_str(); - if(defFile == "") + if((defFile == "") || !m_uiForm.cbInst->isVisible()) + { + m_uiForm.instLoadProgressLabel->setText(QString("Instument loading failed!")); + m_uiForm.cbInst->setEnabled(true); + m_uiForm.pbRun->setEnabled(true); return; + } QString outWS = "__empty_" + m_uiForm.cbInst->currentText(); @@ -179,7 +183,6 @@ void IndirectConvertToEnergy::instrumentSelectChanged(const QString& name) instLoader->setProperty("Filename", defFile.toStdString()); instLoader->setProperty("OutputWorkspace", outWS.toStdString()); - m_uiForm.instLoadProgressLabel->setVisible(true); m_algRunner->startAlgorithm(instLoader); } @@ -188,16 +191,15 @@ void IndirectConvertToEnergy::instrumentSelectChanged(const QString& name) */ void IndirectConvertToEnergy::instrumentLoadingDone(bool error) { - if(error) + QString curInstPrefix = m_uiForm.cbInst->itemData(m_uiForm.cbInst->currentIndex()).toString(); + if((curInstPrefix == "") || error) { - m_curInterfaceSetup = ""; + m_uiForm.instLoadProgressLabel->setText(QString("Instument loading failed!")); + m_uiForm.cbInst->setEnabled(true); + m_uiForm.pbRun->setEnabled(true); return; } - QString curInstPrefix = m_uiForm.cbInst->itemData(m_uiForm.cbInst->currentIndex()).toString(); - if(curInstPrefix == "") - return; - if(!m_indirectInstruments) { m_indirectInstruments = new Indirect(qobject_cast<QWidget*>(this->parent()), m_uiForm);