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

Restore default settings #1872

Open
Bost opened this issue Aug 29, 2021 · 24 comments
Open

Restore default settings #1872

Bost opened this issue Aug 29, 2021 · 24 comments

Comments

@Bost
Copy link

Bost commented Aug 29, 2021

Please add functionality to restore default settings. Or at least documentation how to do it. Thank you.

@mlouielu
Copy link
Collaborator

mlouielu commented Aug 29, 2021 via email

@Bost
Copy link
Author

Bost commented Aug 29, 2021

Thanks.

@mlouielu
Copy link
Collaborator

@Bost Would you like to help create a PR for this?

@Chicchi7393
Copy link

i could help

@Davidy22
Copy link
Collaborator

Davidy22 commented Oct 3, 2021

I'll assign @Chicchi7393 since they're volunteering here.

@Chicchi7393
Copy link

@Davidy22 sorry, i tried to make the button, i think i succeded but i can't test because the settings aren't saving when closing (and it gives me two errors at startup (arch with gnome40) )

@Davidy22
Copy link
Collaborator

Davidy22 commented Oct 3, 2021

Are you making any calls to self.settings.general.set_boolean()? That'll probably help you change settings to their original value. I can't see your code, but I suspect you just have the button changing some states in the preferences ui right now.

@Chicchi7393
Copy link

Chicchi7393 commented Oct 3, 2021

i got the schemas from the config file (could be unpractical in the future, if you want i'll use os.system to reset every category of properties available) and on the click it will loop in the schemas to reset using the function self.settings.general.reset, i can't test because in my case it doesn't even save to the config but i can link the maybe-functioning fork

@Davidy22
Copy link
Collaborator

Davidy22 commented Oct 3, 2021

On quick inspection of the commit, that's a massive amount of changes to prefs.glade for one button being added. Skimming through, a hefty chunk of it seems to be a change in convention? Is the preferences window failing to pop up for you at all, because some side effect in this hefty change might be the cause of that. You can also run guake with guake --debug for more messages that can help you pinpoint the issue better.

@Chicchi7393
Copy link

On quick inspection of the commit, that's a massive amount of changes to prefs.glade for one button being added. Skimming through, a hefty chunk of it seems to be a change in convention? Is the preferences window failing to pop up for you at all, because some side effect in this hefty change might be the cause of that. You can also run guake with guake --debug for more messages that can help you pinpoint the issue better.

apparently only changing the version of glade changed this much, i'll try to revert and change only the needed

@Chicchi7393
Copy link

@Davidy22 there is no such thing as --debug, also committed on the fork using glade 3.22.2 but the handler is not called

@Davidy22
Copy link
Collaborator

Davidy22 commented Oct 3, 2021

Oh whoops misremembered, it's --verbose

@Chicchi7393
Copy link

Oh whoops misremembered, it's --verbose

still, if i do guake -p --verbose nothing gets logged, now it saves what i set but the reset button doesn't do anything (that should also restart the settings, but it doesn't do it, so i suppose the handler doesn't even get executed)

@Davidy22
Copy link
Collaborator

Davidy22 commented Oct 4, 2021

To get log output, close guake entirely and run guake --verbose from another terminal to start guake. Pulling your repo and running with --verbose, I get the following message at the moment that I click the reset button:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/guake/prefs.py", line 562, in resetAllSettings_clicked_cb
    self.prefDlg.resetAllSettings_clicked_cb(btn)
  File "/usr/local/lib/python3.8/dist-packages/guake/prefs.py", line 815, in resetAllSettings_clicked_cb
    list_schemas = os.system("gsettings list-schemas | grep guake").split("\n")
AttributeError: 'int' object has no attribute 'split'

For sections of code like the one throwing the error above where no functions from guake are actually being called, you can also write a quick proof of concept in a throwaway file and copy it into guake once you get it to work. Looks like this is just a typing error that could have been tested and fixed outside of guake

@Chicchi7393
Copy link

Fixed it I suppose, i can’t test run because I’m at school with my iPad but in around 1h and 50m I can test, hope everything works!

@Davidy22
Copy link
Collaborator

Davidy22 commented Oct 4, 2021

Alright, make a pull request once you get it tested and working and ready to submit so someone can take a closer look

@Chicchi7393
Copy link

Alright, make a pull request once you get it tested and working and ready to submit so someone can take a closer look

apparently the program hates me, i expect it to work but https://hastebin.com/lexalemeqa.py

@mlouielu
Copy link
Collaborator

mlouielu commented Oct 4, 2021

Alright, make a pull request once you get it tested and working and ready to submit so someone can take a closer look

apparently the program hates me, i expect it to work but https://hastebin.com/lexalemeqa.py

What kinda code do you run?

You cannot use (and better not use, use subprocess) os.system() to pipe stuff, it return int because it failed, and return errno.

You should use subprocess to handle the pipe, and for better wrap for spawn new processes.

@Davidy22
Copy link
Collaborator

Davidy22 commented Oct 4, 2021

Just inspecting the error a little bit, and I'm not in sure what context did you manage to get guake_version() to return None, but expected parameter type is string and there's probably a good sensical place for you to add a check somewhere to make that line work.

On a side note, are you installing from source with sudo make install or some other path? I notice the error path is slightly different from mine. Probably doesn't actually make a difference though

@Chicchi7393
Copy link

Alright, make a pull request once you get it tested and working and ready to submit so someone can take a closer look

apparently the program hates me, i expect it to work but https://hastebin.com/lexalemeqa.py

What kinda code do you run?

You cannot use (and better not use, use subprocess) os.system() to pipe stuff, it return int because it failed, and return errno.

You should use subprocess to handle the pipe, and for better wrap for spawn new processes.

i now use subprocess, that error happened after i switched back to subprocess

@Chicchi7393
Copy link

Just inspecting the error a little bit, and I'm not in sure what context did you manage to get guake_version() to return None, but expected parameter type is string and there's probably a good sensical place for you to add a check somewhere to make that line work.

On a side note, are you installing from source with sudo make install or some other path? I notice the error path is slightly different from mine. Probably doesn't actually make a difference though

i do make reinstall in between the changes

@Davidy22
Copy link
Collaborator

Davidy22 commented Oct 4, 2021

well whatever it is, do some logging to try to figure out why guake_version's giving a blank return and add an appropriate check

@Davidy22
Copy link
Collaborator

Davidy22 commented Oct 9, 2021

How's fixing the patch up progressing, @Chicchi7393?

@Davidy22
Copy link
Collaborator

Unassigning due to no response

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

4 participants