26 #include <ctkXnatExperiment.h>
27 #include <ctkXnatSubject.h>
31 #include <QMessageBox>
32 #include <QPushButton>
39 : QDialog(parent), m_Type(type)
48 m_Object =
new ctkXnatSubject();
53 m_Object =
new ctkXnatExperiment();
61 QList<QLineEdit *> children = m_Widget->findChildren<QLineEdit *>();
62 foreach (QLineEdit *child, children)
64 child->setReadOnly(
false);
67 QGridLayout *grid =
dynamic_cast<QGridLayout *
>(m_Widget->layout());
69 QPushButton *btnOk =
new QPushButton(
"Create");
70 QPushButton *btnCancel =
new QPushButton(
"Cancel");
72 QHBoxLayout *hLayout =
new QHBoxLayout();
73 hLayout->addWidget(btnOk);
74 hLayout->addWidget(btnCancel);
79 grid->addLayout(hLayout, grid->rowCount() + 1, 1);
98 ctkXnatSubject *subject;
99 ctkXnatExperiment *experiment;
123 if (subject->property(
"label").isEmpty())
126 msgBox.setIcon(QMessageBox::Warning);
127 msgBox.setText(
"Please fill in an ID to create a new subject!");
139 if (experiment->property(
"label").isEmpty())
142 msgBox.setIcon(QMessageBox::Warning);
143 msgBox.setText(
"Please fill in an ID to create a new experiment!");
147 else if (experiment->property(
"xsiType").isEmpty() || experiment->property(
"xsiType") ==
"xnat:experimentData")
150 msgBox.setIcon(QMessageBox::Warning);
151 msgBox.setText(
"Please fill in an XSI Type to create a new experiment!");
156 m_Object = experiment;
QmitkXnatCreateObjectDialog(SpecificType type, QWidget *parent=0)
virtual ~QmitkXnatCreateObjectDialog()
ctkXnatObject * GetXnatObject()