tkivy: improve confirm seed screen - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit b3861bd54d980cc1a3fdfb15cf009ab78f02ab11 DIR parent 656069070a9ba8c68c066226bdd4c02883f7c7ae HTML Author: ThomasV <thomasv@electrum.org> Date: Sat, 13 Feb 2016 17:38:54 +0100 kivy: improve confirm seed screen Diffstat: M gui/kivy/uix/dialogs/create_restor… | 21 +++++++++++++++++++++ M gui/kivy/uix/dialogs/installwizard… | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) --- DIR diff --git a/gui/kivy/uix/dialogs/create_restore.py b/gui/kivy/uix/dialogs/create_restore.py t@@ -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' t@@ -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' t@@ -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: t@@ -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: t@@ -249,6 +261,7 @@ Builder.load_string(''' text: 'M' MButton: text: '<' + size_hint: 2, None GridLayout: rows: 1 t@@ -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(' ') DIR diff --git a/gui/kivy/uix/dialogs/installwizard.py b/gui/kivy/uix/dialogs/installwizard.py t@@ -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):