15#define DECLARE_DIALOG(classname) \
17 Mantid::Kernel::RegistrationHelper register_dialog_##classname( \
18 ((MantidQt::API::AlgorithmDialogFactory::Instance().subscribe<classname>(#classname)), 0)); \
86 void setShowKeepOpen(
const bool showOption);
89 bool isShowKeepOpen()
const;
92 void initializeLayout();
95 bool isInitialized()
const;
107 virtual void parseInput();
110 virtual void saveInput();
125 bool requiresUserInput(
const QString &propName)
const;
128 QString getInputValue(
const QString &propName)
const;
130 QLabel *getValidatorMarker(
const QString &propname);
133 void storePropertyValue(
const QString &name,
const QString &
value);
136 void removePropertyValue(
const QString &name);
139 bool setPropertyValues(
const QStringList &skipList = QStringList());
140 bool setPropertyValue(
const QString &pName,
bool validateOthers);
142 void showValidators();
148 const QString &getOptionalMessage()
const;
151 void addOptionalMessage(QVBoxLayout *mainLay);
154 bool isForScript()
const;
157 bool isMessageAvailable()
const;
160 bool isWidgetEnabled(
const QString &propName)
const;
166 QWidget *tie(QWidget *widget,
const QString &property, QLayout *parent_layout =
nullptr,
bool readHistory =
true);
169 void untie(
const QString &property);
172 QString openFileDialog(
const QString &propName);
178 void fillAndSetComboBox(
const QString &propName, QComboBox *optionsBox)
const;
181 void fillLineEdit(
const QString &propName, QLineEdit *field);
184 QLayout *createDefaultButtonLayout(
const QString &helpText = QString(
"?"),
const QString &loadText = QString(
"Run"),
185 const QString &cancelText = QString(
"Close"),
186 const QString &keepOpenText = QString(
"Keep Open"));
189 QPushButton *createHelpButton(
const QString &helpText = QString(
"?"))
const;
192 void flagInputWS(QWidget *inputWidget);
196 QString getValue(QWidget *widget);
207 void accept()
override;
210 void reject()
override;
213 virtual void helpClicked();
216 virtual void keepOpenChanged(
int state);
219 virtual void algorithmCompleted();
222 virtual void executeAlgorithmAsync();
224 virtual void removeAlgorithmFromManager();
226 void enableExitButton();
232 bool requestedToKeepEnabled(
const QString &propName)
const;
237 QString getPreviousValue(
const QString &propName)
const;
239 void setPreviousValue(QWidget *widget,
const QString &property);
244 void closeEvent(QCloseEvent *evt)
override;
254 void isForScript(
bool forScript);
256 void executeOnAccept(
bool on);
258 void setOptionalMessage(
const QString &message);
260 void addEnabledAndDisableLists(
const QStringList &enabled,
const QStringList &disabled);
#define EXPORT_OPT_MANTIDQT_COMMON
double value
The value of the point.
This class should be the basis for all customised algorithm dialogs.
QStringList m_enabled
A list of property names that should have their widgets enabled.
void algCompletedSignal()
Emitted when alg completes and dialog is staying open.
bool m_statusTracked
A flag to track whether the status of the algorithm is being tracked.
QStringList m_python_arguments
A list of property names that have been passed from Python.
QString m_strMessage
The message string to be displayed at the top of the widget; if it exists.
QHash< QString, QWidget * > m_tied_properties
A list pointers to the widget for each property.
QVector< QWidget * > m_inputws_opts
Store a list of the names of input workspace boxes.
QStringList m_disabled
A list of property names that the user has requested to be disabled (overrides those in enabled)
bool m_forScript
A boolean indicating whether this is for a script or not.
virtual void initLayout()=0
This does the work and must be overridden in each deriving class.
bool m_autoParseOnInit
Flag if the input should be parsed automatically on initialization.
Mantid::API::IAlgorithm_sptr m_algorithm
The algorithm associated with this dialog.
bool m_msgAvailable
Is the message string empty or not.
QHash< QString, QString > m_errors
A map where key = property name; value = the error for this property (i.e.
QHash< QString, QString > m_propertyValueMap
A map of property <name, value> pairs that have been taken from the dialog.
QString m_algName
The name of the algorithm.
bool m_keepOpen
Whether to keep the dialog box open after alg execution.
std::vector< Mantid::API::AlgorithmObserver * > m_observers
A list of AlgorithmObservers to add to the algorithm prior to execution.
QStringList openMultipleFileDialog(const QString &propName)
Open a file dialog to select many file.
QVector< QLineEdit * > m_outputws_fields
Store a list of output workspace text edits.
QPushButton * m_exitButton
QTimer m_btnTimer
Enable the close button when the timer fires.
QStringList m_algProperties
The properties associated with this dialog.
QStringList m_noValidation
A list of property names whose widgets handle their own validation.
bool m_isInitialized
Whether the layout has been initialized.
QHash< QPushButton *, int > m_wsbtn_tracker
A map to keep track of replace workspace button presses.
QCheckBox * m_keepOpenCheckBox
QHash< QString, QLabel * > m_validators
A list of labels to use as validation markers.
This class is responsible for creating the correct dialog for an algorithm.
Observes Algorithm notifications: start,progress,finish,error.
IAlgorithm is the interface implemented by the Algorithm base class.
Base class for properties.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm
Helper class which provides the Collimation Length for SANS instruments.