@@ -27,7 +27,8 @@
|
||||
import threading
|
||||
|
||||
from PyQt5.Qt import QVBoxLayout, QLabel
|
||||
from electrum.gui.qt.password_dialog import PasswordDialog, PW_PASSPHRASE
|
||||
|
||||
from electrum.gui.qt.password_dialog import PasswordLayout, PW_PASSPHRASE
|
||||
from electrum.gui.qt.util import *
|
||||
|
||||
from electrum.i18n import _
|
||||
@@ -114,11 +115,16 @@ class QtHandlerBase(QObject, PrintError):
|
||||
def passphrase_dialog(self, msg, confirm):
|
||||
# If confirm is true, require the user to enter the passphrase twice
|
||||
parent = self.top_level_window()
|
||||
d = WindowModalDialog(parent, _("Enter Passphrase"))
|
||||
if confirm:
|
||||
d = PasswordDialog(parent, None, msg, PW_PASSPHRASE)
|
||||
confirmed, p, passphrase = d.run()
|
||||
OK_button = OkButton(d)
|
||||
playout = PasswordLayout(msg=msg, kind=PW_PASSPHRASE, OK_button=OK_button)
|
||||
vbox = QVBoxLayout()
|
||||
vbox.addLayout(playout.layout())
|
||||
vbox.addLayout(Buttons(CancelButton(d), OK_button))
|
||||
d.setLayout(vbox)
|
||||
passphrase = playout.new_password() if d.exec_() else None
|
||||
else:
|
||||
d = WindowModalDialog(parent, _("Enter Passphrase"))
|
||||
pw = QLineEdit()
|
||||
pw.setEchoMode(2)
|
||||
pw.setMinimumWidth(200)
|
||||
|
||||
Reference in New Issue
Block a user