Browse Source

ScanQRTextEdit allow_multi=True for sweeping and importing privkeys into existing wallet

3.1
SomberNight 7 years ago
parent
commit
3de5b91c15
  1. 5
      gui/qt/main_window.py
  2. 4
      gui/qt/util.py

5
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 = []

4
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)

Loading…
Cancel
Save