summaryrefslogtreecommitdiffstats
path: root/gui/mainwindow.cpp
diff options
context:
space:
mode:
authorTakSuyu <taksuyu@gmail.com>2013-07-04 15:39:41 -0700
committerTakSuyu <taksuyu@gmail.com>2013-07-04 15:39:41 -0700
commit4f57207fd2de15f153a3548f572ba56750a3bfd4 (patch)
treebd587e71786ce7f65a3aadc1f33d9d9be0226a8a /gui/mainwindow.cpp
parent6122e0cbc3d10b64dbbe82f5a8f1f849bce7eeef (diff)
downloadMultiMC-4f57207fd2de15f153a3548f572ba56750a3bfd4.tar
MultiMC-4f57207fd2de15f153a3548f572ba56750a3bfd4.tar.gz
MultiMC-4f57207fd2de15f153a3548f572ba56750a3bfd4.tar.lz
MultiMC-4f57207fd2de15f153a3548f572ba56750a3bfd4.tar.xz
MultiMC-4f57207fd2de15f153a3548f572ba56750a3bfd4.zip
Added dialog box and functionality to mainwindow delete button.
Diffstat (limited to 'gui/mainwindow.cpp')
-rw-r--r--gui/mainwindow.cpp12
1 files changed, 11 insertions, 1 deletions
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()