1
0

add qr code scanner to kivy wizard

This commit is contained in:
ThomasV
2016-01-16 15:05:49 +01:00
parent 4f0631d78d
commit d68f42df95
2 changed files with 29 additions and 29 deletions

View File

@@ -175,6 +175,10 @@ Builder.load_string('''
id: back
text: _('Back')
root: root
Button:
id: scan
text: _('QR')
on_release: root.scan_seed()
CreateAccountButton:
id: next
text: _('Next')
@@ -320,10 +324,16 @@ class RestoreSeedDialog(CreateAccountDialog):
def get_seed_text(self):
ti = self.ids.text_input_seed
text = unicode(ti.text.lower()).strip()
text = unicode(ti.text).strip()
text = ' '.join(text.split())
return text
def scan_seed(self):
def on_complete(text):
self.ids.text_input_seed.text = text
app = App.get_running_app()
app.scan_qr(on_complete)
def on_parent(self, instance, value):
if value:
tis = self.ids.text_input_seed