diff options
Diffstat (limited to 'src/citra_qt/main.cpp')
| -rw-r--r-- | src/citra_qt/main.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 144f11117..fefa39d0d 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -497,7 +497,25 @@ void GMainWindow::OnConfigure() { | |||
| 497 | //GControllerConfigDialog* dialog = new GControllerConfigDialog(controller_ports, this); | 497 | //GControllerConfigDialog* dialog = new GControllerConfigDialog(controller_ports, this); |
| 498 | } | 498 | } |
| 499 | 499 | ||
| 500 | bool GMainWindow::ConfirmClose() { | ||
| 501 | if (emu_thread != nullptr) { | ||
| 502 | auto answer = QMessageBox::question(this, tr("Citra"), | ||
| 503 | tr("Are you sure you want to close Citra?"), | ||
| 504 | QMessageBox::Yes | QMessageBox::No, QMessageBox::No); | ||
| 505 | |||
| 506 | if (answer == QMessageBox::No) { | ||
| 507 | return false; | ||
| 508 | } | ||
| 509 | } | ||
| 510 | return true; | ||
| 511 | } | ||
| 512 | |||
| 500 | void GMainWindow::closeEvent(QCloseEvent* event) { | 513 | void GMainWindow::closeEvent(QCloseEvent* event) { |
| 514 | if (!ConfirmClose()) { | ||
| 515 | event->ignore(); | ||
| 516 | return; | ||
| 517 | } | ||
| 518 | |||
| 501 | // Save window layout | 519 | // Save window layout |
| 502 | QSettings settings(QSettings::IniFormat, QSettings::UserScope, "Citra team", "Citra"); | 520 | QSettings settings(QSettings::IniFormat, QSettings::UserScope, "Citra team", "Citra"); |
| 503 | 521 | ||