diff --git a/Code/Mantid/Framework/DataHandling/src/Load.cpp b/Code/Mantid/Framework/DataHandling/src/Load.cpp index 8fe2c475e27d25b4e04668a481d54020e6a21a20..97297251a207e7adc50c298a8d7bf9f95942a90b 100644 --- a/Code/Mantid/Framework/DataHandling/src/Load.cpp +++ b/Code/Mantid/Framework/DataHandling/src/Load.cpp @@ -241,11 +241,13 @@ namespace Mantid */ void Load::exec() { - const std::string loaderName = getPropertyValue("LoaderName"); + std::string loaderName = getPropertyValue("LoaderName"); IDataFileChecker_sptr loader; if( loaderName.empty() ) { loader = getFileLoader(getPropertyValue("Filename")); + loaderName = loader->name(); + setPropertyValue("LoaderName", loaderName); } else { diff --git a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/AlgorithmDialog.h b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/AlgorithmDialog.h index 51d9a213db073f189b3795a4d51d7c5596d10bb0..d088b9334ee796350067c7da8b1186982393bc35 100644 --- a/Code/Mantid/MantidQt/API/inc/MantidQtAPI/AlgorithmDialog.h +++ b/Code/Mantid/MantidQt/API/inc/MantidQtAPI/AlgorithmDialog.h @@ -147,8 +147,8 @@ protected: /// Adds a property (name,value) pair to the stored map void storePropertyValue(const QString & name, const QString & value); - /// Set the properties that have been parsed from the dialog - bool setPropertyValues(); + /// Set properties on this algorithm by pulling values from the tied widgets + bool setPropertyValues(const QStringList & skipList = QStringList()); //@} /** @name Dialog information */ diff --git a/Code/Mantid/MantidQt/API/src/AlgorithmDialog.cpp b/Code/Mantid/MantidQt/API/src/AlgorithmDialog.cpp index 609f29e81ee43e12b820fe778d297e8e00f19b2e..e67b662fa3766e03dd3d64bc65e4819eca36f1fc 100644 --- a/Code/Mantid/MantidQt/API/src/AlgorithmDialog.cpp +++ b/Code/Mantid/MantidQt/API/src/AlgorithmDialog.cpp @@ -226,22 +226,31 @@ void AlgorithmDialog::storePropertyValue(const QString & name, const QString & v /** * Set the properties that have been parsed from the dialog. + * @param skipList :: An optional list of property names whose values will not be set * @returns A boolean that indicates if the validation was successful. */ -bool AlgorithmDialog::setPropertyValues() +bool AlgorithmDialog::setPropertyValues(const QStringList & skipList) { QStringList::const_iterator pend = m_algProperties.end(); bool allValid(true); for( QStringList::const_iterator pitr = m_algProperties.begin(); pitr != pend; ++pitr ) { const QString pName = *pitr; + Mantid::Kernel::Property *p = getAlgorithmProperty(pName); QString value = getInputValue(pName); QLabel *validator = getValidatorMarker(pName); std::string error(""); - Mantid::Kernel::Property *p = getAlgorithmProperty(pName); + try { - error = p->setValue(value.toStdString()); + if( skipList.contains(pName) ) + { + error = p->isValid(); + } + else + { + error = p->setValue(value.toStdString()); + } } catch(std::exception & err_details) { diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp index a52748795f848581fe43867da985340cee17ef8d..7dca258eb0aaf0dc8b9bde4f2c27f943d4d51080 100644 --- a/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp +++ b/Code/Mantid/MantidQt/CustomDialogs/src/LoadDialog.cpp @@ -3,6 +3,7 @@ //------------------------------------------------------------------------------ #include "MantidQtCustomDialogs/LoadDialog.h" #include "MantidQtMantidWidgets/MWRunFiles.h" +#include "MantidQtAPI/AlgorithmInputHistory.h" // Qt #include <QLineEdit> #include <QCheckBox> @@ -120,6 +121,9 @@ namespace MantidQt { m_fileWidget->saveSettings("Mantid/Algorithms/Load"); AlgorithmDialog::saveInput(); + //Ensure the filename is store as the full file + API::AlgorithmInputHistory::Instance().storeNewValue("Load", + QPair<QString, QString>("Filename", m_currentFile)); } /** @@ -133,7 +137,9 @@ namespace MantidQt // Add the helpful summary message if( isMessageAvailable() ) + { this->addOptionalMessage(staticLayout); + } // Filename widget m_fileWidget = new MantidWidgets::MWRunFiles(this); @@ -193,7 +199,6 @@ namespace MantidQt } m_loaderLayout->deleteLater(); m_loaderLayout = NULL; - this->adjustSize(); } m_loaderLayout = new QGridLayout; @@ -250,7 +255,7 @@ namespace MantidQt } // Attempt to set any values that may have been retrieved - setPropertyValues(); + setPropertyValues(QStringList("Filename")); } /** diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/MWRunFiles.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/MWRunFiles.cpp index 9e71841daac5a7ba642ccdae6b4b50f62f2bb51f..ff894f3ceb0caa20f635b8d1d4de3efc72eda451 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/src/MWRunFiles.cpp +++ b/Code/Mantid/MantidQt/MantidWidgets/src/MWRunFiles.cpp @@ -318,7 +318,7 @@ int MWRunFiles::getEntryNum() const */ QVariant MWRunFiles::getUserInput() const { - return QVariant(m_uiForm.fileEditor->text()); + return QVariant(getText()); } /** @@ -518,8 +518,8 @@ QString MWRunFiles::createFileFilter() ext = sitr.next(); QString key = ext.toUpper(); bool found(false); - const size_t itemCount = finalIndex.count(); - for( size_t i = 0 ; i < itemCount; ++i ) + const int itemCount = finalIndex.count(); + for( int i = 0 ; i < itemCount; ++i ) { if( key == finalIndex[i].first ) {