Commit Graph

245 Commits (master)

Author SHA1 Message Date
Andrei Kortunov bd59247270 Avoid trailing line breaks 1 month ago
Andrei Kortunov f0543c5500 Implement a context menu for data directories page (feature 8130) 1 month ago
Evil Eye 7bbb1bf05d Merge branch 'loosey-goosey' into 'master'
Store original representation of paths in content lists. Also compare against existing content lists in a more forgiving way.

See merge request OpenMW/openmw!4424
2 months ago
psi29a a11e683a40 Merge branch 'content-lists-could-provide-duplicate-fallback-archives' into 'master'
Gracefully handle content lists that specify duplicate BSAs

Closes #8200

See merge request OpenMW/openmw!4421
2 months ago
AnyOldName3 7640b6bcf4 Typo 2 months ago
AnyOldName3 c2b383ea92 Store original representation of paths in content lists
Also compare against existing content lists in a more forgiving way.

The first improvement makes it possible to use relative paths in openmw.cfg without the launcher canonicalising them.
This was really annoying if you used a relative path on purpose.
It also stops the launcher converting all paths to Qt's convention, where forward slashes are used on Windows even though they're not native.
The engine doesn't care, so you could always put either in the config file, but the launcher wouldn't stand for that, and would make them match.

To make this work, we need to store a path's originalRepresentation in the content list, compare paths loaded from openmw.cfg based on their originalRepresentation, and convert paths from originalRepresentation to absolute value when loading them from a content list.

The second improvement means that paths that are equivalent, but expressed differently (e.g. mismatched case on Windows, mismatched separators on Windows, or mild differences like unnecessary `./`es and doubled separators) don't trigger the creation of a new effectively-identical content list.

To make this work, we had to switch the comparison to lexicaly normalise the path first.
It could only be lexical normalisation as originalRepresentation might be absolute, relative, or absolute-but-based-on-a-path-slug, and we didn't want slugs to break things or relative paths to count as equivalent to absolute ones that refer to the same file.
The comparison is case-insensitive on Windows, and case-sensitive elsewhere.
This isn't strictly right, as you can have case-sensitive things mounted on Windows or tell a Linux directory to be case-insensitive, but we can't tell when that might happen based on a lexical path as it depends on real directory properties (and might differ for different parts of the path, which is too much hassle to support).
2 months ago
AnyOldName3 0537b53d21 Gracefully handle content lists that specify duplicate BSAs
Previously, if fed bad data, or a content list predated a BSA being moved to a non-user config file, or possibly in other situations (but not any of the obvious ones as those had other guards), the `selectedArchives` list could be longer than the number of archives available due to duplicate entries.

This ensures they're handled like entries specifying no-longer-present archives, and just skips the duplicates.
The same would happen elsewhere in similar situations, but those code paths aren't always taken.
2 months ago
AnyOldName3 7556ab6f90 Make the launcher ignore case in bsa names 2 months ago
psi29a f456978cc3 Merge branch 'blueshift' into 'master'
Launcher: Support extended selection for directories

See merge request OpenMW/openmw!4346
4 months ago
Alexei Kotov 073e4639bf Launcher: Support extended selection for directories 4 months ago
Alexei Kotov f393c40cbd Launcher: Fix Insert Above behavior when the directory is added automatically 4 months ago
Alexei Kotov 8a7035020a Don't check subdirectories of valid content subdirectories (#8085) 5 months ago
Yury Stepovikov 80d2b289e7 Fix archive selection when switching profiles (#7956) 7 months ago
Andrei Kortunov 5e8dc9cc03 Fix stub icon color 8 months ago
AnyOldName3 47ef2d018f Always set userrole for archive list 9 months ago
AnyOldName3 e735bf67e1 Brace-initialise SettingValue
Clang didn't like it otherwise
9 months ago
AnyOldName3 59334f694d Don't forget to add path to UserRole 9 months ago
AnyOldName3 b15f7857c0 currentDir.value is already canonicalised 9 months ago
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.
10 months ago
AnyOldName3 1af59c3a43 Tooltips for data-local and resources/vfs 10 months ago
AnyOldName3 f476301670 There's no such thing as the global data directory
That's what resources/vfs is for.
10 months ago
elsid cc9f9b53ba
Convert BsaVersion to enum class 10 months ago
Andrei Kortunov 7e345436f4 Localize Launcher and Wizard 11 months ago
Yury Stepovikov c90ebcc86b Allow multiselect in the archives tab (#7606) 11 months ago
Evil Eye 672cefd594 Track checked EsmFile pointers instead of full paths 12 months ago
Andrei Kortunov ca19f7006c Make hardcoded strings in Launcher and Wizard localizable 1 year ago
Andrei Kortunov 5e96825e6b Highlight new items in launcher by text formatting, not by color 1 year ago
elsid 8f27178a0b
Use settings values for navigator in the launcher 1 year ago
Alexei Kotov f68bd3ba97 Launcher: Improve directory appending UX and heuristics (bug #7502)
- Recognize more asset directories and omwgame files
- Always let the user append the selected directory
- Automatically pick the user-selected directory if it's the only valid directory
- Add a caption to directory selection dialog, properly handle cancellation
1 year ago
Alexei Kotov 5e5a25f901 Show BA2 files in the launcher 1 year ago
Andrei Kortunov 8df7ce545e Migrate from GraphicsWindowQt to QOpenGLWidget 2 years ago
fredzio 37c4587ca4 Display directories that contains omwscripts.
Display newly added omwscripts as new.
2 years ago
elsid 9815f930d9
Setup launcher configuration manager and logging before initializing UI 2 years ago
elsid de112a2950
Simplify converting file names into absolute file paths 2 years ago
elsid 5a691380ea
Use single set to check presence of archives 2 years ago
elsid b1765cf05a
Do single lookup for widget item 2 years ago
elsid 62536d5cf7
Use static QFile::exists instead of creating object 2 years ago
elsid ecb9c35268
Remove unused variable 2 years ago
elsid 9280957581
Save original paths
If directory path is a symlink it should be showed and written to config files
as is. Between launcher runs the resulting canonical path may be different so
the resolved path becomes outdated.
2 years ago
elsid ff7fcd752a
Use set to track visited directories instead of removing duplicates 2 years ago
Cédric Mocquillon c1fbe90953 Handle GNRL case of ba2 format 2 years ago
psi29a aee7716c3a Merge branch 'launcher_typed_settings' into 'master'
Typed launcher settings

See merge request OpenMW/openmw!2650
2 years ago
elsid 8be2fc9fd7
Stop updating navmeshtool progress on first bad message 2 years ago
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.
2 years ago
AnyOldName3 438b03908d Use dedicated function to convert QString to std::filesystem::path II
Some missed conversions identified in review.
2 years ago
AnyOldName3 f757ac642a Use dedicated function to convert QString to std::filesystem::path
I noticed this while reviewing something else and trying to find the
function to recommend using it.
2 years ago
Andrei Kortunov 902c48d1bb Rework launcher UI 2 years ago
elsid 843753da14
Remove unused includes 2 years ago
elsid 624d8bc931
Support unsigned settings values 2 years ago
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago