| 403 | } |
| 404 | |
| 405 | void QmitkPipInstallDialog::SetUiFinished(bool success) |
| 406 | { |
| 407 | // Clear both possible accepted-slot bindings before rewiring so repeated |
| 408 | // fail/retry cycles don't accumulate duplicate connections. Otherwise the |
| 409 | // constructor's connect to OnInstallClicked survives the failure path and |
| 410 | // SetUiFinished(false) would stack a second connect on top of it, causing |
| 411 | // a single Retry click to fire OnInstallClicked twice. |
| 412 | disconnect(m_Ui->buttonBox, &QDialogButtonBox::accepted, this, &QmitkPipInstallDialog::OnInstallClicked); |
| 413 | disconnect(m_Ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); |
| 414 | |
| 415 | if (success) |
| 416 | { |
| 417 | m_Ui->buttonBox->setStandardButtons(QDialogButtonBox::Ok); |
| 418 | connect(m_Ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); |
| 419 | } |
| 420 | else |
| 421 | { |
| 422 | m_Ui->buttonBox->setStandardButtons(QDialogButtonBox::Retry | QDialogButtonBox::Cancel); |
| 423 | connect(m_Ui->buttonBox, &QDialogButtonBox::accepted, this, &QmitkPipInstallDialog::OnInstallClicked); |
| 424 | } |
| 425 | |
| 426 | m_Ui->buttonBox->setEnabled(true); |
| 427 | } |
| 428 | |
| 429 | void QmitkPipInstallDialog::OfferDetails() |
| 430 | { |
no test coverage detected