|
@ -2066,37 +2066,27 @@ class ElectrumWindow(QMainWindow): |
|
|
d = QDialog(self) |
|
|
d = QDialog(self) |
|
|
d.setModal(1) |
|
|
d.setModal(1) |
|
|
d.setWindowTitle(_("Enter Password")) |
|
|
d.setWindowTitle(_("Enter Password")) |
|
|
|
|
|
|
|
|
pw = QLineEdit() |
|
|
pw = QLineEdit() |
|
|
pw.setEchoMode(2) |
|
|
pw.setEchoMode(2) |
|
|
|
|
|
|
|
|
vbox = QVBoxLayout() |
|
|
vbox = QVBoxLayout() |
|
|
if not msg: |
|
|
if not msg: |
|
|
msg = _('Please enter your password') |
|
|
msg = _('Please enter your password') |
|
|
vbox.addWidget(QLabel(msg)) |
|
|
vbox.addWidget(QLabel(msg)) |
|
|
|
|
|
|
|
|
grid = QGridLayout() |
|
|
grid = QGridLayout() |
|
|
grid.setSpacing(8) |
|
|
grid.setSpacing(8) |
|
|
grid.addWidget(QLabel(_('Password')), 1, 0) |
|
|
grid.addWidget(QLabel(_('Password')), 1, 0) |
|
|
grid.addWidget(pw, 1, 1) |
|
|
grid.addWidget(pw, 1, 1) |
|
|
vbox.addLayout(grid) |
|
|
vbox.addLayout(grid) |
|
|
|
|
|
|
|
|
vbox.addLayout(Buttons(CancelButton(d), OkButton(d))) |
|
|
vbox.addLayout(Buttons(CancelButton(d), OkButton(d))) |
|
|
d.setLayout(vbox) |
|
|
d.setLayout(vbox) |
|
|
|
|
|
|
|
|
run_hook('password_dialog', pw, grid, 1) |
|
|
run_hook('password_dialog', pw, grid, 1) |
|
|
if not d.exec_(): return |
|
|
if not d.exec_(): return |
|
|
return unicode(pw.text()) |
|
|
return unicode(pw.text()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def tx_from_text(self, txt): |
|
|
def tx_from_text(self, txt): |
|
|
"json or raw hexadecimal" |
|
|
"json or raw hexadecimal" |
|
|
|
|
|
txt = txt.strip() |
|
|
try: |
|
|
try: |
|
|
txt.decode('hex') |
|
|
txt.decode('hex') |
|
|
is_hex = True |
|
|
is_hex = True |
|
|