summaryrefslogtreecommitdiffstats
path: root/src/citra_qt
diff options
context:
space:
mode:
authorLittleWhite <lw.demoscene@googlemail.com>2016-01-13 18:40:41 +0100
committerLittleWhite <lw.demoscene@googlemail.com>2016-02-04 22:15:42 +0100
commit973a6c40dae76b4a03af3e481a31cedfb3011115 (patch)
tree055fa0a774b7ce330cc4ca6e1435668460a87505 /src/citra_qt
parentAdd check before closure when emulation is running (diff)
downloadyuzu-973a6c40dae76b4a03af3e481a31cedfb3011115.tar
yuzu-973a6c40dae76b4a03af3e481a31cedfb3011115.tar.gz
yuzu-973a6c40dae76b4a03af3e481a31cedfb3011115.tar.bz2
yuzu-973a6c40dae76b4a03af3e481a31cedfb3011115.tar.lz
yuzu-973a6c40dae76b4a03af3e481a31cedfb3011115.tar.xz
yuzu-973a6c40dae76b4a03af3e481a31cedfb3011115.tar.zst
yuzu-973a6c40dae76b4a03af3e481a31cedfb3011115.zip
Diffstat (limited to 'src/citra_qt')
-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)
}
UpdateRecentFiles();
+ confirm_before_closing = settings.value("confirmClose", true).toBool();
+
// Setup connections
connect(game_list, SIGNAL(GameChosen(QString)), this, SLOT(OnGameListLoadFile(QString)));
connect(ui.action_Load_File, SIGNAL(triggered()), this, SLOT(OnMenuLoadFile()));
@@ -498,16 +500,13 @@ void GMainWindow::OnConfigure() {
}
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 (emu_thread == nullptr || !confirm_before_closing)
+ return true;
- if (answer == QMessageBox::No) {
- return false;
- }
- }
- return true;
+ auto answer = QMessageBox::question(this, tr("Citra"),
+ tr("Are you sure you want to close Citra?"),
+ QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
+ return answer != QMessageBox::No;
}
void GMainWindow::closeEvent(QCloseEvent* event) {
@@ -530,6 +529,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) {
settings.setValue("singleWindowMode", ui.action_Single_Window_Mode->isChecked());
settings.setValue("displayTitleBars", ui.actionDisplay_widget_title_bars->isChecked());
settings.setValue("firstStart", false);
+ settings.setValue("confirmClose", confirm_before_closing);
game_list->SaveInterfaceLayout(settings);
SaveHotkeys(settings);
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:
GPUCommandListWidget* graphicsCommandsWidget;
QAction* actions_recent_files[max_recent_files_item];
+ bool confirm_before_closing;
};
#endif // _CITRA_QT_MAIN_HXX_