diff --git a/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmDialog.h b/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmDialog.h index b76d2429daad9e78f8a4296c20cecf314cbce613..56ae4633890d5913f0ff6a35d7b1b4651896159a 100644 --- a/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmDialog.h +++ b/qt/widgets/common/inc/MantidQtWidgets/Common/AlgorithmDialog.h @@ -252,7 +252,7 @@ protected: /// argument /// @param propName :: Name of the property /// @return Previous value. If there is no value, empty string is returned - QString getPreviousValue(const QString &propName); + QString getPreviousValue(const QString &propName) const; /// Set a value based on any old input that we have void setPreviousValue(QWidget *widget, const QString &property); /// Handle completion of algorithm started while staying open diff --git a/qt/widgets/common/src/AlgorithmDialog.cpp b/qt/widgets/common/src/AlgorithmDialog.cpp index 872f92a818b4cd59e7969c750757dc82bdddb5ff..a9c97719c5a58f165adc318c543327d1f864655c 100644 --- a/qt/widgets/common/src/AlgorithmDialog.cpp +++ b/qt/widgets/common/src/AlgorithmDialog.cpp @@ -944,7 +944,7 @@ QString AlgorithmDialog::getValue(QWidget *widget) { } } -QString AlgorithmDialog::getPreviousValue(const QString &propName) { +QString AlgorithmDialog::getPreviousValue(const QString &propName) const { QString value; if (!isForScript()) { diff --git a/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/FitDialog.h b/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/FitDialog.h index e17b6ce5f669da6daf94c9643e4bc66b5ab2e3cb..23018d4052bc400b8509d2d00550f94310891c8c 100644 --- a/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/FitDialog.h +++ b/qt/widgets/plugins/algorithm_dialogs/inc/MantidQtWidgets/Plugins/AlgorithmDialogs/FitDialog.h @@ -95,8 +95,6 @@ private: /// Get the domain type: Simple, Sequential, or Parallel QString getDomainTypeString() const; - /// Return property value stored in history - QString getStoredPropertyValue(const QString &propName) const; /// Get allowed values for a property QStringList getAllowedPropertyValues(const QString &propName) const; /// Set i-th workspace name @@ -123,7 +121,7 @@ public: InputWorkspaceWidget(FitDialog *parent, int domainIndex = 0); /// Return property value stored in history QString getStoredPropertyValue(const QString &propName) const { - return m_fitDialog->getStoredPropertyValue(propName); + return m_fitDialog->getPreviousValue(propName); } /// Get allowed values for a property QStringList getAllowedPropertyValues(const QString &propName) const { diff --git a/qt/widgets/plugins/algorithm_dialogs/src/FitDialog.cpp b/qt/widgets/plugins/algorithm_dialogs/src/FitDialog.cpp index e62b200697acf0cd50627c288a7d129c740331fd..1b72c9bd7fad54f4eca9635d01f392ee6c2d6c74 100644 --- a/qt/widgets/plugins/algorithm_dialogs/src/FitDialog.cpp +++ b/qt/widgets/plugins/algorithm_dialogs/src/FitDialog.cpp @@ -364,7 +364,7 @@ void FitDialog::parseInput() { * @param readHistory :: If true then the history will be re read. */ void FitDialog::tieStaticWidgets(const bool readHistory) { - QString funValue = getStoredPropertyValue("Function"); + QString funValue = getPreviousValue("Function"); if (!funValue.isEmpty()) { m_form.function->setFunction(funValue); } @@ -386,7 +386,7 @@ void FitDialog::tieStaticWidgets(const bool readHistory) { // tie(m_form.cbDomainType, "DomainType", m_form.staticLayout, readHistory); connect(m_form.cbDomainType, SIGNAL(currentIndexChanged(int)), this, SLOT(domainTypeChanged())); - QString domainTypeValue = getStoredPropertyValue("DomainType"); + QString domainTypeValue = getPreviousValue("DomainType"); if (!domainTypeValue.isEmpty()) { m_form.cbDomainType->setItemText(-1, domainTypeValue); } @@ -398,7 +398,7 @@ void FitDialog::tieStaticWidgets(const bool readHistory) { // read value from history tie(m_form.cbMinimizer, "Minimizer", m_form.staticLayout, readHistory); - auto value = getStoredPropertyValue("InputWorkspace"); + auto value = getPreviousValue("InputWorkspace"); setWorkspaceName(0, value); } @@ -486,29 +486,6 @@ void FitDialog::functionChanged() { // createDynamicLayout(); } -/** - * Return property value stored in history - * @param propName :: A property name - */ -QString FitDialog::getStoredPropertyValue(const QString &propName) const { - // Get the value from either the previous input store or from Python argument - QString value(""); - Mantid::Kernel::Property *property = getAlgorithmProperty(propName); - - if (!isForScript()) { - value = m_propertyValueMap.value(propName); - if (value.isEmpty()) { - value = - AlgorithmInputHistory::Instance().previousInput(m_algName, propName); - } - } else { - if (!property) - return ""; - value = m_propertyValueMap.value(propName); - } - return value; -} - /** * Get allowed values for a property * @param propName :: A property name