summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Morph2021-09-12 12:01:57 -0400
committerGravatar GitHub2021-09-12 12:01:57 -0400
commit990730246551fe4d3fc4679d46515a8efa3161d7 (patch)
tree4edde9fb8b767f5c1e31c05d0b31d2f428ba9ac2
parentMerge pull request #6992 from german77/brains (diff)
parentmain: Apply confirm exit setting in exit locked scenarios (diff)
downloadyuzu-990730246551fe4d3fc4679d46515a8efa3161d7.tar.gz
yuzu-990730246551fe4d3fc4679d46515a8efa3161d7.tar.xz
yuzu-990730246551fe4d3fc4679d46515a8efa3161d7.zip
Merge pull request #6997 from ameerj/stop-emulation-confirmation
main: Apply confirm exit setting in exit locked scenarios
-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