-
Notifications
You must be signed in to change notification settings - Fork 58
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
Update the Settings screen - reload theme, restore defaults #463
Conversation
…by and courtroom)
…tings screen Add a "restore to defaults" option that allows you to restore all the configuration to its default values. Set up a .temp settings file that allows you to undo the effects of restoring default options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me. @oldmud0?
QFile::rename(ao_app->get_base_path() + "config.ini", ao_app->get_base_path() + "config.temp"); | ||
// Load up the default settings | ||
ao_app->configini->clear(); | ||
// Update the values on the settings ui | ||
update_values(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds complicated. You just want to read an empty file for QSettings, right? Perhaps read config.temp
, update values, and delete the file right away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I tried but QSettings behavior overwrote the file lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No but like delete the qsettings instance right after reading.
Add two new buttons - Reload Theme and Restore Defaults
Reload Theme button works even in lobby
Restore Defaults will rename the config.ini to config.temp and initialize the default values.
If the user presses "Cancel", the .temp file is reinstated as the config.ini file.
This also slightly overhauls the code for settings, moving all the funcs that set the checkbox values etc. into its own update_values() func
PR is tested, seems to be working just fine
Closes #454