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. */
| 472 | * TODO: Then, load the first unfinished task, if any. |
| 473 | */ |
| 474 | void 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. |
no test coverage detected