summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar ameerj2021-09-11 22:36:03 -0400
committerGravatar ameerj2021-09-12 00:31:32 -0400
commit188cf1aed2f3179ef656aba5845af1f7c0fb7bd9 (patch)
tree85a426a19d9cef142a6d73f7906d41d44e167a81
parentMerge pull request #6846 from ameerj/nvdec-gpu-decode (diff)
downloadyuzu-188cf1aed2f3179ef656aba5845af1f7c0fb7bd9.tar.gz
yuzu-188cf1aed2f3179ef656aba5845af1f7c0fb7bd9.tar.xz
yuzu-188cf1aed2f3179ef656aba5845af1f7c0fb7bd9.zip
main: Apply confirm exit setting in exit locked scenarios
Some titles set an exit lock through HLE, which prompts an exit confirmation when stopping emulation if the system is locked. This change allows bypassing this confirmation if the setting to confirm exits has been disabled by the user.
-rw-r--r--src/yuzu/main.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index e36774cc6..77d53e7bc 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -3174,12 +3174,11 @@ std::optional<u64> GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProv
3174} 3174}
3175 3175
3176bool GMainWindow::ConfirmClose() { 3176bool GMainWindow::ConfirmClose() {
3177 if (emu_thread == nullptr || !UISettings::values.confirm_before_closing) 3177 if (emu_thread == nullptr || !UISettings::values.confirm_before_closing) {
3178 return true; 3178 return true;
3179 3179 }
3180 QMessageBox::StandardButton answer = 3180 const auto text = tr("Are you sure you want to close yuzu?");
3181 QMessageBox::question(this, tr("yuzu"), tr("Are you sure you want to close yuzu?"), 3181 const auto answer = QMessageBox::question(this, tr("yuzu"), text);
3182 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
3183 return answer != QMessageBox::No; 3182 return answer != QMessageBox::No;
3184} 3183}
3185 3184
@@ -3261,14 +3260,13 @@ bool GMainWindow::ConfirmChangeGame() {
3261} 3260}
3262 3261
3263bool GMainWindow::ConfirmForceLockedExit() { 3262bool GMainWindow::ConfirmForceLockedExit() {
3264 if (emu_thread == nullptr) 3263 if (emu_thread == nullptr || !UISettings::values.confirm_before_closing) {
3265 return true; 3264 return true;
3265 }
3266 const auto text = tr("The currently running application has requested yuzu to not exit.\n\n"
3267 "Would you like to bypass this and exit anyway?");
3266 3268
3267 const auto answer = 3269 const auto answer = QMessageBox::question(this, tr("yuzu"), text);
3268 QMessageBox::question(this, tr("yuzu"),
3269 tr("The currently running application has requested yuzu to not "
3270 "exit.\n\nWould you like to bypass this and exit anyway?"),
3271 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
3272 return answer != QMessageBox::No; 3270 return answer != QMessageBox::No;
3273} 3271}
3274 3272