diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-05-01 01:27:10 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-05-01 01:27:10 +0200 |
commit | 21df531db1935f6b01411a729e3f45b634f6d9c9 (patch) | |
tree | e07c06ecc27b14aed70b18a6dd62bd2a3ae60fd2 /application/MainWindow.cpp | |
parent | f06ac02396c8dfd002db80453963cb61bddce080 (diff) | |
download | MultiMC-21df531db1935f6b01411a729e3f45b634f6d9c9.tar MultiMC-21df531db1935f6b01411a729e3f45b634f6d9c9.tar.gz MultiMC-21df531db1935f6b01411a729e3f45b634f6d9c9.tar.lz MultiMC-21df531db1935f6b01411a729e3f45b634f6d9c9.tar.xz MultiMC-21df531db1935f6b01411a729e3f45b634f6d9c9.zip |
GH-1873 allow closing main window, fix window ref count
Diffstat (limited to 'application/MainWindow.cpp')
-rw-r--r-- | application/MainWindow.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp index 2ab37e54..08afbbb3 100644 --- a/application/MainWindow.cpp +++ b/application/MainWindow.cpp @@ -1403,28 +1403,11 @@ void MainWindow::on_actionViewSelectedInstFolder_triggered() void MainWindow::closeEvent(QCloseEvent *event) { - if(MMC->numRunningInstances()) - { - auto resBtn = QMessageBox::question( - this, - tr("Do you want to close MultiMC?"), - tr("<p>You still have instances running.</p><p>Closing MultiMC will result in inaccurate time tracking and no Minecraft crash handling.</p><p>Are you sure?</p>"), - QMessageBox::No | QMessageBox::Yes, - QMessageBox::Yes - ); - if (resBtn != QMessageBox::Yes) - { - event->ignore(); - return; - } - } - - // no running instances or user said yes. - event->accept(); // Save the window state and geometry. MMC->settings()->set("MainWindowState", saveState().toBase64()); MMC->settings()->set("MainWindowGeometry", saveGeometry().toBase64()); - QApplication::exit(); + event->accept(); + emit isClosing(); } void MainWindow::changeEvent(QEvent* event) |