Skip to content
Snippets Groups Projects
Commit 78a08002 authored by Peterson, Peter's avatar Peterson, Peter
Browse files

Change getStoredPropertyValue to getPreviousValue

FitDialog::getStoredPropertyValue was a duplicate version of
AlgorithmDialog::getPreviousValue. This just changes from one to the
other.
parent bddad0bb
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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()) {
......
......@@ -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 {
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment