MCPcopy Create free account
hub / github.com/MITK/MITK / OnSubmitButtonClicked

Method OnSubmitButtonClicked

Modules/FormsUI/src/QmitkForm.cpp:303–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303void QmitkForm::OnSubmitButtonClicked()
304{
305 if (this->ValidateCurrentSection())
306 {
307 emit Submit();
308
309 if (m_ResponsesPath.empty())
310 {
311 m_ResponsesPath = QFileDialog::getSaveFileName(this,
312 "Submit Form",
313 QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation).append("/form.csv"),
314 "Comma-separated values (*.csv)").toStdString();
315 }
316
317 if (!m_ResponsesPath.empty())
318 {
319 bool retry;
320
321 do
322 {
323 retry = false;
324
325 try
326 {
327 mitk::Forms::SubmitToCSV(*m_Form, m_ResponsesPath);
328 }
329 catch (const mitk::Exception& e)
330 {
331 QMessageBox messageBox;
332 messageBox.setWindowTitle("Submit form");
333 messageBox.setIcon(QMessageBox::Warning);
334 messageBox.setText(e.GetDescription());
335 auto retryButton = messageBox.addButton("Retry", QMessageBox::NoRole);
336 messageBox.addButton("Ignore", QMessageBox::YesRole);
337
338 messageBox.exec();
339
340 if (messageBox.clickedButton() == retryButton)
341 retry = true;
342 }
343 } while (retry);
344
345 m_HasBeenSubmitted = true;
346 this->Update();
347 }
348 }
349}
350
351void QmitkForm::OnClearButtonClicked()
352{

Callers

nothing calls this directly

Calls 6

UpdateMethod · 0.95
setIconMethod · 0.80
emptyMethod · 0.45
setTextMethod · 0.45
GetDescriptionMethod · 0.45

Tested by

no test coverage detected