summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar liamwhite2023-11-04 11:14:01 -0400
committerGravatar GitHub2023-11-04 11:14:01 -0400
commit34101d8c5e8f8b3ce3027ba8ed40fb8666a21a0e (patch)
tree131d3da25af0ea80e4f760e74c328804c32aa782
parentMerge pull request #11954 from t895/log-hardware (diff)
parentqt: remove duplicate exit confirmation setting (diff)
downloadyuzu-34101d8c5e8f8b3ce3027ba8ed40fb8666a21a0e.tar.gz
yuzu-34101d8c5e8f8b3ce3027ba8ed40fb8666a21a0e.tar.xz
yuzu-34101d8c5e8f8b3ce3027ba8ed40fb8666a21a0e.zip
Merge pull request #11885 from liamwhite/stop-nagging-me
qt: remove duplicate exit confirmation setting
-rw-r--r--src/yuzu/configuration/shared_translation.cpp1
-rw-r--r--src/yuzu/main.cpp12
-rw-r--r--src/yuzu/uisettings.h4
3 files changed, 9 insertions, 8 deletions
diff --git a/src/yuzu/configuration/shared_translation.cpp b/src/yuzu/configuration/shared_translation.cpp
index 3fe448f27..1434b1a56 100644
--- a/src/yuzu/configuration/shared_translation.cpp
+++ b/src/yuzu/configuration/shared_translation.cpp
@@ -156,7 +156,6 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) {
156 // Ui General 156 // Ui General
157 INSERT(UISettings, select_user_on_boot, "Prompt for user on game boot", ""); 157 INSERT(UISettings, select_user_on_boot, "Prompt for user on game boot", "");
158 INSERT(UISettings, pause_when_in_background, "Pause emulation when in background", ""); 158 INSERT(UISettings, pause_when_in_background, "Pause emulation when in background", "");
159 INSERT(UISettings, confirm_before_closing, "Confirm exit while emulation is running", "");
160 INSERT(UISettings, confirm_before_stopping, "Confirm before stopping emulation", ""); 159 INSERT(UISettings, confirm_before_stopping, "Confirm before stopping emulation", "");
161 INSERT(UISettings, hide_mouse, "Hide mouse on inactivity", ""); 160 INSERT(UISettings, hide_mouse, "Hide mouse on inactivity", "");
162 INSERT(UISettings, controller_applet_disabled, "Disable controller applet", ""); 161 INSERT(UISettings, controller_applet_disabled, "Disable controller applet", "");
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index db9da6dc8..91aba118a 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -2174,6 +2174,7 @@ void GMainWindow::ShutdownGame() {
2174 return; 2174 return;
2175 } 2175 }
2176 2176
2177 play_time_manager->Stop();
2177 OnShutdownBegin(); 2178 OnShutdownBegin();
2178 OnEmulationStopTimeExpired(); 2179 OnEmulationStopTimeExpired();
2179 OnEmulationStopped(); 2180 OnEmulationStopped();
@@ -3484,7 +3485,7 @@ void GMainWindow::OnExecuteProgram(std::size_t program_index) {
3484} 3485}
3485 3486
3486void GMainWindow::OnExit() { 3487void GMainWindow::OnExit() {
3487 OnStopGame(); 3488 ShutdownGame();
3488} 3489}
3489 3490
3490void GMainWindow::OnSaveConfig() { 3491void GMainWindow::OnSaveConfig() {
@@ -4847,7 +4848,12 @@ bool GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProvider& installe
4847} 4848}
4848 4849
4849bool GMainWindow::ConfirmClose() { 4850bool GMainWindow::ConfirmClose() {
4850 if (emu_thread == nullptr || !UISettings::values.confirm_before_closing) { 4851 if (emu_thread == nullptr ||
4852 UISettings::values.confirm_before_stopping.GetValue() == ConfirmStop::Ask_Never) {
4853 return true;
4854 }
4855 if (!system->GetExitLocked() &&
4856 UISettings::values.confirm_before_stopping.GetValue() == ConfirmStop::Ask_Based_On_Game) {
4851 return true; 4857 return true;
4852 } 4858 }
4853 const auto text = tr("Are you sure you want to close yuzu?"); 4859 const auto text = tr("Are you sure you want to close yuzu?");
@@ -4952,7 +4958,7 @@ bool GMainWindow::ConfirmChangeGame() {
4952} 4958}
4953 4959
4954bool GMainWindow::ConfirmForceLockedExit() { 4960bool GMainWindow::ConfirmForceLockedExit() {
4955 if (emu_thread == nullptr || !UISettings::values.confirm_before_closing) { 4961 if (emu_thread == nullptr) {
4956 return true; 4962 return true;
4957 } 4963 }
4958 const auto text = tr("The currently running application has requested yuzu to not exit.\n\n" 4964 const auto text = tr("The currently running application has requested yuzu to not exit.\n\n"
diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h
index b62ff620c..77d992c54 100644
--- a/src/yuzu/uisettings.h
+++ b/src/yuzu/uisettings.h
@@ -93,10 +93,6 @@ struct Values {
93 Setting<bool> show_filter_bar{linkage, true, "showFilterBar", Category::Ui}; 93 Setting<bool> show_filter_bar{linkage, true, "showFilterBar", Category::Ui};
94 Setting<bool> show_status_bar{linkage, true, "showStatusBar", Category::Ui}; 94 Setting<bool> show_status_bar{linkage, true, "showStatusBar", Category::Ui};
95 95
96 Setting<bool> confirm_before_closing{
97 linkage, true, "confirmClose", Category::UiGeneral, Settings::Specialization::Default,
98 true, true};
99
100 SwitchableSetting<ConfirmStop> confirm_before_stopping{linkage, 96 SwitchableSetting<ConfirmStop> confirm_before_stopping{linkage,
101 ConfirmStop::Ask_Always, 97 ConfirmStop::Ask_Always,
102 "confirmStop", 98 "confirmStop",