commit 46b84366932d51b90dedec1be962890a2bcd1659
parent c79655d26a37d9cd11902c938c72152fa8d52a50
Author: ThomasV <thomasv@electrum.org>
Date: Sun, 5 Nov 2017 12:49:38 +0100
fix #2562: show error message if hardware library is missing
Diffstat:
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/plugins.py b/lib/plugins.py
@@ -392,6 +392,8 @@ class DeviceMgr(ThreadJob, PrintError):
def client_for_keystore(self, plugin, handler, keystore, force_pair):
self.print_error("getting client for keystore")
+ if handler is None:
+ raise BaseException(_("Handler not found for") + ' ' + plugin.name + '\n' + _("A library is probably missing."))
handler.update_status(False)
devices = self.scan_devices()
xpub = keystore.xpub
diff --git a/plugins/hw_wallet/plugin.py b/plugins/hw_wallet/plugin.py
@@ -41,7 +41,7 @@ class HW_PluginBase(BasePlugin):
self.keystore_class.plugin = self
def is_enabled(self):
- return self.libraries_available
+ return True
def device_manager(self):
return self.parent.device_manager
diff --git a/plugins/hw_wallet/qt.py b/plugins/hw_wallet/qt.py
@@ -182,6 +182,12 @@ class QtPluginBase(object):
for keystore in wallet.get_keystores():
if not isinstance(keystore, self.keystore_class):
continue
+ if not self.libraries_available:
+ window.show_error(
+ _("Cannot find python library for") + " '%s'.\n" % self.name \
+ + _("Make sure you install it with python3")
+ )
+ return
tooltip = self.device + '\n' + (keystore.label or 'unnamed')
cb = partial(self.show_settings_dialog, window, keystore)
button = StatusBarButton(QIcon(self.icon_unpaired), tooltip, cb)