Commit Graph

85 Commits

Author SHA1 Message Date
Alexei Kotov b370bce480 Restore data directory root Morrowind.ini detection
This turned out to be relevant for those data directories that were generated by the wizard from a retail disc.
Note the initial disc installation doesn't need to be registered as an installation because of the special case when the settings importer is run.
2026-03-18 03:12:19 +03:00
Alexei Kotov 427da3cb90 Wizard: Mostly uncursify data directory handling (#8999)
Avoid shoving every single directory in the config file
Avoid duplicates caused by mismatches between the canonical path with forward slash separator and the absolute path with native separators
Give up on the broken attempt to move the path to the end of the list and clean up the essentially dead code
2026-03-18 03:09:09 +03:00
Alexei Kotov a59985894c Wizard: Preserve comments when writing openmw.cfg 2026-03-18 02:29:39 +03:00
Alexei Kotov fe3ea42955 Use the appropriate types for string literals and languages in the wizard 2026-03-16 19:13:49 +03:00
Alexei Kotov f7963efcda Realize QMessageBox::critical/question exist, convert MainWizard messages 2026-03-16 18:33:30 +03:00
Alexei Kotov 450a8c60ea Move "can't create user config directory" error to the constructor
If the standard library failed to create it, it's doubtful Qt will succeed, might as well fail early
2026-03-16 18:09:10 +03:00
Alexei Kotov aa43bd4522 Deduplicate MainWizard critical error messages 2026-03-16 18:09:10 +03:00
Alexei Kotov c975a192dd More wizard cleanup I can't be bothered to categorize
This also fixes language repopulation when you return to the language selection page.
2026-03-16 18:09:10 +03:00
Alexei Kotov 294d24c5ba Const-ify everything in the wizard 2026-03-16 18:09:10 +03:00
Alexei Kotov 14a454d5ca Parent wizard messages to the relevant widget when applicable
This improves positioning. Not the ones in the wizard constructor as that won't go too well.
2026-03-16 18:09:10 +03:00
Alexei Kotov 7f18c3cfd5 Get rid of ComponentsListWidget
Why do we even have that widget?
2026-03-11 20:08:15 +03:00
Alexei Kotov 44db323019 Wizard: Simplify Morrowind.ini detection 2026-03-11 20:08:15 +03:00
Nathan Conway 2efb47c74d removed more dead code 2026-02-27 11:00:26 -05:00
Nathan Conway e75c250c01 wizard logging uses Log class 2026-02-26 22:44:33 -05:00
Evil Eye dafefc2e88 Address feedback 2025-12-01 17:08:51 +01:00
Evil Eye f619fab7aa Don't build a list of installations outside the wizard 2025-12-01 17:08:51 +01:00
Evil Eye cdb89422d4 Allow for more than a single installation 2025-12-01 17:08:50 +01:00
elsid 3067294f0d Add and fix -Wshadow 2025-08-18 21:09:06 +02:00
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
AnyOldName3 322a378907 Load correct config files in the wizard 2024-02-28 00:49:15 +00:00
Andrei Kortunov 8d06a99507 Register language selector properly 2023-12-19 10:20:31 +04:00
Andrei Kortunov ca19f7006c Make hardcoded strings in Launcher and Wizard localizable 2023-12-11 12:02:43 +04:00
Andrei Kortunov c5b16d1ba2 Do not include formatting spaces to localizable strings 2023-11-30 13:06:50 +04:00
elsid cf75363290 Typed launcher settings
QMultiMap is not clear about what settings exist and it's not efficient way to
access them after they are loaded.
2023-01-27 12:42:05 +01:00
elsid 0961720835 Join path components using path::operator/ instead of string::operator+ 2023-01-27 01:07:15 +01:00
elsid dd89403df0 Move ensureUtf8Encoding to named namespace
To follow https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#sf21-dont-use-an-unnamed-anonymous-namespace-in-a-header

Add QtGlobal include to define QT_VERSION and QT_VERSION_CHECK macroses before
they're used.
2023-01-18 22:58:35 +01:00
Andrei Kortunov bfcbc2350d Handle UTF-8 in Qt streams in the Qt6-compatible way 2023-01-12 15:39:50 +04:00
jvoisin cd29c181cf Another pass with IWYU 2022-10-10 15:16:18 +02:00
jvoisin 3cbf1dc042 First pass with include-what-you-use 2022-10-09 10:39:43 +00:00
clang-format-bot ddb0522bbf Apply clang-format to code base 2022-09-22 21:35:26 +03:00
Project579 ca14fc00dc Added dedicated functions for conversions between QString and std::filesystem::path. 2022-09-11 14:41:21 +02:00
Project579 c226b35f1f Fix some remaining encoding errors due to std::filesystem transition. 2022-09-11 14:41:20 +02:00
Project579 a13709c510 Replace implicit convertions from std::filesystem::path to std::string with correctly converting functions. 2022-09-11 14:41:20 +02:00
Project579 e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2022-09-11 14:41:15 +02:00
Project579 4bb07282c9 Replace all remaining occurrences of boost::filesystem with std::filesystem. 2022-09-11 02:19:00 +02:00
Mat 405a5c5d25 functor-based Qt signal-slot syntax wizard 2022-08-23 17:14:11 -03:00
Andrei Kortunov 43f552f48f Allow users to decide if they need to import bitmap fonts 2022-08-17 22:12:15 +04:00
jvoisin 8b9ed57348 Clean up Qt includes 2022-06-17 11:56:54 +02:00
psi29a 8f02cd7d17 Merge branch 'fix_6627' into 'master'
Fix #6627

Closes #6627

See merge request OpenMW/openmw!1762
2022-04-17 17:13:13 +00:00
Eris Caffee db84d9e649 Issue 2766 Warn user of old MW version detected 2022-04-17 16:28:14 +00:00
Petr Mikheev fa29b9d6f7 Fix #6627 2022-04-10 22:31:09 +02:00
Bret Curtis 74e7cfc023 remove unused includes: part1
remove unused imports: part2

revert one tidy we will keep for c++20
2022-01-23 17:30:25 +01:00
Josquin Frei 63a8bc5f9b Fix wizard dialogs 2022-01-07 14:35:11 +00:00
Alexei Dobrohotov ab789e37e1 Wizard: fix "file is already opened" warning 2020-12-14 03:45:03 +03:00
Andrei Kortunov 98bb73ffb7 Do not use deprecated QTextStream::endl 2020-06-22 18:46:45 +04:00
elsid 045ceeac11 Replace foreach macro by for-loop 2019-10-20 20:08:16 +02:00
tri4ng1e f2613a74b1 Write settings before invoking openmw-iniimporter 2018-05-17 21:20:04 +03:00
Capostrophic 5a3086b0c6 Auto-detect the actual Morrowind assets path (Fixes #4336) 2018-03-23 23:52:08 +03:00
Thunderforge f41a4bb937 Changing "New Installation" to "Retail CD/DVD" for clarity 2017-08-09 00:20:49 -05:00
Allofich 3420121c3f Fix shadowing warnings 2016-11-13 23:20:51 +09:00