From 896f078ed7db874798e8408e313ef26f22d927d6 Mon Sep 17 00:00:00 2001 From: heliguy4599 Date: Wed, 4 Oct 2023 18:09:12 -0400 Subject: [PATCH] Properly handle no flatpaks Make the UI properly handler itself when there are no installed flatpak --- src/orphans_window.py | 7 ++++++- src/window.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/orphans_window.py b/src/orphans_window.py index 10859523..40967f71 100644 --- a/src/orphans_window.py +++ b/src/orphans_window.py @@ -165,8 +165,13 @@ def sizeThread(self, row, path): # Create the list of folders in the window def generateList(self): - self.host_flatpaks = self.my_utils.getHostFlatpaks() + + if self.host_flatpaks == [['', '']]: + self.app_window.toast_overlay.add_toast(Adw.Toast.new(_("Could not manage data"))) + self.this_just_crashes_the_window_so_it_doesnt_open() + return + self.list_of_data.remove_all() self.selected_dirs = [] self.set_title(self.window_title) diff --git a/src/window.py b/src/window.py index 5690f01b..69314c8a 100644 --- a/src/window.py +++ b/src/window.py @@ -522,7 +522,7 @@ def __init__(self, **kwargs): self.settings.bind("is-maximized", self, "maximized", Gio.SettingsBindFlags.DEFAULT) self.settings.bind("is-fullscreen", self, "fullscreened", Gio.SettingsBindFlags.DEFAULT) - if self.host_flatpaks == [['']]: + if self.host_flatpaks == [['', '']]: self.windowSetEmpty(True) return