electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit f93bc5951cc6bd30ca3cfdbdf32ef848a14a3ff8
parent 5086fd6b27b534eaa22a8649b45bb6a78bb353f9
Author: ThomasV <thomasv@gitorious>
Date:   Thu,  3 Oct 2013 09:19:09 +0200

simplify show_seed dialog

Diffstat:
Mgui/qt/installwizard.py | 10++++++++--
Mgui/qt/main_window.py | 4++--
Mgui/qt/seed_dialog.py | 15+++++++--------
3 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/gui/qt/installwizard.py b/gui/qt/installwizard.py @@ -240,9 +240,15 @@ class InstallWizard(QDialog): def show_seed(self, wallet): from seed_dialog import make_seed_dialog + + vbox = make_seed_dialog(wallet.seed, wallet.imported_keys) + vbox.addLayout(ok_cancel_buttons(self, _("Next"))) + if self.layout(): QWidget().setLayout(self.layout()) - make_seed_dialog(self, wallet.seed, wallet.imported_keys) - self.exec_() + self.setLayout(vbox) + + if not self.exec_(): + exit() def password_dialog(self, wallet): diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -1491,8 +1491,8 @@ class ElectrumWindow(QMainWindow): QMessageBox.warning(self, _('Error'), _('Incorrect Password'), _('OK')) return from seed_dialog import SeedDialog - d = SeedDialog(self) - d.show_seed(seed, self.wallet.imported_keys) + d = SeedDialog(self, seed, self.wallet.imported_keys) + d.exec_() else: l = {} for k in self.wallet.master_private_keys.keys(): diff --git a/gui/qt/seed_dialog.py b/gui/qt/seed_dialog.py @@ -25,15 +25,16 @@ from qrcodewidget import QRCodeWidget from util import close_button class SeedDialog(QDialog): - def __init__(self, parent): + def __init__(self, parent, seed, imported_keys): QDialog.__init__(self, parent) self.setModal(1) self.setWindowTitle('Electrum' + ' - ' + _('Seed')) self.parent = parent - def show_seed(self, seed, imported_keys): - make_seed_dialog(self, seed, imported_keys) - self.exec_() + vbox = make_seed_dialog(seed, imported_keys) + vbox.addLayout(close_button(self)) + self.setLayout(vbox) + class PrivateKeysDialog(QDialog): @@ -54,7 +55,7 @@ class PrivateKeysDialog(QDialog): -def make_seed_dialog(self, seed, imported_keys): +def make_seed_dialog(seed, imported_keys): brainwallet = ' '.join(mnemonic.mn_encode(seed)) @@ -92,6 +93,4 @@ def make_seed_dialog(self, seed, imported_keys): vbox.addLayout(grid) vbox.addWidget(label2) - vbox.addLayout(close_button(self)) - - self.setLayout(vbox) + return vbox