From 39163d124ecbe77ccc2c52babb6546e435428092 Mon Sep 17 00:00:00 2001 From: heliguy Date: Wed, 29 Nov 2023 02:42:47 -0500 Subject: [PATCH] Hide view apps using this runtime Hide the view apps using this runtime button in the properties_window when the current runtime is not a dependant runtime --- data/ui/properties.blp | 1 + src/properties_window.py | 5 +++-- src/window.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/data/ui/properties.blp b/data/ui/properties.blp index 896907a..77e15b8 100644 --- a/data/ui/properties.blp +++ b/data/ui/properties.blp @@ -77,6 +77,7 @@ template PropertiesWindow: Adw.Window { Adw.ActionRow view_apps { title: _("Show Apps Using this Runtime"); activatable: true; + visible: false; [suffix] Image { diff --git a/src/properties_window.py b/src/properties_window.py index 92a285c..e45b0eb 100644 --- a/src/properties_window.py +++ b/src/properties_window.py @@ -74,9 +74,10 @@ class PropertiesWindow(Adw.Window): self.spinner.set_visible(False) if "runtime" in self.current_flatpak[12]: + # Pak is a runtime self.runtime.set_visible(False) - else: - self.view_apps.set_visible(False) + if self.app_ref in self.parent_window.dependent_runtimes: + self.view_apps.set_visible(True) def generateLower(self): column_headers = [ diff --git a/src/window.py b/src/window.py index e271101..b3fb5f9 100644 --- a/src/window.py +++ b/src/window.py @@ -280,6 +280,7 @@ class WarehouseWindow(Adw.ApplicationWindow): def generate_list_of_flatpaks(self): self.host_flatpaks = self.my_utils.getHostFlatpaks() + self.dependent_runtimes = self.my_utils.getDependentRuntimes() self.set_title(self.main_window_title) self.eol_list = [] self.system_mask_list = self.my_utils.getHostMasks("system")