18#include <QApplication>
21#include <QDesktopWidget>
33#include <QSignalMapper>
68 auto *dialog_layout =
new QVBoxLayout();
69 setLayout(dialog_layout);
94 viewport->layout()->update();
96 viewport->layout()->setSizeConstraint(QLayout::SetMinimumSize);
98 QCoreApplication::processEvents();
100 int screenHeight = QApplication::desktop()->height();
101 int dialogHeight = viewport->sizeHint().height();
105 if ((dialogHeight + 100) < 0.8 * screenHeight) {
109 dialogHeight = this->sizeHint().height();
112 int dialogWidth = this->sizeHint().width() + 25;
113 if (dialogWidth > 640)
119 this->resize(dialogWidth, dialogHeight);
171 QMessageBox::critical(
this,
"",
172 "One or more properties are invalid. The invalid properties are\n"
173 "marked with a *, hold your mouse over the * for more information.");
This class should be the basis for all customised algorithm dialogs.
bool isMessageAvailable() const
Is there a message string available.
QStringList m_enabled
A list of property names that should have their widgets enabled.
virtual void executeAlgorithmAsync()
Executes the algorithm in a separate thread.
bool setPropertyValues(const QStringList &skipList=QStringList())
Set properties on this algorithm by pulling values from the tied widgets.
QStringList m_python_arguments
A list of property names that have been passed from Python.
QStringList m_disabled
A list of property names that the user has requested to be disabled (overrides those in enabled)
QHash< QString, QString > m_errors
A map where key = property name; value = the error for this property (i.e.
bool m_keepOpen
Whether to keep the dialog box open after alg execution.
QLayout * createDefaultButtonLayout(const QString &helpText=QString("?"), const QString &loadText=QString("Run"), const QString &cancelText=QString("Close"), const QString &keepOpenText=QString("Keep Open"))
Create a row layout of buttons with specified text.
void storePropertyValue(const QString &name, const QString &value)
Adds a property (name,value) pair to the stored map.
void parse()
Parse out the input from the dialog.
Mantid::API::IAlgorithm_sptr getAlgorithm() const
Get the algorithm pointer.
void setPreviousValue(QWidget *widget, const QString &property)
Set a value based on any old input that we have.
void addOptionalMessage(QVBoxLayout *mainLay)
Add the optional message to the given layout.
virtual void saveInput()
Save the input history of an accepted dialog.
void accept() override
A slot that can be used to connect a button that accepts the dialog if all of the properties are vali...
void parseInput() override
Parse out information from the dialog.
GenericDialog(QWidget *parent=nullptr)
Default Constructor.
AlgorithmPropertiesWidget * m_algoPropertiesWidget
Widget containing all the PropertyWidgets.
void initLayout() override
Create the layout for this dialog.
~GenericDialog() override
Destructor.