16#include <QFontMetrics>
53 QVBoxLayout *main_layout =
new QVBoxLayout(
this);
60 auto *prop_line =
new QHBoxLayout;
61 prop_line->addWidget(
new QLabel(
"Select a file to load:"));
68 auto *browseBtn =
new QPushButton(
"Browse");
69 connect(browseBtn, SIGNAL(clicked()),
this, SLOT(
browseClicked()));
71 prop_line->addWidget(browseBtn);
73 main_layout->addLayout(prop_line);
78 prop_line =
new QHBoxLayout;
79 prop_line->addWidget(
new QLabel(
"Enter name for workspace:"));
82 prop_line->addStretch();
83 main_layout->addLayout(prop_line);
86 auto *groupbox =
new QGroupBox(
"Spectra Options");
87 prop_line =
new QHBoxLayout;
89 auto *text_field =
new QLineEdit;
90 text_field->setMaximumWidth(
m_wsBox->fontMetrics().horizontalAdvance(
"888888"));
91 prop_line->addWidget(
new QLabel(
"Start:"));
92 prop_line->addWidget(text_field);
93 tie(text_field,
"SpectrumMin", prop_line);
95 text_field =
new QLineEdit;
96 text_field->setMaximumWidth(
m_wsBox->fontMetrics().horizontalAdvance(
"888888"));
97 prop_line->addWidget(
new QLabel(
"End:"));
98 prop_line->addWidget(text_field);
99 tie(text_field,
"SpectrumMax", prop_line);
101 text_field =
new QLineEdit;
102 prop_line->addWidget(
new QLabel(
"List:"));
103 prop_line->addWidget(text_field);
104 tie(text_field,
"SpectrumList", prop_line);
106 prop_line->addStretch();
107 groupbox->setLayout(prop_line);
108 main_layout->addWidget(groupbox);
111 prop_line =
new QHBoxLayout;
112 text_field =
new QLineEdit;
113 prop_line->addWidget(
new QLabel(
"Periods:"));
114 prop_line->addWidget(text_field);
115 prop_line->addStretch();
116 tie(text_field,
"PeriodList", prop_line);
118 main_layout->addLayout(prop_line);
125 auto *cacheBox =
new QComboBox;
127 std::vector<std::string>::const_iterator vend = items.end();
128 for (std::vector<std::string>::const_iterator vitr = items.begin(); vitr != vend; ++vitr) {
129 cacheBox->addItem(QString::fromStdString(*vitr));
131 prop_line =
new QHBoxLayout;
132 prop_line->addWidget(
new QLabel(
"Cache file locally:"), 0, Qt::AlignRight);
133 prop_line->addWidget(cacheBox, 0, Qt::AlignLeft);
134 tie(cacheBox,
"Cache", prop_line);
137 prop_line->addStretch();
142 QCheckBox *checkbox =
new QCheckBox(
"Load Log Files",
this);
143 prop_line->addWidget(checkbox);
144 tie(checkbox,
"LoadLogFiles", prop_line);
146 prop_line->addStretch();
151 auto *monitorsBox =
new QComboBox;
152 std::vector<std::string> monitoritems = loadMonitors->
allowedValues();
153 std::vector<std::string>::const_iterator mend = monitoritems.end();
154 for (std::vector<std::string>::const_iterator mitr = monitoritems.begin(); mitr != mend; ++mitr) {
155 monitorsBox->addItem(QString::fromStdString(*mitr));
157 prop_line->addWidget(
new QLabel(
"LoadMonitors:"), 0, Qt::AlignRight);
158 prop_line->addWidget(monitorsBox);
159 tie(monitorsBox,
"LoadMonitors", prop_line);
163 main_layout->addLayout(prop_line);
175 QFileInfo(
m_pathBox->text()).absoluteDir().path());
179 if (!filepath.isEmpty()) {
185 if (
m_wsBox->isEnabled() && !filepath.isEmpty())
186 m_wsBox->setText(QFileInfo(filepath).baseName());
#define DECLARE_DIALOG(classname)
bool isMessageAvailable() const
Is there a message string available.
bool isWidgetEnabled(const QString &propName) const
Check is a given property should have its control enabled or not.
QString openFileDialog(const QString &propName)
Open a file dialog to select a file.
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.
void addOptionalMessage(QVBoxLayout *mainLay)
Add the optional message to the given layout.
Mantid::Kernel::Property * getAlgorithmProperty(const QString &propName) const
Get a pointer to the named property.
This class gives specialised dialog for the LoadRaw algorithm.
void browseClicked()
A slot for the browse button clicked signal.
~LoadRawDialog() override
Destructor.
QLineEdit * m_pathBox
The line inputs.
LoadRawDialog(QWidget *parent=nullptr)
Constructor.
void initLayout() override
Create the layout.
Base class for properties.
virtual std::vector< std::string > allowedValues() const
Returns the set of valid values for this property, if such a set exists.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...