abrt / gnome-abrt

ABRT oopses list designed according to https://live.gnome.org/Design/Apps/Oops
GNU General Public License v3.0
19 stars 22 forks source link

migrating from gtk3 to gtk4 #353

Closed sudipshil9862 closed 2 months ago

sudipshil9862 commented 4 months ago
msrb commented 4 months ago

Just for the record, I was looking into this on Friday, but I am getting the following error when trying to run the app:

(gnome-abrt:7147): Gtk-CRITICAL **: 05:02:53.929: Error building template class 'OopsWindow' for an instance of type 'OopsWindow': .:0:0 Invalid property: GtkHeaderBar.show-close-button
ERROR:root:'NoneType' object has no attribute 'set_placeholder'
Traceback (most recent call last):
  File "/home/michal/projects/abrt/gnome-abrt/build/src/gnome-abrt", line 208, in do_activate
    main_window = OopsWindow(self, self.all_sources, controller)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/michal/projects/abrt/gnome-abrt/build/src/gnome_abrt/views.py", line 365, in __init__
    self.lb_problems.set_placeholder(label)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'set_placeholder'
FAILED: meson-internal__run 
env MESON_SOURCE_ROOT=/home/michal/projects/abrt/gnome-abrt MESON_BUILD_ROOT=/home/michal/projects/abrt/gnome-abrt/build MESON_SUBDIR= 'MESONINTROSPECT=/usr/bin/meson introspect' src/gnome-abrt
ninja: build stopped: subcommand failed.

I am still looking into it ;)

sudipshil9862 commented 4 months ago

The error occurs because lb_problems is not being properly initialized when running ninja -C build run. This can happen if the UI is not fully loaded.

The error does not occur when you run ninja -C build install followed by ninja -C build run, because installing the application likely sets up the environment and resources correctly before running the application.

This is just my assumption. But worked for me.

mike-fabian commented 4 months ago

Just for the record, I was looking into this on Friday, but I am getting the following error when trying to run the app:

(gnome-abrt:7147): Gtk-CRITICAL **: 05:02:53.929: Error building template class 'OopsWindow' for an instance of type 'OopsWindow': .:0:0 Invalid property: GtkHeaderBar.show-close-button
ERROR:root:'NoneType' object has no attribute 'set_placeholder'
Traceback (most recent call last):
  File "/home/michal/projects/abrt/gnome-abrt/build/src/gnome-abrt", line 208, in do_activate
    main_window = OopsWindow(self, self.all_sources, controller)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/michal/projects/abrt/gnome-abrt/build/src/gnome_abrt/views.py", line 365, in __init__
    self.lb_problems.set_placeholder(label)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'set_placeholder'
FAILED: meson-internal__run 
env MESON_SOURCE_ROOT=/home/michal/projects/abrt/gnome-abrt MESON_BUILD_ROOT=/home/michal/projects/abrt/gnome-abrt/build MESON_SUBDIR= 'MESONINTROSPECT=/usr/bin/meson introspect' src/gnome-abrt
ninja: build stopped: subcommand failed.

I am still looking into it ;)

That error occurs because the old Gtk3 gnome-abrt rpm package is installed and has the file /usr/share/gnome-abrt/org.freedesktop.GnomeAbrt.gresource which contains the UI files.

When running from the git checkout with ninja -C build run, that file is still read from /usr/share/gnome-abrt/org.freedesktop.GnomeAbrt.gresource, not the new file for the Gtk4 UI from ./build/data/org.freedesktop.GnomeAbrt.gresource.

To make it run, it is enough to install that single file:

sudo mkdir -p /usr/share/gnome-abrt/ && sudo cp ./build/data/org.freedesktop.GnomeAbrt.gresource /usr/share/gnome-abrt/

sudipshil9862 commented 3 months ago

when we press ctrl+c by selecting any word, was it trying to copy the problem id instead of that word ?

on_gac_copy_id_activate
    (Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
     ^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/gi/overrides/__init__.py", line 31, in __getattr__
    return getattr(self._introspection_module, name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/site-packages/gi/module.py", line 130, in __getattr__
    raise AttributeError("%r object has no attribute %r" % (
AttributeError: 'gi.repository.Gtk' object has no attribute 'Clipboard'
sudipshil9862 commented 2 months ago
sudipshil9862 commented 2 months ago

Some screenshot of the latest design of gnome-abrt. Hope you will like it. image image

msrb commented 2 months ago

:+1:

@sudipshil9862 This looks fantastic! And it seems to be working really well. Thank you so much :) I will create an update for Rawhide this following week so more people will have a chance to test it and provide feedback.

Thank you :)