From 997dd17933feb5c5ac2afd2fada7d4af0674f444 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Tue, 27 Sep 2016 12:11:19 +0200 Subject: [PATCH] call choose_device when button is clicked --- plugins/hw_wallet/qt.py | 15 ++++++++++++++- plugins/trezor/qt_generic.py | 12 ------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/plugins/hw_wallet/qt.py b/plugins/hw_wallet/qt.py index 9effb2680..ed3e85408 100644 --- a/plugins/hw_wallet/qt.py +++ b/plugins/hw_wallet/qt.py @@ -172,6 +172,7 @@ class QtHandlerBase(QObject, PrintError): from electrum.plugins import hook +from electrum.util import UserCancelled from electrum_gui.qt.main_window import StatusBarButton class QtPluginBase(object): @@ -194,5 +195,17 @@ class QtPluginBase(object): # Trigger a pairing keystore.thread.add(partial(self.get_client, keystore)) + def choose_device(self, window, keystore): + '''This dialog box should be usable even if the user has + forgotten their PIN or it is in bootloader mode.''' + device_id = self.device_manager().xpub_id(keystore.xpub) + if not device_id: + try: + info = self.device_manager().select_device(self, keystore.handler, keystore) + except UserCancelled: + return + device_id = info.device.id_ + return device_id + def show_settings_dialog(self, window, keystore): - pass + device_id = self.choose_device(window, keystore) diff --git a/plugins/trezor/qt_generic.py b/plugins/trezor/qt_generic.py index 79e53b9fb..9aadd42fc 100644 --- a/plugins/trezor/qt_generic.py +++ b/plugins/trezor/qt_generic.py @@ -201,18 +201,6 @@ class QtPlugin(QtPluginBase): if device_id: SettingsDialog(window, self, keystore, device_id).exec_() - def choose_device(self, window, keystore): - '''This dialog box should be usable even if the user has - forgotten their PIN or it is in bootloader mode.''' - device_id = self.device_manager().xpub_id(keystore.xpub) - if not device_id: - try: - info = self.device_manager().select_device(self, keystore.handler, keystore) - except UserCancelled: - return - device_id = info.device.id_ - return device_id - def request_trezor_init_settings(self, wizard, method, device): vbox = QVBoxLayout() next_enabled = True