Browse Source

ENH: add a check before delete cache

Bill Hoffman 17 years ago
parent
commit
e4a1823f43
1 changed files with 11 additions and 2 deletions
  1. 11 2
      Source/QtDialog/CMakeSetupDialog.cxx

+ 11 - 2
Source/QtDialog/CMakeSetupDialog.cxx

@@ -543,9 +543,18 @@ void CMakeSetupDialog::doReloadCache()
 }
 
 void CMakeSetupDialog::doDeleteCache()
-{
+{   
+  QString title = tr("Delete Cache");
+  QString message = "Are you sure you want to delete the cache?";
+  QMessageBox::StandardButton btn;
+  btn = QMessageBox::information(this, title, message, 
+                                 QMessageBox::Yes | QMessageBox::No);
+  if(btn == QMessageBox::No)
+    {
+    return;
+    }
   QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
-    "deleteCache", Qt::QueuedConnection);
+                            "deleteCache", Qt::QueuedConnection);
 }
 
 void CMakeSetupDialog::doAbout()