Mantid
|
A widget consisting of a ComboBox and a TreeWidget to allow a user to select an algorithm either by category or by typing. More...
#include <AlgorithmSelectorWidget.h>
Public Slots | |
void | executeSelected () |
Slot called to execute whatever is the selected algorithm. More... | |
void | findAlgTextChanged (const QString &text) |
Show the selection in the tree when it changes in the combo. More... | |
void | treeSelectionChanged () |
Show the selection in the combo when it changes in the tree. More... | |
void | update () |
Update the lists of algorithms. More... | |
Signals | |
void | algorithmFactoryUpdateReceived () |
void | algorithmSelectionChanged (const QString &, int) |
void | executeAlgorithm (const QString &, int) |
Public Member Functions | |
AlgorithmSelectorWidget (QWidget *parent) | |
Constructor. More... | |
SelectedAlgorithm | getSelectedAlgorithm () |
Return the selected algorithm. More... | |
void | setSelectedAlgorithm (QString &algName) |
Set which algorithm is currently selected. More... | |
bool | showExecuteButton () const |
Is the the execute button visible. More... | |
void | showExecuteButton (const bool) |
Show/hide the execute button. More... | |
~AlgorithmSelectorWidget () override | |
Destructor. More... | |
Protected Attributes | |
QPushButton * | m_execButton |
FindAlgComboBox * | m_findAlg |
AlgorithmTreeWidget * | m_tree |
Properties | |
bool | showExecuteButton |
Private Member Functions | |
void | handleAlgorithmFactoryUpdate (Mantid::API::AlgorithmFactoryUpdateNotification_ptr) |
Callback for AlgorithmFactory update notifications. More... | |
Private Attributes | |
bool | m_updateInProgress |
Poco::NObserver< AlgorithmSelectorWidget, Mantid::API::AlgorithmFactoryUpdateNotification > | m_updateObserver |
Observes algorithm factory update notifications. More... | |
A widget consisting of a ComboBox and a TreeWidget to allow a user to select an algorithm either by category or by typing.
Definition at line 57 of file AlgorithmSelectorWidget.h.
MantidQt::MantidWidgets::AlgorithmSelectorWidget::AlgorithmSelectorWidget | ( | QWidget * | parent | ) |
Constructor.
Definition at line 29 of file AlgorithmSelectorWidget.cpp.
References algorithmFactoryUpdateReceived(), executeAlgorithm(), executeSelected(), findAlgTextChanged(), Mantid::Kernel::SingletonHolder< T >::Instance(), m_execButton, m_findAlg, m_tree, m_updateObserver, treeSelectionChanged(), and update().
|
override |
Destructor.
Definition at line 74 of file AlgorithmSelectorWidget.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), and m_updateObserver.
|
signal |
Referenced by AlgorithmSelectorWidget(), and handleAlgorithmFactoryUpdate().
|
signal |
Referenced by findAlgTextChanged(), and treeSelectionChanged().
|
signal |
Referenced by AlgorithmSelectorWidget(), and executeSelected().
|
slot |
Slot called to execute whatever is the selected algorithm.
Definition at line 96 of file AlgorithmSelectorWidget.cpp.
References executeAlgorithm(), and getSelectedAlgorithm().
Referenced by AlgorithmSelectorWidget().
|
slot |
Show the selection in the tree when it changes in the combo.
Definition at line 105 of file AlgorithmSelectorWidget.cpp.
References algorithmSelectionChanged(), getSelectedAlgorithm(), m_findAlg, and m_tree.
Referenced by AlgorithmSelectorWidget().
SelectedAlgorithm MantidQt::MantidWidgets::AlgorithmSelectorWidget::getSelectedAlgorithm | ( | ) |
Return the selected algorithm.
The tree has priority. If nothing is selected in the tree, return the ComboBox selection
Definition at line 135 of file AlgorithmSelectorWidget.cpp.
References MantidQt::MantidWidgets::AlgorithmTreeWidget::getSelectedAlgorithm(), MantidQt::MantidWidgets::FindAlgComboBox::getSelectedAlgorithm(), m_findAlg, m_tree, and MantidQt::MantidWidgets::SelectedAlgorithm::name.
Referenced by executeSelected(), findAlgTextChanged(), and treeSelectionChanged().
|
private |
Callback for AlgorithmFactory update notifications.
The algorithm factory has been updated, refresh the widget.
Definition at line 162 of file AlgorithmSelectorWidget.cpp.
References algorithmFactoryUpdateReceived().
void MantidQt::MantidWidgets::AlgorithmSelectorWidget::setSelectedAlgorithm | ( | QString & | algName | ) |
Set which algorithm is currently selected.
Does not fire any signals. Updates the combobox, deselects in the tree.
algName | :: name of the algorithm |
Definition at line 148 of file AlgorithmSelectorWidget.cpp.
bool MantidQt::MantidWidgets::AlgorithmSelectorWidget::showExecuteButton | ( | ) | const |
Is the the execute button visible.
Definition at line 79 of file AlgorithmSelectorWidget.cpp.
References m_execButton.
void MantidQt::MantidWidgets::AlgorithmSelectorWidget::showExecuteButton | ( | const bool | val | ) |
Show/hide the execute button.
Definition at line 82 of file AlgorithmSelectorWidget.cpp.
References m_execButton.
|
slot |
Show the selection in the combo when it changes in the tree.
Definition at line 121 of file AlgorithmSelectorWidget.cpp.
References algorithmSelectionChanged(), getSelectedAlgorithm(), and m_findAlg.
Referenced by AlgorithmSelectorWidget().
|
slot |
Update the lists of algorithms.
Definition at line 86 of file AlgorithmSelectorWidget.cpp.
References m_findAlg, m_tree, m_updateInProgress, MantidQt::MantidWidgets::AlgorithmTreeWidget::update(), and MantidQt::MantidWidgets::FindAlgComboBox::update().
Referenced by AlgorithmSelectorWidget().
|
protected |
Definition at line 83 of file AlgorithmSelectorWidget.h.
Referenced by AlgorithmSelectorWidget(), and showExecuteButton().
|
protected |
Definition at line 82 of file AlgorithmSelectorWidget.h.
Referenced by AlgorithmSelectorWidget(), findAlgTextChanged(), getSelectedAlgorithm(), setSelectedAlgorithm(), treeSelectionChanged(), and update().
|
protected |
Definition at line 81 of file AlgorithmSelectorWidget.h.
Referenced by AlgorithmSelectorWidget(), findAlgTextChanged(), getSelectedAlgorithm(), setSelectedAlgorithm(), and update().
|
private |
Definition at line 91 of file AlgorithmSelectorWidget.h.
Referenced by update().
|
private |
Observes algorithm factory update notifications.
Definition at line 89 of file AlgorithmSelectorWidget.h.
Referenced by AlgorithmSelectorWidget(), and ~AlgorithmSelectorWidget().
|
readwrite |
Definition at line 47 of file AlgorithmSelectorWidget.h.