diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp index 8378f43b2733d0ab412cb04a2418a2c6551e1bea..34c04d59637fb5a324aa49ddcae401be39f32fec 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/DirectConvertToEnergy.cpp @@ -39,8 +39,9 @@ DirectConvertToEnergy::DirectConvertToEnergy(QWidget *parent) : m_curInterfaceSetup(""), m_curEmodeType(DirectConvertToEnergy::Undefined), m_settingsGroup("CustomInterfaces/DirectConvertToEnergy"), m_algRunner(new MantidQt::API::AlgorithmRunner(this)) { - QObject::connect(m_algRunner, SIGNAL(algorithmComplete(bool)), this, SLOT(instrumentLoadingDone(bool))); - QObject::connect(m_algRunner, SIGNAL(algorithmProgress(double, const std::string &)), this, SLOT(instrumentLoadProgress(double, const std::string &))); + //Signals to report load instrument algo progress + connect(m_algRunner, SIGNAL(algorithmComplete(bool)), this, SLOT(instrumentLoadingDone(bool))); + connect(m_algRunner, SIGNAL(algorithmProgress(double, const std::string &)), this, SLOT(instrumentLoadProgress(double, const std::string &))); } /** @@ -48,6 +49,9 @@ DirectConvertToEnergy::DirectConvertToEnergy(QWidget *parent) : */ DirectConvertToEnergy::~DirectConvertToEnergy() { + //Make sure no algos are sunning after the window has been closed + m_algRunner->cancelRunningAlgorithm(); + saveSettings(); } @@ -187,7 +191,9 @@ void DirectConvertToEnergy::instrumentSelectChanged(const QString& name) instLoader->initialize(); instLoader->setProperty("Filename", defFile.toStdString()); instLoader->setProperty("OutputWorkspace", outWS.toStdString()); - + + //Ensure no other algorithm is running + m_algRunner->cancelRunningAlgorithm(); m_algRunner->startAlgorithm(instLoader); } diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDataReduction.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDataReduction.cpp index bd6aa8d8e3ba1cf0db38552b03486f2156f93be1..c4191b053627ec52ba22b058d15cb6db47857563 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDataReduction.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/IndirectDataReduction.cpp @@ -39,8 +39,9 @@ IndirectDataReduction::IndirectDataReduction(QWidget *parent) : m_curInterfaceSetup(""), m_settingsGroup("CustomInterfaces/IndirectDataReduction"), m_algRunner(new MantidQt::API::AlgorithmRunner(this)) { - QObject::connect(m_algRunner, SIGNAL(algorithmComplete(bool)), this, SLOT(instrumentLoadingDone(bool))); - QObject::connect(m_algRunner, SIGNAL(algorithmProgress(double, const std::string &)), this, SLOT(instrumentLoadProgress(double, const std::string &))); + //Signals to report load instrument algo progress + connect(m_algRunner, SIGNAL(algorithmComplete(bool)), this, SLOT(instrumentLoadingDone(bool))); + connect(m_algRunner, SIGNAL(algorithmProgress(double, const std::string &)), this, SLOT(instrumentLoadProgress(double, const std::string &))); } /** @@ -48,6 +49,9 @@ IndirectDataReduction::IndirectDataReduction(QWidget *parent) : */ IndirectDataReduction::~IndirectDataReduction() { + //Make sure no algos are sunning after the window has been closed + m_algRunner->cancelRunningAlgorithm(); + saveSettings(); } @@ -133,7 +137,6 @@ void IndirectDataReduction::saveSettings() instrName = m_uiForm.cbInst->currentText(); - settings.setValue("instrument-name", instrName); settings.endGroup(); } @@ -183,6 +186,8 @@ void IndirectDataReduction::instrumentSelectChanged(const QString& name) instLoader->setProperty("Filename", defFile.toStdString()); instLoader->setProperty("OutputWorkspace", outWS.toStdString()); + //Ensure no other algorithm is running + m_algRunner->cancelRunningAlgorithm(); m_algRunner->startAlgorithm(instLoader); }