[PR #1679] [CLOSED] Prevent settings from being saved when close button is pressed instead of save #2244

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1679
Author: @rainmakerv3
Created: 12/7/2024
Status: Closed

Base: mainHead: configsave


📝 Commits (10+)

  • bf6fcfa PM4 hack
  • 20d6fe7 Merge remote-tracking branch 'upstream/main'
  • 2a3519e Merge upstream
  • f6442db Merge remote-tracking branch 'upstream/main'
  • 74f6942 Merge remote-tracking branch 'upstream/main'
  • 8d4986b Merge remote-tracking branch 'upstream/main'
  • 3263172 Merge remote-tracking branch 'upstream/main'
  • f3e9f7f Merge remote-tracking branch 'upstream/main'
  • f91f968 Merge remote-tracking branch 'upstream/main'
  • 700bac1 Revert "PM4 hack"

📊 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

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:

  1. 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.

  2. 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/1679 **Author:** [@rainmakerv3](https://github.com/rainmakerv3) **Created:** 12/7/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `configsave` --- ### 📝 Commits (10+) - [`bf6fcfa`](https://github.com/shadps4-emu/shadPS4/commit/bf6fcfa4b7aa6f060ddd8d57ccf8316ee49986a3) PM4 hack - [`20d6fe7`](https://github.com/shadps4-emu/shadPS4/commit/20d6fe70fdacba0c14e6744d96c3fd9f290b87a0) Merge remote-tracking branch 'upstream/main' - [`2a3519e`](https://github.com/shadps4-emu/shadPS4/commit/2a3519ea53380d65c823f93f8f2257f85cd31880) Merge upstream - [`f6442db`](https://github.com/shadps4-emu/shadPS4/commit/f6442db632d0adbcdc0b87355fe87919cf77ce7f) Merge remote-tracking branch 'upstream/main' - [`74f6942`](https://github.com/shadps4-emu/shadPS4/commit/74f6942469a342873671a4e68f30789bbcd0f904) Merge remote-tracking branch 'upstream/main' - [`8d4986b`](https://github.com/shadps4-emu/shadPS4/commit/8d4986b5b2893204bd20ff41d32489bb5b094256) Merge remote-tracking branch 'upstream/main' - [`3263172`](https://github.com/shadps4-emu/shadPS4/commit/32631725a2ca4283785a17686dd1622b367aeee4) Merge remote-tracking branch 'upstream/main' - [`f3e9f7f`](https://github.com/shadps4-emu/shadPS4/commit/f3e9f7ff0350d0f72ea0f162ae6942d950bce010) Merge remote-tracking branch 'upstream/main' - [`f91f968`](https://github.com/shadps4-emu/shadPS4/commit/f91f968383ae29635399f2821f65c5260f29cb0c) Merge remote-tracking branch 'upstream/main' - [`700bac1`](https://github.com/shadps4-emu/shadPS4/commit/700bac13112a0d28b7bbe16aeef5ac6cdb2559cc) Revert "PM4 hack" ### 📊 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 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: 1) 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. 2) 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:44 +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#2244
No description provided.