GradienceTeam / Gradience

Change the look of Adwaita, with ease
https://gradienceteam.github.io
GNU General Public License v3.0
1.3k stars 47 forks source link

bug: `FlatpakGSettings` does not contain the function `set_string` #858

Open manan-gup opened 7 months ago

manan-gup commented 7 months ago

Is there an existing issue for this?

What happened?

While trying to apply gtk-3 themes via adw-gtk3 I get the error:

Traceback (most recent call last):
  File "/app/lib/python3.11/site-packages/gradience/frontend/main.py", line 605, in apply_color_scheme
    PresetUtils().apply_preset("gtk3", self.preset)
  File "/app/lib/python3.11/site-packages/gradience/backend/theming/preset.py", line 120, in apply_preset
    self.set_gtk3_theme()
  File "/app/lib/python3.11/site-packages/gradience/backend/theming/preset.py", line 46, in set_gtk3_theme
    self.settings.set_string("gtk-theme", "adw-gtk3")
    ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FlatpakGSettings' object has no attribute 'set_string'

The FlatpakGSettings definition doesn't actually contain this function but does contain set: https://github.com/GradienceTeam/Gradience/blob/29fa687f2c8ffd68c61629716a42e7623f53683f/gradience/backend/utils/gsettings.py#L247

To Reproduce

  1. Open the flatpak devel version of Gradience
  2. Apply a theme and check the box for gtk-3

Expected behavior

No response

Screenshots

No response

OS

EndeavourOs

DE/WM version

GNOME 45

Version

0.8.0-beta2-cdc6692

Installation method

Flatpak from Github Actions

Enabled system extensions (GNOME specific)

No response

Additional context

No response

Code of Conduct

github-actions[bot] commented 7 months ago

Welcome on Gradience. 🥳 We really appreciate your contribution. The core team will review your issue as soon as possible. You can also join the Matrix room: https://matrix.to/#/#Gradience-space:envs.net or the Discord server: https://discord.com/invite/4njFDtfGEZ

manan-gup commented 7 months ago

I'm also getting yapsy errors:

Traceback (most recent call last):
  File "/app/lib/python3.11/site-packages/yapsy/PluginManager.py", line 535, in loadPlugins
    is_correct_subclass = issubclass(element, self.categories_interfaces[category_name])
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: issubclass() arg 1 must be a class

which is probably causing the firefox theming to not work. This is what I get when I press the firefox toggle:

Traceback (most recent call last):
  File "/app/lib/python3.11/site-packages/gradience/frontend/widgets/plugin_row.py", line 95, in on_switch_toggled
    if self.switch.get_active():
       ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_active'
peterbone-bo commented 7 months ago

I am seeing the same error. (lots of them actually)

Platform:

Arch Linux, Gnome 45.3, Wayland, Gradience 0.8.0-beta2-8b5c6f5 (Flatpak)

keilmillerjr commented 7 months ago

Likewise. I have the same error on arch using gradience-git. It would be nice to have firefox matching. It's the most commonly used app on my desktop.

KennyDevT commented 7 months ago

You just need to remove the _string from set_string in preset.py

manan-gup commented 7 months ago

Yeah, given what I've reported, I also thing the same. But, I'm not familiar with the project, so, I don't know if its 100% correct. Also, I can't get the project to build in the Gnome Builder flatpak, so, can't really experiment with it.

KennyDevT commented 7 months ago

You can modify the existing file at /var/lib/flatpak/app/com.github.GradienceTeam.Gradience.Devel/current/active/files/lib/python3.11/site-packages/gradience/backend/theming/

donorsemen commented 6 months ago

You can modify the existing file at /var/lib/flatpak/app/com.github.GradienceTeam.Gradience.Devel/current/active/files/lib/python3.11/site-packages/gradience/backend/theming/

But this file doesn't have any lines matching "_string", I'll say more, no other file in this directory has anything like it Снимок экрана от 2024-02-29 20-26-40

KennyDevT commented 6 months ago

https://github.com/lavafroth/Gradience/blob/fix-set-gtk3-theme/gradience/backend/theming/preset.py download this version of the file