1
0

plugins dialog: fix is_available, do not show plugins that are not available

This commit is contained in:
ThomasV
2025-06-10 11:02:18 +02:00
parent 86f3eec8e6
commit 630124136e
2 changed files with 4 additions and 3 deletions

View File

@@ -340,6 +340,8 @@ class PluginsDialog(WindowModalDialog, MessageBoxMixin):
display_name = metadata.get('fullname')
if not display_name:
continue
if not self.plugins.is_available(name):
continue
label = IconLabel(text=display_name, reverse=True)
icon_path = metadata.get('icon')
if icon_path:

View File

@@ -712,7 +712,7 @@ class Plugins(DaemonThread):
def is_plugin_enabler_config_key(cls, key: str) -> bool:
return key.startswith('plugins.')
def is_available(self, name: str, wallet: 'Abstract_Wallet') -> bool:
def is_available(self, name: str) -> bool:
d = self.descriptions.get(name)
if not d:
return False
@@ -723,8 +723,7 @@ class Plugins(DaemonThread):
except ImportError as e:
self.logger.warning(f'Plugin {name} unavailable: {repr(e)}')
return False
requires = d.get('requires_wallet_type', [])
return not requires or wallet.wallet_type in requires
return True
def get_hardware_support(self):
out = []