| 91 | } |
| 92 | |
| 93 | void QmitkXnatCreateObjectDialog::OnAcceptClicked() |
| 94 | { |
| 95 | // ctkXnatProject* project; |
| 96 | ctkXnatSubject *subject; |
| 97 | ctkXnatExperiment *experiment; |
| 98 | |
| 99 | switch (m_Type) |
| 100 | { |
| 101 | // case PROJECT: |
| 102 | // project = dynamic_cast<QmitkXnatProjectWidget*>(m_Widget)->GetProject(); |
| 103 | |
| 104 | // // Check mandatory field |
| 105 | // if (project->property("label").isEmpty()) |
| 106 | // { |
| 107 | // QMessageBox msgBox; |
| 108 | // msgBox.setIcon(QMessageBox::Warning); |
| 109 | // msgBox.setText("Please fill in an ID to create a new project!"); |
| 110 | // msgBox.exec(); |
| 111 | // return; |
| 112 | // } |
| 113 | |
| 114 | // m_Object = project; |
| 115 | // break; |
| 116 | |
| 117 | case SUBJECT: |
| 118 | subject = dynamic_cast<QmitkXnatSubjectWidget *>(m_Widget)->GetSubject(); |
| 119 | |
| 120 | // Check mandatory field |
| 121 | if (subject->property("label").isEmpty()) |
| 122 | { |
| 123 | QMessageBox msgBox; |
| 124 | msgBox.setIcon(QMessageBox::Warning); |
| 125 | msgBox.setText("Please fill in an ID to create a new subject!"); |
| 126 | msgBox.exec(); |
| 127 | return; |
| 128 | } |
| 129 | |
| 130 | m_Object = subject; |
| 131 | break; |
| 132 | |
| 133 | case EXPERIMENT: |
| 134 | experiment = dynamic_cast<QmitkXnatExperimentWidget *>(m_Widget)->GetExperiment(); |
| 135 | |
| 136 | // Check mandatory field |
| 137 | if (experiment->property("label").isEmpty()) |
| 138 | { |
| 139 | QMessageBox msgBox; |
| 140 | msgBox.setIcon(QMessageBox::Warning); |
| 141 | msgBox.setText("Please fill in an ID to create a new experiment!"); |
| 142 | msgBox.exec(); |
| 143 | return; |
| 144 | } |
| 145 | else if (experiment->property("xsiType").isEmpty() || experiment->property("xsiType") == "xnat:experimentData") |
| 146 | { |
| 147 | QMessageBox msgBox; |
| 148 | msgBox.setIcon(QMessageBox::Warning); |
| 149 | msgBox.setText("Please fill in an XSI Type to create a new experiment!"); |
| 150 | msgBox.exec(); |
nothing calls this directly
no test coverage detected