Mantid
Loading...
Searching...
No Matches
Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | Private Slots | Private Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::DataSelector Class Reference

This class defines a widget for selecting a workspace of file path by using a combination of two child MantidWidgets: FileFinderWidget and WorkspaceSelector. More...

#include <DataSelector.h>

Inheritance diagram for MantidQt::MantidWidgets::DataSelector:
MantidQt::API::MantidWidget

Signals

void dataReady (const QString &wsname)
 Signal emitted when data is ready from a workspace selector or file browser.
 
void filesAutoLoaded ()
 Signal emitted when files are found and autoloaded.
 
void filesFound ()
 Signal emitted when files were found but widget isn't autoloading.
 
void fileViewVisible ()
 Signal emitted when file input is visible.
 
void loadClicked ()
 Signal emitted when the load button is clicked.
 
void workspaceViewVisible ()
 Signal emitted when workspace selector is visible.
 
- Signals inherited from MantidQt::API::MantidWidget
void runAsPythonScript (const QString &code, bool)
 

Public Member Functions

bool allowMultipleFiles () const
 Return whether this widget allows multiple files to be specified within the edit box.
 
void allowMultipleFiles (const bool allow)
 Set whether this widget allows multiple files to be specifed or not.
 
API::FileFinderSettings captureSettings () const
 Capture the current state of the child file finder without persistent I/O.
 
 DataSelector (QWidget *parent=nullptr)
 
ButtonOpts doButtonOpt () const
 Returns the preference for how the dialog control should be.
 
void doButtonOpt (const ButtonOpts buttonOpt)
 Set how the browse should appear.
 
bool doMultiEntry () const
 Whether to find the number of entries in the file or assume (the normal situation) of one entry.
 
void doMultiEntry (const bool multiEntry)
 Set to true to enable the period number box.
 
bool extsAsSingleOption () const
 Returns whether the file dialog should display the exts as a single list or as multiple items.
 
void extsAsSingleOption (const bool value)
 Sets whether the file dialog should display the exts as a single list or as multiple items.
 
QString getAlgorithmProperty () const
 Returns the algorithm name.
 
virtual QString getCurrentDataName (bool const autoLoad=true) const
 Get the currently available file or workspace name.
 
QStringList getFBSuffixes ()
 Gets the suffixes allowed by the file browser.
 
QString getFullFilePath () const
 Get the current file path in the FileFinderWidget widget.
 
QString getInstrumentOverride ()
 Gets the instrument override.
 
QString getLabelText () const
 Return the label text on the widget.
 
QString getLoadBtnText () const
 Gets the load button text.
 
QString getProblem () const
 Get file problem, empty string means no error.
 
QString getValidatingAlgorithm () const
 Gets if the validating algorithm of workspace selector.
 
QStringList getWorkspaceTypes () const
 Gets the workspace types allowed by the workspace selector.
 
QString getWsNameFromFiles () const
 Get the workspace name from the list of files.
 
QStringList getWSSuffixes ()
 Gets the suffixes allowed by the workspace selector.
 
bool isFileSelectorVisible () const
 Get whether the file selector is currently being shown.
 
bool isForDirectory () const
 Returns if this widget is for selecting a directory or not.
 
void isForDirectory (const bool mode)
 Sets directory searching mode.
 
bool isForRunFiles () const
 Returns if this widget is for run file searching or not.
 
void isForRunFiles (const bool mode)
 Sets whether this widget is for run file searching or not.
 
bool isOptional () const
 Gets if optional.
 
void isOptional (bool)
 Sets if optional.
 
virtual bool isValid (bool const autoLoad=true)
 Checks if widget is in a valid state.
 
bool isWorkspaceSelectorVisible () const
 Get whether the workspace selector is currently being shown.
 
LiveButtonOpts liveButtonState () const
 Gets the live button state.
 
void liveButtonState (const LiveButtonOpts option)
 Sets the live button state.
 
void restoreSettings (const API::FileFinderSettings &settings)
 Restore the child file finder from an in-memory snapshot without persistent I/O.
 
void saveSettings (QSettings &settings, const API::FileFinderSettings &values) const
 Persist the supplied snapshot to mutable storage positioned at the target group.
 
void setAlgorithmProperty (const QString &text)
 Sets an algorithm name that can be tied to this widget.
 
void setAlwaysLoadAsGroup (bool const loadAsGroup)
 Sets the DataSelector to always load data inside a WorkspaceGroup.
 
void setFBSuffixes (const QStringList &suffixes)
 Sets the suffixes allowed by the file browser.
 
void setInstrumentOverride (const QString &instName)
 Sets the instrument override.
 
void setLabelText (const QString &text)
 Set the text on the label.
 
void setLoadBtnText (const QString &)
 Sets the load button text.
 
void setLoadProperty (std::string const &propertyName, bool const value)
 Set an extra property on the load algorithm before execution.
 
void setLoadProperty (std::string const &propertyName, std::string const &value)
 Set an extra string-valued property on the load algorithm before execution.
 
void setSelectorIndex (int index)
 Sets which selector (file or workspace) is visible.
 
void setShowLoad (bool load)
 Set if the load button should be shown.
 
void setTypeSelectorVisible (bool visible)
 Sets if the option to choose selector is visible.
 
void setValidatingAlgorithm (const QString &algName)
 Sets the validating algorithm of workspace selector.
 
void setWorkspaceSelectorIndex (QString const &workspaceName)
 Set the index of the combobox containing the loaded workspace.
 
void setWorkspaceTypes (const QStringList &types)
 Sets the workspace types allowed by the workspace selector.
 
void setWSSuffixes (const QStringList &suffixes)
 Sets the suffixes allowed by the workspace selector.
 
bool showHiddenWorkspaces () const
 Gets if the workspace selector shows hidden workspaces.
 
void showHiddenWorkspaces (bool show)
 Sets if the workspace selector shows hidden workspaces.
 
bool showWorkspaceGroups () const
 Gets if the workspace selector shows group workspaces.
 
void showWorkspaceGroups (bool show)
 Sets if the workspace selector shows workspace groups.
 
bool willShowLoad ()
 Check if the widget will show the load button.
 
 ~DataSelector () override
 
- Public Member Functions inherited from MantidQt::API::MantidWidget
virtual QVariant getUserInput () const
 Returns a QVariant containing what the widget classes as user input so that input can be returned through a common interface.
 
virtual void setUserInput (const QVariant &value)
 Sets a value on a mantid widget through a common interface.
 

Static Public Member Functions

static API::FileFinderSettings readSettings (const QSettings &settings)
 Query file-finder settings from const storage without changing this widget or writing settings.
 

Protected Member Functions

void dragEnterEvent (QDragEnterEvent *) override
 Called when an item is dragged onto a control.
 
void dropEvent (QDropEvent *) override
 Called when an item is dropped.
 
- Protected Member Functions inherited from MantidQt::API::MantidWidget
 MantidWidget (QWidget *parent=nullptr)
 Default constructor.
 
QString runPythonCode (const QString &code, bool no_output=false)
 Run python code that is passed to it and, optionally, return anything it wrote to standard output as a string.
 

Properties

QString Algorithm
 
QString algorithmAndProperty
 
ButtonOpts buttonOpts
 
bool extsAsSingleOption
 
QStringList fileBrowserSuffixes
 
bool findDirectory
 
bool findRunFiles
 
QString instrumentOverride
 
QString label
 
LiveButtonOpts liveButton
 
QString loadLabelText
 
bool multiEntry
 
bool multipleFiles
 
bool optional
 
bool ShowGroups
 
bool ShowHidden
 
bool showLoad
 
QStringList workspaceSuffixes
 
QStringList WorkspaceTypes
 

Private Slots

void handleAutoLoadComplete (bool error)
 Slot called if the widget fails to auto load the file.
 
void handleFileInput ()
 Slot called when file input is available.
 
void handleViewChanged (int index)
 Slot called when the current view is changed.
 
void handleWorkspaceInput ()
 Slot called when workspace input is available.
 

Private Member Functions

void autoLoadFile (const QString &filenames)
 Attempt to automatically load a file.
 
void executeLoadAlgorithm (std::string const &filename, std::string const &outputWorkspace)
 Execute load algorithm.
 

Private Attributes

MantidQt::API::QtAlgorithmRunner m_algRunner
 Algorithm Runner used to run the load algorithm.
 
bool m_alwaysLoadAsGroup
 Flag to always load data, placing it inside a WorkspaceGroup, even if there is 1 entry.
 
bool m_isOptional
 Flag if optional.
 
Mantid::API::AlgorithmRuntimeProps m_loadProperties
 Extra load properties to set on the load algorithm before execution.
 
bool m_showLoad
 Flag to show or hide the load button. By default this is set to true.
 
Ui::DataSelector m_uiForm
 Member containing the widgets child widgets.
 

Detailed Description

This class defines a widget for selecting a workspace of file path by using a combination of two child MantidWidgets: FileFinderWidget and WorkspaceSelector.

This widget combines the two to produce a single composite widget that emits signals when the user has chosen appropriate input.

Author
Samuel Jackson
Date
07/08/2013

Definition at line 38 of file DataSelector.h.

Constructor & Destructor Documentation

◆ DataSelector()

MantidQt::MantidWidgets::DataSelector::DataSelector ( QWidget *  parent = nullptr)

◆ ~DataSelector()

MantidQt::MantidWidgets::DataSelector::~DataSelector ( )
overridedefault

Member Function Documentation

◆ allowMultipleFiles() [1/2]

bool MantidQt::MantidWidgets::DataSelector::allowMultipleFiles ( ) const
inline

Return whether this widget allows multiple files to be specified within the edit box.

Returns
True if multiple files can be specified, false otherwise

Definition at line 125 of file DataSelector.h.

◆ allowMultipleFiles() [2/2]

void MantidQt::MantidWidgets::DataSelector::allowMultipleFiles ( const bool  allow)
inline

Set whether this widget allows multiple files to be specifed or not.

Parameters
allow:: If true then the widget will accept multiple files else only a single file may be specified

Definition at line 134 of file DataSelector.h.

◆ autoLoadFile()

void MantidQt::MantidWidgets::DataSelector::autoLoadFile ( const QString &  filepath)
private

Attempt to automatically load a file.

Attempt to load a file if the widget is set to attempt auto-loading.

Function creates an instance of the load algorithm and attaches it to a algorithm runner to attempt loading.

Parameters
filepath:: The file path to load

Definition at line 222 of file DataSelector.cpp.

References executeLoadAlgorithm(), and getWsNameFromFiles().

Referenced by handleFileInput().

◆ captureSettings()

API::FileFinderSettings MantidQt::MantidWidgets::DataSelector::captureSettings ( ) const

Capture the current state of the child file finder without persistent I/O.

Definition at line 410 of file DataSelector.cpp.

References m_uiForm.

◆ dataReady

void MantidQt::MantidWidgets::DataSelector::dataReady ( const QString &  wsname)
signal

Signal emitted when data is ready from a workspace selector or file browser.

Referenced by MantidQt::MantidWidgets::AddWorkspaceDialog::AddWorkspaceDialog(), handleAutoLoadComplete(), and handleWorkspaceInput().

◆ doButtonOpt() [1/2]

ButtonOpts MantidQt::MantidWidgets::DataSelector::doButtonOpt ( ) const
inline

Returns the preference for how the dialog control should be.

Returns
the setting

Definition at line 245 of file DataSelector.h.

◆ doButtonOpt() [2/2]

void MantidQt::MantidWidgets::DataSelector::doButtonOpt ( const ButtonOpts  buttonOpt)
inline

Set how the browse should appear.

Parameters
buttonOpt:: the preference for the control, if there will be one, to activate the dialog box

Definition at line 253 of file DataSelector.h.

◆ doMultiEntry() [1/2]

bool MantidQt::MantidWidgets::DataSelector::doMultiEntry ( ) const
inline

Whether to find the number of entries in the file or assume (the normal situation) of one entry.

Returns
true if the widget is to look for multiple entries

Definition at line 177 of file DataSelector.h.

◆ doMultiEntry() [2/2]

void MantidQt::MantidWidgets::DataSelector::doMultiEntry ( const bool  multiEntry)
inline

Set to true to enable the period number box.

Parameters
multiEntrywhether to show the multiperiod box

Definition at line 183 of file DataSelector.h.

◆ dragEnterEvent()

void MantidQt::MantidWidgets::DataSelector::dragEnterEvent ( QDragEnterEvent *  de)
overrideprotected

Called when an item is dragged onto a control.

Parameters
de:: the drag event data package

Definition at line 487 of file DataSelector.cpp.

◆ dropEvent()

void MantidQt::MantidWidgets::DataSelector::dropEvent ( QDropEvent *  de)
overrideprotected

Called when an item is dropped.

Parameters
de:: the drop event data package

Definition at line 439 of file DataSelector.cpp.

References executeLoadAlgorithm(), m_uiForm, and setWorkspaceSelectorIndex().

◆ executeLoadAlgorithm()

void MantidQt::MantidWidgets::DataSelector::executeLoadAlgorithm ( std::string const &  filename,
std::string const &  outputWorkspace 
)
private

Execute load algorithm.

Executes the load algorithm in a background thread using the Algorithm runner.

Parameters
filename:: The filename of the file to be loaded.
outputWorkspace:: The name to give the output workspace.

Definition at line 233 of file DataSelector.cpp.

References m_algRunner, m_loadProperties, and MantidQt::API::QtAlgorithmRunner::startAlgorithm().

Referenced by autoLoadFile(), dropEvent(), and isValid().

◆ extsAsSingleOption() [1/2]

bool MantidQt::MantidWidgets::DataSelector::extsAsSingleOption ( ) const
inline

Returns whether the file dialog should display the exts as a single list or as multiple items.

Returns
boolean

Definition at line 203 of file DataSelector.h.

◆ extsAsSingleOption() [2/2]

void MantidQt::MantidWidgets::DataSelector::extsAsSingleOption ( const bool  value)
inline

Sets whether the file dialog should display the exts as a single list or as multiple items.

Parameters
value:: If true the file dialog wil contain a single entry will all filters

Definition at line 211 of file DataSelector.h.

References value.

◆ filesAutoLoaded

void MantidQt::MantidWidgets::DataSelector::filesAutoLoaded ( )
signal

Signal emitted when files are found and autoloaded.

Referenced by MantidQt::MantidWidgets::AddWorkspaceDialog::AddWorkspaceDialog(), and handleFileInput().

◆ filesFound

void MantidQt::MantidWidgets::DataSelector::filesFound ( )
signal

Signal emitted when files were found but widget isn't autoloading.

◆ fileViewVisible

void MantidQt::MantidWidgets::DataSelector::fileViewVisible ( )
signal

Signal emitted when file input is visible.

Referenced by handleViewChanged().

◆ getAlgorithmProperty()

QString MantidQt::MantidWidgets::DataSelector::getAlgorithmProperty ( ) const
inline

Returns the algorithm name.

Returns
The algorithm name

Definition at line 189 of file DataSelector.h.

◆ getCurrentDataName()

QString MantidQt::MantidWidgets::DataSelector::getCurrentDataName ( bool const  autoLoad = true) const
virtual

Get the currently available file or workspace name.

Gets the name of item selected in the DataSelector.

This will return the currently selected item in the workspace selector, if the workspace view is active. If the file view is active, it will return the basename of the file. If multiple files are allowed, and auto-loading is off, it will return the full user input. If there is no valid input the method returns an empty string.

Parameters
autoLoad:: Whether or not autoload is turned on.
Returns
The name of the current data item

Definition at line 353 of file DataSelector.cpp.

References getFullFilePath(), getWsNameFromFiles(), index, and m_uiForm.

Referenced by isValid().

◆ getFBSuffixes()

QStringList MantidQt::MantidWidgets::DataSelector::getFBSuffixes ( )
inline

Gets the suffixes allowed by the file browser.

Returns
List of suffixes allowed by the file browser

Definition at line 218 of file DataSelector.h.

◆ getFullFilePath()

QString MantidQt::MantidWidgets::DataSelector::getFullFilePath ( ) const

Get the current file path in the FileFinderWidget widget.

Gets the full file path currently in the file browser.

Returns
The full file path

Definition at line 321 of file DataSelector.cpp.

References m_uiForm.

Referenced by getCurrentDataName(), and getWsNameFromFiles().

◆ getInstrumentOverride()

QString MantidQt::MantidWidgets::DataSelector::getInstrumentOverride ( )
inline

Gets the instrument override.

Returns
List of instrument override

Definition at line 232 of file DataSelector.h.

◆ getLabelText()

QString MantidQt::MantidWidgets::DataSelector::getLabelText ( ) const
inline

Return the label text on the widget.

Returns
The current value of the text on the label

Definition at line 164 of file DataSelector.h.

◆ getLoadBtnText()

QString MantidQt::MantidWidgets::DataSelector::getLoadBtnText ( ) const

Gets the load button text.

Gets the text displayed on the load button.

Returns
The text on the load button

Definition at line 385 of file DataSelector.cpp.

References m_uiForm.

◆ getProblem()

QString MantidQt::MantidWidgets::DataSelector::getProblem ( ) const

Get file problem, empty string means no error.

Return the error.

Returns
A string explaining the error.

Definition at line 200 of file DataSelector.cpp.

References isFileSelectorVisible(), and m_uiForm.

Referenced by MantidQt::CustomInterfaces::UserInputValidator::checkDataSelectorIsValid().

◆ getValidatingAlgorithm()

QString MantidQt::MantidWidgets::DataSelector::getValidatingAlgorithm ( ) const
inline

Gets if the validating algorithm of workspace selector.

Returns
validating algorithm

Definition at line 331 of file DataSelector.h.

◆ getWorkspaceTypes()

QStringList MantidQt::MantidWidgets::DataSelector::getWorkspaceTypes ( ) const
inline

Gets the workspace types allowed by the workspace selector.

Returns
List of workspace types allowed by the workspace selector

Definition at line 289 of file DataSelector.h.

◆ getWsNameFromFiles()

QString MantidQt::MantidWidgets::DataSelector::getWsNameFromFiles ( ) const

Get the workspace name from the list of files.

Gets the workspace name that is created after loading the files.

Returns
The workspace name that is created after loading the files

Definition at line 328 of file DataSelector.cpp.

References getFullFilePath(), and m_uiForm.

Referenced by autoLoadFile(), getCurrentDataName(), and handleAutoLoadComplete().

◆ getWSSuffixes()

QStringList MantidQt::MantidWidgets::DataSelector::getWSSuffixes ( )
inline

Gets the suffixes allowed by the workspace selector.

Returns
List of suffixes allowed by the workspace selector

Definition at line 275 of file DataSelector.h.

◆ handleAutoLoadComplete

void MantidQt::MantidWidgets::DataSelector::handleAutoLoadComplete ( bool  error)
privateslot

Slot called if the widget fails to auto load the file.

Handles when the load algorithm completes.

Parameters
error:: Whether loading completed without error

Definition at line 268 of file DataSelector.cpp.

References dataReady(), error, getWsNameFromFiles(), m_alwaysLoadAsGroup, and m_uiForm.

Referenced by DataSelector().

◆ handleFileInput

void MantidQt::MantidWidgets::DataSelector::handleFileInput ( )
privateslot

Slot called when file input is available.

Handle signals when files are found or the user manually clicks load.

Definition at line 100 of file DataSelector.cpp.

References autoLoadFile(), filesAutoLoaded(), and m_uiForm.

Referenced by DataSelector().

◆ handleViewChanged

void MantidQt::MantidWidgets::DataSelector::handleViewChanged ( int  index)
privateslot

Slot called when the current view is changed.

Handles when the view changes between workspace and file selection.

Parameters
index:: The index the stacked widget has been switched too.

Definition at line 300 of file DataSelector.cpp.

References fileViewVisible(), handleWorkspaceInput(), index, m_uiForm, and workspaceViewVisible().

Referenced by DataSelector().

◆ handleWorkspaceInput

void MantidQt::MantidWidgets::DataSelector::handleWorkspaceInput ( )
privateslot

Slot called when workspace input is available.

Handles when the user select a workspace in the workspace selector.

Definition at line 283 of file DataSelector.cpp.

References dataReady(), and m_uiForm.

Referenced by DataSelector(), and handleViewChanged().

◆ isFileSelectorVisible()

bool MantidQt::MantidWidgets::DataSelector::isFileSelectorVisible ( ) const

Get whether the file selector is currently being shown.

Get if the file selector is currently being shown.

Returns
:: true if it is visible, otherwise false

Definition at line 127 of file DataSelector.cpp.

References index, and m_uiForm.

Referenced by getProblem(), isValid(), and isWorkspaceSelectorVisible().

◆ isForDirectory() [1/2]

bool MantidQt::MantidWidgets::DataSelector::isForDirectory ( ) const
inline

Returns if this widget is for selecting a directory or not.

Returns
True if selecting a directory

Definition at line 152 of file DataSelector.h.

◆ isForDirectory() [2/2]

void MantidQt::MantidWidgets::DataSelector::isForDirectory ( const bool  mode)
inline

Sets directory searching mode.

Parameters
modeTrue to search for directories only

Definition at line 158 of file DataSelector.h.

◆ isForRunFiles() [1/2]

bool MantidQt::MantidWidgets::DataSelector::isForRunFiles ( ) const
inline

Returns if this widget is for run file searching or not.

Returns
True if this widget searches for run files, false otherwise

Definition at line 140 of file DataSelector.h.

◆ isForRunFiles() [2/2]

void MantidQt::MantidWidgets::DataSelector::isForRunFiles ( const bool  mode)
inline

Sets whether this widget is for run file searching or not.

Parameters
mode:: True if this widget searches for run files, false otherwise

Definition at line 146 of file DataSelector.h.

◆ isOptional() [1/2]

bool MantidQt::MantidWidgets::DataSelector::isOptional ( ) const

Gets if optional.

Return whether empty input is allowed.

Returns
:: Flag if is optional

Definition at line 85 of file DataSelector.cpp.

References m_isOptional.

◆ isOptional() [2/2]

void MantidQt::MantidWidgets::DataSelector::isOptional ( bool  optional)

Sets if optional.

Sets if the text field is optional.

Parameters
optional:: Set the optional status of the text field

Definition at line 91 of file DataSelector.cpp.

References m_isOptional, m_uiForm, and optional.

◆ isValid()

bool MantidQt::MantidWidgets::DataSelector::isValid ( bool const  autoLoad = true)
virtual

Checks if widget is in a valid state.

Check if the data selector is in a valid state.

Checks using the relvant widgets isValid method depending on what view is currently being shown

Parameters
autoLoad:: Whether to automatically load the data if it is not found in the ADS.
Returns
:: If the data selector is valid

Definition at line 147 of file DataSelector.cpp.

References executeLoadAlgorithm(), getCurrentDataName(), isFileSelectorVisible(), isValid(), m_uiForm, and workspace.

Referenced by MantidQt::CustomInterfaces::UserInputValidator::checkDataSelectorIsValid(), and isValid().

◆ isWorkspaceSelectorVisible()

bool MantidQt::MantidWidgets::DataSelector::isWorkspaceSelectorVisible ( ) const

Get whether the workspace selector is currently being shown.

Get if the workspace selector is currently being shown.

Returns
:: true if it is visible, otherwise false

Definition at line 137 of file DataSelector.cpp.

References isFileSelectorVisible().

◆ liveButtonState() [1/2]

LiveButtonOpts MantidQt::MantidWidgets::DataSelector::liveButtonState ( ) const
inline

Gets the live button state.

Returns
live button option

Definition at line 260 of file DataSelector.h.

◆ liveButtonState() [2/2]

void MantidQt::MantidWidgets::DataSelector::liveButtonState ( const LiveButtonOpts  option)
inline

Sets the live button state.

Parameters
option:: livebutton option

Definition at line 267 of file DataSelector.h.

◆ loadClicked

void MantidQt::MantidWidgets::DataSelector::loadClicked ( )
signal

Signal emitted when the load button is clicked.

Referenced by DataSelector().

◆ readSettings()

API::FileFinderSettings MantidQt::MantidWidgets::DataSelector::readSettings ( const QSettings &  settings)
static

Query file-finder settings from const storage without changing this widget or writing settings.

Definition at line 402 of file DataSelector.cpp.

References MantidQt::API::FileFinderWidget::readSettings().

◆ restoreSettings()

void MantidQt::MantidWidgets::DataSelector::restoreSettings ( const API::FileFinderSettings &  settings)

Restore the child file finder from an in-memory snapshot without persistent I/O.

Definition at line 406 of file DataSelector.cpp.

References m_uiForm.

◆ saveSettings()

void MantidQt::MantidWidgets::DataSelector::saveSettings ( QSettings &  settings,
const API::FileFinderSettings &  values 
) const

Persist the supplied snapshot to mutable storage positioned at the target group.

Definition at line 412 of file DataSelector.cpp.

References m_uiForm.

◆ setAlgorithmProperty()

void MantidQt::MantidWidgets::DataSelector::setAlgorithmProperty ( const QString &  text)
inline

Sets an algorithm name that can be tied to this widget.

Parameters
text:: The name of the algorithm and property in the form [AlgorithmName|PropertyName]

Definition at line 196 of file DataSelector.h.

◆ setAlwaysLoadAsGroup()

void MantidQt::MantidWidgets::DataSelector::setAlwaysLoadAsGroup ( bool const  loadAsGroup)

Sets the DataSelector to always load data inside a WorkspaceGroup.

Sets the DataSelector to always make sure the loaded data is a WorkspaceGroup.

If only one entry is loaded from a NeXus file, then this entry is added to a WorkspaceGroup.

Parameters
loadAsGroup:: Whether to load the data as a workspace group.

Definition at line 400 of file DataSelector.cpp.

References m_alwaysLoadAsGroup.

◆ setFBSuffixes()

void MantidQt::MantidWidgets::DataSelector::setFBSuffixes ( const QStringList &  suffixes)
inline

Sets the suffixes allowed by the file browser.

Parameters
suffixes:: List of suffixes allowed by the file browser

Definition at line 225 of file DataSelector.h.

◆ setInstrumentOverride()

void MantidQt::MantidWidgets::DataSelector::setInstrumentOverride ( const QString &  instName)
inline

Sets the instrument override.

Parameters
instName:: name of instrument override

Definition at line 239 of file DataSelector.h.

◆ setLabelText()

void MantidQt::MantidWidgets::DataSelector::setLabelText ( const QString &  text)
inline

Set the text on the label.

Parameters
text:: A string giving the label to use for the text

Definition at line 170 of file DataSelector.h.

◆ setLoadBtnText()

void MantidQt::MantidWidgets::DataSelector::setLoadBtnText ( const QString &  text)

Sets the load button text.

Sets the text shown on the load button.

Parameters
text:: The text to display on the button

Definition at line 392 of file DataSelector.cpp.

References m_uiForm.

◆ setLoadProperty() [1/2]

void MantidQt::MantidWidgets::DataSelector::setLoadProperty ( std::string const &  propertyName,
bool const  value 
)

Set an extra property on the load algorithm before execution.

Parameters
propertyName:: The name of the Load algorithm property to be set
value:: The value of the Load algorithm property to be set

Definition at line 249 of file DataSelector.cpp.

References m_loadProperties, Mantid::API::AlgorithmProperties::update(), and value.

◆ setLoadProperty() [2/2]

void MantidQt::MantidWidgets::DataSelector::setLoadProperty ( std::string const &  propertyName,
std::string const &  value 
)

Set an extra string-valued property on the load algorithm before execution.

Parameters
propertyName:: The name of the Load algorithm property to be set
value:: The value of the Load algorithm property to be set

Definition at line 259 of file DataSelector.cpp.

References m_loadProperties, Mantid::API::AlgorithmProperties::update(), and value.

◆ setSelectorIndex()

void MantidQt::MantidWidgets::DataSelector::setSelectorIndex ( int  index)

Sets which selector (file or workspace) is visible.

Sets whether the file or workspace selector is visible.

Definition at line 115 of file DataSelector.cpp.

References index, and m_uiForm.

◆ setShowLoad()

void MantidQt::MantidWidgets::DataSelector::setShowLoad ( bool  load)

Set if the load button should be shown.

Set if the load button will be shown or not This will change if the button widget is visible and enabled.

Parameters
load:: Whether the load button will be shown

Definition at line 429 of file DataSelector.cpp.

References m_showLoad, and m_uiForm.

◆ setTypeSelectorVisible()

void MantidQt::MantidWidgets::DataSelector::setTypeSelectorVisible ( bool  visible)

Sets if the option to choose selector is visible.

Sets whether the file or workspace type selector is visible.

Definition at line 120 of file DataSelector.cpp.

References m_uiForm.

◆ setValidatingAlgorithm()

void MantidQt::MantidWidgets::DataSelector::setValidatingAlgorithm ( const QString &  algName)
inline

Sets the validating algorithm of workspace selector.

Parameters
algName:: validating algorithm

Definition at line 338 of file DataSelector.h.

◆ setWorkspaceSelectorIndex()

void MantidQt::MantidWidgets::DataSelector::setWorkspaceSelectorIndex ( QString const &  workspaceName)

Set the index of the combobox containing the loaded workspace.

This sets the workspace selector's index to the workspace which was dragged and dropped onto the data selector.

Parameters
workspaceName:: the name of the workspace dragged onto the selector

Definition at line 478 of file DataSelector.cpp.

References index, and m_uiForm.

Referenced by dropEvent().

◆ setWorkspaceTypes()

void MantidQt::MantidWidgets::DataSelector::setWorkspaceTypes ( const QStringList &  types)
inline

Sets the workspace types allowed by the workspace selector.

Parameters
types:: List of workspace types allowed by the workspace selector

Definition at line 296 of file DataSelector.h.

◆ setWSSuffixes()

void MantidQt::MantidWidgets::DataSelector::setWSSuffixes ( const QStringList &  suffixes)
inline

Sets the suffixes allowed by the workspace selector.

Parameters
suffixes:: List of suffixes allowed by the workspace selector

Definition at line 282 of file DataSelector.h.

◆ showHiddenWorkspaces() [1/2]

bool MantidQt::MantidWidgets::DataSelector::showHiddenWorkspaces ( ) const
inline

Gets if the workspace selector shows hidden workspaces.

Returns
Boolean flag if hidden workspaces are shown

Definition at line 303 of file DataSelector.h.

◆ showHiddenWorkspaces() [2/2]

void MantidQt::MantidWidgets::DataSelector::showHiddenWorkspaces ( bool  show)
inline

Sets if the workspace selector shows hidden workspaces.

Parameters
show:: Boolean flag if hidden workspaces are shown

Definition at line 310 of file DataSelector.h.

◆ showWorkspaceGroups() [1/2]

bool MantidQt::MantidWidgets::DataSelector::showWorkspaceGroups ( ) const
inline

Gets if the workspace selector shows group workspaces.

Returns
Boolean flag if group workspaces are shown

Definition at line 317 of file DataSelector.h.

◆ showWorkspaceGroups() [2/2]

void MantidQt::MantidWidgets::DataSelector::showWorkspaceGroups ( bool  show)
inline

Sets if the workspace selector shows workspace groups.

Parameters
show:: Boolean flag if group workspaces are shown

Definition at line 324 of file DataSelector.h.

◆ willShowLoad()

bool MantidQt::MantidWidgets::DataSelector::willShowLoad ( )

Check if the widget will show the load button.

Check if the load button will be shown on the interface.

Returns
If the load button will be shown or not

Definition at line 421 of file DataSelector.cpp.

References m_showLoad.

◆ workspaceViewVisible

void MantidQt::MantidWidgets::DataSelector::workspaceViewVisible ( )
signal

Signal emitted when workspace selector is visible.

Referenced by handleViewChanged().

Member Data Documentation

◆ m_algRunner

MantidQt::API::QtAlgorithmRunner MantidQt::MantidWidgets::DataSelector::m_algRunner
private

Algorithm Runner used to run the load algorithm.

Definition at line 381 of file DataSelector.h.

Referenced by DataSelector(), and executeLoadAlgorithm().

◆ m_alwaysLoadAsGroup

bool MantidQt::MantidWidgets::DataSelector::m_alwaysLoadAsGroup
private

Flag to always load data, placing it inside a WorkspaceGroup, even if there is 1 entry.

Definition at line 387 of file DataSelector.h.

Referenced by handleAutoLoadComplete(), and setAlwaysLoadAsGroup().

◆ m_isOptional

bool MantidQt::MantidWidgets::DataSelector::m_isOptional
private

Flag if optional.

Definition at line 385 of file DataSelector.h.

Referenced by isOptional(), and isOptional().

◆ m_loadProperties

Mantid::API::AlgorithmRuntimeProps MantidQt::MantidWidgets::DataSelector::m_loadProperties
private

Extra load properties to set on the load algorithm before execution.

Definition at line 379 of file DataSelector.h.

Referenced by executeLoadAlgorithm(), setLoadProperty(), and setLoadProperty().

◆ m_showLoad

bool MantidQt::MantidWidgets::DataSelector::m_showLoad
private

Flag to show or hide the load button. By default this is set to true.

Definition at line 383 of file DataSelector.h.

Referenced by setShowLoad(), and willShowLoad().

◆ m_uiForm

Ui::DataSelector MantidQt::MantidWidgets::DataSelector::m_uiForm
private

Property Documentation

◆ Algorithm

QString MantidQt::MantidWidgets::DataSelector::Algorithm
readwrite

Definition at line 62 of file DataSelector.h.

◆ algorithmAndProperty

QString MantidQt::MantidWidgets::DataSelector::algorithmAndProperty
readwrite

Definition at line 50 of file DataSelector.h.

◆ buttonOpts

ButtonOpts MantidQt::MantidWidgets::DataSelector::buttonOpts
readwrite

Definition at line 52 of file DataSelector.h.

◆ extsAsSingleOption

bool MantidQt::MantidWidgets::DataSelector::extsAsSingleOption
readwrite

Definition at line 51 of file DataSelector.h.

◆ fileBrowserSuffixes

QStringList MantidQt::MantidWidgets::DataSelector::fileBrowserSuffixes
readwrite

Definition at line 42 of file DataSelector.h.

◆ findDirectory

bool MantidQt::MantidWidgets::DataSelector::findDirectory
readwrite

Definition at line 47 of file DataSelector.h.

◆ findRunFiles

bool MantidQt::MantidWidgets::DataSelector::findRunFiles
readwrite

Definition at line 46 of file DataSelector.h.

◆ instrumentOverride

QString MantidQt::MantidWidgets::DataSelector::instrumentOverride
readwrite

Definition at line 44 of file DataSelector.h.

◆ label

QString MantidQt::MantidWidgets::DataSelector::label
readwrite

Definition at line 48 of file DataSelector.h.

◆ liveButton

LiveButtonOpts MantidQt::MantidWidgets::DataSelector::liveButton
readwrite

Definition at line 53 of file DataSelector.h.

◆ loadLabelText

QString MantidQt::MantidWidgets::DataSelector::loadLabelText
readwrite

Definition at line 66 of file DataSelector.h.

◆ multiEntry

bool MantidQt::MantidWidgets::DataSelector::multiEntry
readwrite

Definition at line 49 of file DataSelector.h.

◆ multipleFiles

bool MantidQt::MantidWidgets::DataSelector::multipleFiles
readwrite

Definition at line 45 of file DataSelector.h.

◆ optional

bool MantidQt::MantidWidgets::DataSelector::optional
readwrite

Definition at line 65 of file DataSelector.h.

Referenced by isOptional().

◆ ShowGroups

bool MantidQt::MantidWidgets::DataSelector::ShowGroups
readwrite

Definition at line 61 of file DataSelector.h.

◆ ShowHidden

bool MantidQt::MantidWidgets::DataSelector::ShowHidden
readwrite

Definition at line 60 of file DataSelector.h.

◆ showLoad

bool MantidQt::MantidWidgets::DataSelector::showLoad
readwrite

Definition at line 43 of file DataSelector.h.

◆ workspaceSuffixes

QStringList MantidQt::MantidWidgets::DataSelector::workspaceSuffixes
readwrite

Definition at line 58 of file DataSelector.h.

◆ WorkspaceTypes

QStringList MantidQt::MantidWidgets::DataSelector::WorkspaceTypes
readwrite

Definition at line 59 of file DataSelector.h.


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