mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 15:56:00 +03:00
[PR #1679] [CLOSED] Prevent settings from being saved when close button is pressed instead of save #2244
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#2244
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/1679
Author: @rainmakerv3
Created: 12/7/2024
Status: ❌ Closed
Base:
main← Head:configsave📝 Commits (10+)
bf6fcfaPM4 hack20d6fe7Merge remote-tracking branch 'upstream/main'2a3519eMerge upstreamf6442dbMerge remote-tracking branch 'upstream/main'74f6942Merge remote-tracking branch 'upstream/main'8d4986bMerge remote-tracking branch 'upstream/main'3263172Merge remote-tracking branch 'upstream/main'f3e9f7fMerge remote-tracking branch 'upstream/main'f91f968Merge remote-tracking branch 'upstream/main'700bac1Revert "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:
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.