mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 08:15:59 +03:00
[GH-ISSUE #1669] Save option settings on close #569
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#569
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?
Originally created by @DanielSvoboda on GitHub (Dec 5, 2024).
Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/1669
In the two codes below, you can see that when you close the emulator, the settings are saved.
This means that even when you press Cancel in the settings menu, the settings will be saved.
I had tried to adjust this in the AutoUpdater PR, but I removed this attempt because it had nothing to do with that PR.
If I'm not mistaken this happens to save the screen position when closing...
https://github.com/shadps4-emu/shadPS4/blob/main/src/emulator.cpp#L100
https://github.com/shadps4-emu/shadPS4/blob/main/src/qt_gui/main_window.cpp#L38
https://github.com/user-attachments/assets/c58aa35b-9650-4828-8e25-0383dd3d84b1
@rainmakerv3 commented on GitHub (Dec 6, 2024):
I looked into this , and it seems there is also a related issue is actually not just caused by the Emulator or Mainwindow destructors mentioned above, but also because the function loading the values for widgets in settings_dialog.cpp uses the values currently in memory rather the values written to the config file.
Even after removing the function call to config::save in each destructor (there should probably be another function saving just window dimensions and such), the issue will still happen if you close and reopen the settings dialog after changing a setting
https://github.com/user-attachments/assets/8eb6fcc3-a67e-4ef6-aa22-cea5a59f3f19
I don't know if there is a better solution for this, but for example changing this in https://github.com/shadps4-emu/shadPS4/blob/main/src/qt_gui/settings_dialog.cpp#L323:
to this:
ui->consoleLanguageComboBox->setCurrentIndex(
std::distance(
languageIndexes.begin(),
std::find(languageIndexes.begin(), languageIndexes.end(), toml::find_or(data, "Settings", "consoleLanguage", 6))) %
languageIndexes.size());
(plus the toml parsing code)
solves the issue as per my testing. I have a sample build here (I only touched the console language setting): https://github.com/rainmakerv3/shadPS4/actions/runs/12199176835
https://github.com/user-attachments/assets/69e117bf-f66b-41b6-9312-e4d559291ec4
Let me know if you think this is an acceptable solution, so I can complete it and PR it.
@Hermiten commented on GitHub (Dec 6, 2024):
New PR is always welcome and they can review it more easily than here :)
@rainmakerv3 commented on GitHub (Dec 7, 2024):
EDIT: the issue I found regarding the Discord RPC setting was fixed in a recent commit
I am currently working on a PR proposing a fix for the other issues, hopefully I can submit it by tomorrow
@DanielSvoboda commented on GitHub (Dec 12, 2024):
After PR-1747 the save was fixed, but I'm experiencing other problems, I don't know if it was caused by this PR. I'm not able to add a new game folder. When I click apply it's not adding my gamesConfig2 folder, it's re-adding gamesConfig, it's very strange as you can see in the video.
https://github.com/user-attachments/assets/25997eaa-391f-4bec-ac1b-6bf7576802ca
@rainmakerv3 commented on GitHub (Dec 13, 2024):
yeah this was my fault sorry :depair: should be fixed by https://github.com/shadps4-emu/shadPS4/pull/1761