disable "Enable" button of unavailable plugins
this changes PluginsDialog to disable the "Enable" button of plugins that are missing dependencies (e.g. amodem) instead of not showing them at all. A tooltip is shown explaining the user why the plugin is disabled.
This commit is contained in:
@@ -340,14 +340,19 @@ class PluginsDialog(WindowModalDialog, MessageBoxMixin):
|
|||||||
display_name = metadata.get('fullname')
|
display_name = metadata.get('fullname')
|
||||||
if not display_name:
|
if not display_name:
|
||||||
continue
|
continue
|
||||||
if not self.plugins.is_available(name):
|
|
||||||
continue
|
|
||||||
label = IconLabel(text=display_name, reverse=True)
|
label = IconLabel(text=display_name, reverse=True)
|
||||||
icon_path = metadata.get('icon')
|
icon_path = metadata.get('icon')
|
||||||
if icon_path:
|
if icon_path:
|
||||||
icon = read_QIcon_from_bytes(self.plugins.read_file(name, icon_path))
|
icon = read_QIcon_from_bytes(self.plugins.read_file(name, icon_path))
|
||||||
label.setIcon(icon)
|
label.setIcon(icon)
|
||||||
label.status_button = PluginStatusButton(self, name)
|
label.status_button = PluginStatusButton(self, name)
|
||||||
|
if not self.plugins.is_available(name):
|
||||||
|
label.status_button.setDisabled(True)
|
||||||
|
label.status_button.setToolTip("".join([
|
||||||
|
_('Plugin {} requires installation of additional dependencies.').format(name),
|
||||||
|
'\n',
|
||||||
|
_('For Electrum to recognize external packages, you need to run it from source.')
|
||||||
|
]))
|
||||||
grid.addWidget(label, i, 0)
|
grid.addWidget(label, i, 0)
|
||||||
grid.addWidget(label.status_button, i, 1)
|
grid.addWidget(label.status_button, i, 1)
|
||||||
# add stretch
|
# add stretch
|
||||||
|
|||||||
Reference in New Issue
Block a user