diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-11-26 18:06:08 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-11-26 18:06:08 +0100 |
commit | 66ffab71ae6bd4731ba02987c108561ab90be75c (patch) | |
tree | 7fa46da1daf4845f37a449197f324dc7dc3599e6 /application/LaunchController.cpp | |
parent | ce70407363b9bdd8d7901467f2bdb91179a9ac22 (diff) | |
download | PrismLauncher-66ffab71ae6bd4731ba02987c108561ab90be75c.tar.gz PrismLauncher-66ffab71ae6bd4731ba02987c108561ab90be75c.tar.bz2 PrismLauncher-66ffab71ae6bd4731ba02987c108561ab90be75c.zip |
NOISSUE allow killing the instance from main window
Diffstat (limited to 'application/LaunchController.cpp')
-rw-r--r-- | application/LaunchController.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/application/LaunchController.cpp b/application/LaunchController.cpp index eaeb9b28..62e582d8 100644 --- a/application/LaunchController.cpp +++ b/application/LaunchController.cpp @@ -288,3 +288,25 @@ void LaunchController::onProgressRequested(Task* task) m_launcher->proceed(); progDialog.execWithTask(task); } + +bool LaunchController::abort() +{ + if(!m_launcher) + { + return true; + } + if(!m_launcher->canAbort()) + { + return false; + } + auto response = CustomMessageBox::selectable( + m_parentWidget, tr("Kill Minecraft?"), + tr("This can cause the instance to get corrupted and should only be used if Minecraft " + "is frozen for some reason"), + QMessageBox::Question, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes)->exec(); + if (response == QMessageBox::Yes) + { + return m_launcher->abort(); + } + return false; +} |