| 235 | } |
| 236 | |
| 237 | void QmitkPipInstallDialog::OnInstallFinished(bool success) |
| 238 | { |
| 239 | m_DotTimer->stop(); |
| 240 | |
| 241 | // While ConfirmCancel is spinning a local event loop, it owns the teardown |
| 242 | // of the dialog. Don't touch the UI here - the failure-state widgets would |
| 243 | // briefly flash before the dialog is rejected. |
| 244 | if (m_IsCancelling) |
| 245 | return; |
| 246 | |
| 247 | this->SetUiFinished(success); |
| 248 | |
| 249 | if (success) |
| 250 | { |
| 251 | this->SetTerminalStatus(QString::fromStdString(m_Spec.name) + |
| 252 | (m_Mode == Mode::Update ? " was updated successfully." : " was installed successfully.")); |
| 253 | m_Ui->packageLabel->hide(); |
| 254 | // The last phase may have left the bar in indeterminate (spinning) mode |
| 255 | // (HF downloads use setRange(0, 0)), so hide it once we're done. |
| 256 | m_Ui->progressBar->hide(); |
| 257 | |
| 258 | if (m_Ui->autoCloseCheckBox->isChecked()) |
| 259 | { |
| 260 | this->accept(); |
| 261 | } |
| 262 | else |
| 263 | { |
| 264 | // User opted out of auto-close so they can inspect the log. Offer the |
| 265 | // details toggle for a successful run too - the raw pip output may still |
| 266 | // be useful (deprecation warnings, resolved versions, etc.). |
| 267 | this->OfferDetails(); |
| 268 | } |
| 269 | } |
| 270 | else |
| 271 | { |
| 272 | this->SetTerminalStatus(m_Mode == Mode::Update ? "Update failed. Please try again." : "Installation failed. Please try again."); |
| 273 | m_Ui->packageLabel->hide(); |
| 274 | m_Ui->progressBar->hide(); |
| 275 | this->OfferDetails(); |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | void QmitkPipInstallDialog::OnProgressChanged(int current, int total) |
| 280 | { |
nothing calls this directly
no test coverage detected