|
Mantid
|
This class is responsible for creating the correct dialog for an algorithm. More...
#include <InterfaceManager.h>
Public Member Functions | |
| void | cleanup () |
| void | closeHelpWindow () |
| AlgorithmDialog * | createDialog (const std::shared_ptr< Mantid::API::IAlgorithm > &alg, QWidget *parent=nullptr, bool forScript=false, const QHash< QString, QString > &presetValues=(QHash< QString, QString >()), const QString &optional_msg=QString(), const QStringList &enabled=QStringList(), const QStringList &disabled=QStringList()) |
| Create a new instance of the correct type of AlgorithmDialog. | |
| AlgorithmDialog * | createDialogFromName (const QString &algorithmName, const int version=-1, QWidget *parent=nullptr, bool forScript=false, const QHash< QString, QString > &presetValues=(QHash< QString, QString >()), const QString &optionalMsg=QString(), const QStringList &enabled=QStringList(), const QStringList &disabled=QStringList()) |
| Create an algorithm dialog for a given name and version. | |
| MantidHelpInterface * | createHelpWindow () const |
| Function that instantiates the help window. | |
| UserSubWindow * | createSubWindow (const QString &interface_name, QWidget *parent=nullptr, bool isWindow=true) |
| Create a new instance of the correct type of UserSubWindow. | |
| QStringList | getUserSubWindowKeys () const |
| The keys associated with UserSubWindow classes. | |
| InterfaceManager () | |
| Constructor. | |
| void | showAlgorithmHelp (const QString &name, const int version=-1) |
| void | showConceptHelp (const QString &name) |
| void | showCustomInterfaceHelp (const QString &name, const QString &area=QString(), const QString §ion=QString()) |
| void | showFitFunctionHelp (const QString &name=QString()) |
| void | showHelpPage (const QString &url=QString()) |
| void | showHomeHelpPage () |
| void | showWebPage (const QString &url) |
| virtual | ~InterfaceManager () |
| Destructor. | |
Static Public Member Functions | |
| static QList< QPointer< UserSubWindow > > & | existingInterfaces () |
| Returns a list of existing UserSubWindows. | |
| static void | registerHelpWindowFactory (Mantid::Kernel::AbstractInstantiator< MantidHelpInterface > *factory) |
| Registration function for the help window factory. | |
Private Member Functions | |
| void | notifyExistingInterfaces (UserSubWindow *newWindow) |
| Notifies the existing interfaces that a new interface has been created, and then notifies the new interface about the other interfaces which already exist. | |
Static Private Attributes | |
| static Mantid::Kernel::AbstractInstantiator< MantidHelpInterface > * | m_helpViewer = nullptr |
| Handle to the help window factory. | |
This class is responsible for creating the correct dialog for an algorithm.
If no specialized version is registered for that algorithm then the default is created
Definition at line 57 of file InterfaceManager.h.
| InterfaceManager::InterfaceManager | ( | ) |
Constructor.
Default Constructor.
Definition at line 214 of file InterfaceManager.cpp.
References MantidQt::API::loadPluginsFromCfgPath().
|
virtualdefault |
Destructor.
| void InterfaceManager::cleanup | ( | ) |
Definition at line 290 of file InterfaceManager.cpp.
References Mantid::Kernel::Logger::debug().
| void InterfaceManager::closeHelpWindow | ( | ) |
Definition at line 279 of file InterfaceManager.cpp.
References Mantid::Kernel::Logger::debug().
| AlgorithmDialog * InterfaceManager::createDialog | ( | const std::shared_ptr< Mantid::API::IAlgorithm > & | alg, |
| QWidget * | parent = nullptr, |
||
| bool | forScript = false, |
||
| const QHash< QString, QString > & | presetValues = (QHash<QString, QString>()), |
||
| const QString & | optionalMsg = QString(), |
||
| const QStringList & | enabled = QStringList(), |
||
| const QStringList & | disabled = QStringList() |
||
| ) |
Create a new instance of the correct type of AlgorithmDialog.
Return a specialized dialog for the given algorithm.
If none exists then the default is returned
| alg | :: A pointer to the algorithm |
| parent | :: An optional parent widget |
| forScript | :: A boolean indicating if this dialog is to be use for from a script or not. If true disables the autoexecution of the dialog |
| presetValues | :: A hash of property names to preset values for the dialog |
| optionalMsg | :: An optional message string to be placed at the top of the dialog |
| enabled | :: These properties will be left enabled |
| disabled | :: These properties will be left disabled |
Definition at line 66 of file InterfaceManager.cpp.
References MantidQt::API::AlgorithmDialog::addEnabledAndDisableLists(), Mantid::Kernel::Logger::debug(), MantidQt::API::AlgorithmDialog::executeOnAccept(), MantidQt::API::AlgorithmDialog::initializeLayout(), MantidQt::API::AlgorithmDialog::isForScript(), MantidQt::API::AlgorithmDialog::setAlgorithm(), MantidQt::API::AlgorithmDialog::setOptionalMessage(), and MantidQt::API::AlgorithmDialog::setPresetValues().
Referenced by MantidQt::MantidWidgets::MantidTreeModel::createAlgorithmDialog(), createDialogFromName(), and MantidQt::MantidWidgets::MantidTreeModel::showAlgorithmDialog().
| AlgorithmDialog * InterfaceManager::createDialogFromName | ( | const QString & | algorithmName, |
| const int | version = -1, |
||
| QWidget * | parent = nullptr, |
||
| bool | forScript = false, |
||
| const QHash< QString, QString > & | presetValues = (QHash<QString, QString>()), |
||
| const QString & | optionalMsg = QString(), |
||
| const QStringList & | enabled = QStringList(), |
||
| const QStringList & | disabled = QStringList() |
||
| ) |
Create an algorithm dialog for a given name and version.
| algorithmName | :: Name of AlgorithmDialog |
| version | :: Version number |
| parent | :: An optional parent widget |
| forScript | :: A boolean indicating if this dialog is to be use for from a script or not |
| presetValues | :: A hash of property names to preset values for the dialog |
| optionalMsg | :: An optional message string to be placed at the top of the dialog |
| enabled | :: These properties will be left enabled |
| disabled | :: These properties will be left disabled |
Definition at line 128 of file InterfaceManager.cpp.
References createDialog().
Referenced by MantidQt::MantidWidgets::FindPeakConvolveStrategy::initialise(), MantidQt::MantidWidgets::CatalogHelper::showLoginDialog(), and MantidQt::MantidWidgets::CatalogHelper::showPublishDialog().
| MantidHelpInterface * InterfaceManager::createHelpWindow | ( | ) | const |
Function that instantiates the help window.
Definition at line 226 of file InterfaceManager.cpp.
References Mantid::Kernel::Logger::error(), Mantid::Kernel::Logger::information(), and m_helpViewer.
Referenced by MantidQt::API::HelpWindow::showAlgorithm(), showAlgorithmHelp(), MantidQt::API::HelpWindow::showConcept(), showConceptHelp(), MantidQt::API::HelpWindow::showCustomInterface(), showCustomInterfaceHelp(), MantidQt::API::HelpWindow::showFitFunction(), showFitFunctionHelp(), showHelpPage(), showHomeHelpPage(), MantidQt::API::HelpWindow::showPage(), and MantidQt::API::HelpWindow::showPage().
| UserSubWindow * InterfaceManager::createSubWindow | ( | const QString & | interface_name, |
| QWidget * | parent = nullptr, |
||
| bool | isWindow = true |
||
| ) |
Create a new instance of the correct type of UserSubWindow.
| interface_name | :: The registered name of the interface |
| parent | :: The parent widget |
| isWindow | :: Should the widget be an independent window |
Definition at line 146 of file InterfaceManager.cpp.
References Mantid::Kernel::Logger::debug(), Mantid::Kernel::Logger::error(), MantidQt::API::UserSubWindow::initializeLayout(), notifyExistingInterfaces(), and MantidQt::API::UserSubWindow::setInterfaceName().
|
static |
Returns a list of existing UserSubWindows.
Definition at line 195 of file InterfaceManager.cpp.
Referenced by notifyExistingInterfaces().
| QStringList InterfaceManager::getUserSubWindowKeys | ( | ) | const |
The keys associated with UserSubWindow classes.
Definition at line 208 of file InterfaceManager.cpp.
|
private |
Notifies the existing interfaces that a new interface has been created, and then notifies the new interface about the other interfaces which already exist.
This can be used to connect signals between interfaces (override otherUserSubWindowCreated in the interface class).
| newWindow | :: The interface just created |
Definition at line 184 of file InterfaceManager.cpp.
References existingInterfaces(), and MantidQt::API::UserSubWindow::otherUserSubWindowCreated().
Referenced by createSubWindow().
|
static |
Registration function for the help window factory.
| factory | the factory instance |
Definition at line 222 of file InterfaceManager.cpp.
References m_helpViewer.
| void InterfaceManager::showAlgorithmHelp | ( | const QString & | name, |
| const int | version = -1 |
||
| ) |
| name | of algorithm to show help for |
| version | of algorithm |
Definition at line 248 of file InterfaceManager.cpp.
References createHelpWindow(), and name.
| void InterfaceManager::showConceptHelp | ( | const QString & | name | ) |
| name | of concept to show help for |
Definition at line 254 of file InterfaceManager.cpp.
References createHelpWindow(), and name.
| void InterfaceManager::showCustomInterfaceHelp | ( | const QString & | name, |
| const QString & | area = QString(), |
||
| const QString & | section = QString() |
||
| ) |
| name | of interface to show help for |
| area | - folder for documentation in the interfaces directory |
| section | - section in the html document |
Definition at line 266 of file InterfaceManager.cpp.
References createHelpWindow(), and name.
| void InterfaceManager::showFitFunctionHelp | ( | const QString & | name = QString() | ) |
| name | of fit function to show help for |
Definition at line 260 of file InterfaceManager.cpp.
References createHelpWindow(), and name.
Referenced by MantidQt::MantidWidgets::FunctionTreeView::showFunctionHelp().
| void InterfaceManager::showHelpPage | ( | const QString & | url = QString() | ) |
| url | Relative URL of help page to show. |
Definition at line 242 of file InterfaceManager.cpp.
References createHelpWindow().
| void InterfaceManager::showHomeHelpPage | ( | ) |
Definition at line 284 of file InterfaceManager.cpp.
References createHelpWindow().
| void InterfaceManager::showWebPage | ( | const QString & | url | ) |
| url | of web page to open in browser |
Definition at line 277 of file InterfaceManager.cpp.
References MantidQt::API::MantidDesktopServices::openUrl().
|
staticprivate |
Handle to the help window factory.
Definition at line 134 of file InterfaceManager.h.
Referenced by createHelpWindow(), and registerHelpWindowFactory().