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

Method OnInstallFinished

Modules/PythonInstallerUI/src/QmitkPipInstallDialog.cpp:237–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void 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
279void QmitkPipInstallDialog::OnProgressChanged(int current, int total)
280{

Callers

nothing calls this directly

Calls 5

SetUiFinishedMethod · 0.95
SetTerminalStatusMethod · 0.95
OfferDetailsMethod · 0.95
stopMethod · 0.45
acceptMethod · 0.45

Tested by

no test coverage detected