2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

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.
This commit is contained in:
ameerj 2021-09-11 22:36:03 -04:00
parent be4e192903
commit 188cf1aed2

View file

@ -3174,12 +3174,11 @@ std::optional<u64> GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProv
}
bool GMainWindow::ConfirmClose() {
if (emu_thread == nullptr || !UISettings::values.confirm_before_closing)
if (emu_thread == nullptr || !UISettings::values.confirm_before_closing) {
return true;
QMessageBox::StandardButton answer =
QMessageBox::question(this, tr("yuzu"), tr("Are you sure you want to close yuzu?"),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
}
const auto text = tr("Are you sure you want to close yuzu?");
const auto answer = QMessageBox::question(this, tr("yuzu"), text);
return answer != QMessageBox::No;
}
@ -3261,14 +3260,13 @@ bool GMainWindow::ConfirmChangeGame() {
}
bool GMainWindow::ConfirmForceLockedExit() {
if (emu_thread == nullptr)
if (emu_thread == nullptr || !UISettings::values.confirm_before_closing) {
return true;
}
const auto text = tr("The currently running application has requested yuzu to not exit.\n\n"
"Would you like to bypass this and exit anyway?");
const auto answer =
QMessageBox::question(this, tr("yuzu"),
tr("The currently running application has requested yuzu to not "
"exit.\n\nWould you like to bypass this and exit anyway?"),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
const auto answer = QMessageBox::question(this, tr("yuzu"), text);
return answer != QMessageBox::No;
}