Commit Graph

230 Commits (e735bf67e198fcbfb74ae378b7a2e65d0e9270e9)

Author SHA1 Message Date
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 10 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 11 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
Project579 ca14fc00dc Added dedicated functions for conversions between QString and std::filesystem::path. 2 years ago
Project579 c226b35f1f Fix some remaining encoding errors due to std::filesystem transition. 2 years ago
Project579 a13709c510 Replace implicit convertions from std::filesystem::path to std::string with correctly converting functions. 2 years ago
Project579 e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2 years ago
mpeco aa57d04b54 functor-based Qt signal-slot syntax launcher 2 years ago
Andrei Kortunov 4b257e496e Use static settings map for launcher and editor - the Settings::Manager has a static data anyway 3 years ago
elsid 4ecee2e167
Avoid using reserved identifier in the global namespace
apps/launcher/datafilespage.cpp:762:12: warning: declaration uses identifier '_reloadCellsMutex', which is reserved in the global namespace [bugprone-reserved-identifier]
std::mutex _reloadCellsMutex;
           ^~~~~~~~~~~~~~~~~
           reloadCellsMutex

apps/openmw/mwgui/journalwindow.cpp:86:103: warning: declaration uses identifier '_sender', which is reserved in the global namespace [bugprone-reserved-identifier]
        void adviseButtonClick (char const * name, void (JournalWindowImpl::*Handler) (MyGUI::Widget* _sender))
                                                                                                      ^~~~~~~
                                                                                                      sender

apps/openmw/mwgui/journalwindow.cpp:92:100: warning: declaration uses identifier '_sender', which is reserved in the global namespace [bugprone-reserved-identifier]
        void adviseKeyPress (char const * name, void (JournalWindowImpl::*Handler) (MyGUI::Widget* _sender, MyGUI::KeyCode key, MyGUI::Char character))
                                                                                                   ^~~~~~~
                                                                                                   sender
3 years ago
jvoisin 8b9ed57348 Clean up Qt includes 3 years ago
psi29a bb0dad7c08 Update to C++20 and see if our CI can handle it. 3 years ago
fredzio bab5e56768 Make the launcher dara directory and bsa list play nicer with dark
themes.

Known issue: the padding icon for disabled data directories is of wrong
color.
3 years ago
Frederic Chardon ad1ab1c880 Follow up to !192 3 years ago
fredzio b88d32ff5b Add 3 tabs in the "Data Files" page
1 with the data directories
2 with the BSA archives
3 with the content selector

When user select a directory to be added, first we walk the directory
hierarchy to make a list of all potential data= entries. If we find
none, the selected directory is added.

If more than one data directory is found, user is presented with a
directory list to check which one(s) are to be added.

Directories containing one or more content file are marked with an icon.

data= and fallback-archive= lines are handled like content= lines:
- they are part of the profile in launcher.cfg, prefixed by the profile
name
- they are updated in openmw.cfg when profile is selected / created

Directories can be moved in the list by drag and drop or by buttons.
Insertion is possible anywhere in the list.
Global data path and data local are shown but are greyed out, as they
are always included.

No attempt is made to ensure that the user choice are valid
(dependencies, overwrite of content).

After a profile is loaded, any added content is highlighted in green.
3 years ago
elsid 7038c82690
Configure mav navmeshdb file size from the launcher 3 years ago
elsid 1baee5ddba
Add check box to remove unused tiles 3 years ago
elsid 2d5ccc804b
Exchange binary messages between navmeshtool and launcher 3 years ago