Skip to content

Commit

Permalink
apport-gtk: Fix TypeError on dialog close
Browse files Browse the repository at this point in the history
`on_progress_window_close_event` is connected to those four objects:

* GtkWindow delete-event (window_information_collection)
* GtkButton clicked (button_cancel_collecting)
* GtkWindow delete-event (window_report_upload)
* GtkButton clicked (button_cancel_upload)

`GtkWindow::delete-event` takes an event parameter, but
`GtkButton::clicked` does not.

Commit c997c1b ("Add type hints to UserInterface class") released
in apport 2.30.0 dropped support for not providing `event` when calling
`on_progress_window_close_event`.

Fixes: c997c1b ("Add type hints to UserInterface class")
LP: #2080524
  • Loading branch information
bdrung authored and schopin-pro committed Nov 8, 2024
1 parent eceaf7b commit 4faa697
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gtk/apport-gtk
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ class GTKUserInterface(apport.ui.UserInterface):
return True

def on_progress_window_close_event(
self, widget: Gtk.Widget, event: Gdk.Event
self, widget: Gtk.Widget, event: Gdk.Event | None = None
) -> None:
# pylint: disable=unused-argument
self.w("window_information_collection").hide()
Expand Down

0 comments on commit 4faa697

Please sign in to comment.