-
-
Couldn't load subscription status.
- Fork 64
Add feature to import/export/reset settings #151
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
Conversation
|
Hey @theoforger sorry for the late response. Your work is amazing and very well done! Thank you! ⭐ |
|
A quick update for you. I just discovered that some of the things you are doing via a subprocess can be done by using a |
|
Thanks for the review ❤️ ! I'll look into Just in case you missed it, I left a comment on the issue about some strange behavoir I observed. Let me know if I should file them as a separate issue. Also, any thoughts on these two?
|
Hey thank you! I didn't see you comment there. I left a reply there with all the details, thank you for spotting these bugs!
What do you think about a simple
Hmmmm, I'll investigate, hope to understand how to fix this soon! |
src/settings/settingsExport.ts
Outdated
|
|
||
| // Flush overridden settings back into system | ||
| Settings.set_active_screen_edges(false); | ||
| Settings.set_enable_move_keybindings(false); |
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.
- Due to the workaround used for overridden settings, if the export file is missing the key
active-screen-edgesorenable-move-keybindings, these two options will remain disabled after import, instead of the default enabled state
The reason behind this is that, during the import of settings, the settings are reset and then active-screen-edges and enable-move-keybindings are set to false.
I see you want to flush all the overridden settings back into system, you could use SettingsOverride.get().restoreAll()
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.
Appreciate the suggestion!
SettingsOverride.get().restoreAll() works except for one situation: If either of these toggles are enabled both before and after the import, the overridden settings remain restored.
I can think of two solutions:
- If the state of either is
enabledboth before and after import:
a. Apply overrides again (is there a function for this?), or
b. Toggle it off and on
What do you think?
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.
Sorry, what do you mean with "the overridden settings remain restored"?
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.
The value of overriden-settings is only populated when you enable the toggle.
In this case, SettingsOverride.get().restoreAll() restores the overridden settings, but it doesn't get populated again since the state of the toggle is unchanged.
Hope that clears things out!
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.
Uuuuhhhh! I understand what do you mean...
Thanks a million, I believe that toggling it off and on, as you suggested, could be the best workaround (there isn't a function to override again). Can you put a comment near this workaround to remember these details in the future? Thanks again!
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 problem. Will do!
|
I noticed the fallback states for several Is this intentional or an oversight? Context: I'm trying to use these functions to determine the states before/after import. |
This was intentional at that time, however there isn't any reason anymore. Because of that, it would be better that the |
|
I just pushed some more code. But the workaround is not working right now. This is getting more complicated than I thought haha. From my testing, The same goes for screen edges. Toggling it on in the GUI does the trick. It only doesn't work if I use the setter function to enable it. Edit: Forgot to mention I added these two setter functions myself. Maybe I missed something there 😄 |
|
Hey thank you! I gave a look at your code and it seems great to me! It's unfortunate you still have that bug 😢 However, considering that I was planning a major release (v14) in the near future I wish to include your amazing changes as well. Because of that, I'm changing the target of your pull request from main to the branch named 13.2 (sorry, at the beginning I thought to do version 13.2 but now I changed my mind to version 14 ahahah) Can you tell me if you have the same bug? That branch includes the changes made to fix the bugs you spotted, maybe they are related! Thank you once again for this amazing work ❤️ Another question, as much important as the other one: is it ok for you if I cite you and put a link to your GitHub account in the release notes which will include your changes? 😃
I looked at them, and you did it perfectly, so the bug is somewhere else 🤔. I'll investigate and come back to you if I have news! |
|
Strange. Now I'm getting this error when I try to open the settings page: I'm using GNOME 46 on Fedora 40 if that's relevant. And thanks for being patient with me haha 😄 |
Hey! I'm so sorry, that's my mistake 😢 I fixed this, you should see a new commit in the target branch (13.2) |
I just tested and this bug still exists 😢
Of course, I'm okay with it 👍 (Sorry I missed this earlier) |
|
Hey, I have good news for you. From my tests, I think I fixed the problem you had! The idea is the following, when settings are reset:
When settings are imported, resetting will override all the settings as well. If the imported file contains a You will see that I also made some changes to how the settings are overridden and how they are reverted: it is now more robust and I believe that code was not good at all and it was causing issues as well. |
|
Fantastic job! I tested it and everything seemed to work properly. I should've thought of restoring the keys during resets haha. Anyway I'll change the PR status to ready 🎉 |
|
Amazing work @theoforger ! Thank you once again, I'll merge and include your changes in the upcoming version of Tiling Shell. You can expect it being released today or tomorrow, depending on the time needed by GSE to review. Can't wait to see people enjoy all the features you implemented! ❤️ Edit: I left the |
|
And thanks for guiding me along the way! It's been such a pleasure working with you ❤️ |
|
I was a little confused about how the file should be named, but worked out that "example.txt" worked. Maybe the Just a suggestion. |
|
@thyttan I think it's a great idea. I noticed the name confusion as well during development and tried to solve it with a filter. For some reason it didn't seem to do anything. Pre-filling might be the better solution here. 👍 @domferr We can use fc.set_current_name('tiling-shell-settings.txt');What do you think? |
|
Hey @theoforger @thyttan I think this is a must have addition! @theoforger I tested your suggestion and it works perfectly, thanks! Next release will include this change 🔜 |
Fixes #122.
Description
This PR implements the feature to import, export and reset settings, which can be accessed through the new buttons inside the preference page:
Implementation
SettingsExportis responsible for all tasks related to this feature.Export
dconf dumpin a subprocess: codeReset
dconf reseton keys that are not in the excluded list: codeImport
dconf load: codeIssues/Possible Improvements
active-screen-edgesorenable-move-keybindings, these two options will remain disabled after import, instead of the default enabled stateFeedback?
I am still new to coding. Any feedback or advice is appreciated 🙏