SeaDve / Mousai

Identify songs in seconds
GNU General Public License v3.0
981 stars 36 forks source link

Cant build #25

Closed sheeepdev closed 3 years ago

sheeepdev commented 3 years ago

I'm pretty sure this is related or even the same issue as #22 but I can't get it to build with meson :(

Traceback (most recent call last):
  File "/usr/local/bin/mousai", line 30, in <module>
    from mousai import main
  File "/usr/local/share/mousai/mousai/main.py", line 18, in <module>
    class Application(Adw.Application):
  File "/usr/lib/python3.9/site-packages/gi/module.py", line 123, in __getattr__
    raise AttributeError("%r object has no attribute %r" % (
AttributeError: 'gi.repository.Adw' object has no attribute 'Application
SeaDve commented 3 years ago

It seem to detect libadwaita, so not #22. But you need the lastest version of libadwaita, specifically from the master branch. libadwaita 1.0.0-alpha-2 doesn't have Adw.Application yet

sheeepdev commented 3 years ago

I have libadwaita-git installed from AUR (1.0.0+alpha.2+3+g959f434-2)

SeaDve commented 3 years ago

You might need something newer

sheeepdev commented 3 years ago

So would I need to compile libadwaita directly from Gnome GitLab?

SeaDve commented 3 years ago

I checked on that specific libadwaita version, it is behind around 20+ commits to which have Adw.Application support, so yes you will need to wither compile it, or maybe something newer from aur

SeaDve commented 3 years ago

something easier though is temporarily replacing Adw.Application witj Gtk.Application in main.py

SeaDve commented 3 years ago

but you'll have broken css

sheeepdev commented 3 years ago

I built libadwaita and it installed successfully and I rebuilt mousai but I get the same error :(

SeaDve commented 3 years ago

something easier though is temporarily replacing Adw.Application witj Gtk.Application in main.py

try this (there's two adw.application, replace both with Gtk.Application)

sheeepdev commented 3 years ago
(python3:3777966): Gtk-CRITICAL **: 12:25:20.966: Error building template class 'MainWindow' for an instance of type 'MainWindow': .:0:0 Invalid object type 'AdwHeaderBar'
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/gi/_gtktemplate.py", line 169, in <lambda>
    lambda s: init_template(s, cls, base_init_template)
  File "/usr/lib/python3.9/site-packages/gi/_gtktemplate.py", line 192, in init_template
    raise RuntimeError(
RuntimeError: Handler 'get_visible_button' was declared with @Gtk.Template.Callback but was not present in template
Traceback (most recent call last):
  File "/usr/local/share/mousai/mousai/main.py", line 36, in do_activate
    win = MainWindow(self.settings, application=self)
  File "/usr/local/share/mousai/mousai/widgets/main_window.py", line 28, in __init__
    self.history_listbox.bind_model(self.history_model, self.new_song_row)
AttributeError: 'NoneType' object has no attribute 'bind_model'
SeaDve commented 3 years ago

after the line with Gtk.Application.do_startup, add Adw.init() to the next line

sheeepdev commented 3 years ago

Launches now, but does not follow my system theme, plus the icon is bugged :( See screenshot below

image

SeaDve commented 3 years ago

that's expected. It is a bug with libadwaita.

SeaDve commented 3 years ago

im not sure though why the icon is missing

sheeepdev commented 3 years ago

I'd love to use flatpak apps but I just can't get over how they are not themed :( Hope this resolves soon

SeaDve commented 3 years ago

one hack to make it follow your theme is to remove Adw.init() again then replace AdwHeaderBar in data/ui/window.ui and data/ui/token_dialog.ui with GtkHeaderBar

SeaDve commented 3 years ago

I'd love to use flatpak apps but I just can't get over how they are not themed :( Hope this resolves soon

The thing with libadwaita is not related on why certain apps installed with flatpak doesn't follow system theme. It is just libadwaita doesn't support third party themes yet, but hopefully, yeah.

SeaDve commented 3 years ago

I guess we can close this?

sheeepdev commented 3 years ago

Yeah, I guess.

sheeepdev commented 3 years ago

one hack to make it follow your theme is to remove Adw.init() again then replace AdwHeaderBar in data/ui/window.ui and data/ui/token_dialog.ui with GtkHeaderBar

Doesnt work

sheeepdev commented 3 years ago

And when I try to listen it says muted

SeaDve commented 3 years ago

https://gitlab.gnome.org/GNOME/libadwaita/-/issues/215 You can also check this issue

SeaDve commented 3 years ago

one hack to make it follow your theme is to remove Adw.init() again then replace AdwHeaderBar in data/ui/window.ui and data/ui/token_dialog.ui with GtkHeaderBar

Doesnt work

I just realized there are also other libadwaita widgets, so you will also have to replace/remove those

SeaDve commented 3 years ago

And when I try to listen it says muted

then it doesn't detect your mic

sheeepdev commented 3 years ago

Tried both desktop audio, and mic.

SeaDve commented 3 years ago

Tried both desktop audio, and mic.

it should follow the default audil source similar to what is shown in sound settings of gnome control center