From 466345c8319301b9e159b5e4317bd7d681bb4dcd Mon Sep 17 00:00:00 2001 From: Daniel Johnson Date: Mon, 25 Dec 2023 06:56:10 -0500 Subject: [PATCH] Redirect some installer-window responses to the cancel button logic, rather than just destroying the window. This causes ongoing incomplete downloads to be cancelled. --- lutris/gui/installerwindow.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lutris/gui/installerwindow.py b/lutris/gui/installerwindow.py index fbfee6581..1694e2990 100644 --- a/lutris/gui/installerwindow.py +++ b/lutris/gui/installerwindow.py @@ -205,6 +205,12 @@ class InstallerWindow(ModelessDialog, """Open the cache configuration dialog""" CacheConfigurationDialog(parent=self) + def on_response(self, dialog, response: Gtk.ResponseType) -> None: + if response in (Gtk.ResponseType.CLOSE, Gtk.ResponseType.CANCEL, Gtk.ResponseType.DELETE_EVENT): + self.on_cancel_clicked() + else: + super().on_response(dialog, response) + def on_back_clicked(self, _button): self.stack.navigate_back()