Mantid
|
This class is responsible for creating the correct dialog for an algorithm. More...
#include <InterfaceManager.h>
Public Member Functions | |
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. More... | |
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. More... | |
MantidHelpInterface * | createHelpWindow () const |
Function that instantiates the help window. More... | |
UserSubWindow * | createSubWindow (const QString &interface_name, QWidget *parent=nullptr, bool isWindow=true) |
Create a new instance of the correct type of UserSubWindow. More... | |
QStringList | getUserSubWindowKeys () const |
The keys associated with UserSubWindow classes. More... | |
InterfaceManager () | |
Constructor. More... | |
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 | showWebPage (const QString &url) |
void | showWikiPage (const QString &page=QString()) |
virtual | ~InterfaceManager () |
Destructor. More... | |
Static Public Member Functions | |
static void | registerHelpWindowFactory (Mantid::Kernel::AbstractInstantiator< MantidHelpInterface > *factory) |
Registration function for the help window factory. More... | |
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. More... | |
Static Private Attributes | |
static Mantid::Kernel::AbstractInstantiator< MantidHelpInterface > * | m_helpViewer = nullptr |
Handle to the help window factory. More... | |
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 55 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::closeHelpWindow | ( | ) |
Definition at line 274 of file InterfaceManager.cpp.
References createHelpWindow().
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 71 of file InterfaceManager.cpp.
References MantidQt::API::AlgorithmDialog::addEnabledAndDisableLists(), Mantid::Kernel::Logger::debug(), MantidQt::API::AlgorithmDialog::executeOnAccept(), MantidQt::API::AlgorithmDialog::initializeLayout(), Mantid::Kernel::SingletonHolder< T >::Instance(), 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 133 of file InterfaceManager.cpp.
References createDialog(), and Mantid::Kernel::SingletonHolder< T >::Instance().
Referenced by 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 closeHelpWindow(), MantidQt::API::HelpWindow::showAlgorithm(), showAlgorithmHelp(), MantidQt::API::HelpWindow::showConcept(), showConceptHelp(), MantidQt::API::HelpWindow::showCustomInterface(), showCustomInterfaceHelp(), MantidQt::API::HelpWindow::showFitFunction(), showFitFunctionHelp(), showHelpPage(), MantidQt::API::HelpWindow::showPage(), and showWikiPage().
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 151 of file InterfaceManager.cpp.
References Mantid::Kernel::Logger::debug(), Mantid::Kernel::Logger::error(), MantidQt::API::UserSubWindow::initializeLayout(), Mantid::Kernel::SingletonHolder< T >::Instance(), notifyExistingInterfaces(), and MantidQt::API::UserSubWindow::setInterfaceName().
QStringList InterfaceManager::getUserSubWindowKeys | ( | ) | const |
The keys associated with UserSubWindow classes.
Definition at line 208 of file InterfaceManager.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance().
|
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 189 of file InterfaceManager.cpp.
References 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 252 of file InterfaceManager.cpp.
References createHelpWindow().
void InterfaceManager::showConceptHelp | ( | const QString & | name | ) |
name | of concept to show help for |
Definition at line 257 of file InterfaceManager.cpp.
References createHelpWindow().
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 267 of file InterfaceManager.cpp.
References createHelpWindow().
void InterfaceManager::showFitFunctionHelp | ( | const QString & | name = QString() | ) |
name | of fit function to show help for |
Definition at line 262 of file InterfaceManager.cpp.
References createHelpWindow().
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::showWebPage | ( | const QString & | url | ) |
url | of web page to open in browser |
Definition at line 272 of file InterfaceManager.cpp.
References MantidQt::API::MantidDesktopServices::openUrl().
void InterfaceManager::showWikiPage | ( | const QString & | page = QString() | ) |
page | Wiki page to show help for |
Definition at line 247 of file InterfaceManager.cpp.
References createHelpWindow().
|
staticprivate |
Handle to the help window factory.
Definition at line 129 of file InterfaceManager.h.
Referenced by createHelpWindow(), and registerHelpWindowFactory().