Mantid
Loading...
Searching...
No Matches
LoadDAEDialog.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7//----------------------
8// Includes
9//----------------------
12
13#include <QFileDialog>
14#include <QLabel>
15#include <QLineEdit>
16#include <QValidator>
17
19
20DECLARE_DIALOG(LoadDAEDialog)
21
22
24public:
26 void operator()(void * /*unused*/) {}
28 void operator()(const void * /*unused*/) {}
29};
30
32 : MantidQt::API::AlgorithmDialog(parent), lineHost(nullptr), lineName(nullptr), minSpLineEdit(nullptr),
33 maxSpLineEdit(nullptr), listSpLineEdit(nullptr), updateLineEdit(nullptr) {}
34
36
38 auto *paramsLayout = new QGridLayout;
39 auto *label = new QLabel(tr("DAE Name"));
40 lineHost = new QLineEdit;
41 label->setBuddy(lineHost);
42 paramsLayout->addWidget(label, 0, 0);
43 paramsLayout->addWidget(lineHost, 0, 1);
44 tie(lineHost, "DAEname", paramsLayout);
45
46 label = new QLabel(tr("Workspace Name"));
47 lineName = new QLineEdit;
48 label->setBuddy(lineName);
49 paramsLayout->addWidget(label, 1, 0);
50 paramsLayout->addWidget(lineName, 1, 1);
51 tie(lineName, "OutputWorkspace", paramsLayout);
52
53 auto *minSpLabel = new QLabel("Starting spectrum");
54 minSpLineEdit = new QLineEdit;
55 paramsLayout->addWidget(minSpLabel, 2, 0);
56 paramsLayout->addWidget(minSpLineEdit, 2, 1);
57 tie(minSpLineEdit, "SpectrumMin", paramsLayout);
58
59 auto *maxSpLabel = new QLabel("Ending spectrum");
60 maxSpLineEdit = new QLineEdit;
61 paramsLayout->addWidget(maxSpLabel, 3, 0);
62 paramsLayout->addWidget(maxSpLineEdit, 3, 1);
63 tie(maxSpLineEdit, "SpectrumMax", paramsLayout);
64
65 auto *listSpLabel = new QLabel("Spectrum List");
66 listSpLineEdit = new QLineEdit;
67 paramsLayout->addWidget(listSpLabel, 4, 0);
68 paramsLayout->addWidget(listSpLineEdit, 4, 1);
69 tie(listSpLineEdit, "SpectrumList", paramsLayout);
70
71 auto *updateLayout = new QHBoxLayout;
72 auto *updateLabel = new QLabel("Update every");
73 updateLineEdit = new QLineEdit;
74 QIntValidator *ival = new QIntValidator(1, 99999999, updateLineEdit);
75 updateLineEdit->setValidator(ival);
76
77 label = new QLabel(" seconds");
78 paramsLayout->addWidget(updateLabel, 5, 0);
79 updateLayout->addWidget(updateLineEdit);
80 updateLayout->addWidget(label);
81 paramsLayout->addLayout(updateLayout, 5, 1);
82 tie(updateLineEdit, "UpdateRate", updateLayout);
83
84 auto *mainLayout = new QVBoxLayout;
85 mainLayout->addLayout(paramsLayout);
86 mainLayout->addLayout(createDefaultButtonLayout("?", "Load", "Cancel"));
87
88 setLayout(mainLayout);
89 setWindowTitle(tr("Load Workspace from DAE"));
90 setFixedHeight(sizeHint().height());
91}
92} // namespace MantidQt::CustomDialogs
#define DECLARE_DIALOG(classname)
double height
Definition: GetAllEi.cpp:155
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.
QWidget * tie(QWidget *widget, const QString &property, QLayout *parent_layout=nullptr, bool readHistory=true)
Tie a widget to a property.
~LoadDAEDialog() override
Destruktor.
LoadDAEDialog(QWidget *parent=nullptr)
Constructor.
void initLayout() override
This does the work and must be overridden in each deriving class.
An object for constructing a shared_ptr that won't ever delete its pointee.
void operator()(const void *)
Does nothing.
void operator()(void *)
Does nothing.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...