[PR #1747] [MERGED] Resubmit - Prevent settings from being saved when close button is pressed instead of save #2274

Closed
opened 2026-02-27 21:15:51 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1747
Author: @rainmakerv3
Created: 12/12/2024
Status: Merged
Merged: 12/12/2024
Merged by: @raphaelthegreat

Base: mainHead: configsave2


📝 Commits (3)

  • 2b91091 Do not save settings when close button pressed instead of save
  • 125303e Update src/common/config.h
  • f484df2 Revert "Update src/common/config.h"

📊 Changes

6 files changed (+193 additions, -162 deletions)

View changed files

📝 src/common/config.cpp (+41 -11)
📝 src/common/config.h (+3 -1)
📝 src/emulator.cpp (+1 -1)
📝 src/qt_gui/main_window.cpp (+3 -3)
📝 src/qt_gui/settings_dialog.cpp (+143 -146)
📝 src/qt_gui/settings_dialog.h (+2 -0)

📄 Description

Resubmitting PR#1679 because I accidentally deleted that branch instead of the one that was merged lol.


Proposed fix for https://github.com/shadps4-emu/shadPS4/issues/1669, more detail on the issue can be seen on that page

There are actually two issues which cause settings to be saved when the close button is pressed:

MainWindow and Emulator destructor functions both call the Config::Save function, which saves every single config variable, including those changed in the config settings dialog box. To resolve this, I created another save function for just those two destructors, which save only the variables related to the main window itself, such as main window dimensions, recent files, and grid/list view settings.

Config variables are connected to each change in the config windows QT widgets, and the UI loads in these variables instead of the values saved to the config file. I rewrote this such that the config variables change value only upon saving, and that UI values are loaded from the config file

Not included in this PR is fixing how the translations are re-applied when changing emulator language.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/1747 **Author:** [@rainmakerv3](https://github.com/rainmakerv3) **Created:** 12/12/2024 **Status:** ✅ Merged **Merged:** 12/12/2024 **Merged by:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Base:** `main` ← **Head:** `configsave2` --- ### 📝 Commits (3) - [`2b91091`](https://github.com/shadps4-emu/shadPS4/commit/2b91091c1f5b1b2d86724d364abb27336c818660) Do not save settings when close button pressed instead of save - [`125303e`](https://github.com/shadps4-emu/shadPS4/commit/125303ea8674b25e93a4c4cf7b93a0357eac19f4) Update src/common/config.h - [`f484df2`](https://github.com/shadps4-emu/shadPS4/commit/f484df2e0518346b90394150a3af137d3d05035f) Revert "Update src/common/config.h" ### 📊 Changes **6 files changed** (+193 additions, -162 deletions) <details> <summary>View changed files</summary> 📝 `src/common/config.cpp` (+41 -11) 📝 `src/common/config.h` (+3 -1) 📝 `src/emulator.cpp` (+1 -1) 📝 `src/qt_gui/main_window.cpp` (+3 -3) 📝 `src/qt_gui/settings_dialog.cpp` (+143 -146) 📝 `src/qt_gui/settings_dialog.h` (+2 -0) </details> ### 📄 Description Resubmitting PR#1679 because I accidentally deleted that branch instead of the one that was merged lol. ------------ Proposed fix for https://github.com/shadps4-emu/shadPS4/issues/1669, more detail on the issue can be seen on that page There are actually two issues which cause settings to be saved when the close button is pressed: MainWindow and Emulator destructor functions both call the Config::Save function, which saves every single config variable, including those changed in the config settings dialog box. To resolve this, I created another save function for just those two destructors, which save only the variables related to the main window itself, such as main window dimensions, recent files, and grid/list view settings. Config variables are connected to each change in the config windows QT widgets, and the UI loads in these variables instead of the values saved to the config file. I rewrote this such that the config variables change value only upon saving, and that UI values are loaded from the config file Not included in this PR is fixing how the translations are re-applied when changing emulator language. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:15:51 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2274
No description provided.