Fix some regressions from layout rework.

This commit is contained in:
Neil Booth 2016-01-13 21:25:48 +09:00
parent 9390a97e9e
commit fd66e15d3d
5 changed files with 10 additions and 9 deletions

View File

@ -175,9 +175,8 @@ class InstallWizard(WindowModalDialog, WizardBase):
return sanitized_seed()
def show_seed(self, seed):
title = _("Your wallet generation seed is:")
slayout = SeedWarningLayout(seed)
self.set_main_layout(slayout.layout(), title)
self.set_main_layout(slayout.layout())
def verify_seed(self, seed, is_valid=None):
while True:

View File

@ -1830,7 +1830,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
self.set_send_button_text()
def change_password_dialog(self):
from password_dialog import PasswordDialog
from password_dialog import PasswordDialog, PW_CHANGE
if self.wallet and self.wallet.is_watching_only():
self.show_error(_('This is a watching-only wallet'))
@ -1840,7 +1840,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
'password. To disable wallet encryption, enter an empty new '
'password.') if self.wallet.use_encryption
else _('Your wallet keys are not encrypted'))
d = PasswordDialog(self, self.wallet, msg, PasswordDialog.PW_CHANGE)
d = PasswordDialog(self, self.wallet, msg, PW_CHANGE)
ok, password, new_password = d.run()
if not ok:
return

View File

@ -34,7 +34,7 @@ class NetworkDialog(WindowModalDialog):
self.setMinimumSize(375, 20)
self.nlayout = NetworkChoiceLayout(network, config)
vbox = QVBoxLayout(self)
vbox.addLayout(nlayout.layout())
vbox.addLayout(self.nlayout.layout())
vbox.addLayout(Buttons(CancelButton(self), OkButton(self)))
def do_exec(self):

View File

@ -93,7 +93,7 @@ class PasswordLayout(object):
lockfile = ":icons/lock.png"
else:
lockfile = ":icons/unlock.png"
logo.setPixmap(QPixmap(lockfile).scaledToWidth(36))
logo.setPixmap(QPixmap(lockfile).scaledToWidth(36))
grid.addWidget(QLabel(msgs[0]), 1, 0)
grid.addWidget(self.new_pw, 1, 1)
@ -145,10 +145,10 @@ class PasswordLayout(object):
class PasswordDialog(WindowModalDialog):
def __init__(self, parent, wallet, msg, kind):
WindowModalDialog.__init__(self)
WindowModalDialog.__init__(self, parent)
OK_button = OkButton(self)
self.playout = PasswordLayout(wallet, msg, kind, OK_button)
self.setTitle(slef.playout.title())
self.setWindowTitle(self.playout.title())
vbox = QVBoxLayout(self)
vbox.addLayout(self.playout.layout())
vbox.addStretch(1)

View File

@ -36,7 +36,7 @@ class SeedDialog(WindowModalDialog):
WindowModalDialog.__init__(self, parent, ('Electrum - ' + _('Seed')))
self.setMinimumWidth(400)
vbox = QVBoxLayout(self)
vbox.addLayout(SeedDisplayLayout(seed))
vbox.addLayout(SeedWarningLayout(seed).layout())
if imported_keys:
warning = ("<b>" + _("WARNING") + ":</b> " +
_("Your wallet contains imported keys. These keys "
@ -86,6 +86,8 @@ class SeedDisplayLayout(SeedLayoutBase):
class SeedWarningLayout(SeedLayoutBase):
def __init__(self, seed, title=None):
if title is None:
title = _("Your wallet generation seed is:")
msg = ''.join([
"<p>",
_("Please save these %d words on paper (order is important). "),