From 48651f61a0f41c06c1c8716b60557e38bc72070d Mon Sep 17 00:00:00 2001 From: Kinsteen Date: Tue, 25 Apr 2023 19:12:58 +0200 Subject: [PATCH] Show message when dependency is not compatible with bottle arch --- bottles/frontend/views/bottle_dependencies.py | 11 +++-------- bottles/frontend/widgets/dependency.py | 7 +++++++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bottles/frontend/views/bottle_dependencies.py b/bottles/frontend/views/bottle_dependencies.py index fd6923a0bd..fdf6cd8116 100644 --- a/bottles/frontend/views/bottle_dependencies.py +++ b/bottles/frontend/views/bottle_dependencies.py @@ -63,8 +63,8 @@ def __init__(self, details, config: BottleConfig, **kwargs): self.btn_report.connect("clicked", open_doc_url, "contribute/missing-dependencies") self.btn_help.connect("clicked", open_doc_url, "bottles/dependencies") - if self.manager.utils_conn.status == False: - self.stack.set_visible_child_name("page_offline") + if not self.manager.utils_conn.status: + self.stack.set_visible_child_name("page_offline") self.spinner_loading.start() @@ -128,12 +128,7 @@ def process_dependencies(): if len(dependencies.keys()) > 0: for dep in dependencies.items(): if dep[0] in self.config.Installed_Dependencies: - continue # Do not list already installed dependencies' - - dependency_arch = dep[1].get("Arch") - if dependency_arch is not None and dependency_arch != self.config.get("Arch"): - # NOTE: avoid listing dependencies not supported by the bottle arch - continue + continue # Do not list already installed dependencies GLib.idle_add(new_dependency, dep) diff --git a/bottles/frontend/widgets/dependency.py b/bottles/frontend/widgets/dependency.py index d50932be48..e137925861 100644 --- a/bottles/frontend/widgets/dependency.py +++ b/bottles/frontend/widgets/dependency.py @@ -67,6 +67,13 @@ def __init__(self, window, config: BottleConfig, dependency, plain=False, **kwar self.btn_reinstall.set_visible(True) return + if self.config.Arch not in dependency[1].get("Arch", "win64_win32"): + self.btn_install.set_visible(False) + self.btn_remove.set_visible(False) + self.btn_reinstall.set_visible(False) + self.btn_err.set_visible(True) + self.btn_err.set_tooltip_text(_("This dependency is not compatible with this bottle architecture.")) + # populate widgets self.set_title(dependency[0]) self.set_subtitle(dependency[1].get("Description"))