kivy: improve confirm seed screen

This commit is contained in:
ThomasV 2016-02-13 17:38:54 +01:00
parent 656069070a
commit b3861bd54d
2 changed files with 22 additions and 1 deletions

View File

@ -129,6 +129,7 @@ Builder.load_string('''
<WordButton@Button>:
size_hint: None, None
padding: '5dp', '5dp'
text_size: None, self.height
width: self.texture_size[0]
height: '30dp'
@ -184,6 +185,7 @@ Builder.load_string('''
new_word: root.on_word
BoxLayout:
id: line1
update_amount: root.update_text
size_hint: 1, None
height: '30dp'
@ -208,9 +210,13 @@ Builder.load_string('''
MButton:
text: 'P'
BoxLayout:
id: line2
update_amount: root.update_text
size_hint: 1, None
height: '30dp'
Widget:
size_hint: 0.5, None
height: '33dp'
MButton:
text: 'A'
MButton:
@ -229,10 +235,16 @@ Builder.load_string('''
text: 'K'
MButton:
text: 'L'
Widget:
size_hint: 0.5, None
height: '33dp'
BoxLayout:
id: line3
update_amount: root.update_text
size_hint: 1, None
height: '30dp'
Widget:
size_hint: 1, None
MButton:
text: 'Z'
MButton:
@ -249,6 +261,7 @@ Builder.load_string('''
text: 'M'
MButton:
text: '<'
size_hint: 2, None
GridLayout:
rows: 1
@ -409,6 +422,14 @@ class RestoreSeedDialog(WizardDialog):
b = WordButton(text=w)
self.ids.suggestions.add_widget(b)
i = len(last_word)
p = set([x[i] for x in suggestions])
for line in [self.ids.line1, self.ids.line2, self.ids.line3]:
for c in line.children:
if isinstance(c, Button):
if c.text in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
c.disabled = (c.text.lower() not in p) and p
def on_word(self, w):
text = self.get_seed_text()
words = text.split(' ')

View File

@ -98,7 +98,7 @@ class InstallWizard(Widget):
else:
self.run('add_seed', (text, None))
# fixme: sync
msg = _('You may also enter an extended public key, to create a watching-only wallet')
msg = _('You may use the camera and scan an extended public key, to create a watching-only wallet')
RestoreSeedDialog(test=Wallet.is_any, message=msg, on_release=on_seed).open()
def add_seed(self, text, password):