Page 1 of 3

How our settings system work?

Posted: 22 Jun 2015, 20:06
by sirherrbatka
…or at least where are the files with configuration located.

This is silly question. I spend around hour trying to figuer out how things works (it surely been a moment) but came to conclusion that I have no idea where are the files that are supposed to be parsed by the user settings object located. Small input would be very usefull.

Re: How our settings system work?

Posted: 22 Jun 2015, 20:17
by DanielCoffey
Are you referring to (on Windows at least) Documents \ My Games \ OpenMW \ openmw.cfg (and settings.cfg in the same folder)?

Re: How our settings system work?

Posted: 22 Jun 2015, 20:28
by jirka642
Aren't all settings files located in standard paths https://wiki.openmw.org/index.php?title=Paths ?

Re: How our settings system work?

Posted: 22 Jun 2015, 22:09
by cc9cii
Have a look at

components/config
components/settings
components/files/configurationmanager.cpp
apps/launcher/maindialog.cpp
apps/opencs/editor.cpp
etc

Re: How our settings system work?

Posted: 23 Jun 2015, 09:25
by sirherrbatka
Thanks.

PS
I guess i was tired. Everything i need at the moment is in the usersettings file.

Re: How our settings system work?

Posted: 23 Jun 2015, 18:26
by sirherrbatka
One additional question. From what I seen, currently opencs lack settings that is suitable for adding complex types to the settings file. That's the case with filter page, however. We need to be able create new filter entry and for each entry specify applicable table plus list of columns that are supposed to be handled. Initially i thought that i should do this with the current framework, and simply extend it if that's required, however; i need to be sure before procedding any further. Could you please answer me, zini?

Re: How our settings system work?

Posted: 24 Jun 2015, 09:26
by Zini
The whole setting system needs a bit of a renovation (it had lots of problems initially and all the fixes I added later are of a makeshift nature). But I don't think that it should affect your task noticeably. You should get away with writing your own Page class (view) and then insert an instance of it in CSVSettings::Dialog::buildPages. It should be possible to extend/re-use at least parts of the existing model (updating and settings storage maybe) and then add whatever is needed.
Sorry, that's all I got for now.

Re: How our settings system work?

Posted: 24 Jun 2015, 18:43
by sirherrbatka
That's enough. I think I know what needs to be done, but will be able to do something next week and nothing this week. Also, TOME is seriously addictive game. Stay away of it.

Re: How our settings system work?

Posted: 17 Aug 2015, 17:41
by sirherrbatka
Sorry that it takes so much time. Somehow i couldn't really motivate myself to work on this.

Anyway:

Graffy, could you please provide some hints on how you suggest to create nested settings models with the current code? I decided that the best way to handle this is to have 3 level tree (root, category, boolean values for each column). However CSMSetting appears to be flat by design. Am I mistaken? If not should i proceed and rebuild settings to reflect my needs (i don't think i can do this, i don't fully understand design goals of current framework) or perhaps i should simply attach some label to each value and filter with it (ugly, but at least should work).

PS
I probabbly should reread this topic before asking new question.

Re: How our settings system work?

Posted: 19 Aug 2015, 15:13
by Zini
Not sure if Graffy is still around.

Its no wonder that you have problems with understanding the design goals, because the current implementation missed the design goals. Partially my fault, I guess. Apparently I failed to communicate the idea to graffy correctly and when accepting the code, I didn't look deep enough to identify the scope of the problem.

Most of the view part is already slated for rewrite. If you wish to re-do the whole thing (view and model), I am okay with that. But it would be a lot of work.

I don't have the time to elaborate on the intended design for the settings system right now. But if you are interested I can do a write-up later this week.