From 4f57207fd2de15f153a3548f572ba56750a3bfd4 Mon Sep 17 00:00:00 2001 From: TakSuyu Date: Thu, 4 Jul 2013 15:39:41 -0700 Subject: Added dialog box and functionality to mainwindow delete button. --- gui/mainwindow.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gui') diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index dda12941..3f0221b2 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -291,7 +291,17 @@ void MainWindow::on_mainToolBar_visibilityChanged ( bool ) void MainWindow::on_actionDeleteInstance_triggered() { - + Instance* inst = selectedInstance(); + if (inst) + { + int response = QMessageBox::question(this, "CAREFUL", + QString("This is permanent! Are you sure?\nAbout to delete: ") + inst->name()); + if (response == QMessageBox::Yes) + { + QDir(inst->rootDir()).removeRecursively(); + instList.loadList(); + } + } } void MainWindow::on_actionRenameInstance_triggered() -- cgit v1.2.3