ScanQRTextEdit allow_multi=True for sweeping and importing privkeys into existing wallet
This commit is contained in:
@@ -2414,7 +2414,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
|||||||
vbox = QVBoxLayout(d)
|
vbox = QVBoxLayout(d)
|
||||||
vbox.addWidget(QLabel(_("Enter private keys:")))
|
vbox.addWidget(QLabel(_("Enter private keys:")))
|
||||||
|
|
||||||
keys_e = ScanQRTextEdit()
|
keys_e = ScanQRTextEdit(allow_multi=True)
|
||||||
keys_e.setTabChangesFocus(True)
|
keys_e.setTabChangesFocus(True)
|
||||||
vbox.addWidget(keys_e)
|
vbox.addWidget(keys_e)
|
||||||
|
|
||||||
@@ -2464,7 +2464,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
|||||||
self.warn_if_watching_only()
|
self.warn_if_watching_only()
|
||||||
|
|
||||||
def _do_import(self, title, msg, func):
|
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:
|
if not text:
|
||||||
return
|
return
|
||||||
bad = []
|
bad = []
|
||||||
|
|||||||
@@ -251,14 +251,14 @@ def line_dialog(parent, title, label, ok_label, default=None):
|
|||||||
if dialog.exec_():
|
if dialog.exec_():
|
||||||
return txt.text()
|
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
|
from .qrtextedit import ScanQRTextEdit
|
||||||
dialog = WindowModalDialog(parent, title)
|
dialog = WindowModalDialog(parent, title)
|
||||||
dialog.setMinimumWidth(500)
|
dialog.setMinimumWidth(500)
|
||||||
l = QVBoxLayout()
|
l = QVBoxLayout()
|
||||||
dialog.setLayout(l)
|
dialog.setLayout(l)
|
||||||
l.addWidget(QLabel(label))
|
l.addWidget(QLabel(label))
|
||||||
txt = ScanQRTextEdit()
|
txt = ScanQRTextEdit(allow_multi=allow_multi)
|
||||||
if default:
|
if default:
|
||||||
txt.setText(default)
|
txt.setText(default)
|
||||||
l.addWidget(txt)
|
l.addWidget(txt)
|
||||||
|
|||||||
Reference in New Issue
Block a user