Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QSettings should use INI files on Windows(TM) instead of the Windows Registry #670

Closed
donbright opened this issue Feb 22, 2014 · 8 comments

Comments

@donbright
Copy link
Sponsor Member

donbright commented Feb 22, 2014

If we move QSettings from the Windows Registry into a simple .ini file inside the OpenSCAD per-user directory, this would make it very simple for the windows folks to customize settings if they wanted to. It would be a text file, much like the .config/OpenSCAD.conf situation that we have on Linux.

The immediate benefit here is for the easy user-customization of colors for the 3d window and for syntax highlighting. It is not as "good" as a fancy GUI interface for color-picking, but it is a good start towards that and is relatively simple to implement. It is an important part of UI to allow users to customize certain things for their environment and situation, such as Colorblind users who may have different perceptions of red/green and whatnot.


The problem wil be migrating Registry entries to the .ini file so that people settings wont change after upgrade of OpenSCAD.

This is a bit tricky but its not rocket science. We can set a rule to prefer .ini file to registry.

Then on startup if the .ini file is missing (as it will be for all upgrades) we can load the registry entries, then immediately save them to a .ini file. (We have to verify that the .ini file wrote properly, of course, by loading it and doing a quick sanity check).

On subsequent runs the per-user .ini file will have all the settings saved.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@donbright donbright added this to the 2014 QX milestone Feb 22, 2014
@donbright donbright self-assigned this Feb 22, 2014
@MichaelAtOz
Copy link
Member

Or you could have a registry point to the last .ini file, then a new version without a local .ini file could look for the last one as the basis for it's own new one. That way new/snapshot stuff won't affect settings for previous versions too.

@kintel
Copy link
Member

kintel commented Nov 7, 2014

In terms of color schemes, this has been moved to separate .json files - see #1008.

@kintel
Copy link
Member

kintel commented Nov 9, 2014

It's possible to use QSettings::IniFormat to force QSettings to store the preferences in .ini files:
http://qt-project.org/doc/qt-5/qsettings.html#platform-specific-notes

@kintel kintel removed this from the 2014 QX milestone Nov 9, 2014
@hgletthofer
Copy link

if this issue is still open, there is the option to add some lines of code to the updater (if there is any) and read all the registry entries, clear them and write them into the said ini file

@donbright donbright removed their assignment Mar 5, 2015
kant added a commit to kant/openscad that referenced this issue Oct 24, 2018
Added missed translated strings
kintel pushed a commit that referenced this issue Oct 25, 2018
Added missed translated strings
@thehans
Copy link
Member

thehans commented Mar 7, 2019

I think ideally we should have a non-Qt dependent alternative to reading settings(for all platforms, not just Windows) so that headless build can read settings without linking to Qt. I know most of the settings are GUI specific, but there are a couple like cache size that shouldn't be tied to GUI.

@MichaelAtOz
Copy link
Member

Ideally a mechanism to allow versioning of preferences.
It doesn't happen often but there was once a problem where a snapshot preference caused (minor PITA) difficulties to the installed Release version. Even just Snapshot v's Release would be a safe practice.

@t-paul
Copy link
Member

t-paul commented Mar 8, 2019

An alternative way of saving might be a nice option. It's probably not very easy to move everything out as there are a couple of cases where Qt stores some kind of internal data representation (QGamepad, Window positions, ...?) so we have to find a way to tunnel that though to a different backend.

@donbright
Copy link
Sponsor Member Author

windows has changed so much this is irrelevant now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants