From 3de5b91c1551c9202545f5b0ad85ae85987c9040 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 25 Dec 2017 19:41:03 +0100 Subject: [PATCH] ScanQRTextEdit allow_multi=True for sweeping and importing privkeys into existing wallet --- gui/qt/main_window.py | 5 +++-- gui/qt/util.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 26ccf6aba..7cbbba2a7 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -2414,7 +2414,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): vbox = QVBoxLayout(d) vbox.addWidget(QLabel(_("Enter private keys:"))) - keys_e = ScanQRTextEdit() + keys_e = ScanQRTextEdit(allow_multi=True) keys_e.setTabChangesFocus(True) vbox.addWidget(keys_e) @@ -2464,7 +2464,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): self.warn_if_watching_only() def _do_import(self, title, msg, func): - text = text_dialog(self, title, msg + ' :', _('Import')) + text = text_dialog(self, title, msg + ' :', _('Import'), + allow_multi=True) if not text: return bad = [] diff --git a/gui/qt/util.py b/gui/qt/util.py index f1f2d0bd2..2d2626a18 100644 --- a/gui/qt/util.py +++ b/gui/qt/util.py @@ -251,14 +251,14 @@ def line_dialog(parent, title, label, ok_label, default=None): if dialog.exec_(): return txt.text() -def text_dialog(parent, title, label, ok_label, default=None): +def text_dialog(parent, title, label, ok_label, default=None, allow_multi=False): from .qrtextedit import ScanQRTextEdit dialog = WindowModalDialog(parent, title) dialog.setMinimumWidth(500) l = QVBoxLayout() dialog.setLayout(l) l.addWidget(QLabel(label)) - txt = ScanQRTextEdit() + txt = ScanQRTextEdit(allow_multi=allow_multi) if default: txt.setText(default) l.addWidget(txt)