plugins dialog: fix is_available, do not show plugins that are not available
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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 = []
|
||||
|
||||
Reference in New Issue
Block a user