summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/citra_qt/main.cpp18
-rw-r--r--src/citra_qt/main.h1
2 files changed, 10 insertions, 9 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index fefa39d0d..da9ea6c91 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -171,6 +171,8 @@ GMainWindow::GMainWindow() : emu_thread(nullptr)
171 } 171 }
172 UpdateRecentFiles(); 172 UpdateRecentFiles();
173 173
174 confirm_before_closing = settings.value("confirmClose", true).toBool();
175
174 // Setup connections 176 // Setup connections
175 connect(game_list, SIGNAL(GameChosen(QString)), this, SLOT(OnGameListLoadFile(QString))); 177 connect(game_list, SIGNAL(GameChosen(QString)), this, SLOT(OnGameListLoadFile(QString)));
176 connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile())); 178 connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile()));
@@ -498,16 +500,13 @@ void GMainWindow::OnConfigure() {
498} 500}
499 501
500bool GMainWindow::ConfirmClose() { 502bool GMainWindow::ConfirmClose() {
501 if (emu_thread != nullptr) { 503 if (emu_thread == nullptr || !confirm_before_closing)
502 auto answer = QMessageBox::question(this, tr("Citra"), 504 return true;
503 tr("Are you sure you want to close Citra?"),
504 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
505 505
506 if (answer == QMessageBox::No) { 506 auto answer = QMessageBox::question(this, tr("Citra"),
507 return false; 507 tr("Are you sure you want to close Citra?"),
508 } 508 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
509 } 509 return answer != QMessageBox::No;
510 return true;
511} 510}
512 511
513void GMainWindow::closeEvent(QCloseEvent* event) { 512void GMainWindow::closeEvent(QCloseEvent* event) {
@@ -530,6 +529,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) {
530 settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked()); 529 settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked());
531 settings.setValue("displayTitleBars", ui.actionDisplay_widget_title_bars->isChecked()); 530 settings.setValue("displayTitleBars", ui.actionDisplay_widget_title_bars->isChecked());
532 settings.setValue("firstStart", false); 531 settings.setValue("firstStart", false);
532 settings.setValue("confirmClose", confirm_before_closing);
533 game_list->SaveInterfaceLayout(settings); 533 game_list->SaveInterfaceLayout(settings);
534 SaveHotkeys(settings); 534 SaveHotkeys(settings);
535 535
diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h
index 3b1bdf15e..8c195f816 100644
--- a/src/citra_qt/main.h
+++ b/src/citra_qt/main.h
@@ -129,6 +129,7 @@ private:
129 GPUCommandListWidget* graphicsCommandsWidget; 129 GPUCommandListWidget* graphicsCommandsWidget;
130 130
131 QAction* actions_recent_files[max_recent_files_item]; 131 QAction* actions_recent_files[max_recent_files_item];
132 bool confirm_before_closing;
132}; 133};
133 134
134#endif // _CITRA_QT_MAIN_HXX_ 135#endif // _CITRA_QT_MAIN_HXX_