Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
MantidQt::API::AbstractAlgorithmInputHistory Class Referenceabstract

This abstract class deals with the loading and saving of previous algorithm property values to/from MantidPlot's QSettings. More...

#include <AlgorithmInputHistory.h>

Inheritance diagram for MantidQt::API::AbstractAlgorithmInputHistory:
MantidQt::MantidWidgets::Configurable MantidQt::API::AlgorithmInputHistoryImpl

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...
 
AbstractAlgorithmInputHistoryoperator= (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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AbstractAlgorithmInputHistory() [1/2]

MantidQt::API::AbstractAlgorithmInputHistory::AbstractAlgorithmInputHistory ( const AbstractAlgorithmInputHistory )
delete

◆ ~AbstractAlgorithmInputHistory()

AbstractAlgorithmInputHistory::~AbstractAlgorithmInputHistory ( )
pure virtual

Abstract destructor.

Destructor.

Definition at line 35 of file AlgorithmInputHistory.cpp.

◆ AbstractAlgorithmInputHistory() [2/2]

AbstractAlgorithmInputHistory::AbstractAlgorithmInputHistory ( const QString &  settingsGroup)
protected

Constructor.

Definition at line 26 of file AlgorithmInputHistory.cpp.

References load().

Member Function Documentation

◆ clearAlgorithmInput()

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.

◆ getPreviousDirectory()

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.

◆ load()

void AbstractAlgorithmInputHistory::load ( )
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().

◆ operator=()

AbstractAlgorithmInputHistory & MantidQt::API::AbstractAlgorithmInputHistory::operator= ( const AbstractAlgorithmInputHistory )
delete

◆ previousInput()

QString AbstractAlgorithmInputHistory::previousInput ( const QString &  algName,
const QString &  propName 
) const

Retrieve an old parameter value.

Parameters
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().

◆ readSettings()

void AbstractAlgorithmInputHistory::readSettings ( const QSettings &  storage)
overridevirtual

◆ save()

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().

◆ setPreviousDirectory()

void AbstractAlgorithmInputHistory::setPreviousDirectory ( const QString &  lastdir)

Set the directory that was accessed when the previous open file dialog was used.

Parameters
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.

◆ storeNewValue()

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.

Parameters
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().

◆ writeSettings()

void AbstractAlgorithmInputHistory::writeSettings ( QSettings &  storage) const
overridevirtual

Member Data Documentation

◆ m_algorithmsGroup

QString MantidQt::API::AbstractAlgorithmInputHistory::m_algorithmsGroup
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().

◆ m_dirKey

QString MantidQt::API::AbstractAlgorithmInputHistory::m_dirKey
private

The string denoting the key for the previous dir storage.

Definition at line 77 of file AlgorithmInputHistory.h.

Referenced by readSettings(), and writeSettings().

◆ m_lastInput

QHash<QString, QHash<QString, QString> > MantidQt::API::AbstractAlgorithmInputHistory::m_lastInput
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().

◆ m_previousDirectory

QString MantidQt::API::AbstractAlgorithmInputHistory::m_previousDirectory
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().


The documentation for this class was generated from the following files: