-
Notifications
You must be signed in to change notification settings - Fork 198
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
Add reset to default layout #833
Add reset to default layout #833
Conversation
cuegui/cuegui/MainWindow.py
Outdated
@@ -422,3 +429,37 @@ def __saveSettings(self): | |||
self.size()) | |||
self.settings.setValue("%s/Position" % self.name, | |||
self.pos()) | |||
|
|||
def __removeConfig(self, config_file): | |||
try: |
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.
Could you explain this chunk of code? I'm having a hard time following it.
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.
we fork the process and let the parent process shutdown, the child then sleep for 3 seconds and remove the config file.
If we remove the config file before saving it's overwritten by Qsettings on closure. this is a very Unix specific hack on our part.
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.
Ok thanks, I see now. A quick search didn't turn up a way to disable this QSettings behavior, so that makes sense.
What if instead we saved a "setting" that actually means "restore the default settings on next startup"? Then in Main.startup
we could change the check to be "if local settings don't exist or they contain the overwrite-me setting, then copy the default config files into place".
f718fa2
to
04d5c7f
Compare
Add menu option to reset to default layout option. Users sometime remove widgets by accident, this helps giving them a simple way to restore to defaults. Closes AcademySoftwareFoundation#832
04d5c7f
to
0590c6e
Compare
@bcipriano this seems to work well and will be cross-platform. |
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.
Looks great, thank you!
Add menu option to reset to default layout option.
Users sometimes remove widgets by accident, this helps to give them a simple way to restore to defaults.
Closes #832