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

Method OnTaskListChanged

Modules/SegmentationUI/src/QmitkSegmentationTaskListWidget.cpp:474–496  ·  view source on GitHub ↗

Provided that a valid segmentation task list is currently selected and the * widget is in its default state, update all controls accordingly. * TODO: Then, load the first unfinished task, if any. */

Source from the content-addressed store, hash-verified

472 * TODO: Then, load the first unfinished task, if any.
473 */
474void QmitkSegmentationTaskListWidget::OnTaskListChanged(mitk::SegmentationTaskList* taskList)
475{
476 this->SetTaskList(taskList);
477
478 const auto numTasks = taskList->GetNumberOfTasks();
479
480 m_Ui->progressBar->setMaximum(numTasks);
481 m_Ui->progressBar->setFormat(QStringLiteral("%v/%m Task(s) done"));
482 m_Ui->progressBar->setEnabled(true);
483
484 this->UpdateProgressBar();
485
486 m_Ui->loadButton->setEnabled(true);
487
488 if (numTasks > 1)
489 m_Ui->nextButton->setEnabled(true);
490
491 // TODO: The line below should be enough but it is happening too early
492 // even before the RenderingManager has any registered render windows,
493 // resulting in mismatching renderer and data geometries.
494
495 // this->LoadNextUnfinishedTask();
496}
497
498/* If possible, change the currently displayed task to the previous task.
499 * Enable/disable navigation buttons according to the task's position.

Callers 1

OnSelectionChangedMethod · 0.95

Calls 4

SetTaskListMethod · 0.95
UpdateProgressBarMethod · 0.95
GetNumberOfTasksMethod · 0.80
setEnabledMethod · 0.45

Tested by

no test coverage detected