Mantid
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
MantidQt::API::InterfaceManager Class Reference

This class is responsible for creating the correct dialog for an algorithm. More...

#include <InterfaceManager.h>

Public Member Functions

void closeHelpWindow ()
 
AlgorithmDialogcreateDialog (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...
 
AlgorithmDialogcreateDialogFromName (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...
 
MantidHelpInterfacecreateHelpWindow () const
 Function that instantiates the help window. More...
 
UserSubWindowcreateSubWindow (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 &section=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...
 

Detailed Description

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

Author
Martyn Gigg, Tessella Support Services plc
Date
24/02/2009

Definition at line 55 of file InterfaceManager.h.

Constructor & Destructor Documentation

◆ InterfaceManager()

InterfaceManager::InterfaceManager ( )

Constructor.

Default Constructor.

Definition at line 214 of file InterfaceManager.cpp.

References MantidQt::API::loadPluginsFromCfgPath().

◆ ~InterfaceManager()

InterfaceManager::~InterfaceManager ( )
virtualdefault

Destructor.

Member Function Documentation

◆ closeHelpWindow()

void InterfaceManager::closeHelpWindow ( )

Definition at line 274 of file InterfaceManager.cpp.

References createHelpWindow().

◆ createDialog()

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

Parameters
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
Returns
An AlgorithmDialog object

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().

◆ createDialogFromName()

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.

Parameters
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().

◆ createHelpWindow()

MantidHelpInterface * InterfaceManager::createHelpWindow ( ) const

◆ createSubWindow()

UserSubWindow * InterfaceManager::createSubWindow ( const QString &  interface_name,
QWidget *  parent = nullptr,
bool  isWindow = true 
)

Create a new instance of the correct type of UserSubWindow.

Parameters
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().

◆ getUserSubWindowKeys()

QStringList InterfaceManager::getUserSubWindowKeys ( ) const

The keys associated with UserSubWindow classes.

Returns
A QStringList containing the keys from the InterfaceFactory that refer to UserSubWindow classes

Definition at line 208 of file InterfaceManager.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance().

◆ notifyExistingInterfaces()

void InterfaceManager::notifyExistingInterfaces ( UserSubWindow newWindow)
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).

Parameters
newWindow:: The interface just created

Definition at line 189 of file InterfaceManager.cpp.

References MantidQt::API::UserSubWindow::otherUserSubWindowCreated().

Referenced by createSubWindow().

◆ registerHelpWindowFactory()

void InterfaceManager::registerHelpWindowFactory ( Mantid::Kernel::AbstractInstantiator< MantidHelpInterface > *  factory)
static

Registration function for the help window factory.

Parameters
factorythe factory instance

Definition at line 222 of file InterfaceManager.cpp.

References m_helpViewer.

◆ showAlgorithmHelp()

void InterfaceManager::showAlgorithmHelp ( const QString &  name,
const int  version = -1 
)
Parameters
nameof algorithm to show help for
versionof algorithm

Definition at line 252 of file InterfaceManager.cpp.

References createHelpWindow().

◆ showConceptHelp()

void InterfaceManager::showConceptHelp ( const QString &  name)
Parameters
nameof concept to show help for

Definition at line 257 of file InterfaceManager.cpp.

References createHelpWindow().

◆ showCustomInterfaceHelp()

void InterfaceManager::showCustomInterfaceHelp ( const QString &  name,
const QString &  area = QString(),
const QString &  section = QString() 
)
Parameters
nameof 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().

◆ showFitFunctionHelp()

void InterfaceManager::showFitFunctionHelp ( const QString &  name = QString())
Parameters
nameof fit function to show help for

Definition at line 262 of file InterfaceManager.cpp.

References createHelpWindow().

Referenced by MantidQt::MantidWidgets::FunctionTreeView::showFunctionHelp().

◆ showHelpPage()

void InterfaceManager::showHelpPage ( const QString &  url = QString())
Parameters
urlRelative URL of help page to show.

Definition at line 242 of file InterfaceManager.cpp.

References createHelpWindow().

◆ showWebPage()

void InterfaceManager::showWebPage ( const QString &  url)
Parameters
urlof web page to open in browser

Definition at line 272 of file InterfaceManager.cpp.

References MantidQt::API::MantidDesktopServices::openUrl().

◆ showWikiPage()

void InterfaceManager::showWikiPage ( const QString &  page = QString())
Parameters
pageWiki page to show help for

Definition at line 247 of file InterfaceManager.cpp.

References createHelpWindow().

Member Data Documentation

◆ m_helpViewer

Mantid::Kernel::AbstractInstantiator< MantidHelpInterface > * InterfaceManager::m_helpViewer = nullptr
staticprivate

Handle to the help window factory.

Definition at line 129 of file InterfaceManager.h.

Referenced by createHelpWindow(), and registerHelpWindowFactory().


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