Mantid
|
This is the base class all customised user interfaces that do not wish to be tied to a specific Mantid algorithm but rather customised for user's requirements. More...
#include <UserSubWindow.h>
Signals | |
void | runAsPythonScript (const QString &code, bool) |
Emitted to start a (generally small) script running. More... | |
void | setFitPropertyBrowser (MantidQt::MantidWidgets::FitPropertyBrowser *browser) |
Thrown when used fit property browser should be changed to given one. More... | |
Public Member Functions | |
void | initializeLayout () |
Create the layout of the widget. Can only be called once. More... | |
void | initializeLocalPython () |
Run local Python init code. More... | |
bool | isInitialized () const |
Is this dialog initialized. More... | |
bool | isPyInitialized () const |
Has the Python initialization function been run. More... | |
UserSubWindow (QWidget *parent=nullptr) | |
DefaultConstructor. More... | |
Static Public Member Functions | |
static std::set< std::string > | aliases () |
A list of aliases. More... | |
static std::string | name () |
Name of the interface. More... | |
Protected Member Functions | |
virtual void | initLayout ()=0 |
To be overridden to set the appropriate layout. More... | |
virtual void | initLocalPython () |
Run local Python setup code. More... | |
QLabel * | newValidator (QWidget *parent) |
Returns a pointer to a new validator QLabel. More... | |
QString | openFileDialog (const bool save, const QStringList &exts) |
Open a file selection box. More... | |
virtual void | otherUserSubWindowCreated (QList< QPointer< UserSubWindow > > &windows) |
To be overridden in order to connect a signal between two interfaces. More... | |
virtual void | otherUserSubWindowCreated (QPointer< UserSubWindow > window) |
To be overridden in order to connect a signal between two interfaces. More... | |
QString | runPythonCode (const QString &code, bool no_output=false) |
Run a piece of python code and return any output that was written to stdout. More... | |
void | showInformationBox (const QString &message) const |
Raise a dialog box giving some information. More... | |
Private Member Functions | |
void | setInterfaceName (const QString &iface_name) |
Set the interface name, made public so possible from Python. More... | |
Private Attributes | |
bool | m_bIsInitialized |
Has this already been initialized. More... | |
QString | m_ifacename |
Store the name of the interface. More... | |
bool | m_isPyInitialized |
Has the python initialization been run. More... | |
PythonRunner | m_pythonRunner |
Python executor. More... | |
Friends | |
class | InterfaceManager |
This is the base class all customised user interfaces that do not wish to be tied to a specific Mantid algorithm but rather customised for user's requirements.
Definition at line 70 of file UserSubWindow.h.
UserSubWindow::UserSubWindow | ( | QWidget * | parent = nullptr | ) |
DefaultConstructor.
Default Constructor.
Definition at line 29 of file UserSubWindow.cpp.
References m_pythonRunner, and runAsPythonScript().
|
inlinestatic |
A list of aliases.
Definition at line 77 of file UserSubWindow.h.
void UserSubWindow::initializeLayout | ( | ) |
Create the layout of the widget. Can only be called once.
Create the layout for this dialog.
Definition at line 42 of file UserSubWindow.cpp.
References initLayout(), Mantid::Kernel::SingletonHolder< T >::Instance(), Mantid::Kernel::Interface, isInitialized(), m_bIsInitialized, and m_ifacename.
Referenced by MantidQt::API::InterfaceManager::createSubWindow().
void UserSubWindow::initializeLocalPython | ( | ) |
Run local Python init code.
Initialize local Python environment.
Calls overridable function in specialized interface
This is called once when the interface is created and is meant to be used to run one off code, i.e. importing modules.
Definition at line 78 of file UserSubWindow.cpp.
References initLocalPython(), isPyInitialized(), and m_isPyInitialized.
|
protectedpure virtual |
To be overridden to set the appropriate layout.
Referenced by initializeLayout().
|
inlineprotectedvirtual |
Run local Python setup code.
Definition at line 103 of file UserSubWindow.h.
Referenced by initializeLocalPython().
bool UserSubWindow::isInitialized | ( | ) | const |
Is this dialog initialized.
Has this window been initialized yet.
Definition at line 65 of file UserSubWindow.cpp.
References m_bIsInitialized.
Referenced by initializeLayout().
bool UserSubWindow::isPyInitialized | ( | ) | const |
Has the Python initialization function been run.
Has the Python initialization function been called yet?
Definition at line 71 of file UserSubWindow.cpp.
References m_isPyInitialized.
Referenced by initializeLocalPython().
|
inlinestatic |
Name of the interface.
Definition at line 75 of file UserSubWindow.h.
|
protected |
Returns a pointer to a new validator QLabel.
The code is copied from AlgorithmDialog.cpp and wont know if the validator label changes there
parent | :: a pointer to an object that will look after it deleting it |
Definition at line 150 of file UserSubWindow.cpp.
|
protected |
Open a file selection box.
save | :: if true a save dialog box used (prompts for replace if file exists) otherwise a load file (file must then exist) |
exts | :: the dialog boxes will only show files that have extensions that match one of the QStrings in the list |
Definition at line 121 of file UserSubWindow.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance().
|
inlineprotectedvirtual |
To be overridden in order to connect a signal between two interfaces.
Definition at line 109 of file UserSubWindow.h.
References UNUSED_ARG.
|
inlineprotectedvirtual |
To be overridden in order to connect a signal between two interfaces.
Definition at line 106 of file UserSubWindow.h.
References UNUSED_ARG.
Referenced by MantidQt::API::InterfaceManager::notifyExistingInterfaces().
|
signal |
Emitted to start a (generally small) script running.
Referenced by UserSubWindow().
|
protected |
Run a piece of python code and return any output that was written to stdout.
Execute a piece of Python code and the output that was written to stdout, i.e.
the output from print statements
code | :: The code to execute |
no_output | :: An optional flag to specify that no output is needed. If running only small commands enable this as it should be faster. The default value is false |
Definition at line 110 of file UserSubWindow.cpp.
References m_pythonRunner, and MantidQt::API::PythonRunner::runPythonCode().
|
signal |
Thrown when used fit property browser should be changed to given one.
|
private |
Set the interface name, made public so possible from Python.
Set the interface name.
iface_name | :: The name of the interface |
Definition at line 165 of file UserSubWindow.cpp.
References m_ifacename.
Referenced by MantidQt::API::InterfaceManager::createSubWindow().
|
protected |
Raise a dialog box giving some information.
Raise a dialog box with some information for the user.
message | :: The message to show |
Definition at line 95 of file UserSubWindow.cpp.
|
friend |
Definition at line 124 of file UserSubWindow.h.
|
private |
Has this already been initialized.
Definition at line 130 of file UserSubWindow.h.
Referenced by initializeLayout(), and isInitialized().
|
private |
Store the name of the interface.
Definition at line 134 of file UserSubWindow.h.
Referenced by initializeLayout(), and setInterfaceName().
|
private |
Has the python initialization been run.
Definition at line 132 of file UserSubWindow.h.
Referenced by initializeLocalPython(), and isPyInitialized().
|
private |
Python executor.
Definition at line 137 of file UserSubWindow.h.
Referenced by runPythonCode(), and UserSubWindow().