1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-01 12:11:31 +00:00
openmw/apps/wizard
AnyOldName3 a130ca57a4 Track source of settings
This one's a biggie.

The basic idea's that GameSettings should know:
* what the interpreted value of a setting is, so it can actually be used.
* what the original value the user put in their config was, so it can be put back when the config's saved.
* which path it's processing the openmw.cfg from so relative paths can be resolved correctly.
* whether a setting's a user setting that can be modified, or from one of the other openmw.cfg files that can't necessarily be modified.

This had fairly wide-reaching implications.

The first is that paths are resolved properly in cases where they previously wouldn't have been.
Without this commit, if the launcher saw a relative path in an openmw.cfg, it'd be resolved relative to the process' working directory (which we always set to the binary directory for reasons I won't get into).
That's not what the engine does, so is bad.
It's also not something a user's likely to suspect.
This mess is no longer a problem as paths are resolved correctly when they're loaded instead of on demand when they're used by whatever uses them.

Another problem was that if paths used slugs like ?userconfig? would be written back to openmw.cfg with the slugs replaced, which defeats the object of using the slugs.
This is also fixed.

Tracking which settings are user settings and which are in a non-editable openmw.cfg allows the launcher to grey out rows so they can't be edited (which is sensible as they can't be edited on-disk) while still being aware of content files that are provided by non-user data directories etc.
This is done in a pretty straightforward way for the data directories and fallback-archives, as those bits of UI are basic, but it's more complicated for content files as that uses a nmodel/view approach and has a lot more moving parts.
Thankfully, I'd already implemented that when dealing with builtin.omwscripts, so it just needed wiring up.

One more thing of note is that I made the SettingValue struct storable as a QVariant so it could be attached to the UI widgets as userdata, and then I could just grab the original representation and use it instead of needing any complicated mapping from display value to on-disk value.
2024-03-06 00:36:13 +00:00
..
ui Move *.ui files for different applications to different folders 2023-12-19 15:21:08 +04:00
unshield Use move semantics for tools 2024-01-21 20:20:37 +04:00
utils First pass with include-what-you-use 2022-10-09 10:39:43 +00:00
CMakeLists.txt Localize Launcher and Wizard 2024-02-01 09:47:25 +04:00
componentselectionpage.cpp Do not include formatting spaces to localizable strings 2023-11-30 13:06:50 +04:00
componentselectionpage.hpp Apply clang-format to code base 2022-09-22 21:35:26 +03:00
conclusionpage.cpp Localize Launcher and Wizard 2024-02-01 09:47:25 +04:00
conclusionpage.hpp Apply clang-format to code base 2022-09-22 21:35:26 +03:00
existinginstallationpage.cpp Do not include formatting spaces to localizable strings 2023-11-30 13:06:50 +04:00
existinginstallationpage.hpp First pass with include-what-you-use 2022-10-09 10:39:43 +00:00
importpage.cpp Apply clang-format to code base 2022-09-22 21:35:26 +03:00
importpage.hpp Apply clang-format to code base 2022-09-22 21:35:26 +03:00
inisettings.cpp Replace some empty constructors and destructors with default 2023-05-29 13:37:19 +02:00
inisettings.hpp Replace some empty constructors and destructors with default 2023-05-29 13:37:19 +02:00
installationpage.cpp Register language selector properly 2023-12-19 10:20:31 +04:00
installationpage.hpp First pass with include-what-you-use 2022-10-09 10:39:43 +00:00
installationtargetpage.cpp Do not include formatting spaces to localizable strings 2023-11-30 13:06:50 +04:00
installationtargetpage.hpp Another pass with IWYU 2022-10-10 15:16:18 +02:00
intropage.cpp Another pass with IWYU 2022-10-10 15:16:18 +02:00
intropage.hpp Another pass with IWYU 2022-10-10 15:16:18 +02:00
languageselectionpage.cpp Register language selector properly 2023-12-19 10:20:31 +04:00
languageselectionpage.hpp Another pass with IWYU 2022-10-10 15:16:18 +02:00
main.cpp Load correct config files in the wizard 2024-02-28 00:49:15 +00:00
mainwizard.cpp Track source of settings 2024-03-06 00:36:13 +00:00
mainwizard.hpp Load correct config files in the wizard 2024-02-28 00:49:15 +00:00
methodselectionpage.cpp Apply clang-format to code base 2022-09-22 21:35:26 +03:00
methodselectionpage.hpp Apply clang-format to code base 2022-09-22 21:35:26 +03:00