def password_dialog(self, msg=None): if not msg: msg = _("Do not enter your device PIN here !\r\n\r\n" \ "Your BTChip wants to talk to you and tell you a unique second factor code.\r\n" \ "For this to work, please open a text editor (on a different computer / device if you believe this computer is compromised) and put your cursor into it, unplug your BTChip and plug it back in.\r\n" \ "It should show itself to your computer as a keyboard and output the second factor along with a summary of the transaction it is signing into the text-editor.\r\n\r\n" \ "Check that summary and then enter the second factor code here.\r\n" \ "Before clicking OK, re-plug the device once more (unplug it and plug it again if you read the second factor code on the same computer)") d = QDialog() d.setModal(1) d.setLayout( make_password_dialog(d, None, msg, False) ) return run_password_dialog(d, None, None)
def trezor_passphrase_dialog(msg): from chainkey_gui.qt.password_dialog import make_password_dialog, run_password_dialog d = QDialog() d.setModal(1) d.setLayout(make_password_dialog(d, None, msg, False)) confirmed, p, passphrase = run_password_dialog(d, None, None) if not confirmed: return None if passphrase is None: passphrase = '' # Even blank string is valid Trezor passphrase passphrase = unicodedata.normalize('NFKD', unicode(passphrase)) return passphrase
def password_dialog(self, msg=None): if not msg: msg = _("Do not enter your device PIN here !\r\n\r\n" \ "Your BTChip wants to talk to you and tell you a unique second factor code.\r\n" \ "For this to work, please open a text editor (on a different computer / device if you believe this computer is compromised) and put your cursor into it, unplug your BTChip and plug it back in.\r\n" \ "It should show itself to your computer as a keyboard and output the second factor along with a summary of the transaction it is signing into the text-editor.\r\n\r\n" \ "Check that summary and then enter the second factor code here.\r\n" \ "Before clicking OK, re-plug the device once more (unplug it and plug it again if you read the second factor code on the same computer)") d = QDialog() d.setModal(1) d.setLayout(make_password_dialog(d, None, msg, False)) return run_password_dialog(d, None, None)
def passphrase_dialog(self): from chainkey_gui.qt.password_dialog import make_password_dialog, run_password_dialog d = QDialog() d.setModal(1) d.setLayout(make_password_dialog(d, None, self.message, False)) confirmed, p, passphrase = run_password_dialog(d, None, None) if not confirmed: QMessageBox.critical(None, _('Error'), _('Password request canceled'), _('OK')) self.passphrase = None else: if passphrase is None: passphrase = '' # Even blank string is valid Trezor passphrase self.passphrase = unicodedata.normalize('NFKD', unicode(passphrase)) self.done.set()