Skip to content

Commit

Permalink
Show message when dependency is not compatible with bottle arch
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinsteen committed Aug 25, 2023
1 parent 43c4a3a commit 48651f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 3 additions & 8 deletions bottles/frontend/views/bottle_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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)

Expand Down
7 changes: 7 additions & 0 deletions bottles/frontend/widgets/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 48651f6

Please sign in to comment.