commit 834d3322b3970c675e80d8a5358c73eac2b65e9b
parent 49550514af7ad04fe09f4cf54589d8c68969d3eb
Author: ThomasV <thomasv@electrum.org>
Date: Tue, 11 Oct 2016 14:59:29 +0200
kivy: seed options dialog
Diffstat:
2 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/gui/kivy/uix/dialogs/installwizard.py b/gui/kivy/uix/dialogs/installwizard.py
@@ -227,6 +227,7 @@ Builder.load_string('''
id: text_input_seed
text: ''
on_text: Clock.schedule_once(root.on_text)
+ on_release: root.options_dialog()
SeedLabel:
text: root.message
BoxLayout:
@@ -397,10 +398,12 @@ Builder.load_string('''
height: self.minimum_height
orientation: 'vertical'
spacing: '12dp'
- SeedLabel:
- text: root.message
SeedButton:
text: root.seed_text
+ on_release: root.options_dialog()
+ SeedLabel:
+ text: root.message
+
<LineDialog>
@@ -523,14 +526,22 @@ class LineDialog(WizardDialog):
class ShowSeedDialog(WizardDialog):
seed_text = StringProperty('')
message = _("If you forget your PIN or lose your device, your seed phrase will be the only way to recover your funds.")
+ ext = False
def on_parent(self, instance, value):
if value:
app = App.get_running_app()
self._back = _back = partial(self.ids.back.dispatch, 'on_release')
+ def options_dialog(self):
+ from seed_options import SeedOptionsDialog
+ def callback(status):
+ self.ext = status
+ d = SeedOptionsDialog(self.ext, callback)
+ d.open()
+
def get_params(self, b):
- return (True,)
+ return (self.ext,)
class WordButton(Button):
@@ -551,6 +562,14 @@ class RestoreSeedDialog(WizardDialog):
self.ids.text_input_seed.text = test_seed if is_test else ''
self.message = _('Please type your seed phrase using the virtual keyboard.')
self.title = _('Enter Seed')
+ self.ext = False
+
+ def options_dialog(self):
+ from seed_options import SeedOptionsDialog
+ def callback(status):
+ self.ext = status
+ d = SeedOptionsDialog(self.ext, callback)
+ d.open()
def get_suggestions(self, prefix):
for w in self.words:
@@ -646,12 +665,14 @@ class RestoreSeedDialog(WizardDialog):
tis.focus = False
def get_params(self, b):
- return (self.get_text(), False, True)
+ return (self.get_text(), False, self.ext)
class ConfirmSeedDialog(RestoreSeedDialog):
def get_params(self, b):
return (self.get_text(),)
+ def options_dialog(self):
+ pass
class ShowXpubDialog(WizardDialog):
diff --git a/gui/qt/installwizard.py b/gui/qt/installwizard.py
@@ -256,7 +256,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
vbox.addStretch(1)
vbox.addWidget(QLabel(_('Options') + ':'))
if self.opt_ext:
- cb_pass = QCheckBox(_('Add an extension to this seed'))
+ cb_pass = QCheckBox(_('Extend this seed with custom words'))
vbox.addWidget(cb_pass)
if self.opt_bip39:
def f(b):
@@ -325,7 +325,7 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
vbox.addLayout(slayout.layout())
vbox.addStretch(1)
vbox.addWidget(QLabel(_('Option') + ':'))
- cb_pass = QCheckBox(_('Add an extension to this seed'))
+ cb_pass = QCheckBox(_('Extend this seed with custom words'))
vbox.addWidget(cb_pass)
self.set_main_layout(vbox)
return cb_pass.isChecked()