From 63ebf7772e7e883101077c639e8e52cc95ecd4fa Mon Sep 17 00:00:00 2001 From: ThomasV Date: Tue, 23 Aug 2016 10:00:46 +0200 Subject: [PATCH] wizard.query_choice --- gui/qt/installwizard.py | 8 ++++++++ plugins/trezor/qt_generic.py | 11 ----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/gui/qt/installwizard.py b/gui/qt/installwizard.py index 5d0d2fd97..921523ba3 100644 --- a/gui/qt/installwizard.py +++ b/gui/qt/installwizard.py @@ -371,6 +371,14 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard): action = c_values[clayout.selected_index()] return action + def query_choice(self, msg, choices): + """called by hardware wallets""" + clayout = ChoicesLayout(msg, choices) + vbox = QVBoxLayout() + vbox.addLayout(clayout.layout()) + self.set_main_layout(vbox, '') + return clayout.selected_index() + @wizard_dialog def account_id_dialog(self, run_next): message = '\n'.join([ diff --git a/plugins/trezor/qt_generic.py b/plugins/trezor/qt_generic.py index 8bf0229a2..e6db6528c 100644 --- a/plugins/trezor/qt_generic.py +++ b/plugins/trezor/qt_generic.py @@ -307,17 +307,6 @@ def qt_plugin_class(base_plugin_class): device_id = info.device.id_ return device_id - def query_choice(self, window, msg, choices): - dialog = WindowModalDialog(window) - clayout = ChoicesLayout(msg, choices) - layout = clayout.layout() - layout.addStretch(1) - layout.addLayout(Buttons(CancelButton(dialog), OkButton(dialog))) - dialog.setLayout(layout) - if not dialog.exec_(): - return None - return clayout.selected_index() - return QtPlugin