70 Commits
Author SHA1 Message Date
esch cd5197836c Let names carry what the comments said
The accessor for every content file of a list is getAllContentListFiles(), beside
getContentListFiles(), and its setter parameter is allFileNames; setProfileContent()
names its parameters enabledFiles and order. The comments that explained those, and
two in the tests that restated their assertions, are gone.
2026-09-14 20:31:11 -05:00
esch 49cc8d88ba Name the reorderable-files accessor for what it returns
userFilesInOrder() says that built-in and non-user content files are left out,
so the comment explaining that is gone.
2026-09-14 20:24:44 -05:00
esch 3923a511ce Restore the content order inside setProfileContent
setProfileContent() is the only place that loads a profile's content into the
selector, so it now takes the saved order too and restores it there, instead of
the data files page doing it afterwards and explaining why in a long comment.
2026-09-14 20:18:22 -05:00
esch 9de45d325c Launcher: remember the position of disabled content files
openmw.cfg records only enabled content files, so the launcher has nowhere to
keep where a disabled one sat. On the next run the dependency sort decides for
it, and the user's arrangement is lost.

Adds a per-profile "order" key to launcher.cfg listing every content file in the
order the user left it, enabled or not. "content" is unchanged and still holds
only the enabled files, because openmw.cfg is the engine's file and the engine
loads only those. A disabled file's position is a launcher concern, so it goes in
launcher.cfg with the rest of the launcher's per-profile state.

Restoring reuses the existing setContentList(list, orderOnly) path rather than
adding a second way to reorder the model. Saving needs one new accessor,
allFilesInOrder(), since nothing reported the displayed order before.

A launcher.cfg written without the key restores nothing and behaves exactly as
before. Launchers 0.49 to 0.51 drop the key when they save, as they drop every
key they do not know. Covered by tests.

Related to #2708
2026-09-14 13:53:35 -05:00
sophielovesmorrowind e8321731c6 Cleanup: pass orderOnly to existing setContentList call 2026-04-14 23:55:35 -06:00
sophielovesmorrowind bc2985c303 FIX: Just make the CS 1:1 to solve the immediate issue 2026-04-14 14:40:32 -06:00
sophielovesmorrowind 2eb07581a8 Content Editor Load Fixes 2026-03-31 22:10:31 -06:00
elsid d121b606b6 Fix and enforce local variable naming 2025-08-05 21:27:48 +02:00
Alexei Kotov 780a4904bd Handle implicitly checked files more consistently (#8563) 2025-06-13 22:14:08 +03:00
elsid 3955428f87 Show progress dialog on updating content selection 2025-05-22 07:47:38 +02:00
Alexei Kotov f7f5665588 Avoid repeated item(QString) in plugin toggling-related code 2025-05-15 23:17:17 +03:00
AnyOldName3 894ea4ba62 Don't precompute load order errors after every change
It's much slower than doing it on demand as it only takes a microsecond, but for a really big load order, there are hundreds of thousands of intermediate calls before everything's set up and we can draw the GUI.
2025-04-08 01:19:24 +01:00
Andrei Kortunov bd59247270 Avoid trailing line breaks 2024-11-20 09:04:22 +04:00
AnyOldName3 cd7941dc9f Some launcher fixes
I tried to fix https://gitlab.com/OpenMW/openmw/-/issues/8080 by making it so that instead of crashing, we showed an error.

In doing so, I discovered some problems with plugin sorting and the refresh button, like:
* it forgetting the non-user content files somewhere
* nothing guaranteeing that built-in content files stay at the top of the list and them only being there because the first data directory that provides them is usually the first data directory
* it forgetting the non-user content files somewhere else
* it looking like it'd forget any kind of non-user setting under certain circumstances

I fixed those problems too
2024-07-31 00:04:38 +01:00
Andrei Kortunov 1bb48bcef7 Treat editor icons as scalable 2024-04-21 20:56:06 +04: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
Evil Eye 0db8026356 Stop adding and deleting rows 2024-01-09 17:45:48 +01:00
Andrei Kortunov 1ca2a0ef66 Store generated UI by pointer to avoid redundant processing 2023-12-24 20:35:19 +04:00
Andrei Kortunov ca19f7006c Make hardcoded strings in Launcher and Wizard localizable 2023-12-11 12:02:43 +04:00
Alexei Dobrohotov 5adda00f5e Content selector: allow using non-primary game files as addon files 2023-07-11 11:07:37 +03:00
Andrei Kortunov 902c48d1bb Rework launcher UI 2023-01-15 12:36:08 +04:00
Andrei Kortunov 307a60e87c Migrate from QRegExp to more modern QRegularExpression 2023-01-11 11:21:46 +04:00
clang-format-botandζeh Matt ddb0522bbf Apply clang-format to code base 2022-09-22 21:35:26 +03:00
mpeco 1868534071 functor-based Qt signal-slot syntax components 2022-08-23 17:14:12 -03:00
jvoisin 8b9ed57348 Clean up Qt includes 2022-06-17 11:56:54 +02:00
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.
2022-04-23 09:54:45 +02:00
Evil Eye a3e039d862 Explicitely sort by file name after adding all data dirs 2021-11-07 14:15:30 +01:00
Petr Mikheev 37386f417e Support *.omwscripts in openmw-launcher 2021-10-29 20:09:47 +02:00
Petr Mikheev 413ac067ec Allow creating omwaddons without a dependency on an omwgame 2021-09-26 17:44:28 +02:00
Cédric MocquillonandAlexei Dobrohotov 6e397e4008 Add a search function to the "Datafiles" tab of the OpenMW launcher 2020-06-21 14:45:30 +00:00
elsid 045ceeac11 Replace foreach macro by for-loop 2019-10-20 20:08:16 +02:00
Andrei Kortunov 3032b177a1 Remove redundant includes 2019-02-23 08:02:12 +04:00
Andrei Kortunov e06f0b797a Replace all NULLs to nullptr 2018-10-09 10:21:12 +04:00
Capostrophic f20f49daa6 Content selector: allow to copy paths to clipboard (feature #2847) 2018-09-29 02:09:13 +03:00
Andrei Kortunov bce8de5fe9 Respect selected encoding in the content selector (bug #4467) 2018-09-25 21:39:18 +04:00
Thunderforge c2fff61ccd Changing so that data changes happen only after the addon is checked 2018-05-26 20:35:28 -05:00
Thunderforge d58cce9c72 Adding WIP code to dynamically change the autocomplete fields 2018-05-22 20:50:31 -05:00
Bret Curtis 39185e6f8c purge the rest of boost::shared and any other boost related things that no longer are required
put boost system back in, clean others up

revert Qt

add back boost fstream
2017-06-09 19:08:53 +02:00
Bret Curtis d785344fad purge all instances of <boost/shared_ptr.hpp>, clean up unused headers 2017-06-09 19:08:53 +02:00
Allofich 125e94ef0e Fix shadowing warnings 2016-10-31 00:39:31 +09:00
Arthur Moore 4c0c20b1a0 Changed relative includes to library header format 2015-11-27 21:01:28 -05:00
cc9cii cccf6c6bdd Rebuild the list of available content files when opening the open/new dialogues. Should resolve Bug #2644. 2015-06-16 12:48:45 +10:00
dteviot b0c4be2316 Multi-select + context menu. (Fixes #2480)
Content selector, added multi-select + context menu to allow check/uncheck the multi-selected items.
2015-05-04 14:52:47 +12:00
dteviot 80fe24207c correction from Scrawl.
Now correctly handles skills/attributes.
Also, document what ContentSelectorView::ContentSelector::slotAddonTableItemActivated() is doing.
2015-03-05 20:21:22 +13:00
dteviot 6878e317a7 launcher: decouple Combo Box model from Plug-ins model.
fixes bug reported by scrawl
1. openmw.cfg had content files in order 'Bloodmoon.esm, Tribunal.esm, Morrowind.esm'
2. Blank_ESM_2.0.esm is in the Data Files directory
3. Do an ini file import.
4. Imported profile will have Blank_ESM_2.0.esm as the game file.  Should be Morrowind.esm.

Root cause: Game File combo box and Plugins Grid shared same data model, so changing plug-in file order also changed order of Game File combo box.
2015-02-24 20:06:06 +13:00
dteviot 6dc202cba3 Removed unneeded parameter from ContentModel::setContentList() 2015-02-23 19:41:41 +13:00
scrawl ab9100fa90 Prevent dropping item on itself in ContentModel (Fixes #2334)
Also improves the drop indicator, it is now shown in between items instead of on an item.
2015-02-05 04:18:43 +01:00
Marc Zinnschlag fa4718283d Merge remote-tracking branch 'scrawl/contentselector' 2015-01-21 15:23:38 +01:00
dteviot 017e4cd4ef OpenCS shows plug-ins with load order issues.
1. FileDiaog in OpenCS now shows warning icon beside .esm./.esp files with load order problems.
2. omwlaucher -> replaced "stop" icon with "warning" icon for files with load order problems.
2015-01-17 18:11:03 +13:00
dteviot 9d6efcecff Merge remote-tracking branch 'OpenMW/master' into FixLoadOrderReset
Fixed Conflict:
	components/contentselector/model/contentmodel.cpp
2015-01-08 12:15:48 +13:00