Mantid
Loading...
Searching...
No Matches
Signals | Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::WorkspaceMultiSelector Class Referencefinal

This class defines a widget for selecting multiple workspace present in the AnalysisDataService and adding to a QTableWidget. More...

#include <WorkspaceMultiSelector.h>

Inheritance diagram for MantidQt::MantidWidgets::WorkspaceMultiSelector:

Signals

void emptied ()
 
void focussed ()
 

Public Member Functions

void connectObservers () const
 Subscribes this object to the Poco NotificationCentre.
 
void disconnectObservers () const
 De-subscribes this object from the Poco NotificationCentre.
 
const QStringList & getWSSuffixes () const
 
bool isValid () const
 
void refresh ()
 
void resetIndexRangeToDefault ()
 
StringPairVec retrieveSelectedNameIndexPairs ()
 
void setupTable ()
 Setup table dimensions and headers from the parent class.
 
void setWSSuffixes (const QStringList &suffix)
 
void unifyRange ()
 
 WorkspaceMultiSelector (QWidget *parent=nullptr)
 Default Constructor.
 
 ~WorkspaceMultiSelector () override
 Destructor.
 

Protected Member Functions

void focusInEvent (QFocusEvent *) override
 Called when there is an interaction with the widget.
 

Properties

QStringList Suffix
 

Private Member Functions

void addItem (const std::string &name)
 
void addItems (const std::vector< std::string > &names)
 
bool checkEligibility (const std::string &name) const
 
void handleAddEvent (Mantid::API::WorkspaceAddNotification_ptr pNf)
 
void handleClearEvent (Mantid::API::ClearADSNotification_ptr pNf)
 
void handleRemEvent (Mantid::API::WorkspacePostDeleteNotification_ptr pNf)
 
void handleRenameEvent (Mantid::API::WorkspaceRenameNotification_ptr pNf)
 
void handleReplaceEvent (Mantid::API::WorkspaceAfterReplaceNotification_ptr pNf)
 
bool hasValidSuffix (const std::string &name) const
 
void renameItem (const std::string &newName, int row)
 

Private Attributes

Poco::NObserver< WorkspaceMultiSelector, Mantid::API::WorkspaceAddNotificationm_addObserver
 Poco Observers for ADS Notifications.
 
std::mutex m_adsMutex
 
Poco::NObserver< WorkspaceMultiSelector, Mantid::API::ClearADSNotificationm_clearObserver
 
Poco::NObserver< WorkspaceMultiSelector, Mantid::API::WorkspacePostDeleteNotificationm_remObserver
 
Poco::NObserver< WorkspaceMultiSelector, Mantid::API::WorkspaceRenameNotificationm_renameObserver
 
Poco::NObserver< WorkspaceMultiSelector, Mantid::API::WorkspaceAfterReplaceNotificationm_replaceObserver
 
QStringList m_suffix
 

Detailed Description

This class defines a widget for selecting multiple workspace present in the AnalysisDataService and adding to a QTableWidget.

Subscribes to the WorkspaceAddNotification and WorkspaceDeleteNotification from the ADS.

Types of workspace to show can be restricted in several ways:

By listing allowed WorkspaceIDs to show (Workspace2D, TableWorkspace, etc) By deciding whether or not to show "hidden" workspaces (identified with a double underscore at the start of the workspace name By providing a suffix that the workspace name must have

Definition at line 37 of file WorkspaceMultiSelector.h.

Constructor & Destructor Documentation

◆ WorkspaceMultiSelector()

MantidQt::MantidWidgets::WorkspaceMultiSelector::WorkspaceMultiSelector ( QWidget *  parent = nullptr)
explicit

Default Constructor.

Definition at line 47 of file WorkspaceMultiSelector.cpp.

References connectObservers(), and refresh().

◆ ~WorkspaceMultiSelector()

MantidQt::MantidWidgets::WorkspaceMultiSelector::~WorkspaceMultiSelector ( )
override

Destructor.

Destructor for WorkspaceMultiSelector De-subscribes this object from the Poco NotificationCentre.

Definition at line 61 of file WorkspaceMultiSelector.cpp.

References disconnectObservers().

Member Function Documentation

◆ addItem()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::addItem ( const std::string &  name)
private

◆ addItems()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::addItems ( const std::vector< std::string > &  names)
private

Definition at line 129 of file WorkspaceMultiSelector.cpp.

References addItem(), checkEligibility(), and name.

Referenced by refresh().

◆ checkEligibility()

bool MantidQt::MantidWidgets::WorkspaceMultiSelector::checkEligibility ( const std::string &  name) const
private

◆ connectObservers()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::connectObservers ( ) const

Subscribes this object to the Poco NotificationCentre.

Definition at line 91 of file WorkspaceMultiSelector.cpp.

References m_addObserver, m_clearObserver, m_remObserver, m_renameObserver, m_replaceObserver, and Mantid::Kernel::DataService< T >::notificationCenter.

Referenced by WorkspaceMultiSelector().

◆ disconnectObservers()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::disconnectObservers ( ) const

De-subscribes this object from the Poco NotificationCentre.

Definition at line 80 of file WorkspaceMultiSelector.cpp.

References m_addObserver, m_clearObserver, m_remObserver, m_renameObserver, and m_replaceObserver.

Referenced by ~WorkspaceMultiSelector().

◆ emptied

void MantidQt::MantidWidgets::WorkspaceMultiSelector::emptied ( )
signal

Referenced by handleClearEvent(), and handleRemEvent().

◆ focusInEvent()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::focusInEvent ( QFocusEvent *  )
overrideprotected

Called when there is an interaction with the widget.

Definition at line 267 of file WorkspaceMultiSelector.cpp.

References focussed().

◆ focussed

void MantidQt::MantidWidgets::WorkspaceMultiSelector::focussed ( )
signal

Referenced by focusInEvent().

◆ getWSSuffixes()

const QStringList & MantidQt::MantidWidgets::WorkspaceMultiSelector::getWSSuffixes ( ) const

Definition at line 105 of file WorkspaceMultiSelector.cpp.

References m_suffix.

◆ handleAddEvent()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::handleAddEvent ( Mantid::API::WorkspaceAddNotification_ptr  pNf)
private

Definition at line 172 of file WorkspaceMultiSelector.cpp.

References addItem(), checkEligibility(), and m_adsMutex.

◆ handleClearEvent()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::handleClearEvent ( Mantid::API::ClearADSNotification_ptr  pNf)
private

Definition at line 192 of file WorkspaceMultiSelector.cpp.

References emptied(), and m_adsMutex.

◆ handleRemEvent()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::handleRemEvent ( Mantid::API::WorkspacePostDeleteNotification_ptr  pNf)
private

Definition at line 179 of file WorkspaceMultiSelector.cpp.

References emptied(), m_adsMutex, and name.

◆ handleRenameEvent()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::handleRenameEvent ( Mantid::API::WorkspaceRenameNotification_ptr  pNf)
private

Definition at line 201 of file WorkspaceMultiSelector.cpp.

References addItem(), checkEligibility(), m_adsMutex, and renameItem().

◆ handleReplaceEvent()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::handleReplaceEvent ( Mantid::API::WorkspaceAfterReplaceNotification_ptr  pNf)
private

Definition at line 227 of file WorkspaceMultiSelector.cpp.

References addItem(), checkEligibility(), m_adsMutex, and name.

◆ hasValidSuffix()

bool MantidQt::MantidWidgets::WorkspaceMultiSelector::hasValidSuffix ( const std::string &  name) const
private

Definition at line 249 of file WorkspaceMultiSelector.cpp.

References m_suffix, and name.

Referenced by checkEligibility().

◆ isValid()

bool MantidQt::MantidWidgets::WorkspaceMultiSelector::isValid ( ) const

Definition at line 100 of file WorkspaceMultiSelector.cpp.

◆ refresh()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::refresh ( )

Definition at line 257 of file WorkspaceMultiSelector.cpp.

References addItems(), and m_adsMutex.

Referenced by setWSSuffixes(), and WorkspaceMultiSelector().

◆ renameItem()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::renameItem ( const std::string &  newName,
int  row 
)
private

◆ resetIndexRangeToDefault()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::resetIndexRangeToDefault ( )

◆ retrieveSelectedNameIndexPairs()

StringPairVec MantidQt::MantidWidgets::WorkspaceMultiSelector::retrieveSelectedNameIndexPairs ( )

Definition at line 136 of file WorkspaceMultiSelector.cpp.

References index, indexCol, and namesCol.

◆ setupTable()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::setupTable ( )

Setup table dimensions and headers from the parent class.

Definition at line 66 of file WorkspaceMultiSelector.cpp.

References MantidQt::MantidWidgets::getRegexValidatorString(), and MantidQt::MantidWidgets::SpectraValidator.

◆ setWSSuffixes()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::setWSSuffixes ( const QStringList &  suffix)

Definition at line 107 of file WorkspaceMultiSelector.cpp.

References m_suffix, and refresh().

◆ unifyRange()

void MantidQt::MantidWidgets::WorkspaceMultiSelector::unifyRange ( )

Definition at line 162 of file WorkspaceMultiSelector.cpp.

References index, and indexCol.

Member Data Documentation

◆ m_addObserver

Poco::NObserver<WorkspaceMultiSelector, Mantid::API::WorkspaceAddNotification> MantidQt::MantidWidgets::WorkspaceMultiSelector::m_addObserver
private

Poco Observers for ADS Notifications.

Definition at line 89 of file WorkspaceMultiSelector.h.

Referenced by connectObservers(), and disconnectObservers().

◆ m_adsMutex

std::mutex MantidQt::MantidWidgets::WorkspaceMultiSelector::m_adsMutex
private

◆ m_clearObserver

Poco::NObserver<WorkspaceMultiSelector, Mantid::API::ClearADSNotification> MantidQt::MantidWidgets::WorkspaceMultiSelector::m_clearObserver
private

Definition at line 91 of file WorkspaceMultiSelector.h.

Referenced by connectObservers(), and disconnectObservers().

◆ m_remObserver

Poco::NObserver<WorkspaceMultiSelector, Mantid::API::WorkspacePostDeleteNotification> MantidQt::MantidWidgets::WorkspaceMultiSelector::m_remObserver
private

Definition at line 90 of file WorkspaceMultiSelector.h.

Referenced by connectObservers(), and disconnectObservers().

◆ m_renameObserver

Poco::NObserver<WorkspaceMultiSelector, Mantid::API::WorkspaceRenameNotification> MantidQt::MantidWidgets::WorkspaceMultiSelector::m_renameObserver
private

Definition at line 92 of file WorkspaceMultiSelector.h.

Referenced by connectObservers(), and disconnectObservers().

◆ m_replaceObserver

Poco::NObserver<WorkspaceMultiSelector, Mantid::API::WorkspaceAfterReplaceNotification> MantidQt::MantidWidgets::WorkspaceMultiSelector::m_replaceObserver
private

Definition at line 93 of file WorkspaceMultiSelector.h.

Referenced by connectObservers(), and disconnectObservers().

◆ m_suffix

QStringList MantidQt::MantidWidgets::WorkspaceMultiSelector::m_suffix
private

Definition at line 95 of file WorkspaceMultiSelector.h.

Referenced by getWSSuffixes(), hasValidSuffix(), and setWSSuffixes().

Property Documentation

◆ Suffix

QStringList MantidQt::MantidWidgets::WorkspaceMultiSelector::Suffix
readwrite

Definition at line 40 of file WorkspaceMultiSelector.h.


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