3 # Electrum - lightweight Bitcoin client
4 # Copyright (C) 2013 ecdsa@github
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 from PyQt4.QtGui import *
20 from PyQt4.QtCore import *
21 import PyQt4.QtCore as QtCore
23 from electrum import mnemonic
24 from qrcodewidget import QRCodeWidget
26 class SeedDialog(QDialog):
27 def __init__(self, parent=None):
28 QDialog.__init__(self, parent)
30 self.setWindowTitle('Electrum' + ' - ' + _('Seed'))
33 def show_seed(self, seed, imported_keys, parent=None):
35 brainwallet = ' '.join(mnemonic.mn_encode(seed))
37 label1 = QLabel(_("Your wallet generation seed is")+ ":")
39 seed_text = QTextEdit(brainwallet)
40 seed_text.setReadOnly(True)
41 seed_text.setMaximumHeight(130)
43 msg2 = _("Please write down or memorize these 12 words (order is important).") + " " \
44 + _("This seed will allow you to recover your wallet in case of computer failure.") + " " \
45 + _("Your seed is also displayed as QR code, in case you want to transfer it to a mobile phone.") + "<p>" \
46 + "<b>"+_("WARNING")+":</b> " + _("Never disclose your seed. Never type it on a website.") + "</b><p>"
48 msg2 += "<b>"+_("WARNING")+":</b> " + _("Your wallet contains imported keys. These keys cannot be recovered from seed.") + "</b><p>"
50 label2.setWordWrap(True)
53 logo.setPixmap(QPixmap(":icons/seed.png").scaledToWidth(56))
54 logo.setMaximumWidth(60)
56 qrw = QRCodeWidget(seed)
58 ok_button = QPushButton(_("OK"))
59 ok_button.setDefault(True)
60 ok_button.clicked.connect(self.accept)
63 #main_layout.addWidget(logo, 0, 0)
65 grid.addWidget(logo, 0, 0)
66 grid.addWidget(label1, 0, 1)
68 grid.addWidget(seed_text, 1, 0, 1, 2)
70 grid.addWidget(qrw, 0, 2, 2, 1)
74 vbox.addWidget(label2)
78 hbox.addWidget(ok_button)