summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-07-04 15:45:45 -0700
committerPetr Mrázek <peterix@gmail.com>2013-07-04 15:45:45 -0700
commit8a66e61221e8e387102fed9b584d50ac7f44c152 (patch)
treebd587e71786ce7f65a3aadc1f33d9d9be0226a8a
parent6122e0cbc3d10b64dbbe82f5a8f1f849bce7eeef (diff)
parent4f57207fd2de15f153a3548f572ba56750a3bfd4 (diff)
downloadMultiMC-8a66e61221e8e387102fed9b584d50ac7f44c152.tar
MultiMC-8a66e61221e8e387102fed9b584d50ac7f44c152.tar.gz
MultiMC-8a66e61221e8e387102fed9b584d50ac7f44c152.tar.lz
MultiMC-8a66e61221e8e387102fed9b584d50ac7f44c152.tar.xz
MultiMC-8a66e61221e8e387102fed9b584d50ac7f44c152.zip
Merge pull request #1 from TakSuyu/master
Delete button functionality
-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()