MCPcopy Create free account
hub / github.com/Kitware/CMake / closeEvent

Method closeEvent

Source/QtDialog/CMakeSetupDialog.cxx:607–643  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

605}
606
607void CMakeSetupDialog::closeEvent(QCloseEvent* e)
608{
609 // prompt for close if there are unsaved changes, and we're not busy
610 if (this->CacheModified) {
611 QString msg = tr("You have changed options but not rebuilt, "
612 "are you sure you want to exit?");
613 QString title = tr("Confirm Exit");
614 QMessageBox::StandardButton btn;
615 btn = QMessageBox::critical(this, title, msg,
616 QMessageBox::Yes | QMessageBox::No);
617 if (btn == QMessageBox::No) {
618 e->ignore();
619 }
620 }
621
622 // don't close if we're busy, unless the user really wants to
623 if (this->CurrentState == Configuring) {
624 QString msg =
625 tr("You are in the middle of a Configure.\n"
626 "If you Exit now the configure information will be lost.\n"
627 "Are you sure you want to Exit?");
628 QString title = tr("Confirm Exit");
629 QMessageBox::StandardButton btn;
630 btn = QMessageBox::critical(this, title, msg,
631 QMessageBox::Yes | QMessageBox::No);
632 if (btn == QMessageBox::No) {
633 e->ignore();
634 } else {
635 this->doInterrupt();
636 }
637 }
638
639 // let the generate finish
640 if (this->CurrentState == Generating) {
641 e->ignore();
642 }
643}
644
645void CMakeSetupDialog::doHelp()
646{

Callers

nothing calls this directly

Calls 1

doInterruptMethod · 0.95

Tested by

no test coverage detected