Mantid
|
This abstract class deals with the loading and saving of previous algorithm property values to/from MantidPlot's QSettings. More...
#include <AlgorithmInputHistory.h>
Public Member Functions | |
AbstractAlgorithmInputHistory (const AbstractAlgorithmInputHistory &)=delete | |
void | clearAlgorithmInput (const QString &algName) |
Clear values for a particular algorithm. More... | |
const QString & | getPreviousDirectory () const |
Get the directory that was accessed when the previous open file dialog was used. More... | |
AbstractAlgorithmInputHistory & | operator= (const AbstractAlgorithmInputHistory &)=delete |
QString | previousInput (const QString &algName, const QString &propName) const |
Retrieve an old parameter value. More... | |
void | readSettings (const QSettings &storage) override |
void | save () const |
Save the values stored here to persistent storage. More... | |
void | setPreviousDirectory (const QString &lastdir) |
Set the directory that was accessed when the previous open file dialog was used. More... | |
void | storeNewValue (const QString &algName, const QPair< QString, QString > &property) |
Update the old values that are stored here. More... | |
void | writeSettings (QSettings &storage) const override |
virtual | ~AbstractAlgorithmInputHistory ()=0 |
Abstract destructor. More... | |
Public Member Functions inherited from MantidQt::MantidWidgets::Configurable | |
virtual void | readSettings (const QSettings &)=0 |
virtual void | writeSettings (QSettings &) const =0 |
virtual | ~Configurable ()=default |
Protected Member Functions | |
AbstractAlgorithmInputHistory (const QString &settingsGroup) | |
Constructor. More... | |
Private Member Functions | |
void | load () |
Load any values that are available from persistent storage. More... | |
Private Attributes | |
QString | m_algorithmsGroup |
The string denoting the group (in the QSettings) where the algorithm properties are stored. More... | |
QString | m_dirKey |
The string denoting the key for the previous dir storage. More... | |
QHash< QString, QHash< QString, QString > > | m_lastInput |
A map indexing the algorithm name and a list of property name:value pairs. More... | |
QString | m_previousDirectory |
The directory that last used by an open file dialog. More... | |
This abstract class deals with the loading and saving of previous algorithm property values to/from MantidPlot's QSettings.
Definition at line 24 of file AlgorithmInputHistory.h.
|
delete |
|
pure virtual |
|
protected |
void AbstractAlgorithmInputHistory::clearAlgorithmInput | ( | const QString & | algName | ) |
Clear values for a particular algorithm.
Clear all stored values associated with a particular algorithm.
Definition at line 55 of file AlgorithmInputHistory.cpp.
References m_lastInput.
const QString & AbstractAlgorithmInputHistory::getPreviousDirectory | ( | ) | const |
Get the directory that was accessed when the previous open file dialog was used.
Definition at line 85 of file AlgorithmInputHistory.cpp.
References m_previousDirectory.
|
private |
Load any values that are available from persistent storage.
Note: this clears all currently values stored
Definition at line 154 of file AlgorithmInputHistory.cpp.
References readSettings().
Referenced by AbstractAlgorithmInputHistory().
|
delete |
QString AbstractAlgorithmInputHistory::previousInput | ( | const QString & | algName, |
const QString & | propName | ||
) | const |
Retrieve an old parameter value.
algName | :: The name of the algorithm |
propName | :: The name of the property |
Definition at line 65 of file AlgorithmInputHistory.cpp.
References m_lastInput.
Referenced by MantidQt::API::AlgorithmPropertiesWidget::initLayout().
|
overridevirtual |
Implements MantidQt::MantidWidgets::Configurable.
Definition at line 95 of file AlgorithmInputHistory.cpp.
References m_algorithmsGroup, m_dirKey, m_lastInput, m_previousDirectory, and value.
Referenced by load().
void AbstractAlgorithmInputHistory::save | ( | ) | const |
Save the values stored here to persistent storage.
Save the stored information to persistent storage.
Definition at line 90 of file AlgorithmInputHistory.cpp.
References writeSettings().
void AbstractAlgorithmInputHistory::setPreviousDirectory | ( | const QString & | lastdir | ) |
Set the directory that was accessed when the previous open file dialog was used.
lastdir | :: A QString giving the path of the directory that was last accessed with a file dialog |
Definition at line 81 of file AlgorithmInputHistory.cpp.
References m_previousDirectory.
void AbstractAlgorithmInputHistory::storeNewValue | ( | const QString & | algName, |
const QPair< QString, QString > & | property | ||
) |
Update the old values that are stored here.
Update the stored map with new property value.
Only valid values are stored here
If the algorithm doesn't exist then it is appended to the list otherwise the previous value is overwritten.
algName | :: The name of the algorithm |
property | :: A pair containing <name,value> of a property |
Definition at line 48 of file AlgorithmInputHistory.cpp.
References m_lastInput.
Referenced by MantidQt::API::AlgorithmPropertiesWidget::saveInput().
|
overridevirtual |
Implements MantidQt::MantidWidgets::Configurable.
Definition at line 125 of file AlgorithmInputHistory.cpp.
References m_algorithmsGroup, m_dirKey, m_lastInput, and m_previousDirectory.
Referenced by save().
|
private |
The string denoting the group (in the QSettings) where the algorithm properties are stored.
Definition at line 74 of file AlgorithmInputHistory.h.
Referenced by readSettings(), and writeSettings().
|
private |
The string denoting the key for the previous dir storage.
Definition at line 77 of file AlgorithmInputHistory.h.
Referenced by readSettings(), and writeSettings().
|
private |
A map indexing the algorithm name and a list of property name:value pairs.
Definition at line 67 of file AlgorithmInputHistory.h.
Referenced by clearAlgorithmInput(), previousInput(), readSettings(), storeNewValue(), and writeSettings().
|
private |
The directory that last used by an open file dialog.
Definition at line 70 of file AlgorithmInputHistory.h.
Referenced by getPreviousDirectory(), readSettings(), setPreviousDirectory(), and writeSettings().