Make KeyBindings generic not show folder specific (#6545)#6571
Make KeyBindings generic not show folder specific (#6545)#6571cybercop23 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes where xlights_keybindings.xml is stored/loaded so key bindings are no longer show-folder-specific, aligning the storage location with the existing JSON settings (“AppData”/user config directory) behavior.
Changes:
- Exposes
GetSettingsFilePath()as a public helper inXLightsConfigAdapterso other UI code can use the platform AppData settings location. - Updates show-folder selection (
xLightsFrame::SetDir) to load keybindings from the AppData settings directory instead of the current show folder. - Adds a one-time migration that copies an existing show-folder keybindings file into the AppData location if the new file doesn’t exist yet.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src-ui-wx/settings/XLightsConfigAdapter.h | Declares GetSettingsFilePath() for reuse outside the adapter implementation. |
| src-ui-wx/settings/XLightsConfigAdapter.cpp | Makes GetSettingsFilePath() non-static so it can be called from other translation units. |
| src-ui-wx/app-shell/TabSetup.cpp | Loads keybindings from AppData and performs a one-time migration from the show folder. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| wxFileName kbf; | ||
| kbf.AssignDir(CurrentDir); | ||
| kbf.AssignDir(GetSettingsFilePath().parent_path().string()); | ||
| kbf.SetFullName(XLIGHTS_KEYBINDING_FILE); |
| if (legacy.FileExists()) { | ||
| wxCopyFile(legacy.GetFullPath(), kbf.GetFullPath()); | ||
| } |
|
I think this is a step backwards ... what if you want specific halloween settings vs christmas settings. Or you host multiple shows. Wonder if there is a better solution here.. |
|
I didn't think you'll want different key bindings for different shows, defeats the purpose. I can add the same logic as options, if there's one in the show folder use that over instead. |
#6545 - now use the same location as preferences/options.