From 151b03b1d90308497562cbefdbe57c3b5a0fffe0 Mon Sep 17 00:00:00 2001 From: heliguy Date: Tue, 5 Sep 2023 01:33:59 -0400 Subject: [PATCH] Make it so the main window cant be closed For single app uninstalls, make it so that the main app window cannot be closed while the app is uninstalling --- src/window.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 7abb5c7..20347dc 100644 --- a/src/window.py +++ b/src/window.py @@ -118,13 +118,14 @@ class FlattoolGuiWindow(Adw.ApplicationWindow): def uninstall_response(self, widget, response_id, _c, index): ref = self.host_flatpaks[index][8] name = self.host_flatpaks[index][0] - command = ["flatpak-spawn", "--host", "flatpak", "removed", ref, "-y"] + command = ["flatpak-spawn", "--host", "flatpak", "remove", ref, "-y"] if response_id == "cancel": self.should_pulse = False return 1 if response_id == "purge": command.append("--delete-data") + handler_id = self.connect('close-request', lambda event: True) # Make window unable to close self.main_progress_bar.set_visible(True) def uninstall_callback(*_args): @@ -136,6 +137,7 @@ class FlattoolGuiWindow(Adw.ApplicationWindow): self.main_progress_bar.set_visible(False) self.should_pulse = False self.refresh_list_of_flatpaks(None, False) + self.disconnect(handler_id) def thread_func(*_args): try: