summaryrefslogtreecommitdiffstats
path: root/src/citra_qt/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/citra_qt/main.cpp18
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() {
//GControllerConfigDialog* dialog = new GControllerConfigDialog(controller_ports, this);
}
+bool GMainWindow::ConfirmClose() {
+ if (emu_thread != nullptr) {
+ auto answer = QMessageBox::question(this, tr("Citra"),
+ tr("Are you sure you want to close Citra?"),
+ QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
+
+ if (answer == QMessageBox::No) {
+ return false;
+ }
+ }
+ return true;
+}
+
void GMainWindow::closeEvent(QCloseEvent* event) {
+ if (!ConfirmClose()) {
+ event->ignore();
+ return;
+ }
+
// Save window layout
QSettings settings(QSettings::IniFormat, QSettings::UserScope, "Citra team", "Citra");